-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwaitingOrdersComputer.php
executable file
·91 lines (73 loc) · 2.16 KB
/
waitingOrdersComputer.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
<!DOCTYPE html>
<html>
<head>
<title>Waiting Orders Computer</title>
<link rel="stylesheet" href="globalUsage/style.css" class="">
</head>
<body>
<?php include "globalUsage/dropdownmenu.html"?>
<h1> <u>Waiting Computers</u></h1>
<form action="waitingOrdersCarts.php" method="post">
<input type="submit" value="Carts" class="otherProduct">
</form>
<br>
<?php include "globalUsage/searchbar.html"?>
<br><br><br><br><br>
<table class = "waiting">
<tr class = "waiting">
<th>id</th>
<th>order_time</th>
<th>status</th>
<th>nbr_products</th>
<th>nbr_boxes</th>
<th>nbr_raspberries</th>
<th>nbr_co2_sensor</th>
<th>nbr_light_sensor</th>
<th>nbr_humidity_sensor</th>
<th>nbr_temperature_sensor</th>
<th>nbr_smoke_sensor</th>
<th>nbr_pressure_sensor</th>
<th>nbr_actuators</th>
<th>nbr_cables</th>
</tr>
<?php
require 'globalUsage/db.php';
$query = "SELECT * FROM orders INNER JOIN computerbox ON orders.reference_id = computerbox.id WHERE orders.product = 'computerbox' AND orders.status = 'waiting' ";
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["status"] . "</td><td>"
. $row["nbr_products"] . "</td><td>"
. $row["nbr_boxes"] . "</td><td>"
. $row["nbr_raspberries"] . "</td><td>"
. $row["nbr_co2_sensor"] . "</td><td>"
. $row["nbr_light_sensor"] . "</td><td>"
. $row["nbr_humidity_sensor"] . "</td><td>"
. $row["nbr_temperature_sensor"] . "</td><td>"
. $row["nbr_smoke_sensor"] . "</td><td>"
. $row["nbr_pressure_sensor"] . "</td><td>"
. $row["nbr_actuators"] . "</td><td>"
. $row["nbr_cables"] .
"</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>