-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex_alert.php
More file actions
76 lines (64 loc) · 2.07 KB
/
ex_alert.php
File metadata and controls
76 lines (64 loc) · 2.07 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
<?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("table1");
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="expire" color="green" >
<font size="5">Medicine Going to Expire</font><br><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: 200px;">
<table class="table table-bordered" id="table1">
<tr>
<th>Medicine</th>
<th>Expire Date</th>
<th>Avai Qty</th>
<th>Cost</th>
<th>Total Cost </th>
</tr>
<?php
include("dbcon.php");
$date = date('d-m-Y');
$inc_date = date("Y-m-d", strtotime("+6 month", strtotime($date)));
$select_sql = "SELECT * FROM stock WHERE expire_date <= '$inc_date' and status='Available' ORDER BY expire_date ASC ";
$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['expire_date']?></font></td>
<td><?php echo $row['remain_quantity']."(".$row['sell_type'].")"?></td>
<td><?php echo $row['actual_price']?></td>
<td><?php echo $row['actual_price']*$row['remain_quantity']?></td>
</tr>
<?php endwhile;?>
</table>
</div>
</div>
</body>
</html>