-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewprescription.php
99 lines (93 loc) · 2.84 KB
/
viewprescription.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
<?php
include("header.php");
include("dbconnection.php");
if(isset($_GET[delid]))
{
$sql ="DELETE FROM prescription WHERE prescriptionid='$_GET[delid]'";
$qsql=mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('prescription deleted successfully..');</script>";
}
}
?>
<div class="wrapper col2">
<div id="breadcrumb">
<ul>
<li class="first">View Prescription</li></ul>
</div>
</div>
<div class="wrapper col4">
<div id="container">
<h1>View prescription record</h1>
<?php
$sql ="SELECT * FROM prescription";
$qsql = mysqli_query($con,$sql);
while($rs = mysqli_fetch_array($qsql))
{
$sqlpatient = "SELECT * FROM patient WHERE patientid='$rs[patientid]'";
$qsqlpatient = mysqli_query($con,$sqlpatient);
$rspatient = mysqli_fetch_array($qsqlpatient);
$sqldoctor = "SELECT * FROM doctor WHERE doctorid='$rs[doctorid]'";
$qsqldoctor = mysqli_query($con,$sqldoctor);
$rsdoctor = mysqli_fetch_array($qsqldoctor);
?>
<table width="200" border="3">
<tbody>
<tr>
<td><strong>Doctor</strong></td>
<td><strong>Patient</strong></td>
<td><strong>Prescription Date</strong></td>
<td><strong>Status</strong></td>
</tr>
<?php
echo "<tr>
<td> $rsdoctor[doctorname]</td>
<td> $rspatient[patientname]</td>
<td> $rs[prescriptiondate]</td>
<td> $rs[status]</td>
</tr>";
?>
</tbody>
</table>
<h1>View Prescription record</h1>
<table width="200" border="3">
<tbody>
<tr>
<td>Medicine</td>
<td>Cost</td>
<td>Unit</td>
<td>Dosage</td>
</tr>
<?php
$sqlprescription_records ="SELECT * FROM prescription_records WHERE prescription_id='$_GET[prescriptionid]'";
$qsqlprescription_records = mysqli_query($con,$sqlprescription_records);
while($rsprescription_records = mysqli_fetch_array($qsqlprescription_records))
{
echo "<tr>
<td> $rsprescription_records[medicine_name]</td>
<td> $rsprescription_records[cost]</td>
<td> $rsprescription_records[unit]</td>
<td> $rsprescription_records[dosage]</td>
</tr>";
}
?>
<tr>
<td colspan="6"><div align="center">
<input type="submit" name="print" id="print" value="Print" onclick="myFunction()"/>
</div></td>
</tr>
</tbody>
</table>
<?php
}
?> <p> </p>
</div>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<?php
include("footer.php");
?>