-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompletedOrdersCarts.php
executable file
·70 lines (58 loc) · 1.59 KB
/
completedOrdersCarts.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
<!DOCTYPE html>
<html>
<head>
<title>Completed Orders Carts</title>
<link rel="stylesheet" href="globalUsage/style.css" class="">
</head>
<body>
<?php include "globalUsage/dropdownmenu.html"?>
<h1> <u>Completed Carts</u></h1>
<br><br><br>
<form action="completedOrdersComputer.php" method="post" class="sameLine">
<input type="submit" value="Computerboxes" class="otherProduct">
</form>
<br><br><br>
<table class = "completed">
<tr class = "completed">
<th>id</th>
<th>order_time</th>
<th>completion_time</th>
<th>status</th>
<th>nbr_products</th>
<th>wheel_color</th>
<th>wheel_type</th>
</tr>
<?php
require 'globalUsage/db.php';
$query = "SELECT * FROM orders INNER JOIN carts ON orders.reference_id = carts.id WHERE orders.product = 'carts' AND orders.status = 'completed'";
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["completion_time"] . "</td><td>"
. $row["status"] . "</td><td>"
. $row["nbr_products"] . "</td><td>"
. $row["wheel_color"] . "</td><td>"
. $row["wheel_type"] .
"</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>