-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmyaccount.php
59 lines (43 loc) · 1.34 KB
/
myaccount.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
<?php
session_start();
include "inc/doc.html";
echo "<h1 id='appoint_title'>My Appointment</h1>";
$mysqli = new mysqli("localhost", "root", "root","hospital");
if ($mysqli->connect_error) {
die("Connection failed: " . $mysqli->connect_error);
}
$query="SELECT name,apt_date,time,dname,dept FROM patient,doctor WHERE dayname(apt_date) in( SELECT dayname FROM doctor,`doctor_days` WHERE doctor.vid=doctor_days.vid) AND department in ( SELECT dept FROM doctor,`doctor_days` WHERE doctor.vid=doctor_days.vid) AND patient.mobile like '{$_SESSION['mobile']}'";
$result=mysqli_query($mysqli,$query);
echo"<table>
<tr>
<th>Patient's Name</th>
<th>Appointment Date</th>
<th>Appointment Time</th>
<th>Doctor's Name</th>
<th>Department</th>
</tr>";
while($row=mysqli_fetch_row($result)){
echo "<tr>
<td>$row[0]</td>
<td>$row[1]</td>
<td>$row[2]</td>
<td>$row[3]</td>
<td>$row[4]</td>
</tr>";
#setting Up Session for email
$_SESSION['pname']=$row[0];
$_SESSION['pdate']=$row[1];
$_SESSION['pappoint']=$row[2];
$_SESSION['docname']=$row[3];
$_SESSION['dept']=$row[4];
}
echo"</table>";
var_dump($_SESSION);
if(mysqli_num_rows($result)>0 )
{
echo '<form name="Patient" action="index.php" method="get">';
echo '<p><input type="submit" value="Click Here To Send Notification on Registered Email"></p>';
echo '</form>';
//header("Location: index.php");
}
?>