-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvieworder.php
More file actions
160 lines (149 loc) · 3.68 KB
/
vieworder.php
File metadata and controls
160 lines (149 loc) · 3.68 KB
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
<?php
include("header.php");
include("dbconnection.php");
if(isset($_GET[delid]))
{
$sql ="DELETE FROM orders WHERE orderid='$_GET[delid]'";
$qsql=mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('order record deleted successfully..');</script>";
}
}
if(isset($_GET[deliverid]))
{
$sql ="UPDATE orders SET deliverydate='$dt' WHERE orderid='$_GET[deliverid]'";
$qsql=mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('order Deliver record updated successfully..');</script>";
}
}
?>
<div class="wrapper col2">
<div id="breadcrumb">
<ul>
<li class="first">View Order</li></ul>
</div>
</div>
<div class="wrapper col4">
<div id="container">
<section class="container">
<h2>Search Order- <input type="search" class="light-table-filter" data-table="order-table" placeholder="Filtrer" /></h2>
<table class="order-table">
<thead>
<tr>
<th>Patient</th>
<th>Doctor</th>
<th>Order Date</th>
<th>Delivery Date</th>
<th>Address</th>
<th>Mobile Number</th>
<th>Status</th>
<?php
if(isset($_SESSION[doctorid]))
{
?>
<th>Deliver</th>
<th>Action</th>
<?php
}
?>
<?php
if(isset($_SESSION[adminid]))
{
?>
<th>Action</th>
<?php
}
?>
</tr>
</thead>
<tbody>
<?php
$sql ="SELECT * FROM orders where orderid!='0' ";
if(isset($_SESSION[patientid]))
{
$sql = $sql . " AND patientid='$_SESSION[patientid]'";
}
if(isset($_SESSION[doctorid]))
{
$sql = $sql . " AND doctorid='$_SESSION[doctorid]'";
}
//echo $sql;
$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);
echo "<tr>
<td> $rspatient[patientname]</td>
<td> $rsdoctor[doctorname]</td>
<td> $rs[orderdate]</td>
<td> $rs[deliverydate]</td>
<td> $rs[address]</td>
<td> $rs[mobileno]</td>
<td> ";
if(isset($_SESSION[patientid]))
{
if($rs[status] == "Active")
{
echo "<a href='prescriptionorderreport.php?orderid=$rs[0]&prescriptionid=$rs[3]'>Orders</a>";
}
else
{
echo $rs[status];
}
}
else
{
echo $rs[status];
}
echo "</td>";
if(isset($_SESSION[doctorid]))
{
if($rs[status] == "Active")
{
echo "<td><a href='prescriptionorderreport.php?orderid=$rs[0]&prescriptionid=$rs[3]'>Orders</a> </td>";
}
else
{
echo "<td><a href='prescriptionorder.php?orderid=$rs[0]'>Add Medicines</a> </td>";
}
echo "<td> <a href='patientreport.php?patientid=$rs[patientid]' target='_blank' >View Patient Report</a> ";
if(isset($_SESSION[adminid]))
{
echo " | <a href='vieworder.php?delid=$rs[orderid]'>Delete</a>";
}
echo "</td>";
}
if(isset($_SESSION[adminid]))
{
echo " <td> ";
if($rs[deliverydate] == "0000-00-00")
{
echo "<a href='vieworder.php?deliverid=$rs[orderid]'>Deliver</a> | ";
echo "<a href='vieworder.php?delid=$rs[orderid]'>Delete</a>";
}
echo "</td>";
}
echo "</tr>";
}
?>
</tbody>
</table>
</section>
<p> </p>
</div>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<?php
include("footer.php");
?>