-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkOrder.php
executable file
·75 lines (56 loc) · 1.66 KB
/
checkOrder.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
<!DOCTYPE html>
<html>
<head>
<title>Check Order</title>
<link rel="stylesheet" href="globalUsage/style.css" class="">
</head>
<body>
<?php include "globalUsage/dropdownmenu.html"?>
<h1> <u>Here is your order</u></h1>
<br><br><br><br><br><br>
<table class = "check">
<tr class = "check">
<th>id</th>
<th>order_time</th>
<th>completion_time</th>
<th>status</th>
<th>nbr_products</th>
</tr>
<?php
require 'globalUsage/db.php';
$id = $_POST["id"];
$query = "SELECT * FROM orders WHERE id = ".$id ;
if ($result = mysqli_query($link, $query)){
if (mysqli_num_rows($result) > 0){
while(($row = mysqli_fetch_assoc($result))){
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></tr>" ;
}
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>
<form action="updateProduction.php" method="post" class = "sameLine">
<input type="hidden" name="id" value="<?php echo $id; ?>">
<input type="submit" name = "case" value="Start Production" class=" bigbutton startProduction">
</form>
<form action="updateProduction.php" method="post" class = "sameLine">
<input type="hidden" name="id" value="<?php echo $id; ?>">
<input type="submit" name = "case" value="Set To Completed" class=" bigbutton setToCompleted">
</form>
</body>
</html>