-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstaff_appointment_approve.php
78 lines (57 loc) · 1.61 KB
/
staff_appointment_approve.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
<?php
include 'staff_sidebar.php';
include 'connection_link.php';
if(isset($_GET['Appointment_id']))
{
$Appointment_id=$_GET['Appointment_id'];
$Approved="Approved";
$sql = "UPDATE `appointment` SET `Appointment_status` = '$Approved' WHERE `appointment`.`Appointment_id` = '$Appointment_id'";
if ($conn->query($sql) == TRUE)
{
}
}
include 'connection_link.php';
$sql = "SELECT * FROM appointment";
$result = mysqli_query($conn, $sql);
echo'<h1 class="Dashboard" >Appointment list</h1>';
if ($result->num_rows > 0)
{
echo "<br>";
echo "<table align=center>
<tr>
<th>Appointment id</th>
<th>Email</th>
<th>Appointment Date</th>
<th>Appointment Slot</th>
<th>Status</th>
</tr>";
while($row = $result->fetch_assoc())
{
if($row["Appointment_status"]=="Not yet")
{
echo "<tr>
<td>".$row["Appointment_id"]. "</td>
<td>".$row["Email"]. "</td>
<td>".$row["Appointment_date"]. "</td>
<td>".$row["Appointment_time"]. "</td>
<td>"."<a href='staff_appointment_approve.php?Appointment_id=".$row["Appointment_id"]."'>Approve</a>"."
</tr>";
}
else
{ echo "<tr>
<td>".$row["Appointment_id"]. "</td>
<td>".$row["Email"]. "</td>
<td>".$row["Appointment_date"]. "</td>
<td>".$row["Appointment_time"]. "</td>
<td>".$row["Appointment_status"]. "</td>
<tr>";
}
}
echo "</table>";
}
else
{
echo "0 results";
}
mysqli_close($conn);
?>