-
Notifications
You must be signed in to change notification settings - Fork 0
/
patappointment.php
231 lines (208 loc) · 6.2 KB
/
patappointment.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
<?php
session_start();
$user=$_SESSION['userid'];
if(isset($_POST['search']))
{
$valueToSearch = $_POST['valueToSearch'];
// search in all table columns
// using concat mysql function
$query = "SELECT * FROM `appointment` WHERE userid='$user' AND CONCAT( `sno`, `userid`, `docid`, `specialization`, `disease`, `appointmentdate`, `appointmenttime`, `consultancyfees`, `userstatus`, `doctorstatus`) LIKE '%".$valueToSearch."%'";
$search_result = filterTable($query);
}
else {
$query = "SELECT * FROM `appointment` where userid='$user' ";
$search_result = filterTable($query);
}
// function to connect and execute the query
function filterTable($query)
{
$connect = mysqli_connect("localhost", "root", "", "hms");
$filter_Result = mysqli_query($connect, $query);
return $filter_Result;
}
?>
<html>
<head>
<title>Patient Appointments</title>
<link rel="stylesheet" type="text/css" href="home.css">
<link rel="shortcut icon" type="image/x-icon" href="images/em.jpg" />
<link rel="stylesheet" href="loader.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css" integrity="sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ" crossorigin="anonymous">
<style>
body{
width:500px;
height:1000px;
background:white;
}
.content-table{
border-collapse:collapse;
margin:25px 0;
font-size:0.9em;
min-width:900px;
border-radius:5px 5px 0px 0px;
overflow:hidden;
box-shadow: 0 0 20px rgba(0,0,0,0.25);
text-align:center;
}
.content-table thead tr {
background-color:#009879;
color:white;
text-align:center;
font-weight:bold;
}
.content-table th,content-table tr{
padding:20px 30px;
}
.content-table tbody tr{
border-bottom:1px solid #dddddd;
}
.content-table tbody tr:nth-of-type(even){
background-color:#f3f3f3;
}
.content-table tbody tr:last-of-type{
border-bottom:2px solid #009879;
}
.link{
background-color:#009879;
width:1260px;
height:40px;
}
.search-box{
position:absolute;
top:70px;
left:530px;
transfrom:translate(-50%,-50%);
background:#009879;
height:40px;
border-radius:40px;
}
.search-box:hover > .search-btn{
background:#009879;
}
.search-btn{
color:white;
float:right;
width:70px;
height:40px;
border:none;
border-radius:40px;
background:#009879;
display:flex;
justify-content:center;
align-items:center;
transition:0.4s;
}
.search-box:hover > .search-txt{
width:200px;
padding:0 6px;
}
.search-txt{
border:none;
background:none;
outline:none;
float:left;
padding:0;
color:white;
font-size:20px;
font-family:sans-serif;
transition:0.4s;
line-height:40px;
width:0px;
}
.btn{
background-color:#ffcccb;
font-family:sofia;
color:red;
width:100px;
height:40px;
border-radius:30%;
box-shadow:0 0 10px #ffcccb;
outline:none;
}
.btn:hover{
background-color:red;
color:white;
}
</style>
</head>
<body>
<div class="loader">
<img src="gif/loader.gif" alt="Loading...." />
</div>
<script src="load.js">
</script>
<div class="link">
<a class="float-right" href="patsignin.php" style="font-size:20px;color:white;text-decoration:none;font-family:sofia;"><h4><i class="fa fa-backward" aria-hidden="true"> Back</i> </h4></a>
</div>
<h1 style="color:#009879;">YOUR APPOINTMENT DETAILS</h1><br>
<form action="" method="POST" autocomplete="off">
<div class="search-box">
<input class="search-txt" type="text" name="valueToSearch" placeholder="Value To Search">
<input class="search-btn" type="submit" name="search" value="SEARCH">
</div>
<table class="content-table">
<thead>
<tr>
<th>USER ID</th>
<th>SPECIALIZATION</th>
<th>DOCTOR ID</th>
<th>DISEASE</th>
<th>APPOINTMENT DATE</th>
<th>APPOINTMENT TIME</th>
<th>CONSULTANCY FEES</th>
<th>YOUR STATUS</th>
<th>ACTION</th>
</tr>
</thead>
</form>
<!-- populate table from mysql database -->
<?php while($row = mysqli_fetch_array($search_result)):?>
<tr>
<td><?php echo $row['userid'] ?></td>
<td><?php echo $row['specialization'] ?></td>
<td><?php echo $row['docid'] ?></td>
<td><?php echo $row['disease'] ?></td>
<td><?php echo $row['appointmentdate'] ?></td>
<td><?php echo $row['appointmenttime'] ?></td>
<td><?php echo $row['consultancyfees'] ?></td>
<td>
<?php
if(($row['userstatus']==1) && ($row['doctorstatus']==1) && ($row['action']==0))
{
echo "Active";
}
if(($row['userstatus']==1) && ($row['doctorstatus']==1) && ($row['action']==1))
{
echo "Your Appointment accepted <br>wait for the Presciption";
}
if(($row['userstatus']==0) && ($row['doctorstatus']==1)&& ($row['action']==0))
{
echo "Cancelled by Yourself";
}
if(($row['userstatus']==1) && ($row['doctorstatus']==0)&&($row['action']==0))
{
echo "Cancelled By the Doctor";
}
?>
</td>
<td>
<form method="POST" action="patstatus.php">
<input type='hidden' name='SNo' value="<?php echo $row['sno'] ?>"/>
<?php
if(($row['userstatus']==1) && ($row['doctorstatus']==1)&& ($row['action']==0))
{
echo "<input class='btn' type='submit' name='cancel' onclick='return checkcancel()' value='Cancel'/>";
}
?>
</form>
</td>
</tr>
<?php endwhile;?>
</table>
<script>
function checkcancel(){
return confirm('Are You Sure You Want Cancel Your Appointment');
}
</script>
</body>
</html>