-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustomerPending.php
143 lines (118 loc) · 4.95 KB
/
CustomerPending.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php
session_start();
include './Assets/header.php';
include './Assets/customer-nav.php';
require './db.php';
?>
<div class="container-fluid row col mx-2">
<div class="card card-body mt-3 row">
<h5>รายการอาหาร</h5>
<table class="
table
mt-2
"
>
<thead>
<th>#</th>
<th>อาหาร</th>
<th>ผู้รับอาหาร</th>
<th>ไรเดอร์</th>
<th>ราคา</th>
<th>การชำระเงิน</th>
<th>สถานะร้านอาหาร</th>
<th>สถานะไรเดอร์</th>
<th>สถานะการจัดส่ง</th>
</thead>
<tbody>
<?php
$res = $db->query("SELECT * FROM pending WHERE UserID = '".$_SESSION['UserID']."'");
while($row = mysqli_fetch_assoc($res)):
?>
<tr>
<td><?=$row['PendingID']?></td>
<td>
<?php
$resss = $db->query("SELECT * FROM menu WHERE MenuID = '".$row['MenuID']."'");
if($mn = mysqli_fetch_assoc($resss)){
echo $mn['MenuName'];
}
?>
</td>
<td><?php
$ress = $db->query("SELECT * FROM users WHERE UserID = '".$row['UserID']."'");
if($us = mysqli_fetch_assoc($ress)){
echo $us['UserRealName'];
}
?></td>
<td><?php
$resp = $db->query("SELECT * FROM users WHERE UserID = '".$row['RiderID']."'");
if($rd = mysqli_fetch_assoc($resp)){
echo $rd['UserRealName'];
}
?></td>
<td><?=$row['TotalPrice']?></td>
<td><?=$row['PendingPayment']?></td>
<td>
<form action="App/UpdatePendingRest.php" method="post">
<input type="text" name="status" id="" value="<?=$row['RestStatus']?>" hidden>
<input type="text" name="id" id="" value="<?=$row['PendingID']?>" hidden>
<?php
if($row['RestStatus'] == 0){
echo '<p style="color: red;">กำลังเตรียมอาหาร</p>';
}
if($row['RestStatus'] == 1){
echo '<p style="color: green;">เตรียมอาหารเสร็จสิน</p>';
}
?>
</form>
</td>
<td>
<form action="" method="post">
<input type="text" name="id" id="" value="<?=$row['PendingID']?>" hidden>
<?php
if($row['RiderStatus'] == 0){
echo '<p class="" style="color: red;" type="submit">กำลังค้นหาไรเดอร์</p>';
}
if($row['RiderStatus'] == 1){
echo '<p class="" style="color: green;" type="submit">พบไรเดอร์แล้ว</p>';
}
?>
</form>
</td>
<td>
<form action="" method="post">
<input type="text" name="id" id="" value="<?=$row['PendingID']?>" hidden>
<?php
if($row['PendingStatus'] == 0){
echo '<p class="" style="color: red;" type="submit">กำลังจัดส่ง</p>';
}
if($row['PendingStatus'] == 1){
echo '<p class="" style="color: green;" type="submit">จัดส่งสำเร็จ</p>';
}
?>
</form>
</td>
<td>
<form action="" method="post">
<input type="text" name="id" id="" value="<?=$row['PendingID']?>" hidden>
<?php
if($row['PendingStatus'] == 0){
echo '<p class="" style="color: red;" type="submit">กำลังจัดส่ง</p>';
}
if($row['PendingStatus'] == 1){
echo '<p class="" style="color: green;" type="submit">จัดส่งสำเร็จ</p>';
}
?>
</form>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
<style>
.progress{
border-radius: 100px;
}
</style>
</div>