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
<?php
session_start();
if (!isset($_SESSION["login"])) {
header("Location: login.php");
exit;
}
require 'header.php';
$mhs = query("SELECT * FROM kontak");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Daftar Pesan</title>
</head>
<body>
<div class="container">
<table class="table table-striped">
<thead>
<tr>
<th scope="col">No.</th>
<th scope="col">Nama</th>
<th scope="col">Email</th>
<th scope="col">Subjek</th>
<th scope="col">Tanggal</th>
<th scope="col">Aksi</th>
</tr>
</thead>
<tbody>
<tr>
<?php $i = 1 ?>
<?php foreach ($mhs as $row) : ?>
<td><?php echo $i; ?></td>
<td>
<?= $row["nama"]; ?>
</td>
<td>
<?= $row["email"]; ?>
</td>
<td>
<a href="Admin_MenampilkanPesan.php?id=<?php echo $row["id"] ?>" class="tulisan"><?= $row["subjek"]; ?></a>
</td>
<td>
<?= $row["tanggal"]; ?>
</td>
<td>
<a href="Admin_HapusPesan.php?id=<?php echo $row["id"] ?>" onclick="return confirm('yakin?');">hapus</a>
</td>
</tr>
<?php $i++; ?>
<?php endforeach; ?>
</tbody>
</table>
</div>
</body>
<?php
require 'footer.php';
?>
</html>