-
Notifications
You must be signed in to change notification settings - Fork 0
/
booking.php
334 lines (242 loc) · 15.6 KB
/
booking.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
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
<!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="stylesheet" href="../css/animations.css">
<link rel="stylesheet" href="../css/main.css">
<link rel="stylesheet" href="../css/admin.css">
<title>Sessions</title>
<style>
.popup{
animation: transitionIn-Y-bottom 0.5s;
}
.sub-table{
animation: transitionIn-Y-bottom 0.5s;
}
</style>
</head>
<body>
<?php
error_reporting(E_ALL); ini_set('display_errors', 1); ini_set('',1);
//learn from w3schools.com
session_start();
if(isset($_SESSION["user"])){
if(($_SESSION["user"])=="" or $_SESSION['usertype']!='p'){
header("location: ../login.php");
}else{
$useremail=$_SESSION["user"];
}
}else{
header("location: ../login.php");
}
//import database
include("../connection.php");
$sqlmain= "select * from patient where pemail=?";
$stmt = $database->prepare($sqlmain);
$stmt->bind_param("s",$useremail);
$stmt->execute();
$result = $stmt->get_result();
$userfetch=$result->fetch_assoc();
$userid= $userfetch["pid"];
$username=$userfetch["pname"];
//echo $userid;
//echo $username;
date_default_timezone_set('Asia/Kolkata');
$today = date('Y-m-d');
//echo $userid;
?>
<div class="container">
<div class="menu">
<table class="menu-container" border="0">
<tr>
<td style="padding:10px" colspan="2">
<table border="0" class="profile-container">
<tr>
<td width="30%" style="padding-left:20px" >
<img src="../img/user.png" alt="" width="100%" style="border-radius:50%">
</td>
<td style="padding:0px;margin:0px;">
<p class="profile-title"><?php echo substr($username,0,13) ?>..</p>
<p class="profile-subtitle"><?php echo substr($useremail,0,22) ?></p>
</td>
</tr>
<tr>
<td colspan="2">
<a href="../logout.php" ><input type="button" value="Log out" class="logout-btn btn-primary-soft btn"></a>
</td>
</tr>
</table>
</td>
</tr>
<tr class="menu-row" >
<td class="menu-btn menu-icon-home " >
<a href="index.php" class="non-style-link-menu "><div><p class="menu-text">Home</p></a></div></a>
</td>
</tr>
<tr class="menu-row">
<td class="menu-btn menu-icon-doctor">
<a href="doctors.php" class="non-style-link-menu"><div><p class="menu-text">All Doctors</p></a></div>
</td>
</tr>
<tr class="menu-row" >
<td class="menu-btn menu-icon-session menu-active menu-icon-session-active">
<a href="schedule.php" class="non-style-link-menu non-style-link-menu-active"><div><p class="menu-text">Scheduled Sessions</p></div></a>
</td>
</tr>
<tr class="menu-row" >
<td class="menu-btn menu-icon-appoinment">
<a href="appointment.php" class="non-style-link-menu"><div><p class="menu-text">My Bookings</p></a></div>
</td>
</tr>
<tr class="menu-row" >
<td class="menu-btn menu-icon-settings">
<a href="settings.php" class="non-style-link-menu"><div><p class="menu-text">Settings</p></a></div>
</td>
</tr>
</table>
</div>
<div class="dash-body">
<table border="0" width="100%" style=" border-spacing: 0;margin:0;padding:0;margin-top:25px; ">
<tr >
<td width="13%" >
<a href="schedule.php" ><button class="login-btn btn-primary-soft btn btn-icon-back" style="padding-top:11px;padding-bottom:11px;margin-left:20px;width:125px"><font class="tn-in-text">Back</font></button></a>
</td>
<td >
<form action="schedule.php" method="post" class="header-search">
<input type="search" name="search" class="input-text header-searchbar" placeholder="Search Doctor name or Email or Date (YYYY-MM-DD)" list="doctors" >
<?php
echo '<datalist id="doctors">';
$list11 = $database->query("select DISTINCT * from doctor;");
$list12 = $database->query("select DISTINCT * from schedule GROUP BY title;");
for ($y=0;$y<$list11->num_rows;$y++){
$row00=$list11->fetch_assoc();
$d=$row00["docname"];
echo "<option value='$d'><br/>";
};
for ($y=0;$y<$list12->num_rows;$y++){
$row00=$list12->fetch_assoc();
$d=$row00["title"];
echo "<option value='$d'><br/>";
};
echo ' </datalist>';
?>
<input type="Submit" value="Search" class="login-btn btn-primary btn" style="padding-left: 25px;padding-right: 25px;padding-top: 10px;padding-bottom: 10px;">
</form>
</td>
<td width="15%">
<p style="font-size: 14px;color: rgb(119, 119, 119);padding: 0;margin: 0;text-align: right;">
Today's Date
</p>
<p class="heading-sub12" style="padding: 0;margin: 0;">
<?php
echo $today;
?>
</p>
</td>
<td width="10%">
<button class="btn-label" style="display: flex;justify-content: center;align-items: center;"><img src="../img/calendar.svg" width="100%"></button>
</td>
</tr>
<tr>
<td colspan="4" style="padding-top:10px;width: 100%;" >
<!-- <p class="heading-main12" style="margin-left: 45px;font-size:18px;color:rgb(49, 49, 49);font-weight:400;">Scheduled Sessions / Booking / <b>Review Booking</b></p> -->
</td>
</tr>
<tr>
<td colspan="4">
<center>
<div class="abc scroll">
<table width="100%" class="sub-table scrolldown" border="0" style="padding: 50px;border:none">
<tbody>
<?php
if(($_GET)){
if(isset($_GET["id"])){
$id=$_GET["id"];
$sqlmain= "select * from schedule inner join doctor on schedule.docid=doctor.docid where schedule.scheduleid=? order by schedule.scheduledate desc";
$stmt = $database->prepare($sqlmain);
$stmt->bind_param("i", $id);
$stmt->execute();
$result = $stmt->get_result();
//echo $sqlmain;
$row=$result->fetch_assoc();
$scheduleid=$row["scheduleid"];
$title=$row["title"];
$docname=$row["docname"];
$docemail=$row["docemail"];
$scheduledate=$row["scheduledate"];
$scheduletime=$row["scheduletime"];
$fee=$row["fee"];
$sql2="select * from appointment where scheduleid=$id";
//echo $sql2;
$result12= $database->query($sql2);
$apponum=($result12->num_rows)+1;
echo '
<form action="booking-complete.php" method="post">
<input type="hidden" name="scheduleid" value="'.$scheduleid.'" >
<input type="hidden" name="apponum" value="'.$apponum.'" >
<input type="hidden" name="date" value="'.$today.'" >
<input type="hidden" name="fee" value="'.$fee.'" >
';
echo '
<td style="width: 50%;" rowspan="2">
<div class="dashboard-items search-items" >
<div style="width:100%">
<div class="h1-search" style="font-size:25px;">
Session Details
</div><br><br>
<div class="h3-search" style="font-size:18px;line-height:30px">
Doctor name: <b>'.$docname.'</b><br>
Doctor Email: <b>'.$docemail.'</b>
</div>
<div class="h3-search" style="font-size:18px;">
</div><br>
<div class="h3-search" style="font-size:18px;">
Session Title: '.$title.'<br>
Session Scheduled Date: '.$scheduledate.'<br>
Session Starts : '.$scheduletime.'<br>
Channeling fee : <b>Ksh. '.$fee.'</b>
</div>
<br>
</div>
</div>
</td>
<td style="width: 25%;">
<div class="dashboard-items search-items" >
<div style="width:100%;padding-top: 15px;padding-bottom: 15px;">
<div class="h1-search" style="font-size:20px;line-height: 35px;margin-left:8px;text-align:center;">
Your Appointment Number
</div>
<center>
<div class=" dashboard-icons" style="margin-left: 0px;width:90%;font-size:70px;font-weight:800;text-align:center;color:var(--btnnictext);background-color: var(--btnice)">'.$apponum.'</div>
</center>
</div><br>
<br>
<br>
</div>
</div>
</td>
</tr>
<tr>
<td>
<input type="Submit" class="login-btn btn-primary btn btn-book" style="margin-left:10px;padding-left: 25px;padding-right: 25px;padding-top: 10px;padding-bottom: 10px;width:95%;text-align: center;" value="Book now" name="booknow"></button>
</form>
</td>
</tr>
';
}
}
?>
</tbody>
</table>
</div>
</center>
</td>
</tr>
</table>
</div>
</div>
</div>
</body>
</html>