-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviewtreatment.php
More file actions
70 lines (69 loc) · 1.56 KB
/
viewtreatment.php
File metadata and controls
70 lines (69 loc) · 1.56 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
<?php
include("header.php");
include("dbconnection.php");
if(isset($_GET[delid]))
{
$sql ="DELETE FROM treatment WHERE treatmentid='$_GET[delid]'";
$qsql=mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('treatment deleted successfully..');</script>";
}
}
?>
<div class="wrapper col2">
<div id="breadcrumb">
<ul>
<li class="first">View treatment</li></ul>
</div>
</div>
<div class="wrapper col4">
<div id="container">
<h1>View treatment record</h1>
<table width="200" border="3">
<tbody>
<tr>
<td><strong>Treatment Type</strong></td>
<td><strong>Treatment cost</strong></td>
<td><strong>Note</strong></td>
<td><strong>Status</strong></td>
<?php
if(isset($_SESSION[adminid]))
{
?>
<td><strong>Action</strong></td>
<?php
}
?>
</tr>
<?php
$sql ="SELECT * FROM treatment";
$qsql = mysqli_query($con,$sql);
while($rs = mysqli_fetch_array($qsql))
{
echo "<tr>
<td> $rs[treatmenttype]</td>
<td> Rs. $rs[treatment_cost]</td>
<td> $rs[note]</td>
<td> $rs[status]</td>";
if(isset($_SESSION[adminid]))
{
echo "<td>
<a href='treatment.php?editid=$rs[treatmentid]'>Edit</a> | <a href='viewtreatment.php?delid=$rs[treatmentid]'>Delete</a> </td>";
}
echo "</tr>";
}
?>
</tbody>
</table>
<h1> </h1>
<p> </p>
</div>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<?php
include("footer.php");
?>