This repository has been archived by the owner on Feb 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorder_list.php
76 lines (65 loc) · 2.87 KB
/
order_list.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Pending Orders List | Customer | FoodHub</title>
</head>
<body>
<?php
include 'config.php';
?>
<h3>FoodHub Orders List</h3>
<br>
<table border='1'>
<thead>
<tr>
<th>Serial</th>
<th>Order Type</th>
<th>Order Placed</th>
<th>Status</th>
<th>Item ID</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
try{
$dbcon = new PDO("mysql:host=$dbserver:$dbport;dbname=$db;","$dbuser","$dbpass");
$dbcon->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sqlquery="SELECT * FROM orders WHERE orders.user_id=2";
try{
$returnval=$dbcon->query($sqlquery); ///PDO Statement
$hometable=$returnval->fetchAll();
foreach($hometable as $row){
?>
<tr>
<td><?php echo $row['order_id'] ?></td>
<td><?php echo $row['ordertype'] ?></td>
<td><?php echo $row['orderplaced'] ?></td>
<td><?php echo $row['orderstatus'] ?></td>
<td><?php echo $row['item_id'] ?></td>
<td><a href="confirm.php?id=<?php echo $row['order_id'] ?>">Complete</a></td>
</tr>
<?php
}
}
catch(PDOException $ex){
?>
<tr>
<td colspan="3">Data read error ... ...</td>
</tr>
<?php
}
}
catch(PDOException $ex){
?>
<tr>
<td colspan="3">Data read error ... ...</td>
</tr>
<?php
}
?>
</tbody>
</table>
</body>
</html>