-
Notifications
You must be signed in to change notification settings - Fork 0
/
tampil-data.php
182 lines (168 loc) · 5.27 KB
/
tampil-data.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
<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<title>Adminis Stikubank</title>
<link rel="icon" href="https://drive.google.com/uc?export=view&id=1wAy7j2uB-QI6Mkg8iDYlUnjCYAXCGk_j">
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(to right, #ff9a9e, #fad0c4);
color: #333;
padding-top: 120px;
text-align: center;
}
.navbar {
position: fixed;
top: 0;
left: 0;
width: 100%;
background-color: maroon;
padding: 10px 0;
text-align: center;
color: #fff;
font-size: 24px;
font-weight: bold;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}
.content {
margin-top: 160px;
}
.dashboard {
font-size: 28px;
color: maroon;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
margin-bottom: 30px;
}
table {
width: 100%;
border-collapse: collapse;
}
th, td {
padding: 15px 20px;
text-align: left;
border-bottom: 1px solid #ddd;
}
th {
background-color: #f2f2f2;
}
.btn {
padding: 5px 12px;
font-size: 16px;
margin: 5px;
border: 2px solid maroon;
border-radius: 10px;
cursor: pointer;
background-color: maroon;
color: #fff;
text-decoration: none;
transition: background-color 0.3s ease;
}
.btn:hover {
background-color: #8b0000;
}
.add-button {
float: left;
margin-top: 35px;
margin-right: 50px;
background-color: #5F8670;
border: #5F8670;
}
.search-container {
margin-bottom: 20px;
}
.search-container input[type="text"] {
padding: 10px;
font-size: 18px;
border-radius: 8px;
border: 2px solid maroon;
}
.search-container input[type="submit"] {
padding: 10px 20px;
font-size: 18px;
background-color: #ffff;
border: 2px solid maroon;
border-radius: 8px;
cursor: pointer;
transition: background-color 0.3s ease;
color: maroon;
}
.search-container input[type="submit"]:hover {
background-color: #8b0000;
background-color: maroon;
color: #ffff;
}
.footer {
width: 100%;
text-align: center;
position: fixed;
bottom: 0;
left: 0;
}
.footer-text {
float: center;
}
</style>
</head>
<body>
<div class="navbar">ADMINISTRATIF FTII UNIVERSITAS STIKUBANK</div>
<div class="content">
<h1 class="dashboard">Data Mahasiswa FTII</h1>
<?php
include 'koneksi.php';
$searchKeyword = "";
if(isset($_GET['search']) && !empty($_GET['search'])) {
$searchKeyword = $_GET['search'];
$sql = "SELECT * FROM mahasiswa WHERE nama LIKE '%$searchKeyword%' OR nim LIKE '%$searchKeyword%' OR alamat LIKE '%$searchKeyword%' OR email LIKE '%$searchKeyword%' OR no_hp LIKE '%$searchKeyword%' OR jenis_kelamin LIKE '%$searchKeyword%' OR jurusan LIKE '%$searchKeyword%'";
} else {
$sql = "SELECT * FROM mahasiswa";
}
$result = mysqli_query($link, $sql);
?>
<div class="search-container">
<form action="" method="GET">
<input type="text" name="search" placeholder="Cari Mahasiswa...">
<input type="submit" value="Cari" class="btn">
</form>
</div>
<table>
<thead>
<tr>
<th>Nama</th>
<th>NIM</th>
<th>Alamat</th>
<th>Email</th>
<th>No HP</th>
<th>Jenis Kelamin</th>
<th>Jurusan</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php while ($row = mysqli_fetch_assoc($result)) { ?>
<tr>
<td><?php echo $row['nama']; ?></td>
<td><?php echo $row['nim']; ?></td>
<td><?php echo $row['alamat']; ?></td>
<td><?php echo $row['email']; ?></td>
<td><?php echo $row['no_hp']; ?></td>
<td><?php echo $row['jenis_kelamin']; ?></td>
<td><?php echo $row['jurusan']; ?></td>
<td>
<a href="edit-akun.php?id=<?php echo $row['id']; ?>" class="btn">Edit</a>
<a href="delete.php?id=<?php echo $row['id']; ?>" class="btn" onclick="return confirm('Apakah Anda yakin ingin menghapus data ini?');">Hapus</a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<a href="buat-akun.html" class="btn add-button">Tambah Mahasiswa</a>
</div>
<!-- footer -->
<footer class="footer">
<div class="footer-text">
<p>Copyright © 2023 by Salsa E | 22.01.53.0047 | All Rights Reserved.</p>
</div>
</footer>
</body>
</html>