-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRiderPending.php
122 lines (101 loc) · 4.3 KB
/
RiderPending.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
<?php
session_start();
include './Assets/header.php';
include './Assets/rider-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 RiderID = '".$_SESSION['UserID']."'");
while($row = mysqli_fetch_assoc($res)):
?>
<tr>
<td><?=$row['PendingID']?></td>
<td>
<?php
$res = $db->query("SELECT * FROM menu WHERE MenuID = '".$row['MenuID']."'");
if($mn = mysqli_fetch_assoc($res)){
echo $mn['MenuName'];
}
?>
</td>
<td><?php
$res = $db->query("SELECT * FROM users WHERE UserID = '".$row['UserID']."'");
if($us = mysqli_fetch_assoc($res)){
echo $us['UserRealName'];
}
?></td>
<td><?php
$res = $db->query("SELECT * FROM users WHERE UserID = '".$row['RiderID']."'");
if($rd = mysqli_fetch_assoc($res)){
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="App/UpdatePendingStatus.php" method="post">
<input type="text" name="status" id="" value="<?=$row['PendingStatus']?>" hidden>
<input type="text" name="id" id="" value="<?=$row['PendingID']?>" hidden>
<?php
if($row['PendingStatus'] == 0){
echo '<button class="btn btn-danger" type="submit">ยังไม่ชำระเงิน</button>';
}
if($row['PendingStatus'] == 1){
echo '<button class="btn btn-success" type="submit">ชำระเงินเสร็จสิ้น</button>';
}
?>
</form>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
</div>