-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.php
47 lines (40 loc) · 927 Bytes
/
test.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
<?php
require 'core_login.php';
require 'database_connect.php';
if(loggedin() && isset($_GET['req']) && $_GET['req'] == '2' && isset($_SESSION['order_id']))
{
$query = "SELECT status, order_id FROM `orders` WHERE order_id=".$_SESSION['order_id'];
$query_run = mysqli_query($connect,$query);
while($row = mysqli_fetch_assoc($query_run))
{
if($row['status']=='0')
{
$status = 'Order Received';
}
else if($row['status']=='1')
{
$status = 'Preparing';
}
else if($row['status']=='2')
{
$status = 'Awaiting Delivery';
}
else if($row['status']=='3')
{
$status = 'Out for Delivery';
}
else if($row['status']=='4')
{
$status = 'Delivered';
}
else if($row['status']=='5' || $row['status']=='6')
{
$status = 'Cancelled';
}
$order_detail = new stdClass;
@$order_detail->id = $row['order_id'];
@$order_detail->status = $status;
}
echo json_encode($order_detail);
}
?>