-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmessages.php
71 lines (56 loc) · 1.44 KB
/
messages.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
<?php
require 'core/init.php';
// Create connection
include_once 'core/db_mysqli_connect.php';
$user = new User();
if (!$user->isLoggedIn()) {
Redirect::to('/login');
}
if ($user->data()->group != 3) {
Redirect::to('/error');
}
$result = $conn->query("SELECT * FROM messages");
?>
<!DOCTYPE html>
<head>
<title>Imaguana | Messages</title>
<!-- CSS, Meta, Ajax, etc. -->
<?php include 'view/head.php' ?>
</head>
<body>
<!-- Navigation Bar -->
<?php include 'view/nav-bar.php'; ?>
<style type="text/css">
td,th{
font-size: 25px;
color: black;
}
</style>
<!-- Page Content -->
<h1 align="center" style="color:black;">All Messages</h1><br>
<table align= "center" border = "5" id="suggestions">
<th>Name</th>
<th>Email</th>
<th>Message</th>
<?php if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) { ?>
<tr>
<td><?php echo $row["name"] ?></td>
<td><?php echo $row["email"] ?></td>
<td><?php echo $row["message"] ?></td>
</tr>
<?php }
}
else{
echo "<p align='center'> No Messages</p>";
}
?>
</table><br><br>
<!-- Foot Bar -->
<div>
<?php include 'view/foot-bar.php'; ?>
</div>
<!-- Scripts -->
<?php include 'view/scripts.php' ?>
</body>
</html>