-
Notifications
You must be signed in to change notification settings - Fork 0
/
edit-sus.php
384 lines (369 loc) · 21 KB
/
edit-sus.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
<?php
session_start();
include "db.php";
if ($_SESSION["login"] != true) {
echo '<script>window.location="login.php"</script>';
}
// Menanpilkan data dari tabel tb_suspek
$barang = mysqli_query(
$conn,
"SELECT * FROM tb_suspek WHERE id_suspek = '" . $_GET["id"] . "' "
);
if (mysqli_num_rows($barang) == 0) {
echo '<script>window.location="dash.php"</script>';
}
$b = mysqli_fetch_assoc($barang);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" type="image/ico" href="images/favicon.ico">
<title>Edit Data Suspek</title>
<!-- Required meta tags-->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="au theme template">
<meta name="author" content="Hau Nguyen">
<meta name="keywords" content="au theme template">
<!-- Title Page-->
<title>Dashboard</title>
<!-- Fontfaces CSS-->
<link href="css/font-face.css" rel="stylesheet" media="all">
<link href="vendor/font-awesome-4.7/css/font-awesome.min.css" rel="stylesheet" media="all">
<link href="vendor/font-awesome-5/css/fontawesome-all.min.css" rel="stylesheet" media="all">
<link href="vendor/mdi-font/css/material-design-iconic-font.min.css" rel="stylesheet" media="all">
<!-- Bootstrap CSS-->
<link href="vendor/bootstrap-4.1/bootstrap.min.css" rel="stylesheet" media="all">
<!-- Bootstrap 5 -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.4/font/bootstrap-icons.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-aFq/bzH65dt+w6FI2ooMVUpc+21e0SRygnTpmBvdBgSdnuTN7QbdgL+OapgHtvPp" crossorigin="anonymous">
<!-- Vendor CSS-->
<link href="vendor/animsition/animsition.min.css" rel="stylesheet" media="all">
<link href="vendor/bootstrap-progressbar/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet" media="all">
<link href="vendor/wow/animate.css" rel="stylesheet" media="all">
<link href="vendor/css-hamburgers/hamburgers.min.css" rel="stylesheet" media="all">
<link href="vendor/slick/slick.css" rel="stylesheet" media="all">
<link href="vendor/select2/select2.min.css" rel="stylesheet" media="all">
<link href="vendor/perfect-scrollbar/perfect-scrollbar.css" rel="stylesheet" media="all">
<!-- Main CSS-->
<link href="css/theme.css" rel="stylesheet" media="all">
</head>
<body class="animsition">
<div class="page-wrapper">
<!-- HEADER MOBILE-->
<header class="header-mobile d-block d-lg-none">
<div class="header-mobile__bar">
<div class="container-fluid">
<div class="header-mobile-inner">
<a class="logo" href="index.html">
<img src="images/ap.png" width="200" height="50px" alt="aplogo" />
</a>
<button class="hamburger hamburger--slider" type="button">
<span class="hamburger-box">
<span class="hamburger-inner"></span>
</span>
</button>
</div>
</div>
</div>
<nav class="navbar-mobile">
<div class="container-fluid">
<ul class="navbar-mobile__list list-unstyled">
<li>
<a class="js-arrow" href="dashbrot.php" style="text-decoration:none" >
<i class="fas fa-tachometer-alt"></i>Dashboard</a>
</li>
<li>
<a href="sus.php" style="text-decoration:none" >
<i class="fas fa-chart-bar"></i>Data Suspek</a>
</li>
<li>
<a href="penumpang.php" style="text-decoration:none" >
<i class="fas fa-table"></i>Monitor Penumpang</a>
</li>
<li>
<a href="exp.php" style="text-decoration:none" >
<i class="far fa-check-square"></i>Export</a>
</li>
</div>
</nav>
</header>
<!-- END HEADER MOBILE-->
<!-- MENU SIDEBAR-->
<aside class="menu-sidebar d-none d-lg-block">
<div class="logo">
<a href="#">
<img src="images/ap.png" alt="aplogo" />
</a>
</div>
<div class="menu-sidebar__content js-scrollbar1">
<nav class="navbar-sidebar">
<ul class="list-unstyled navbar__list">
<li>
<a class="js-arrow" href="dashbrot.php" style="text-decoration:none" >
<i class="fas fa-tachometer-alt"></i>Dashboard</a>
</li>
<li>
<a href="sus.php" style="text-decoration:none" >
<i class="fas fa-chart-bar"></i>Data Suspek</a>
</li>
<li>
<a href="penumpang.php" style="text-decoration:none" >
<i class="fas fa-table"></i>Monitor Penumpang</a>
</li>
<li>
<a href="exp.php" style="text-decoration:none" >
<i class="far fa-check-square"></i>Export</a>
</li>
</ul>
</nav>
</div>
</aside>
<!-- END MENU SIDEBAR-->
<!-- PAGE CONTAINER-->
<div class="page-container">
<!-- HEADER DESKTOP-->
<header class="header-desktop">
<div class="section__content section__content--p25">
<div class="container-fluid">
<div class="header-wrap">
<div class="account-wrap ml-auto">
<div class="account-item clearfix js-item-menu">
<div class="image">
<img src="images/profile.png" />
</div>
<div class="account-dropdown js-dropdown">
<div class="info clearfix">
<div class="image">
<a href="#">
<img src="images/profile.png" alt="Profile" />
</a>
</div>
<div class="content">
<h5 class="name">
<a href="#" style="text-decoration:none" >Admin</a>
</h5>
</div>
</div>
<div class="account-dropdown__footer">
<a href="logout.php" style="text-decoration:none" >
<i class="zmdi zmdi-power"></i>Logout</a>
</div>
</div>
</div>
</div>
</div>
</header>
<!-- HEADER DESKTOP-->
<!-- MAIN CONTENT-->
<div class="main-content">
<div class="section__content section__content--p30">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="overview-wrap">
<h2 class="title-1">Edit Data Suspek</h2>
</div>
</div>
</div>
<div class="card mt-2">
<div class="card-header">
<strong>Normal</strong> Form
</div>
<div class="card-body card-block">
<form action="" method="post" class="">
<div class="form-group">
<input type="hidden" name="id" class="form-control" value="<?php echo $b[
"id_suspek"
]; ?>">
<label class=" form-control-label">Nomor Penerbangan</label>
<input type="text" name="nama" class="form-control" placeholder="Masukkan Nomor Penerbangan" value="<?php echo $b[
"nomor_penerbangan"
]; ?>" required>
</div>
<div class="form-group">
<label class="form-label">Nama Penumpang</label>
<input type="text" name="tnamap" class="form-control" placeholder="Masukkan Nama Penumpang" value="<?php echo $b[
"nama_penumpang"
]; ?>" required>
</div>
<div class="form-group">
<label class="form-label">Nama Barang</label>
<input type="text" name="tnamab" class="form-control" placeholder="Masukkan Nama Penumpang" value="<?php echo $b[
"nama_barang"
]; ?>" required>
</div>
<div class="mb-2">
<label class="form-label">Kategori Barang</label>
<select class="form-select" name="tkategoribarang" required>
<?php $kategori_barang =
$b["kategori_barang"]; ?>
<!-- <optgroup label="--Pilih--"></optgroup> -->
<option value="">--Pilih--</option>
<option value="Benda Tajam" <?php echo $kategori_barang ==
"Benda Tajam"
? "selected"
: ""; ?>>Benda Tajam</option>
<option value="Material Korosif" <?php echo $kategori_barang ==
"Material Korosif"
? "selected"
: ""; ?>>Material Korosif</option>
<option value="Bahan Peledak" <?php echo $kategori_barang ==
"Bahan Peledak"
? "selected"
: ""; ?>>Bahan Peledak</option>
<option value="Gas Bertekanan" <?php echo $kategori_barang ==
"Gas Bertekana"
? "selected"
: ""; ?>>Gas Bertekanan</option>
<option value="Cairan Mudah Terbakar" <?php echo $kategori_barang ==
"Cairan Mudah Terbakar"
? "selected"
: ""; ?>>Cairan Mudah Terbakar</option>
<option value="Benda Padat Mudah Terbakar" <?php echo $kategori_barang ==
"Benda Padat Mudah Terbaka"
? "selected"
: ""; ?>>Benda Padat Mudah Terbakar</option>
<option value="Material yang Teroksidasi" <?php echo $kategori_barang ==
"Material yang Teroksidasi"
? "selected"
: ""; ?>>Material yang Teroksidasi</option>
<option value="Zat Radioaktif" <?php echo $kategori_barang ==
"Zat Radioaktif"
? "selected"
: ""; ?>>Zat Radioaktif</option>
<option value="Zat Beracun" <?php echo $kategori_barang ==
"Zat Beracun"
? "selected"
: ""; ?>>Zat Beracun</option>
<option value="Agen Etiologis" <?php echo $kategori_barang ==
"Agen Etiologis"
? "selected"
: ""; ?>>Agen Etiologis</option>
<option value="Gas Padat" <?php echo $kategori_barang ==
"Gas Padat"
? "selected"
: ""; ?>>Gas Padat</option>
<option value="Senjata Tajam" <?php echo $kategori_barang ==
"Senjata Tajam"
? "selected"
: ""; ?>>Senjata Tajam</option>
</select>
</div>
<div class="row">
<div class="col">
<div class="mb-2">
<label class="form-label">Jumlah</label>
<input type="number" name="tjumlah" class="form-control" placeholder="Masukkan Jumlah Barang" value="<?php echo $b[
"jumlah"
]; ?>" required>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="mb-2">
<label class="form-label">Satuan</label>
<select class="form-select" name="tsatuan" required>
<?php $satuan = $b["satuan"]; ?>
<option value="">---Pilih---</option>
<option value="Unit" <?php echo $satuan ==
"Unit"
? "selected"
: ""; ?>>Unit</option>
<option value="Pcs" <?php echo $satuan ==
"Pcs"
? "selected"
: ""; ?>>Pcs</option>
<option value="Box" <?php echo $satuan ==
"Box"
? "selected"
: ""; ?>>Box</option>
</select>
</div>
</div>
</div>
<div class="mb-2">
<label class="form-label">Status</label>
<select class="form-select" name="tstatus" required>
<?php $status = $b["status"]; ?>
<option <?php echo $status ==
"Aktif"
? "selected"
: ""; ?>>Aktif</option>
<option <?php echo $status ==
"Tidak Aktif"
? "selected"
: ""; ?>>Tidak Aktif</option>
</select>
</div>
<div class="card-footer">
<button type="submit" class="btn btn-success btn-sm" name="bsimpan">
<i class="fa fa-dot-circle-o"></i> Submit
</button>
<button type="reset" class="btn btn-danger btn-sm">
<i class="fa fa-ban"></i> Reset
</button>
</div>
</form>
</div>
</div>
<?php if (isset($_POST["bsimpan"])) {
// data inputan dari form
$id = $_POST["id"];
$nomor_penerbangan = $_POST["nama"];
$nama_penumpang = $_POST["tnamap"];
$nama_barang = $_POST["tnamab"];
$kategori_barang = $_POST["tkategoribarang"];
$jumlah = $_POST["tjumlah"];
$status = $_POST["tstatus"];
$satuan = $_POST["tsatuan"];
$update = "UPDATE `tb_suspek` SET `nomor_penerbangan`='$nomor_penerbangan',`nama_penumpang`='$nama_penumpang',`nama_barang`='$nama_barang',`kategori_barang`='$kategori_barang',`jumlah`='$jumlah',`satuan`='$satuan',`status`='$status' WHERE `id_suspek`='$id'";
$query = mysqli_query($conn, $update);
if ($query) {
echo '<script>alert("Ubah data berhasil")</script>';
echo '<script>window.location="sus.php"</script>';
} else {
echo "gagal " . mysqli_error($conn);
}
} ?>
<footer class="d-flex flex-wrap justify-content-between align-items-center py-3 my-4 border-top"></footer>
<div class="col d-flex align-items-center">
<div class="copyright align-items-center">
<p class="text align-items-center">Copyright © 2023 Telkom-PENS. All rights reserved</p>
</div>
</div>
</div>
</div>
</footer>
</div>
</div>
<!-- END MAIN CONTENT-->
<!-- END PAGE CONTAINER-->
</div>
</div>
<!-- Jquery JS-->
<script src="vendor/jquery-3.2.1.min.js"></script>
<!-- Bootstrap JS-->
<script src="vendor/bootstrap-4.1/popper.min.js"></script>
<script src="vendor/bootstrap-4.1/bootstrap.min.js"></script>
<!-- Vendor JS -->
<script src="vendor/slick/slick.min.js">
</script>
<script src="vendor/wow/wow.min.js"></script>
<script src="vendor/animsition/animsition.min.js"></script>
<script src="vendor/bootstrap-progressbar/bootstrap-progressbar.min.js">
</script>
<script src="vendor/counter-up/jquery.waypoints.min.js"></script>
<script src="vendor/counter-up/jquery.counterup.min.js">
</script>
<script src="vendor/circle-progress/circle-progress.min.js"></script>
<script src="vendor/perfect-scrollbar/perfect-scrollbar.js"></script>
<script src="vendor/chartjs/Chart.bundle.min.js"></script>
<script src="vendor/select2/select2.min.js">
</script>
<!-- Main JS-->
<script src="js/main.js"></script>
</body>
</html>
<!-- end document-->