-
Notifications
You must be signed in to change notification settings - Fork 0
/
kitchen.php
47 lines (38 loc) · 1.27 KB
/
kitchen.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
<?php //kitchen.php
require_once 'library.php';
require_once 'login.php';
$conn = new mysqli($hn, $un, $pw, $db);
if ($conn->connect_error) mysqli_ferror($conn);
// GET Kitchen STATS
$query = "SELECT * FROM orders WHERE DATE(time) = CURDATE()";
$result = $conn->query($query);
if (!$result) echo "Couldn't get today's orders: " . $conn->error;
$num_orders = $result->num_rows;
$query = "SELECT * FROM menuniv WHERE stock = 1";
$result = $conn->query($query);
if (!$result) echo "Couldn't get today's stock: " . $conn->error;
$num_items = $result->num_rows;
// BEGIN PAGE
echo "<html>";
echo file_get_contents("kitchen_head.html");
echo "<body>";
echo file_get_contents("kitchen_header.html");
echo file_get_contents("nav.html");
echo <<<_END
<main>
<h2>The Kitchen</h2>
<p>From here you can fill orders, update the stock, and pick up your paycheck.</p>
<ul id='kitchen_links'>
<li><a href='fill_orders.php'>Fill Orders</a></li>
<li><a href='update_stock.php'>Update Stock</a></li>
<li><a href='items_props.php'>Add and delete items/properties</a></li>
</ul>
<p>There's currently <b>$num_orders</b> order for the day!</p>
<p>There's currently <b>$num_items</b> items in stock!</p>
</main>
_END;
echo file_get_contents("footer.html");
$result->close();
$conn->close();
echo "</html>";
?>