forked from hzequn/PHP_hotel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathleave_order.php
36 lines (36 loc) · 865 Bytes
/
leave_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
<?php
//验证登陆信息
include_once 'conn.php';
?>
<link rel="stylesheet" href="css/style.css" />
<script src="js/jquery-2.1.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/sweetalert.min.js" type="text/javascript" charset="utf-8"></script>
<?php
$id=$_GET["id"];
$yuan=$_GET["yuan"];
$tablename=$_GET["tablename"];
if($yuan=="是")
{
$comewhere=$_SERVER['HTTP_REFERER'];
echo
"<script>
$(function(){
swal('失败','客房之前已经退房了','error').then(() => {
location.href='$comewhere';
})});
</script>";
}
else
{
$sql="update $tablename set `leave`='是' where id=$id";
mysql_query($sql);
$comewhere=$_SERVER['HTTP_REFERER'];
echo
"<script>
$(function(){
swal('成功','退房成功!','success').then(() => {
location.href='$comewhere';
})});
</script>";
}
?>