-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelete.php
137 lines (113 loc) Β· 3.43 KB
/
delete.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
session_start();
require_once './conn.php';
if (isset($_GET['reserveid'])) {
$id = $_GET['reserveid'];
$query = "DELETE FROM `reserve` WHERE reserve_id= '$id'";
$delete = mysqli_query($conn, $query);
if ($delete) {
echo
"<script>
alert(' π Reservation Cancelled.. .');
window.location.href='./userDashboard.php#reservations';
</script>";
}
} elseif (isset($_GET['pkgid'])) {
$id = $_GET['pkgid'];
$query = "DELETE FROM `package` WHERE package_id= '$id'";
$delete = mysqli_query($conn, $query);
if ($delete) {
echo
"<script>
alert(' π Package removed...');
window.location.href='./ownerDashboard.php';
</script>";
}
} elseif (isset($_GET['hotelid'])) {
$id = $_GET['hotelid'];
$query = "DELETE FROM `hotel` WHERE hotel_id='$id'";
$delete = mysqli_query($conn, $query);
if ($delete) {
echo
"<script>
alert(' π Hotel Removed...');
window.location.href='./ownerDashboard.php';
</script>";
}
} elseif (isset($_GET['userid'])) {
$id = $_GET['userid'];
$query = "DELETE FROM `user` WHERE user_id='$id'";
$delete = mysqli_query($conn, $query);
if ($delete) {
echo
"<script>
alert(' π Account has been deleted.');
window.location.href = 'javascript:history.go(-1)';
</script>";
}
} elseif (isset($_GET['msgid'])) {
$id = $_GET['msgid'];
$query = "DELETE FROM `contact` WHERE msg_ID=$id";
$result = mysqli_query($conn, $query);
if ($result) {
echo
"<script>
alert(' Succesfully Deleted.. .');
window.location.href='./customerCareDashboard.php';
</script>";
} else {
echo
"<script>
alert('The delete action cannot be completed. Try Again.. .');
window.location.href='./customerCareDashboard.php';
</script>";
}
} elseif (isset($_GET['ownerid'])) {
$id = $_GET['ownerid'];
$query = "DELETE FROM `hotel_owner` WHERE owner_id='$id'";
$delete = mysqli_query($conn, $query);
if ($delete) {
echo
"<script>
alert(' π Account Deleted...');
window.location.href = 'javascript:history.go(-1)';
</script>";
}
} elseif (isset($_GET['uuserid'])) {
$id = $_GET['uuserid'];
$query = "DELETE FROM `user` WHERE user_id='$id'";
$delete = mysqli_query($conn, $query);
if ($delete) {
session_destroy();
echo
"<script>
alert(' π Your account has been deleted.');
window.location.href = './register.php';
</script>";
}
} elseif (isset($_GET['oownerid'])) {
$id = $_GET['oownerid'];
$query = "DELETE FROM `hotel_owner` WHERE owner_id='$id'";
$delete = mysqli_query($conn, $query);
if ($delete) {
session_destroy();
echo
"<script>
alert(' π Account Deleted...');
window.location.href = './ownerRegister.php';
</script>";
}
} elseif (isset($_GET['employeeid'])) {
$id = $_GET['employeeid'];
$query = "DELETE FROM `admin` WHERE admin_id='$id'";
$delete = mysqli_query($conn, $query);
if ($delete) {
echo
"<script>
alert(' π Account has been deleted.');
window.location.href = 'javascript:history.go(-1)';
</script>";
}
}
// close the connection
mysqli_close($conn);