<?php /*a:3:{s:59:"D:\phpstudy_pro\WWW\2022_09_zscq\view\admin\user\index.html";i:1663233338;s:59:"D:\phpstudy_pro\WWW\2022_09_zscq\view\admin\common\top.html";i:1625466448;s:62:"D:\phpstudy_pro\WWW\2022_09_zscq\view\admin\common\bottom.html";i:1629163316;}*/ ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title><?php echo config('common.CMS_NAME'); ?></title>
<link rel="stylesheet" href="/static/tqcms/css/common.css">
<link rel="stylesheet" href="/static/tqcms/layui/css/layui.css"><!--layui css-->
<link rel="stylesheet" href="/static/tqcms/css/skin.css">
<script src="/static/tqcms/js/jquery.js"></script>
</head>
<body>
<div class="body_top">
	<ul class="title">
    	<li class="active"><a href="<?php echo url('index',array('pid'=>$info['pid'])); ?>">会员管理</a></li>
    </ul>
</div>

<div class="body_content_list">

<script type="text/html" id="barDemo">
<span class="tq_table_bar">
  <a class="layui-btn layui-btn-xs" href="javascript:add('查看<?php echo htmlentities($info['typename']); ?>','<?php echo url('edit',array('view'=>$view,'pid'=>$info['pid'])); ?>&id={{d.id}}');">查看</a>
  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</span>
</script>

<script type="text/html" id="is_effect">
<span class="tq_table_bar">
	<input type="checkbox" name="is_effect" value="{{d.id}}" lay-skin="switch" lay-text="未审核|已审核" lay-filter="is_effect" {{ d.is_effect ==2 ? 'checked' : '' }}>
</span>
</script>

<script type="text/html" id="tq_btn">
  	<a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="check_all">全选</a>
  	<a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="list_delete">删除</a>
	<span class="tq_map_box">
	起始时间: <input name="strtime" value="<?php echo htmlentities($strtime); ?>" type="text" autocomplete="off" lay-verify="date" id="strdate" class="layui-input tq_toolbar_input" />&nbsp;&nbsp;&nbsp;&nbsp;
	结束时间: <input name="endtime" value="<?php echo htmlentities($endtime); ?>" type="text" autocomplete="off" lay-verify="date" id="enddate" class="layui-input tq_toolbar_input" />&nbsp;&nbsp;&nbsp;&nbsp;
	关键词: <input name="keyword" value="<?php echo htmlentities($keyword); ?>" type="text" class="layui-input tq_toolbar_input" />
	</span>　
  	<a class="layui-btn layui-btn-normal layui-btn-sm admin_cx" lay-event="tq_map">查询</a>
</script>


<table lay-filter="list" style="display:none">
  <thead>
    <tr>
      <th lay-data="{type:'checkbox', width:40}"></th>
      <th lay-data="{field:'id', width:80, sort:true}">编号</th>
	  <th lay-data="{field:'type', width:180, sort:true}">类型</th>
	  <th lay-data="{field:'name', width:180, sort:true}">用户名</th>
	  <th lay-data="{field:'lxr', width:180, sort:true}">姓名</th>
      <th lay-data="{field:'phone', width:140, sort:true}">手机号</th>
      <th lay-data="{field:'card', width:320, sort:true}">邮箱</th>
      <th lay-data="{field:'create_time'}">时间</th>
      <th lay-data="{field:'is_effect', width:110, align:'center', toolbar:'#is_effect'}">状态</th>
      <th lay-data="{field:'caozuo', width:130, align:'center', toolbar:'#barDemo'}">操作</th>
    </tr> 
  </thead>
  <tbody>
    <?php if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
    <tr>
      <td></td>
      <td><?php echo htmlentities($v['id']); ?></td>
	  <td><?php if($v['type']==1): ?>个人<?php endif; if($v['type']==2): ?>企业<?php endif; ?></td>
      <td><?php echo htmlentities($v['name']); ?></td>
	  <td><?php echo htmlentities($v['lxr']); ?></td>
      <td><?php echo htmlentities($v['phone']); ?></td>
      <td><?php echo htmlentities($v['mail']); ?></td>
    
      <td><?php echo htmlentities(date('Y-m-d',!is_numeric($v['time'])? strtotime($v['time']) : $v['time'])); ?></td>
      <td><?php echo htmlentities($v['is_effect']); ?></td>
      <td></td>
    </tr>
	<?php endforeach; endif; else: echo "" ;endif; ?>
  </tbody>
</table>
</div>

<script src="/static/tqcms/layui/layui.js"></script><!--layui js-->
<script src="/static/tqcms/layui/laytq.js"></script><!--layui js-->
<script src="/static/tqcms/js/common.js"></script>
<script src="/static/tqcms/js/md5.js"></script>
<script src="/static/tqcms/js/url.js"></script>
</body>
</html>
<script>
iname=self.frameElement.name;
layui.use('table', function(){
var table = layui.table,form = layui.form;

table.init('list', {
	height:'full-71' //设置高度
	,toolbar: '#tq_btn'
	,defaultToolbar: ['filter']
	,limit:'<?php echo htmlentities($limit); ?>'
	,page: { //支持传入 laypage 组件的所有参数（某些参数除外，如：jump/elem） - 详见文档
      layout: [] //自定义分页布局
	  ,limit:'<?php echo htmlentities($limit); ?>' //每页显示的数据条数
    }
});   

var laypage = layui.laypage;
laypage.render({
	elem: 'layui-table-page1' //注意，这里的 test1 是 ID，不用加 # 号
		,layout: ['limit','count', 'prev', 'page', 'next', 'skip'] //自定义分页布局
		,prev:'<i class="layui-icon">&#xe603;</i>'
		,next:'<i class="layui-icon">&#xe602;</i>'
		,count:'<?php echo htmlentities($count); ?>'
		,limit:'<?php echo htmlentities($limit); ?>' //每页显示的数据条数
		,limits:['<?php echo htmlentities($limits); ?>',<?php echo htmlentities($syltem_page_list); ?>]
		,groups:8 //只显示 1 个连续页码
		,curr:'<?php echo htmlentities($curr); ?>'//获取起始页
		,hash: 'page' //自定义hash值
		,jump: function(obj, first){
			var curr = obj.curr;
			if(!first){
				location.href='<?php echo url("index",array("pid"=>$info["pid"],"strtime"=>$strtime,"endtime"=>$endtime,"keyword"=>$keyword)); ?>&limit='+obj.limit+'&page='+obj.curr;
			}
		}
});


	laydate = layui.laydate;

	//日期str
	laydate.render({
		elem: '#strdate', //需要渲染的input id
		type: 'datetime',
		position: 'fixed',
		ready: function(date){ $('.layui-laydate').addClass('form_sousuo_1'); },
		done: function(value, date){
			var endtime=$('#enddate').val();
			var end=new Date(endtime.replace("-", "/").replace("-", "/"));
			var value=new Date(value.replace("-", "/").replace("-", "/"));
			if(endtime!='' && end < value){
				window.top.tq_alert('开始时间不能大于结束时间','',2);
				setTimeout(function(){
					$('#strdate').val('');
				},500);
			}
		}
	});

	//日期end
	laydate.render({
		elem: '#enddate', //需要渲染的input id
		type: 'datetime',
		position: 'fixed',
		ready: function(date){ $('.layui-laydate').addClass('form_sousuo_2'); },
		done: function(value, date){
			var strtime=$("input[name='strtime']").val();
			var str=new Date(strtime.replace("-", "/").replace("-", "/"));
			var value=new Date(value.replace("-", "/").replace("-", "/"));
			if(strtime=='' || str > value){
				window.top.tq_alert('结束时间不能小于开始时间','',2);
				setTimeout(function(){
					$('#enddate').val('');
				},500);
			}
		}
	});


//监听工具条
table.on('tool(list)', function(obj){
	var data = obj.data;
	//删除
	if(obj.event === 'del'){
		window.top.delete_c(obj,iname);
	}

});

//表头操作
table.on('toolbar(list)', function(obj){

	//全选
	if(obj.event==='check_all'){
		$('input[name="layTableCheckbox"]+').click();
	}
	
	//批量属性
	var checkStatus = table.checkStatus(obj.config.id);
	var data = checkStatus.data;
	var idArray = new Array();
	for(j=0,len=data.length; j<len; j++) {
		idArray.push(data[j].id);
	}
	
	//批量删除
	if(obj.event==='list_delete'){
		if(data.length==0){
			window.top.tq_alert('请至少选择一条信息','',2);
			return false;
		}
		window.top.delete_ids(idArray,iname);
	}

	//查询
	if(obj.event==='tq_map'){
		var strtime=$("input[name='strtime']").val();
		var endtime=$("input[name='endtime']").val();
		var keyword=$("input[name='keyword']").val();
		location.href="<?php echo url('index',array('pid'=>$info['pid'],'limit'=>$limit)); ?>&page=1&strtime="+strtime+"&endtime="+endtime+"&keyword="+keyword;
	}
	
	if(obj.event==='tq_help'){
		alert(2);
	}	
});

//监听状态操作
form.on('switch(is_effect)', function(obj){
	var is_effect=obj.elem.checked==true?2:1;
	$.post('/admin/Common/is_edit',{id:this.value,is_effect:is_effect,dbname:'user'},function(data){ });
});
  
});
//layui end;

//传入三级article页批量删除
function delete_er(info){
	$.post('/admin/Common/list_delete_true',{id:info,table:'user'},function(data){
		window.location.reload();
	});
}


//删除-父级返回
function delete_id(info){
	$.post('/admin/Common/delete_id',{id:info.data.id,table:'user'},function(data){ 
		info.del();
	});
}

//查看打开新标签
function add(title,url){
	window.top.article_open(title,url);
	//window.parent.iframe_f(title,url);
}
</script>