-
Notifications
You must be signed in to change notification settings - Fork 27
/
undo.php
32 lines (32 loc) · 924 Bytes
/
undo.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
<?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"];
$tablename=$_GET['tablename'];
$sql="select undo='是' from $tablename where id=".$id;
mysql_query($sql);
if(mysql_affected_rows() == 1){
echo
"<script language='javascript'>
$(function(){
swal('警告','用户本身已停用','warning').then(() => {
location.href='".$_SERVER["HTTP_REFERER"]."';
})});
</script>";
}else{
$sql="update $tablename set `undo`='是' where id= ".$id;
mysql_query($sql);
$comewhere=$_SERVER['HTTP_REFERER'];
echo "<script language='javascript'>
$(function(){
swal('成功','停用用户','success').then(() => {
location.href='".$_SERVER["HTTP_REFERER"]."';
})});
</script>";
}
?>