-
Notifications
You must be signed in to change notification settings - Fork 0
/
history.php
69 lines (55 loc) · 1.66 KB
/
history.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
<?php
session_start();
require 'config.php';
require '../connect.php';
if (session_id() == '' || !isset($_SESSION) || !isset($_SESSION['user']) || $_SESSION['user'] == '') {
header("location:login.php");
exit;
}
$user = $_SESSION["user"];
// Get database
$sql = "SELECT * FROM postal_notification WHERE sender='$user' ORDER BY time DESC";
$result = $con->query($sql);
if ($result->num_rows <= 0) {
echo "0 results";
exit;
}
?>
<html>
<head>
<title> Postal Notification System </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<style>
.container {
overflow-x: auto;
}
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 700px;
margin: 0 auto;
}
td, th {
border: 1px solid #dddddd;
text-align: center;
padding: 8px;
}
</style>
</head>
<body>
<h2> History for <?php echo $user; ?> </h2>
<div class="container">
<table>
<tr><th> Timestamp (UTC) </th> <th> Email </th> <th> Comments </th></tr>
<?php
while($row = $result->fetch_assoc()) {
echo "<tr> <td>" . $row["time"] . "</td><td>" . $row["recipient"] . " </td><td> " . $row["comments"] . "</td> </tr>";
}
?>
</table>
</div>
</body>
</html>
<?php
$con->close();
?>