-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.php
More file actions
110 lines (84 loc) · 2.93 KB
/
main.php
File metadata and controls
110 lines (84 loc) · 2.93 KB
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
<?php
session_start();
if (!isset($_SESSION["login"])) {
header("location: main.php");
exit;
}
require 'function.php';
// Ambil semua data dari tabel 'yes'
$yes = query("SELECT * FROM yes");
// Tombol cari terdeteksi
if (isset($_POST["cari"])) {
$yes = cari($_POST["keyword"]);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/loading.css">
<link rel="stylesheet" href="css/main.css">
<title>Halaman Admin</title>
<style>
@media print {
.logout {
display: none;
}
.btn-blue {
display: none;
}
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>Daftar Anak Mahasiswa Magang</h1>
<a href="logout.php" class="logout">Logout</a>
</div>
<form action="" method="post" class="form-container">
<a href="add.php" class="btn-blue">Tambah Data</a>
<input type="text" name="keyword" id="keyword" placeholder="Cari data" autofocus autocomplete="off">
<button type="submit" name="cari" id="tombol-cari" class="btn-green">Cari</button>
<img src="animation/Spinner@1x-1.0s-200px-200px.gif" class="load">
</form>
<div id="container">
<table>
<thead>
<tr>
<th>No.</th>
<th>Aksi</th>
<th>Gambar</th>
<th>Nik</th>
<th>Nama</th>
<th>Email</th>
<th>Jurusan</th>
</tr>
</thead>
<tbody>
<?php $i = 1; ?>
<?php foreach ($yes as $mg) : ?>
<tr>
<td><?php echo $i ?></td>
<td>
<a href="edit.php?id=<?php echo $mg["id"] ?>">Edit</a> |
<a href="delete.php?id=<?php echo $mg["id"]; ?>" onclick="return confirm('Yakin?');">Delete</a>
</td>
<td><img src="img/<?php echo $mg["gambar"]; ?>" alt=""></td>
<td><?php echo $mg["nik"]; ?></td>
<td><?php echo $mg["nama"]; ?></td>
<td><?php echo $mg["email"]; ?></td>
<td><?php echo $mg["jurusan"]; ?></td>
</tr>
<?php $i++; ?>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
<script src="js/jquery-3.7.1.min.js"></script>
<script src="js/main.js"></script>
<script src="js/jquery.js"></script>
</body>
</html>