-
Notifications
You must be signed in to change notification settings - Fork 0
/
delorder-result.php
57 lines (47 loc) · 1.68 KB
/
delorder-result.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
<?php
include_once('config.php');
session_save_path('./session');
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
</head>
<body>
<?php
if(isset($_SESSION['access']) && $_SESSION['access']==true) {
$del_orderid=$_GET['id'];
$stmt = mysqli_prepare($con,"DELETE FROM `Order` WHERE `orderID` = ?");
mysqli_stmt_bind_param($stmt,'s',$del_orderid);
$dela=mysqli_stmt_execute($stmt);
$stmt = mysqli_prepare($con,"DELETE FROM `Subscribe` WHERE `orderID` = ?");
mysqli_stmt_bind_param($stmt,'s',$del_orderid);
$delb=mysqli_stmt_execute($stmt);
if($dela && $delb) {
echo "<div class='alert alert-success'>". $del_orderid . " 已經成功刪除 !!<br>Redirecting...</div>";
} else {
echo "<div class='alert alert-info'> Something Wrong!!<br>Redirecting... </div>";
}
mysqli_stmt_close($stmt);
mysqli_close($con);
if($_SESSION['permission']=='admin') {
header('Refresh: 2; url=admin.php');
} else {
header('Refresh: 2; url=user.php');
}
}
else{
echo "<html>
<head>
<title>Error</title>
<link href='css/bootstrap.min.css' rel='stylesheet' media='screen'>
</head>
<body><div class='alert alert-error'> <h1>You shall not pass!</h1></div></body></html>";
mysqli_close($con);
header('Refresh: 2; url=index.php');
}
?>
</body>
</html>