<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
	<!-- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	| 房佳（专业的新房分销ERP管理系统）
	+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	| Copyright (c) 2008-2019 http://fj.ytsofts.cn/ All rights reserved.
	+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	| 本系统由淮南市银泰软件科技有限公司提供技术支持
	+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	| QQ号：984784483
	+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
	<head>
		<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
		<meta name="renderer" content="webkit|ie-comp|ie-stand">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
		<meta http-equiv="Cache-Control" content="no-siteapp"/>
		<link rel="Bookmark" href="/Public/favicon.ico">
		<link rel="Shortcut Icon" href="/Public/favicon.ico"/>
		<link rel="stylesheet" type="text/css" href="/Public/static/h-ui/css/H-ui.min.css" />
		<link rel="stylesheet" type="text/css" href="/Public/static/h-ui.admin/css/H-ui.admin.css"/>
		<link rel="stylesheet" type="text/css" href="/Public/lib/Hui-iconfont/1.0.8/iconfont.css"/>
		<link rel="stylesheet" type="text/css" href="/Public/static/h-ui.admin/css/style.css"/>
		
	<link rel="stylesheet" href="/Public/lib/layui1/css/layui.css" media="all">
	<style type="text/css">
		.layui-form-checkbox {
			margin: 10px;
		}
	</style>

	</head>
	<body>
		
	<div style="position:fixed;top:0;width: 100%; border-top-style: solid;border-top-width: 2px;border-top-color: #009688;z-index: 999;"></div>
	<form class="layui-form" action="/admin/rbac/kxrole" method="post">
		<input type="hidden" name="id" value="<?php echo ($_GET['id']); ?>"/>
		<div style="padding: 30px;">
			<div style="text-align: center;width: 100%;">
				<input type="checkbox" id="quanxuan" lay-filter="quanxuan" title="全选"/>
			</div>
			<div class="layui-collapse" style="margin-top: 20px;width: 100%;">
				<?php if(is_array($rolefl)): $i = 0; $__LIST__ = $rolefl;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$pz): $mod = ($i % 2 );++$i;?><div class="layui-colla-item zwflx">
						<h2 class="layui-colla-title">
							<?php echo ($pz['lxming']); ?>
						</h2>
						<div class="layui-colla-content layui-show">
							<input type="checkbox" class="flxcz" lay-filter="zwlxqx" title="全选"/>
							<?php if(is_array($role)): foreach($role as $key=>$zw): if($zw["rolefl"] == $pz["lxid"]): ?><input type="checkbox" class="duoxuan" name="duoxuan[<?php echo ($key); ?>]" data-id="<?php echo ($zw['id']); ?>" value="<?php echo ($zw['id']); ?>" title="<?php echo ($zw['remark']); ?>" <?php if($roleid[$zw["id"]] == $zw["id"]): ?>checked=""<?php endif; ?>/><?php endif; endforeach; endif; ?>
						</div>
					</div><?php endforeach; endif; else: echo "" ;endif; ?>
			</div>
		</div>
		<div style="line-height:50PX;">&nbsp;</div>
		<div class="layui-form-item" style="width:100%;height:45px;margin:0 auto;background:#fff;position:fixed;bottom:0;text-align:center;border-top-style: solid;border-top-width: 1px;border-top-color: #009688;padding-top: 5px;" id="submit">
			<div class="layui-input-block" style="margin-left: 15px;">
				<button class="layui-btn layui-btn-radius" lay-submit="" lay-filter="demo1">
					<i class="Hui-iconfont">&#xe603;</i> 立即提交
				</button>
				<button type="reset" class="layui-btn layui-btn-radius layui-btn-primary">
					<i class="Hui-iconfont">&#xe72a;</i> 重置
				</button>
				<button type="button" class="layui-btn layui-btn-radius layui-btn-primary" onclick="parent.location.reload()">
					<i class="Hui-iconfont">&#xe706;</i> 关闭
				</button>
			</div>
		</div>
	</form>

		<script type="text/javascript" src="/Public/lib/jquery/1.9.1/jquery.min.js"></script> 
		<script type="text/javascript" src="/Public/lib/layer/2.4/layer.js"></script>
		<script type="text/javascript" src="/Public/static/h-ui/js/H-ui.min.js"></script>
		<script type="text/javascript" src="/Public/static/h-ui.admin/js/H-ui.admin.js"></script>
		<script>
			$(document).ready(function(){
				$(document).bind("contextmenu",function(e){
					return false;
				});
			});
		</script>
		
	<script src="/Public/lib/layui1/layui.js" charset="utf-8"></script>
	<script>
		layui.use(['form', 'layedit', 'laydate', 'element'], function(){
			var form = layui.form
			,layer = layui.layer
			,layedit = layui.layedit
			,laydate = layui.laydate
			,element = layui.element;
			//监听提交
			form.on('submit(demo1)', function(data){
				$.ajax({
					type: 'POST',
					url: '<?php echo U('rbac/kxrole');?>',
					data:data.field,
					dataType: 'json',
					success: function(data){
						if(data.status==1){
							var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
							parent.layer.msg(data.info);//父级页面提示成功信息
							parent.layer.close(index);//关闭弹出的子页面窗口
						}else{
							layer.msg(data.info,function(){});//错误提示
						}
					},
					error:function(data) {
						console.log(data.msg);
					},
				});
				return false;
			});
			//全选的实现
			form.on('checkbox(quanxuan)', function(data){
				$(".flxcz").prop("checked", this.checked);
				$(".duoxuan").prop("checked", this.checked);
				form.render('checkbox');
			});
			form.on('checkbox(zwlxqx)', function(data){
				$(data.elem).parents(".zwflx").find(".duoxuan").prop("checked", this.checked);
				form.render('checkbox');
			});
		});
	</script>

	</body>
</html>