-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetDrugs.php
More file actions
51 lines (45 loc) · 2.21 KB
/
getDrugs.php
File metadata and controls
51 lines (45 loc) · 2.21 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
<div class="content table-responsive table-full-width">
<table class="table table-hover table-striped">
<thead>
<th>Drug Id</th>
<th>Drug Name</th>
<th>Price</th>
<th>Prescription</th>
<th>Status</th>
</thead>
<tbody>
<?php
session_start();
$user_id=$_SESSION['s_id'];
include'../Database/config.php';
$select_drugs="SELECT * FROM `stocklevels` WHERE PharmacyID='$user_id'";
$run_select=mysqli_query($conn,$select_drugs);
$nums=mysqli_num_rows($run_select);
While($rows=mysqli_fetch_array($run_select)){
$DrugID=$rows['DrugID'];
$drugname=$rows['drugname'];
$presciption=$rows['presciption'];
$price=$rows['price'];
$Status=$rows['Status'];
?>
<tr>
<td><?php echo $DrugID; ?></td>
<td><?php echo $drugname; ?></td>
<td><?php echo $price; ?></td>
<td><?php echo $presciption; ?></td>
<td><?php if($Status=='instock'){
?>
<button class="btn btn-success btn-sm">instock</button>
<?php
}else{
?>
<button class="btn btn-danger btn-sm">not instock</button>
<?php
} ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>