-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcancelOrder.php
More file actions
41 lines (35 loc) · 994 Bytes
/
cancelOrder.php
File metadata and controls
41 lines (35 loc) · 994 Bytes
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
<?php
include 'connect.php';
include 'authverify.php';
$a=array();
$b=array();
$uid=$_POST['uid'];
$token=$_POST['token'];
$order_id=$_POST['orderId'];
if(verify($uid,$token)){
$c = array();
$d = array();
$query=mysqli_query($link,"select * from orders where order_id=$order_id and store_id=1 and user_id=$uid and status=0") ;
$d=array();
if(mysqli_num_rows($query)>0)
{
$b["success"]=100;
$query2=mysqli_query($link,"delete from orders where order_id=$order_id");
$query2=mysqli_query($link,"delete from order_details where order_id=$order_id");
array_push($a,$b);
echo json_encode($a);
}
else{
$b["success"]=200;
$b["message"]="No Data";
array_push($a,$b);
echo json_encode($a);
}
}
else{
$b["success"]=200;
$b["message"]="Invalid Credentials";
array_push($a,$b);
echo json_encode($a);
}
?>