-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview_orders.php
executable file
·151 lines (132 loc) · 3.67 KB
/
view_orders.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<!DOCTYPE html>
<html>
<head>
<title>MacMedia Orders</title>
<link rel="shortcut icon" href="./logo.png" type="image/x-icon">
<style>
html,
body {
height: 100%;
}
body {
margin: 0;
background: linear-gradient(45deg, #49a09d, #5f2c82);
font-family: sans-serif;
font-weight: 100;
}
.container {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.scrollable-div {
width: 1200px;
max-height: 800px; /* Adjust this as needed */
overflow-y: auto;
}
table {
width: 100%;
border-collapse: collapse;
overflow: hidden;
box-shadow: 0 0 20px rgba(0,0,0,0.1);
}
th,
td {
padding: 15px;
background-color: rgba(255,255,255,0.2);
color: #fff;
}
th {
text-align: left;
}
thead th {
background-color: #55608f;
border-radius: 1%;
}
tbody tr:hover {
background-color: rgba(255,255,255,0.3);
}
tbody td {
position: relative;
}
tbody td:hover::before {
content: "";
position: absolute;
left: 0;
right: 0;
top: -9999px;
bottom: -9999px;
background-color: rgba(255,255,255,0.2);
z-index: -1;
}
/* For Firefox */
.scrollable-div {
scrollbar-width: thin;
scrollbar-color: #888 #f2f2f2;
}
/* For Chrome, Safari, and Opera */
.scrollable-div::-webkit-scrollbar {
width: 12px;
}
.scrollable-div::-webkit-scrollbar-track {
box-shadow: inset 0 0 5px grey;
border-radius: 10px;
}
.scrollable-div::-webkit-scrollbar-thumb {
background: #888;
border-radius: 10px;
}
.scrollable-div::-webkit-scrollbar-thumb:hover {
background: #555;
}
</style>
</head>
<body>
<div class='container'>
<div class="scrollable-div">
<table>
<thead>
<tr>
<th><strong>Order ID:</strong></th>
<th><strong>Fish Burger Quantity:</strong></th>
<th><strong>Chicken Burger Quantity:</strong> </th>
<th><strong>Cheese Burger Quantity:</strong></th>
<th><strong>French Fries Quantity:</strong></th>
<th><strong>Milkshake Quantity:</strong></th>
<th><strong>Hamburger Quantity:</strong></th>
<th><strong>Total Amount:</strong></th>
</tr>
</thead>
<tbody>
<?php
//Connect to database
$db = new SQLite3("dbMacMedia.db");
$db->busyTimeout(5000);
//Create query and execute query
$query = "SELECT * FROM orders WHERE status = 'bezig'";
$result = $db->query($query);
while($order = $result->fetchArray(SQLITE3_ASSOC)) {
echo "<tr>";
echo "<td>" .$order['id'] . "</td>";
echo "<td>" . ($order['fishburgerant'] > 0 ? $order['fishburgerant'] : '0') . "</td>";
echo "<td>" . ($order['chickenburgerant'] > 0 ? $order['chickenburgerant'] : '0') . "</td>";
echo "<td>" . ($order['cheeseburgerant'] > 0 ? $order['cheeseburgerant'] : '0') . "</td>";
echo "<td>" . ($order['frenchfriesant'] > 0 ? $order['frenchfriesant'] : '0') . "</td>";
echo "<td>" . ($order['milkshakeant'] > 0 ? $order['milkshakeant'] : '0') . "</td>";
echo "<td>" . ($order['hamburgerant'] > 0 ? $order['hamburgerant'] : '0') . "</td>";
echo "<td>" . "$" . $order['totalAmount'] . "</td>";
echo "<td><form action='delete_order.php' method='post'>
<input type='hidden' name='orderId' value='".$order['id']."'/>
<input type='submit' value='Delete'/>
</form></td>";
echo "</tr>";
}
?>
</tbody>
</table>
</div>
</div>
<script src="./refresh.js" async defer></script>
</body>
</html>