-
Notifications
You must be signed in to change notification settings - Fork 1
/
user_home.php
432 lines (360 loc) · 14 KB
/
user_home.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
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
<?php
session_start();
?>
<!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">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>User Home</title>
<!-- Bootstrap core CSS -->
<link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<link href="../bootstrap/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="user_home.css" rel="stylesheet">
<!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<script src="../bootstrap/js/ie-emulation-modes-warning.js"></script>
</head>
<style type="text/css">
.sidenav a, .dropdown-btn {
padding: 6px 8px 6px 16px;
text-decoration: none;
font-size: .875rem;
font-weight: 500;
color: #333;
display: block;
border: none;
background: none;
width: 100%;
text-align: left;
cursor: pointer;
outline: none;
}
.emp-profile{
padding: 3%;
margin-top: 3%;
margin-bottom: 3%;
border-radius: 0.5rem;
background: #fff;
}
.profile-head h5{
color: #333;
}
.profile-head h6{
color: #0062cc;
}
.profile-work{
padding: 14%;
margin-top: -15%;
}
.profile-work p{
font-size: 12px;
color: #818182;
font-weight: 600;
margin-top: 10%;
}
.profile-work a{
text-decoration: none;
color: #495057;
font-weight: 600;
font-size: 14px;
}
.profile-work ul{
list-style: none;
}
.profile-tab label{
font-weight: 600;
}
.profile-tab p{
font-weight: 600;
color: #0062cc;
}
.fa-caret-down {
float: right;
padding-right: 8px;
}
.dropdown-container {
display: none;
background-color: rgba(0, 0, 0, .25);
padding-left: 8px;
}
.feather {
width: 16px;
height: 16px;
vertical-align: text-bottom;
}
/*
* Sidebar
*/
.sidebar {
position: fixed;
top: 0;
bottom: 0;
left: 0;
z-index: 100; /* Behind the navbar */
padding: 48px 0 0; /* Height of navbar */
box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}
.sidebar-sticky {
position: relative;
top: 0;
height: calc(100vh - 48px);
padding-top: .5rem;
overflow-x: hidden;
overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */
}
@supports ((position: -webkit-sticky) or (position: sticky)) {
.sidebar-sticky {
position: -webkit-sticky;
position: sticky;
}
}
.sidebar .nav-link {
font-weight: 500;
color: #333;
}
.sidebar .nav-link .feather {
margin-right: 4px;
color: #999;
}
.sidebar .nav-link.active {
color: #007bff;
}
.sidebar .nav-link:hover .feather,
.sidebar .nav-link.active .feather {
color: inherit;
}
.sidebar-heading {
font-size: .75rem;
text-transform: uppercase;
}
/*
* Content
*/
[role="main"] {
padding-top: 48px; /* Space for fixed navbar */
}
/*
* Navbar
*/
.navbar .form-control {
padding: .75rem 1rem;
border-width: 0;
border-radius: 0;
}
.form-control-dark {
color: #fff;
background-color: rgba(255, 255, 255, .1);
border-color: rgba(255, 255, 255, .1);
}
.form-control-dark:focus {
border-color: transparent;
box-shadow: 0 0 0 3px rgba(255, 255, 255, .25);
}
</style>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid" style="background-color: #78a890;">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#" style="font-family: 'Merienda'; font-size: 38px;color: white"><b>INPATCare</b></a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="logout.php" style="color: white;"><b>Logout</b></a></li>
<!-- <li><a href="cart.php" style="color: white;"><b>Cart</b></a></li> -->
</ul>
<!-- <form class="navbar-form navbar-right">
<input type="text" class="form-control" placeholder="Search for the products...">
</form> -->
</div>
</div>
</nav>
<div class="container-fluid" >
<div class="row">
<nav class="col-md-2 d-none d-md-block bg-light sidebar">
<div class="sidebar-sticky" >
<ul class="nav flex-column">
<li class="nav-item"><a class="nav-link active" href="#"><span data-feather="home"></span><b>Home</b><span class="sr-only">(current)</span></a></li>
<!-- <li><a class="nav-link" href="user_myaccount.php"><span data-feather="calendar"></span><b>My account</b></a></li>
<li><a class="nav-link" href="user_history.php"><span data-feather="clock"></span><b>History</b></a></li> -->
</ul>
</div>
</div>
<!-- Content div in user home -->
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<h2 class="cover-heading">On The Way</h2><hr>
<div class="table-responsive">
<table class="table table-striped">
<?php
include "sql_access.php";
$patient_user_id=$_SESSION['patient_user_id'];
$sql="select m.medicine_name, p.dosage_quantity, mt.medicine_type_measure, p.dosage_time, p.prescription_id from prescription p inner join prescription_activity a on p.prescription_id = a.prescription_id inner join medicine m on p.medicine_id = m.medicine_id inner join medicine_types mt on m.medicine_type_id = mt.medicine_type_id inner join patient pt on pt.patient_id = p.patient_id where pt.patient_user_id = '$patient_user_id' and a.prescription_status = 'PICKED-UP'";
$result=mysqli_query($connect,$sql);
$chck=mysqli_num_rows($result);
if($chck>0)
{
echo '
<thead>
<tr>
<th>Medicine</th>
<th>Dosage</th>
<th>Prescription Time</th>
</tr>
</thead>
<tbody>
';
$looping=0;
while ($data=mysqli_fetch_array($result))
{
echo '<tr>';
echo '<td><form method="post"><input type="hidden" name="prescription_id1" value='.$data['prescription_id'].'>'.$data['medicine_name'].'</td>';
echo '<td>'.$data['dosage_quantity'].' '.$data['medicine_type_measure'].'</td>';
echo '<td>'.$data['dosage_time'].'</td>';
echo '<td><input type="submit" class="btn btn-primary" name= "button_received" value="Received"></td>';
echo '<td><input type="submit" class="btn btn-primary" name= "button_invalidate" value="In-validate"></form></td>';
//echo $looping;
echo '</tr>';
$looping++;
}
echo '</tbody>
</table>';
}
// else
// {
// echo '<th>No Medications to give now</th>';
// }
?>
</div>
<h2 class="sub-header">To Be Administered</h2><hr>
<div class="table-responsive">
<table class="table table-striped">
<?php
include "sql_access.php";
$patient_user_id=$_SESSION['patient_user_id'];
$sql="select m.medicine_name, p.dosage_quantity, mt.medicine_type_measure, p.dosage_time, p.prescription_id from prescription p inner join prescription_activity a on p.prescription_id = a.prescription_id inner join medicine m on p.medicine_id = m.medicine_id inner join medicine_types mt on m.medicine_type_id = mt.medicine_type_id inner join patient pt on pt.patient_id = p.patient_id where pt.patient_user_id = '$patient_user_id' and a.prescription_status = 'DELIVERED'";
$result=mysqli_query($connect,$sql);
$chck=mysqli_num_rows($result);
if($chck>0)
{
echo '
<thead>
<tr>
<th>Medicine</th>
<th>Dosage</th>
<th>Prescription Time</th>
</tr>
</thead>
<tbody>
';
while ($data=mysqli_fetch_array($result))
{
echo '<tr>';
echo '<td><form method="post"><input type="hidden" name="prescription_id2" value='.$data['prescription_id'].'>'.$data['medicine_name'].'</td>';
echo '<td>'.$data['dosage_quantity'].$data['medicine_type_measure'].'</td>';
echo '<td>'.$data['dosage_time'].'</td>';
echo '<td><input type="submit" class="btn btn-primary" name= "button_administered" value="Administered"></form></td>';
echo '</tr>';
}
echo '</tbody>
</table>';
}
// else
// {
// echo '<th>No Hot picks yet</th>';
// }
?>
</div>
<h2 class="sub-header">Medicines History</h2><hr>
<div class="table-responsive">
<table class="table table-striped">
<?php
include "sql_access.php";
$patient_user_id=$_SESSION['patient_user_id'];
$sql="select m.medicine_name, p.dosage_frequency, p.dosage_quantity, mt.medicine_type_measure, p.prescription_id, a.prescription_date from prescription p inner join prescription_activity a on p.prescription_id = a.prescription_id inner join medicine m on p.medicine_id = m.medicine_id inner join medicine_types mt on m.medicine_type_id = mt.medicine_type_id inner join patient pt on pt.patient_id = p.patient_id where pt.patient_user_id = '$patient_user_id' and a.prescription_status = 'ADMINISTERED' order by prescription_date desc";
$result=mysqli_query($connect,$sql);
$chck=mysqli_num_rows($result);
if($chck>0)
{
echo '
<thead>
<tr>
<th>Medicine</th>
<th>Daily Dosage</th>
<th>Dosage</th>
<th>Date</th>
</tr>
</thead>
<tbody>
';
while ($data=mysqli_fetch_array($result))
{
echo '<tr>';
echo '<td>'.$data['medicine_name'].'</td>';
echo '<td>'.$data['dosage_frequency'].'</td>';
echo '<td>'.$data['dosage_quantity'].' '.$data['medicine_type_measure'].'</td>';
echo '<td>'.$data['prescription_date'].'</td>';
echo '</tr>';
}
echo '</tbody>
</table>';
}
?>
</div>
</div>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="../../assets/js/vendor/jquery.min.js"><\/script>')</script>
<script src="../../assets/js/vendor/popper.min.js"></script>
<script src="../../dist/js/bootstrap.min.js"></script>
<script src="../../assets/js/vendor/holder.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
<!-- Icons -->
<script src="https://unpkg.com/feather-icons/dist/feather.min.js"></script>
<script>
feather.replace()
</script>
</body>
</html>
<?php
IF(ISSET($_POST['button_received'])){
$prs_id = $_POST['prescription_id1'];
$sql = "UPDATE prescription_activity SET prescription_status='DELIVERED' WHERE prescription_id = '$prs_id'";
$result = mysqli_query($connect,$sql);
echo "<meta http-equiv='refresh' content='0'>";
};
IF(ISSET($_POST['button_invalidate'])){
$prs_id = $_POST['prescription_id1'];
$sql = "UPDATE prescription_activity SET prescription_status='IDLE' WHERE prescription_id = '$prs_id'";
$result = mysqli_query($connect,$sql);
echo "<meta http-equiv='refresh' content='0'>";
};
IF(ISSET($_POST['button_administered'])){
$prs_id = $_POST['prescription_id2'];
$sql = "UPDATE prescription_activity SET prescription_status='ADMINISTERED' WHERE prescription_id = '$prs_id'";
$result = mysqli_query($connect,$sql);
echo "<meta http-equiv='refresh' content='0'>";
};
?>