-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpatviewprescription.php
116 lines (98 loc) · 3.35 KB
/
patviewprescription.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
<?php include("adheader.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="container-fluid">
<div class="block-header">
<h2 class="text-center">View Prescription Record</h2>
</div>
<?php
$sql ="SELECT * FROM prescription where patientid='$_SESSION[patientid]'";
$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);
?>
<div class="card" style="padding: 10px">
<section class="container">
<table class="table table-bordered table-striped table-hover js-basic-example dataTable ">
<thead>
<tr>
<td width="71" scope="col"><strong>Doctor</strong></td>
<td width="71" scope="col"><strong>Patient</strong></td>
<td width="71" scope="col"><strong>Prescription Date</strong></td>
<td width="71" scope="col"><strong>Status</strong></td>
</tr>
</thead>
<tbody>
<?php
echo "<tr>
<td> $rsdoctor[doctorname]</td>
<td> $rspatient[patientname]</td>
<td> $rs[prescriptiondate]</td>
<td> $rs[status]</td>
</tr>";
?>
</tbody>
</table>
<br>
<br>
<br>
<table class="table table-bordered table-striped table-hover js-basic-example dataTable ">
<thead>
<tr>
<td>Medicine</td>
<td>Cost</td>
<td>Unit</td>
<td>Dosage</td>
</tr>
</thead>
<tbody>
<?php
$sqlprescription_records ="SELECT * FROM prescription_records LEFT JOIN medicine ON prescription_records.medicine_name=medicine.medicineid WHERE prescription_records.prescription_id='$rs[0]'";
$qsqlprescription_records = mysqli_query($con,$sqlprescription_records);
while($rsprescription_records = mysqli_fetch_array($qsqlprescription_records))
{
echo "<tr>
<td> $rsprescription_records[medicinename]</td>
<td> ₹$rsprescription_records[cost]</td>
<td> $rsprescription_records[unit]</td>
<td> $rsprescription_records[dosage]</td>
</tr>";
}
?>
</tbody>
</table>
<input type="submit" class="btn btn-lg" name="print" id="print" value="Print" onclick="myFunction()"/>
</div>
<?php
}
?> <p> </p>
</div>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<?php
include("adfooter.php");
?>
<script>
function myFunction()
{
window.print();
}
</script>