-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewpatdetails.php
239 lines (227 loc) · 7.72 KB
/
viewpatdetails.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
<?php
include("includes/header.php");
include("includes/conn.php");
if(!isset($_SESSION[pat_id]))
{
echo "<script>window.location=index.php;</script>";
}
$resultpat = mysqli_query($con,"SELECT * FROM patient where pat_id=$_SESSION[pat_id]");
$rowpat = mysqli_fetch_array($resultpat)
?>
<div id="templatemo_main">
<div id="sidebar" class="float_l">
<div class="sidebar_box">
<?php
include("sidebar.php");
patienthome();
?>
</div>
</div>
<div id="content" class="faq float_r">
<table width="690" border="0">
<tr bgcolor="#FFFFCC">
<td colspan="4" align="center">Profile</td>
</tr>
<tr>
<td width="96" bgcolor="#FFFFCC">Name:</td>
<td width="197"><?php echo $rowpat[pat_name]; ?></td>
<td width="80" bgcolor="#FFFFCC">Email-ID:</td>
<td width="299"><form id="form1" name="form1" method="post" action="">
<label for="name"></label>
<?php echo $rowpat[email_id]; ?>
</form></td>
</tr>
<tr>
<td bgcolor="#FFFFCC">Date Of Birth:</td>
<td><?php echo $rowpat[dob]; ?></td>
<td bgcolor="#FFFFCC">Gender:</td>
<td><?php echo $rowpat[gender]; ?></td>
</tr>
<tr>
<td bgcolor="#FFFFCC">Address:</td>
<td><?php echo $rowpat[address]; ?></td>
<td bgcolor="#FFFFCC">Contact:</td>
<td><?php echo $rowpat[contact]; ?></td>
</tr>
</table>
<br />
<table width="688" border="0">
<tr bgcolor="#FFFFCC">
<td colspan="6" align="center">Appointment Details</td>
</tr>
<tr bgcolor="#FFFFCC">
<td width="126">Appointment ID</td>
<td width="99">Branch Name</td>
<td width="121">Doctor Name</td>
<td width="115">Date</td>
<td width="122">Time</td>
<td width="79">Status</td>
</tr>
<?php
$result = mysqli_query($con,"SELECT * FROM appointment where pat_id=$_SESSION[pat_id]");
while($row = mysqli_fetch_array($result))
{
$result1 = mysqli_query($con,"SELECT * FROM branch where branch_id=$row[branch_id]");
$row1 = mysqli_fetch_array($result1);
echo "<tr>";
echo "<td><a href=viewpatdetails.php?appid=$row[app_id]&patid=$_SESSION[pat_id]>" . $row[app_id] . "</a></td>";
echo "<td>" . $row1[branch_name] . "</td>";
echo "<td>" . $row[doc_id] . "</td>";
echo "<td>" . $row[app_date] . "</td>";
echo "<td>" . $row[app_time] . "</td>";
echo "<td>" . $row[status] . "</td>";
echo "</tr>";
}
?>
</table>
<br />
<?php
if(isset($_GET[appid]))
{
$restt = mysqli_query($con,"SELECT * FROM test where app_id=$_GET[appid]");
$arrrec = mysqli_fetch_array($restt);
$sph = unserialize($arrrec[sph]);
$cyl = unserialize($arrrec[cyl]);
$axis = unserialize($arrrec[axis]);
?>
<hr>
<table width="688" border="0">
<tr bgcolor="#FFFFCC">
<td colspan="6" align="center"><h2>Appointment Details of Appointment No. <?php echo $_GET[appid]; ?></h2></td>
</tr>
</table>
<table width="688" border="0">
<tr bgcolor="#FFFFCC">
<td colspan="4" align="center">Test Results</td>
</tr>
<tr>
<td width="96" bgcolor="#FFFFCC">Test ID:</td>
<td width="161"><?php
$testid = $arrrec[test_id];
echo $arrrec[test_id];
?></td>
<td width="114" bgcolor="#FFFFCC">Appointment ID:</td>
<td width="299"><?php echo $arrrec[app_id]; ?></td>
</tr>
<tr bgcolor="#FFFFCC">
<td colspan="2" align="center"><strong>Left Eye </strong></td>
<td colspan="2" align="center"><strong>Right Eye </strong></td>
</tr>
<tr bgcolor="#FFFFCC">
<td bgcolor="#FFFFCC">SPH: </td>
<td><?php echo $sph[0]; ?></td>
<td bgcolor="#FFFFCC">SPH:</td>
<td><?php echo $sph[1]; ?></td>
</tr>
<tr bgcolor="#FFFFCC">
<td bgcolor="#FFFFCC">CYL: </td>
<td><?php echo $cyl[0]; ?></td>
<td bgcolor="#FFFFCC">CYL:</td>
<td><?php echo $cyl[1]; ?></td>
</tr>
<tr bgcolor="#FFFFCC">
<td bgcolor="#FFFFCC">Axis:</td>
<td><?php echo $axis[0]; ?></td>
<td bgcolor="#FFFFCC">Axis:</td>
<td><?php echo $axis[1]; ?></td>
</tr>
<tr>
<td height="34" colspan="2" bgcolor="#FFFFCC">Remarks:</td>
<td colspan="2"><?php echo $arrrec[remarks]; ?></td>
</tr>
<tr>
<td colspan="2" bgcolor="#FFFFCC">Specs Requirement:</td>
<td colspan="2"><?php echo $arrrec[specs_req]; ?></td>
</tr>
</table>
<hr>
<?php
$respat = mysqli_query($con,"SELECT * FROM appointment where pat_id=$_SESSION[pat_id]");
$recpat = mysqli_fetch_array($respat);
$restest = mysqli_query($con,"SELECT * FROM test where app_id=$arrrec[app_id]");
$rettest = mysqli_fetch_array($restest);
$sqlprescription = "SELECT * FROM prescription where test_id=$rettest[test_id]";
$res = mysqli_query($con,$sqlprescription);
if(mysqli_num_rows($res) >= 1)
{
?>
<table width="689" height="162" border="0">
<tr bgcolor="#FFFFCC">
<th colspan="6" align="center">Prescription</th>
</tr>
<tr bgcolor="#FFFFCC">
<td width="117">Test ID</td>
<td width="170">Number Of Days</td>
<td width="194">Medicine Names</td>
<td width="69">Mg</td>
<td width="117">Dosage</td>
<tr>
<?php
$retpres = mysqli_fetch_array($res);
$nod= unserialize($retpres[no_of_days]);
$medname = unserialize($retpres[medicines]);
$mg = unserialize($retpres[mg]);
$dosage = unserialize($retpres[dosage]);
echo "<td>" . $retpres[test_id] . "</td>";
for($k=0; $k<count($nod); $k++)
{
for($j=1;$j<=$k;$j++)
{
echo "<td>" . "</td>";
}
echo "<td>" . $nod[$k] . "</td>";
echo "<td>" . $medname[$k] . "</td>";
echo "<td>" . $mg[$k] . "</td>";
echo "<td>" . $dosage[$k] . "</td>";
echo "</tr>";
}
?>
<tr><td bgcolor="#FFFFCC">Remarks:</td>
<td colspan="5"><?php echo $retpres[remarks];?></td></tr>
<tr>
</table>
<?php
}
$sql = "SELECT * FROM order where test_id=$arrrec[test_id]";
$res1 = mysqli_query($con,$sql);
if(mysqli_num_rows($res1) >= 1)
{
?>
<p> </p>
<table width="688" border="0">
<tr bgcolor="#FFFFCC">
<td colspan="7" align="center">Purchase Details</td>
</tr>
<tr bgcolor="#FFFFCC">
<td width="73">Order ID</td>
<td width="100">Admin Name</td>
<td width="70">Test ID</td>
<td width="157">Product Name</td>
<td width="93">Order date</td>
<td width="63">Total Amount</td>
<td width="84">Dispatch Date</td>
</tr>
<?php
while($row = mysqli_fetch_array($res1))
{
echo "<tr>";
echo "<td>" . $row[order_id] . "</td>";
echo "<td>" . $row[admin_id] . "</td>";
echo "<td>" . $row[test_id] . "</td>";
echo "<td>" . $row[product_id] . "</td>";
echo "<td>" . $row[order_date] . "</td>";
echo "<td>" . $row[total] . "</td>";
echo "</tr>";
}
?>
</table>
<?php
}
}
?>
</div>
<div class="cleaner"></div>
</div>
<?php
include("includes/footer.php");
?>