forked from Karwann/Online-Grocery-shopping
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreturn-order.php
48 lines (37 loc) · 1.07 KB
/
return-order.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
<?php
include("./connection.php");
error_reporting(0);
if(isset($_POST["id"])){
$q = "SELECT * FROM orders WHERE order_id = '".$_POST["id"]."'";
$data= mysqli_query($conn, $q);
while($row = mysqli_fetch_array($data)){
$sadmin= $row['admin_name'];
$sid= $row['order_id'];
$stitle= $row['product_title'];
$sprice= $row['product_price'];
$sqty= $row['product_qty'];
$spay_id= $row['payment_id'];
$spay_status= $row['payment_status'];
$sdel_status= $row['delivery_status'];
$sship= $row['shipping_method'];
$scust= $row['buyer_email'];
$scust_name= $row['buyer_name'];
$scust_ph= $row['buyer_phone'];
$scust_add= $row['buyer_address'];
if($sdel_status == 'ND'){
if($spay_status == 'Cod'){
$q = "DELETE FROM orders WHERE order_id ='$sid'";
$data= mysqli_query($conn, $q);
}
else{
$q = "UPDATE orders SET delivery_status='Returned' WHERE order_id ='$sid'";
$data= mysqli_query($conn, $q);
}
}
else{
$q = "UPDATE orders SET delivery_status='Returned' WHERE order_id ='$sid'";
$data= mysqli_query($conn, $q);
}
}
}
?>