-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpatient_details_D.php
317 lines (306 loc) · 10.6 KB
/
patient_details_D.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
<?php
$ptId;
session_start();
ini_set('error_reporting', 0);
ini_set('display_errors', 0);
if(isset($_GET['view']))
{
$ptId = $_GET['view'];
}
if(!isset($_SESSION['loggedin']) || $_SESSION['loggedin']!=true)
{
header("location: doctor_login.php");
exit;
}
?>
<?php
include 'partials/_dbconnect.php';
$sql = "Select * from userpatient where PatientId ='$ptId'";
$result = mysqli_query($conn,$sql);
$num = mysqli_num_rows($result);
if($num==1)
{
$row = mysqli_fetch_array($result);
$_SESSION['userName'] = $row["PatientName"];
$_SESSION['userAge'] = $row["PatientAge"];
$_SESSION['userSex'] = $row["PatientSex"];
$_SESSION['userBg'] = $row["PatientBg"];
$_SESSION['userWeight'] = $row["PatientWeight"];
$_SESSION['userHeight'] = $row["PatientHeight"];
}
?>
<?php
$sql2 = "Select * from dailysymptoms where PatientId ='$ptId'";
$result2 = mysqli_query($conn,$sql2);
?>
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
include 'partials/_dbconnect.php';
$patientId = $_POST['patientId'];
$dateMed = $_POST['medDate'];
$userMed = $_POST['medicine'];
$exists = false;
if($exists==false)
{
$sql3 = "INSERT INTO `prescribedmedicine` (`PatientId`, `Date`,`Medicine`) VALUES ('$patientId','$dateMed','$userMed')";
$result3 = mysqli_query($conn,$sql3);
if($result3)
{
$ptId = $patientId;
}
else
{
die(mysqli_error($conn));
}
}
}
?>
<?php
$sqlImg = "SELECT * FROM userimage WHERE PatientId = $ptId";
$resultImg = mysqli_query($conn,$sqlImg);
$rowImg = mysqli_fetch_assoc($resultImg);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Patient Details</title>
<!-- Required meta tags -->
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
crossorigin="anonymous"
/>
<link rel="stylesheet" href="css/patientdetails.css"/>
</head>
<style></style>
<body style="background-color:#ffff;">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark" style="background-color:#112B3C">
<a class="navbar-brand" href="#" style="font-weight:bold;">Covid<break>Sym</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" style="color:#FFFF;"href="/covidSym2/doctor_login.php">Dashboard</a>
</li>
<li class="nav-item">
<a class="nav-link" style="color:#FFFF;" href="#prescribe_medicine">Prescribe Medicine</a>
</li>
<li class="nav-item" style="position:relative; left:1100px;">
<a class="nav-link" style="color:#FFFF;" href="/covidSym2/logout.php">Log Out</a>
</li>
</ul>
</div>
</nav>
<!-- <div id="particle-container"></div> -->
<h1 class="dashboard-title">Patient Details</h1>
<section >
<div class="container py-5">
<div class="row">
</div>
<div class="row" >
<div class="col-lg-4">
<div class="card mb-4 shadow" style="background-color: #112B3C;border-radius:30px;width:400px;position:relative;left:150px;" >
<div class="card-body text-center">
<?php
if($rowImg['status']==0)
{
?>
<img src='images/profile<?php echo $ptId?>.jpg'
class="rounded-circle img-fluid" style="width: 150px; border-radius:2px;" onclick="addImageForm()">;
<?php
}
else{ ?>
<img src='images/profileImg.jpg'
class="rounded-circle img-fluid" style="width: 150px;" onclick="addImageForm()">;
<?php
}
?>
<h5 class="my-3" style="color: white;"><?php echo $_SESSION['userName']?></h5>
<p class="mb-1"></p>
<p class="mb-4"></p>
<div class="d-flex justify-content-center mb-2">
</div>
</div>
</div>
</div>
<div class="col-lg-5" >
<div class="card mb-4" style="background-color: #112B3C;border-radius: 30px;color: #EFEFEF;font-size: 20px; position:relative;left:175px;">
<div class="card-body" style="border: radius 30px;">
<div class="row" style="padding:0px;">
<div class="col-sm-5">
<p class="mb-0">Name</p>
</div>
<div class="col-sm-7">
<p class="mb-0"><?php echo $_SESSION['userName']?></p>
</div>
</div>
<hr>
<div class="row" style="padding:0px;">
<div class="col-sm-5">
<p class="mb-0">Age</p>
</div>
<div class="col-sm-7">
<p class="mb-0"><?php echo $_SESSION['userAge'] ?></p>
</div>
</div>
<hr>
<div class="row" style="padding:0px;">
<div class="col-sm-5">
<p class="mb-0">Patient Id:</p>
</div>
<div class="col-sm-7">
<p class="mb-0"><?php echo $ptId?></p>
</div>
</div>
<hr>
<div class="row" style="padding:0px;">
<div class="col-sm-5">
<p class="mb-0">Sex</p>
</div>
<div class="col-sm-7">
<p class="mb-0">
<?php
if($_SESSION['userSex']==0)
echo "Male";
else
echo "Female";
?> </p></p>
</div>
</div>
<hr>
<div class="row" style="padding:0px;">
<div class="col-sm-5">
<p class="mb-0">Blood Group</p>
</div>
<div class="col-sm-7">
<p class="mb-0"><?php echo $_SESSION['userBg']?></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<div class="dailyContainer">
<h1 class="dashboard-title" style="color:white;">Daily Symptoms</h1>
<table data-aos="fade-up">
<thead>
<tr>
<th>Date</th>
<th>Body Temperature</th>
<th>Oxygen Saturation</th>
<th>Cough</th>
<th>Fatigue</th>
<th>Loss of Smell</th>
<th>Loss of Taste</th>
<th>Others</th>
</tr>
</thead>
<tbody>
<?php
$i =0;
if(mysqli_num_rows($result2)>0)
{
while($row=mysqli_fetch_assoc($result2))
{
?>
<tr>
<td><?php echo $row['CurrentDate']?></td>
<td><?php echo $row['BodyTemp']?></td>
<td><?php echo $row['oxySaturation']?></td>
<td>
<?php if($row['Cough']==0)
echo "Yes";
else
echo "No"; ?>
</td>
<td><?php if($row['Fatigue']==0)
echo "Yes";
else
echo "No"; ?></td>
<td><?php if($row['LossSmell']==0)
echo "Yes";
else
echo "No"; ?></td>
<td><?php if($row['LossTaste']==0)
echo "Yes";
else
echo "No";?></td>
<td>
<?php echo $row['OtherSym']?>
</td>
</tr>
<?php
$i++;
}
}
?>
</tbody>
</table>
<br /><br />
</div>
<div class="chart">
<canvas id="myChart" width="500" height="100"></canvas>
</div>
<section id="prescribe_medicine">
<h2 class="dashboard-title">Prescribe Medicine</h2>
<div style="background-color:#112B3C; width:60% ;border-radius:10px; position:relative; height:320px;left:400px;bottom:40px;">
<form action="/covidSym2/patient_Details_D.php" method="post">
<label for="Date" style="color:#ffff">Date:</label>
<input style ="height:40px;"type="date" style="height:3rem;" name="medDate" >
<label for="patientId" style="color:#ffff">Patient ID:</label>
<input type="text" style="height:40px;" placeholder="Enter the Patient Id:" name="patientId">
<br>
<label for="Medicine" style="color:#ffff">Prescription:</label>
<input style ="width:500px;height:150px;width:70%;" type="textarea" placeholder="Enter the prescription:" name="medicine">
<br>
<input type="submit" style="background-color:#022B57;color:#E2B842; height:50px; position:relative; left:300px;">
</form>
</div>
</section>
</body>
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
crossorigin="anonymous"
></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js@3.7.1/dist/chart.min.js"></script>
<script>
const ctx = document.getElementById('myChart').getContext('2d');
const myChart = new Chart(ctx, {
type: 'line',
data: {
labels: ['01/01/2022', '02/01/2022', '03/01/2022', '04/01/2022'],
datasets: [{
label: 'Daily Temperature',
data: [98.7, 97.2, 102.7, 96.8],
backgroundColor: "#012b39",
borderColor: "#012b39",
borderWidth: 8
}]
},
options: {
scales: {
y: {
beginAtZero: false
}
}
}
});
var textWrapper = document.querySelector('.ml3');
textWrapper.innerHTML = textWrapper.textContent.replace(/\S/g, "<span class='letter'>$&</span>");
AOS.init();
</script>
</html>