-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqty_alert.php
More file actions
81 lines (61 loc) · 1.9 KB
/
qty_alert.php
File metadata and controls
81 lines (61 loc) · 1.9 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
<?php
session_start();
if(!isset($_SESSION['user_session'])){
header("location:index.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript">
function med_name() {//***Search For Medicine *****
var input, filter, table, tr, td, i;
input = document.getElementById("name_med");
filter = input.value.toUpperCase();
table = document.getElementById("table2");
tr = table.getElementsByTagName("tr");
for (i = 0; i < tr.length; i++) {
td = tr[i].getElementsByTagName("td")[0];
if (td) {
if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
}
}
}
}
</script>
</head>
<body>
<div class="stock" >
<font size="5" color="purple">Medicine Out of Stock</font><hr>
<input type="text" id="name_med" size="4" onkeyup="med_name()" placeholder="Search for Medicine names.." title="Type in a name">
<div style="overflow-x:auto; overflow-y: auto; height: 150px;">
<table class="table table-bordered" id="table2">
<tr>
<th>Medicine</th>
<th>Avai Qty</th>
<th>Expire Date</th>
<th>Cost</th>
</tr>
<?php
include("dbcon.php");
$quantity = "10";
$select_sql= "SELECT * FROM stock where remain_quantity <= '$quantity' and status = 'Available'";
$result = mysqli_query($con,$select_sql);
while ($row = mysqli_fetch_array($result)) :
?>
<tr>
<td><?php echo $row['medicine_name']?></td>
<td><font color="red"><?php echo $row['remain_quantity']."(".$row['sell_type'].")"?></font></td>
<td><?php echo $row['expire_date']?></td>
<td><?php echo $row['actual_price']?></td>
</tr>
<?php endwhile;?>
</table>
</div>
</div><br>
</body>
</html>