-
Notifications
You must be signed in to change notification settings - Fork 0
/
drdashboard.php
139 lines (139 loc) · 4.83 KB
/
drdashboard.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
<?php
session_start();
if(!isset($_SESSION['drloggedin']) && $_SESSION['drloggedin']!=true){
header("location: login.php");
}
?>
<?php
require "partials/connection.php";
$sql= "SELECT * FROM `drdetail` WHERE `drusername` LIKE '".$_SESSION['username']."'" ;
$result=mysqli_query($conn,$sql);
?>
<!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="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="partials/footer.css">
<link rel="stylesheet" href="partials/navbar.css">
<link rel="stylesheet" href="//cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css">
<title><?php echo $_SESSION['username']?></title>
<style>
.container{
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
}
.container img{
height: 300px;
}
.userdetail{
padding: 26px 70px;
}
.userdetail h3{
margin: 10px 10px;
font-size:22px;
}
.appointment{
height: 300px;
margin: 26px 70px;
text-align:center;
overflow-y:scroll;
}
.appointmentList{
margin: 10px;
}
#image {
position: fixed;
z-index: -1;
width: 30%;
top: 350px;
}
#viewmsg{
color: blue;
margin: 10px;
}
footer{
width: 100%;
}
</style>
</head>
<body>
<?php require 'partials/navbar.php'?>
<!-- <img id="image" src="images/collaborate.svg"> -->
<div class="content">
<div class="container">
<img src="images/dpicon.jpg">
<div class="userdetail">
<?php
$detail=mysqli_fetch_assoc($result);
echo "<h3>Name: ".$detail['fullname']."</h3>
<h3>Speciality: ".$detail['speciality']."</h3>
<h3>Username: ".$detail['drusername']."</h3>";
?>
<a id="viewmsg" href="http://localhost/iHealth/messages.php">View Messages</a>
</div>
</div>
<div class="appointment">
<h1>Your Appoinments</h1>
<hr>
<?php
// $sql="SELECT * FROM `appointments` WHERE `drusername` LIKE '".$detail['drusername']."'";
// $result=mysqli_query($conn,$sql);
// $num=mysqli_num_rows($result);
// while($row=mySqli_fetch_assoc($result)){
// echo '<div class="appointmentList">You have appointment with '.$row["username"].' on '.$row["day"].'-'.$row["month"].'-'.$row["year"].' at '.$row["hour"].':'.$row["min"].'AM</div>';
// }
// if($num==0){
// echo '<div class="appointmentList">You have no Appointments</div>';
// }
?>
<table class="table" id="myTable">
<thead>
<tr>
<th scope="col">Sr No.</th>
<th scope="col">Patient</th>
<th scope="col">Date</th>
<th scope="col">Time</th>
</tr>
</thead>
<tbody>
<?php
$sql="SELECT * FROM `appointments` WHERE `drusername` LIKE '".$detail['drusername']."'";
$sno = 0;
$resultRow = mysqli_query($conn, $sql);
while($row = mysqli_fetch_assoc($resultRow)){
$sno = $sno + 1;
echo ' <tr>
<th scope="row">'.$sno.'</th>
<td>'.$row["username"].'</td>
<td>'.$row["day"].'-'.$row["month"].'-'.$row["year"].'</td>
<td>'.$row["hour"].':'.$row["min"].'AM</td>
</tr>';
}
?>
</tbody>
</table>
</div>
<script src="https://code.jquery.com/jquery-3.6.0.js" integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=" crossorigin="anonymous"></script>
<script src="//cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
<script>
$(document).ready( function () {
$('#myTable').DataTable();
} );
</script>
<script>
let edits=document.getElementsByClassName('edit');
Array.from(edits).forEach(element=>{
element.addEventListener("click",(e)=>{
console.log("edit",e.target);
})
})
</script>
<?php require 'partials/footer.html'?>
</div>
</body>
</html>