-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathappointments.php
More file actions
116 lines (106 loc) · 4.4 KB
/
appointments.php
File metadata and controls
116 lines (106 loc) · 4.4 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="icon" href="img">
<link rel="icon" type="image/x-icon" href="css/img/logo1.png">
<link rel="stylesheet" href="css/nav.css">
<link rel="stylesheet" href="css/appointments.css">
<script src="https://kit.fontawesome.com/8ef5e4d9da.js"></script>
<title>DCMS | Logs Page</title>
</head>
<body onload="onStart(); setColors()">
<?php
include 'nav.php';
include 'db_conn.php';
?>
<section>
<h1 id="pendingApp">Pending Appointments</h1>
<div class="tableHeader">
<label>Name</label>
<label>Position</label>
<label>Service</label>
<label>Date Scheduled</label>
<label>Date Created</label>
<label>State</label>
</div>
<div class="table">
<?php
$sql = "SELECT * FROM `appointments` WHERE `state` = 'Pending'";
$result = mysqli_query($conn, $sql);
if ($result) {
while ($row = mysqli_fetch_assoc($result)) {
$id = $row['id'];
$name = $row['name'];
$position = $row['position'];
$service = $row['service'];
$dateCreated = $row['dateTime'];
$dateEnd = $row['date'];
echo '
<div class="tableContent">
<label style="display:none">'.$id.'</label>
<label>'.$name.'</label>
<label>'.$position.'</label>
<label>'.$service.'</label>
<label>'.$dateCreated.'</label>
<label>'.$dateEnd.'</label>
<div>
<button class="buttons" id="acceptBtn"><a id="acceptLabel" href="accept.php?acceptId='.$id.'">Accept</a></button>
<button class="buttons" id="denyBtn"><a id="denyLabel" href="deny.php?denyId='.$id.'"">Deny</a></button>
</div>
</div>
';
}
}
?>
<div>
</div>
</section>
<section>
<h1 id="onProgressApp">On Progress Appointments</h1>
<div class="tableHeader">
<label>Name</label>
<label>Position</label>
<label>Service</label>
<label>Date Scheduled</label>
<label>Date Created</label>
<label>State</label>
</div>
<div class="table">
<?php
$sql = "SELECT * FROM `appointments` WHERE `state` = 'Accepted'";
$result = mysqli_query($conn, $sql);
if ($result) {
while ($row = mysqli_fetch_assoc($result)) {
$id = $row['id'];
$name = $row['name'];
$position = $row['position'];
$service = $row['service'];
$dateCreated = $row['dateTime'];
$dateEnd = $row['date'];
echo '
<div class="tableContent">
<label style="display:none">'.$id.'</label>
<label>'.$name.'</label>
<label>'.$position.'</label>
<label>'.$service.'</label>
<label>'.$dateCreated.'</label>
<label>'.$dateEnd.'</label>
<div>
<button class="buttons" id="successBtn"><a id="successLabel" href="success.php?successId='.$id.'">Success</a></button>
<button class="buttons" id="failedBtn"><a id="failedLabel" href="failed.php?failedId='.$id.'"">Failed</a></button>
</div>
</div>
';
}
}
?>
<div>
</div>
</section>
<script src="js/nav.js"></script>
<script src="js/appointments.js"></script>
</body>
</html>