-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscan.php
141 lines (127 loc) · 5.39 KB
/
scan.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
<?php
session_start();
include 'db.php';
if (!$conn) {
die("<script>alert('Gagal tersambung dengan database.')</script>");
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/ico" href="images/favicon.ico">
<title>ATNOS</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-aFq/bzH65dt+w6FI2ooMVUpc+21e0SRygnTpmBvdBgSdnuTN7QbdgL+OapgHtvPp" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
</head>
<body>
<!-- Nav Bar Start -->
<nav class="navbar navbar-expand-lg" style="background-color: #9ec4fe;">
<div class="container-fluid">
<a class="navbar-brand" href="#">Airport Technology Network Of Support</a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto ms-auto">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="dashboard.php">Home</a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="suspek.php">Data Suspek</a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="penumpang.php">Monitor Penumpang</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Nav Bar END -->
<!-- Awal Kontainer -->
<div class="container">
<!-- Awal Row -->
<div class="row">
<!-- Awal col -->
<div class="col-md-8 mx-auto mt-5">
<!-- Awal card -->
<div class="card">
<div class="card-header bg-primary text-light">
Form Scan
</div>
<div class="card-body">
<!-- Awal form -->
<form action="" method="POST" enctype="multipart/form-data">
<div class="mb-2">
<label class="form-label">Cari</label>
<input type="text" name="tcari" value="<?php if (isset($_POST['bcari'])) {
echo $_POST['bcari'];
} ?>" class="form-control" placeholder="Scan Here">
<div class="text-center">
<hr>
<button class="btn btn-primary bi bi-plus" name="bcari" type="submit"> Tambahkan</button>
<button class="btn btn-danger bi bi-bootstrap-reboot" name="breset" type="Batalkan"> Reset</button>
</div>
</form>
<!-- Akhir form -->
<?php
if (isset($_POST['bcari'])) {
$input = $_POST['tcari'];
$array = explode(' ', $input);
$DataArray = array();
foreach ($array as $item) {
$DataArray[] = "'$item'";
}
$sql = "INSERT INTO `tb_suspek`(`nomor_penerbangan`, `nama_penumpang`) VALUES ";
$sql .= '(' . implode(',', $DataArray) . ')';
$simpan = mysqli_query($conn, $sql);
if ($simpan) {
echo "<script>
alert('Simpan data sukses');
document.location='scan.php';
</script>";
} else {
echo "<script>
alert('Simpan data Gagal');
document.location='scan.php';
</script>";
}
}
?>
</div>
<div class="card-footer bg-primary">
</div>
</div>
<!-- Akhir card -->
</div>
<!-- Akhir col -->
</div>
<!-- Akhir Row -->
</div>
<!-- Akhir Kontainer -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-qKXV1j0HvMUeCBQ+QVp7JcfGl760yU08IQ+GpUo5hlbpg51QRiuqHAJz8+BrxE/N"
crossorigin="anonymous"></script>
</body>
<!-- Footer -->
<div class="container">
<footer class="d-flex flex-wrap justify-content-between align-items-center py-3 my-4 border-top fixed-bottom">
<div class="col d-flex align-items-center">
<marquee onmouseout='this.start()' onmouseover='this.stop()' scrollamount='10'><img src="images/ap1logo.png"
width="60" height="30" />  SELAMAT DATANG DI TERMINAL 1 BANDAR UDARA INTERNASIONAL JUANDA
SURABAYA  <img src="images/ap1logo.png" width="60" height="30" />  JANGAN MENINGGALKAN BARANG
BAWAAN ANDA TANPA PENGAWASAN  <img src="images/ap1logo.png" width="60" height="30" />  DO NOT
LEAVE YOUR LUGGAGE UNATTENDED  <img src="images/ap1logo.png" width="60" height="30" />  SILENT
AIRPORT SUDAH DIBERLAKUKAN, MOHON PARA PENUMPANG SELALU MEMPERHATIKAN INFORMASI PENERBANGAN PADA MONITOR FIDS
YANG TERSEDIA. TERIMAKASIH.  <img src="images/ap1logo.png" width="60" height="30" />  SILENT
AIRPORT POLICY HAS BEEN ENFORCED, PASSANGERS ARE ADVISED TO CHECK FLIGHT INFORMATION ON AVAILABLE FIDS SCREEN.
THANK YOU.  </marquee>
</div>
</footer>
</div>
<!-- End Footer -->
</html>