-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorderlist.php
68 lines (57 loc) · 1.73 KB
/
orderlist.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
include_once('db.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<style>
/* .bor{
width: 93rem;
height: 38rem;
border: 3px solid black;
} */
table{
border: 1px solid black;
width: 35rem;
margin: 20px;
}
th,tr,td{
border: 1px solid black;
}
</style>
<h1>Kitchen order list</h1>
<div class="bor">
<?php
// Loop through the table numbers
$tableNumber = $_SESSION['table'];
$sql1 = "SELECT o.id, i.name, o.quantity ,o.order_id FROM ordered_item o LEFT JOIN menu i ON o.menu_item_id = i.id WHERE o.order_id ='$tableNumber'";
$orders = mysqli_query($conn, $sql1);
if(mysqli_num_rows($orders)>0){
echo"<table>";
echo"<thead>";
echo"<tr>";
echo"<th>Table No".$tableNumber."</th>";
echo"<th>Quantity</th>";
echo"</tr>";
echo"</thead>";
echo"<tbody>";
while ($order = mysqli_fetch_assoc($orders)) {
echo '<tr>';
echo '<td>' . $order['name'] . '</td>';
echo '<td>' . $order['quantity'] . '</td>';
echo '</tr>';
}
echo"</tbody>";
echo"</table>";
}
?>
<button type='button' style='float: right; width:150px; height:150px;' class='btn btn-light btn-lg' onclick='window.location.href="log_out.php"'>Exit</button>
</div>
</body>
</html>