forked from bharadwajtannu/accomodation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin-dashboard.php
81 lines (70 loc) · 1.8 KB
/
admin-dashboard.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
<?php
include 'connect.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta char set="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Dashboard - Accommodation Information</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f7f7f7;
color: #333;
}
h1 {
text-align: center;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
th,
td {
padding: 10px;
text-align: left;
border-bottom: 1px solid #ddd;
}
th {
background-color: #f2f2f2;
font-weight: bold;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
</style>
</head>
<body>
<?php
$sql = "SELECT * FROM accommodation_bookings";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "<h1>Admin Dashboard - Accommodation Information</h1>";
echo "<table>
<tr>
<th>Name</th>
<th>email</th>
<th>phone</th>
<th>room_type</th>
</tr>";
while ($row = $result->fetch_assoc()) {
echo "<tr>
<td>" . $row["name"] . "</td>
<td>" . $row["email"] . "</td>
<td>" . $row["phone"] . "</td>
<td>" . $row["room_type"] . "</td>
</tr>";
}
echo "</table>";
} else {
echo "<h1>No accommodations found.</h1>";
}
$conn->close();
?>
<a href="logout.php">Logout</a>
</body>
</html>