-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathongoingOrders.php
executable file
·66 lines (51 loc) · 1.26 KB
/
ongoingOrders.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
<!DOCTYPE html>
<html>
<head>
<title>Ongoing Orders</title>
<link rel="stylesheet" href="globalUsage/style.css" class="">
</head>
<body class = "image ongoing">
<?php include "globalUsage/dropdownmenu.html"?>
<h1> <u>Ongoing Orders</u></h1>
<br>
<?php include "globalUsage/searchbar.html"?>
<br><br><br><br><br>
<table class = "ongoing">
<tr class = "ongoing">
<th>id</th>
<th>order_time</th>
<th>product</th>
<th>status</th>
<th>nbr_products</th>
</tr>
<?php
require 'globalUsage/db.php';
$query = "SELECT * FROM orders WHERE status = 'ongoing'";
if ($result = mysqli_query($link, $query)){
if (mysqli_num_rows($result) > 0){ $i = 0;
while(($row = mysqli_fetch_assoc($result)) && $i<100){
echo "<tr><td>"
. $row["id"] . "</td><td>"
. $row["order_time"] . "</td><td>"
. $row["product"] . "</td><td>"
. $row["status"] . "</td><td>"
. $row["nbr_products"] .
"</td></tr>" ;
$i ++;
}
echo "</table>";
}else{
echo "0 results";
}
mysqli_free_result($result);
}
else if (!$result){
$message = 'Invalid query: ' .mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
mysqli_close($link);
?>
</table>
</body>
</html>