-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-dataLR.php
126 lines (113 loc) · 5.75 KB
/
update-dataLR.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?php
if (isset($_POST['updateLR'])) {
$id_tampilLR = $_SESSION['id_updatetampilLR'];
// $dataS = $_POST['dataS'];
// $dataR = $_POST['dataR'];
// var_dump($_POST);
// $dataSS = implode("|", $dataS);
// var_dump(tambah($_POST));
if (update($_POST, $_SESSION['id_updateLR']) > 0) {
echo "
<script>
var id = " . json_encode($id_tampilLR) . ";
document.location.href = 'tables.php?id_LR=' + id +'&u_berhasil=berhasil';
</script>
";
} else {
echo "
<script>
var id = " . json_encode($id_tampilLR) . ";
document.location.href = 'tables.php?id_LR=' + id +'&u_gagal=gagal';
</script>
";
}
}
?>
<div class="modal fade" id="update-dataLR" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true" role="dialog">
<div class="modal-dialog modal-dialog-scrollable mw-100 w-100">
<div class="card mx-auto mb-3 w-75 mt-4">
<div class="modal-content">
<div class="modal-header">
<div class="modal-title w-100 text-center position-absolute fw-bold fs-4">Update Jumlah Korban Kecelakaan</div>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="card-body">
<form method="POST" role="form">
<div class="container">
<div class="row mb-3 justify-content-center">
<div class="col-12 col-lg-6 col-md-8 col-sm-10 col-xl-4">
<select name="kondisiUpdate" class="form-select ac">
<option value="3">Luka Ringan</option>
</select>
</div>
</div>
<div class="row mb-3 text-center">
<div class="col-5">
<h5 class="fw-semibold">Data Mentah</h5>
</div>
<div class="col-2 text-center">
<div class="vr"></div>
</div>
<div class="col-5">
<h5 class="fw-semibold">Data Real</h5>
</div>
</div>
<div class="row mb-3">
<div class="col-5">
<div class="row justify-content-start">
<label for="tahun1" class="col-12 col-lg-5 col-md-6 col-sm-7 col-form-label">Tahun</label>
<div class="col-12 col-md-6 col-sm-5">
<input type="number" class="form-control ac" id="tahun1" name="tahunMentah" autocomplete="off" required="required" value="<?= $_SESSION['update_tahun_data_mentahLR'] ?>">
</div>
</div>
</div>
<div class="col-2 text-center">
<div class="vr"></div>
</div>
<div class="col-5">
<div class="row justify-content-end">
<label for="tahun2" class="col-12 col-lg-5 col-md-6 col-sm-7 col-form-label">Tahun</label>
<div class="col-12 col-md-6 col-sm-5">
<input type="number" class="form-control ac" id="tahun2" name="tahunReal" value="<?= $_SESSION['update_tahun_data_realLR'] ?>" autocomplete="off" required="required">
</div>
</div>
</div>
</div>
<?php for($i=0; $i < count($bulan); $i++) : ?>
<div class="row mb-3">
<div class="col-5">
<div class="row justify-content-start">
<label for="<?= $bulan[$i] ?>" class="col-12 col-lg-5 col-md-6 col-sm-7 col-form-label"><?= $bulan[$i] ?></label>
<div class="col-12 col-md-6 col-sm-5">
<input type="number" class="form-control ac" id="<?= $bulan[$i]?>" name="dataM[]" value="<?= $_SESSION['update_convertMentahLR'][$i] ?>" required="required">
</div>
</div>
</div>
<div class="col-2 text-center">
<div class="vr"></div>
</div>
<div class="col-5">
<div class="row justify-content-end">
<label for="<?= "{$bulan[$i]}$" ?>" class="col-12 col-lg-5 col-md-6 col-sm-7 col-form-label"><?= $bulan[$i] ?></label>
<div class="col-12 col-md-6 col-sm-5">
<input type="number" class="form-control ac" id="<?= "{$bulan[$i]}$" ?>" name ="dataR[]" value="<?= $_SESSION['update_convertRealLR'][$i] ?>" required="required">
</div>
</div>
</div>
</div>
<?php endfor; ?>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-success" id="simpan" name="updateLR">Update</button>
</div>
</form>
</div>
</div>
</div>
</div>