include_once 'conn.php';
$user=$_GET['user'];
$name=$_GET['name'];
$agree=$_GET['agree'];
?>
用户注册信息列表已有注册信息列表
$sql="select * from yonghuzhuce where 1=1";
$query=mysql_query($sql);
$rowscount=mysql_num_rows($query);
?>
共<?php echo $rowscount;?>条记录
批量停用
账号:
姓名:
是否审核:
所有
是
否
$sql="select * from yonghuzhuce where 1=1";
if ($user!=""){
$sql=$sql." and zhanghao like '%$user%'";
}
if ($name!=""){
$sql=$sql." and xingming like '%$name%'";
}
if ($agree!=""){
$sql=$sql." and issh like '$agree'";
}
$sql=$sql." order by id desc";
$query=mysql_query($sql);
$rowscount=mysql_num_rows($query);
if($rowscount==0)
{
?>
}
else
{
$pagelarge=10;//每页行数;
$pagecurrent=$_GET["pagecurrent"];
if($rowscount%$pagelarge==0)
{
$pagecount=$rowscount/$pagelarge;
}
else
{
$pagecount=intval($rowscount/$pagelarge)+1;
}
if($pagecurrent=="" || $pagecurrent<=0)
{
$pagecurrent=1;
}
if($pagecurrent>$pagecount)
{
$pagecurrent=$pagecount;
}
$sum=$pagecurrent*$pagelarge;
if($pagecurrent==$pagecount)
{
if($rowscount%$pagelarge==0)
{
$sum=$pagecurrent*$pagelarge;
}
else
{
$sum=$pagecurrent*$pagelarge-$pagelarge+$rowscount%$pagelarge;
}
}
?>
序号 | 姓名 | 账号 | 头像 | 性别 | 家庭地址 | 是否审核 | 是否停用 | 添加时间 | 操作 |
---|
for($i=$pagecurrent*$pagelarge-$pagelarge;$i
{
?>
<?php echo $i+1;?><?php echo mysql_result($query,$i,xingming);?><?php echo mysql_result($query,$i,zhanghao);?> <?php echo mysql_result($query,$i,xingbie);?><?php echo mysql_result($query,$i,diqu);?><?php echo mysql_result($query,$i,Email);?><?php echo mysql_result($query,$i,issh);?><?php echo mysql_result($query,$i,undo);?><?php echo date('Y/m/d',strtotime(mysql_result($query,$i,addtime)));?>οnclick="return confirm('确定审核?')"<?php }?>>
审核
οnclick="return confirm('真的要停用?')"<?php }?>>
<?php if(mysql_result($query,$i,undo) == '否'){?>停用<?php }else{?>启用<?php }?>
修改
}
}
?>
if($rowscount > 10)
{
?>
//全选操作
function checkall() {
var checkall = document.getElementById("checkall");
var checkedall = checkall.checked;
var sel_btn = document.getElementsByClassName("sel_btn");
if(checkedall) {
//全选
for(var i = 0; i < sel_btn.length; i++) {
//设置复选框的选中状态
sel_btn[i].checked = true;
}
} else {
//取消全选
for(var i = 0; i < sel_btn.length; i++) {
sel_btn[i].checked = false;
}
}
}
function undoSelected(){
//获取选中数据的id
var select_boxes = $(".sel_btn");
var ids = new Array();
for(var i = 0; i < select_boxes.length; i++){
if(select_boxes[i].checked){
ids.push($(select_boxes[i]).attr('data-id'));
}
}
//将选中的id发送到php处理文件中实现删除
$.ajax({
url: "undo_all.php",
type: "post",
data: {
table: "yonghuzhuce",
ids: ids
},
success: function(res){
if(res.code == 0){//没有选择任何数据
swal({
title: "警告!",
text: "请选择停用的用户!",
icon: "warning",
});
return false;
}
if(res.code == 1){//后台返回code状态1表示执行成功
if(res.n ==0){
swal({
title: "失败!",
text: "用户本身已停用",
icon: "error",
showConfirmButton: true
}).then ((isConfirm) => {//执行成功后的回调
history.go(0);
})
}else{
swal({
title: "成功!",
text: "成功停用"+res.n+"个用户,"+"失败停用"+res.m+"个用户",
icon: "success",
showConfirmButton: true
}).then ((isConfirm) => {//执行成功后的回调
history.go(0);
})
}
}
}
})
}
一键复制
编辑
Web IDE
原始数据
按行查看
历史