-
Notifications
You must be signed in to change notification settings - Fork 0
/
getuser.php
72 lines (54 loc) · 1.77 KB
/
getuser.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
<?php
include_once 'assets/conn/dbconnect.php';
$q = $_GET['q'];
// echo $q;
$res = mysqli_query($con,"SELECT * FROM doctorschedule WHERE scheduleDate='$q'");
if (!$res) {
die("Error running $sql: " . mysqli_error());
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- <link href="assets/css/bootstrap.min.css" rel="stylesheet"> -->
</head>
<body>
<?php
if (mysqli_num_rows($res)==0) {
echo "<div class='alert alert-danger' role='alert'>Doctor is not available at the moment. Please try again later.</div>";
} else {
echo " <table class='table table-hover'>";
echo " <thead>";
echo " <tr>";
echo " <th>Day</th>";
echo " <th>Date</th>";
echo " <th>Start</th>";
echo " <th>End</th>";
echo " <th>Availability</th>";
echo " </tr>";
echo " </thead>";
echo " <tbody>";
while($row = mysqli_fetch_array($res)) {
?>
<tr>
<?php
// $avail=null;
if ($row['bookAvail']!='available') {
$avail="danger";
} else {
$avail="primary";
}
echo "<td>" . $row['scheduleDay'] . "</td>";
echo "<td>" . $row['scheduleDate'] . "</td>";
echo "<td>" . $row['startTime'] . "</td>";
echo "<td>" . $row['endTime'] . "</td>";
echo "<td> <span class='label label-".$avail."'>". $row['bookAvail'] ."</span></td>";
?>
</tr>
<?php
}
}
?>
</tbody>
</body>
</html>