-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsupplies_action.php
54 lines (42 loc) · 1.25 KB
/
supplies_action.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
<?php
include('supplies.inc.php');
?>
<html>
<head>
<title>
Submitted!
</title>
<script type="text/JavaScript">
timer = setTimeout("location.href = 'supplies.php';",3000);
function waitHere() {
clearTimeout(timer);
document.getElementById('link_p').innerHTML = "<a href='supplies.php'>Check-out Page</a>";
}
</script>
</head>
<body>
<p id="link_p">
<a href="javascript:waitHere();">Wait Here</a>
</p>
<?php
// ************************************************ Subtract whatever was taken from inventory, and keep a record of it
$warning = updateRecords($_POST);
print $warning; // if it worked correctly it won't print anything.
// if there was an error with the query it will print that.
// ************************************************ Display the current supply levels
$all_supplies = getAllSupplies();
print "<br />";
foreach ($all_supplies as $key => $val) {
print $key . ": " . $val['prod_num'] . " (" . $val['prod_printer'] . " " . $val['prod_alt_printer'] . ") ";
if ($val['prod_amount'] <= $val['prod_alert_level']) {
print "<span style='color:red'>";
}
print " Quantity: " . $val['prod_amount'];
if ($val['prod_amount'] <= $val['prod_alert_level']) {
print "</span>";
}
print " <br/>";
}
?>
</body>
</html>