-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.php
68 lines (59 loc) · 1.8 KB
/
admin.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
<?php
include "dbConnect.php";
session_start();
$username = $password = '';
$username_err = $password_err = '';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Your login validation code here
}
$query = "SELECT * FROM `appointments` WHERE `approved` = 0";
$result = mysqli_query($conn, $query);
if ($result) {
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Add your header content here -->
</head>
<body>
<div class="container">
<h2>Appointments for Approval</h2>
<table class="table">
<thead>
<tr>
<th>Pet Name</th>
<th>Pet Owner Name</th>
<th>Service Type</th>
<th>Preferred Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
while ($row = mysqli_fetch_assoc($result)) {
echo "<tr>";
echo "<td>" . $row['pet_name'] . "</td>";
echo "<td>" . $row['pet_owner_name'] . "</td>";
echo "<td>" . $row['appointment_type'] . "</td>";
echo "<td>" . $row['preferred_date'] . "</td>";
echo "<td>
<a href='approve.php?id=" . $row['id'] . "'>Approve</a> |
<form method='post' action='delete.php'>
<input type='hidden' name='appointment_id' value='" . $row['id'] . "'>
<button type='submit' name='delete' class='btn btn-link'>Delete</button>
</form>
</td>"; // Link to approve.php with appointment ID
echo "</tr>";
}
?>
</tbody>
</table>
</div>
<!-- Other HTML content -->
</body>
</html>
<?php
} else {
echo "Error fetching appointments: " . mysqli_error($conn);
}
?>