-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathviewmedicine.php
64 lines (58 loc) · 1.6 KB
/
viewmedicine.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
<?php
include("adformheader.php");
include("dbconnection.php");
if(isset($_GET[delid]))
{
$sql ="DELETE FROM medicine WHERE medicineid='$_GET[delid]'";
$qsql=mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('Medicine redcord deleted successfully..');</script>";
}
}
?>
<div class="container-fluid">
<div class="block-header">
<h2 class="text-center">View Medicine List</h2>
</div>
</div>
<div class="card">
<section class="container">
<table class="table table-bordered table-striped table-hover js-basic-example dataTable">
<thead>
<tr>
<th>Name</th>
<th>Cost</th>
<th>description</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$sql ="SELECT * FROM medicine";
$qsql = mysqli_query($con,$sql);
while($rs = mysqli_fetch_array($qsql))
{
echo "<tr>
<td> $rs[medicinename]</td>
<td> ₹$rs[medicinecost]</td>
<td> $rs[description]</td>
<td> $rs[status]</td>
<td>
<a href='medicine.php?editid=$rs[medicineid]' class='btn btn-raised bg-green'>Edit</a>
<a href='viewmedicine.php?delid=$rs[medicineid]' class='btn btn-raised bg-blush'>Delete</a></td>
</tr>";
}
?>
</tbody>
</table>
</section>
</div>
</div>
</div>
</div>
</div>
<?php
include("adformfooter.php");
?>