forked from abhishekdudhal/online-shopping
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cancel.php
47 lines (41 loc) · 804 Bytes
/
cancel.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
session_start();
$id=$_SESSION['eid'];
include("config.php");
require 'connect.php';
$itemno=$_REQUEST['itemno'];
$sql="select * from orders where order_no='$itemno'";
$row=$conn->query($sql);
if($arr=$row->fetch_assoc())
{
$chck=$arr['OrderStatus'];
}
if($chck!='COMPLETE')
{
if(mysql_query("UPDATE orders
SET OrderStatus='CANCEL' WHERE order_no='$itemno'"))
{
header("location:myprof.php");
}
else
{
die(mysql_error());
}
}else
{
header("location:myprof.php");
}
if(isset($_REQUEST['log'])=='out')
{
session_destroy();
header("location:index.php");
}
else if($id=="")
{
header("location:index.php");
}
if($itemno=="")
{
header("location:index.php");
}
?>