<?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"/>
		
	<style type="text/css">
		.pagination {
			margin: 20px 0;
		}
		.pagination ul {
			display: inline-block;
			list-style:none;
			*display: inline;
			/* IE7 inline-block hack */
			*zoom: 1;
			margin-left: 0;
			margin-bottom: 0;
			-webkit-border-radius: 4px;
			-moz-border-radius: 4px;
			border-radius: 4px;
			-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
			-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
			box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
		}
		.pagination ul > li {
			display: inline;
		}
		.pagination ul > li > a,
		.pagination ul > li > span,
		.pagination #lastspan {
			float: left;
			padding: 4px 12px;
			line-height: 20px;
			text-decoration: none;
			background-color: #ffffff;
			border: 1px solid #dddddd;
			border-left-width: 0;
		}
		.pagination ul > li > a:hover,
		.pagination ul > li > a:focus,
		.pagination ul > .active > a,
		.pagination ul > .active > span {
			background-color: #f5f5f5;
		}
		.pagination ul > .active > a,
		.pagination ul > .active > span {
				color: #999999;
				cursor: default;
		}
		.pagination ul > .disabled > span,
		.pagination ul > .disabled > a,
		.pagination ul > .disabled > a:hover,
		.pagination ul > .disabled > a:focus {
			color: #999999;
			background-color: transparent;
			cursor: default;
		}
		.pagination ul > li:first-child > a,
		.pagination ul > li:first-child > span {
			border-left-width: 1px;
			-webkit-border-top-left-radius: 4px;
			-moz-border-radius-topleft: 4px;
			border-top-left-radius: 4px;
			-webkit-border-bottom-left-radius: 4px;
			-moz-border-radius-bottomleft: 4px;
			border-bottom-left-radius: 4px;
		}
		.pagination ul > li:last-child > a,
		.pagination ul > li:last-child > span,
		.pagination #lastspan {
			-webkit-border-top-right-radius: 4px;
			-moz-border-radius-topright: 4px;
			border-top-right-radius: 4px;
			-webkit-border-bottom-right-radius: 4px;
			-moz-border-radius-bottomright: 4px;
			border-bottom-right-radius: 4px;
		}
		.pagination-centered {
			text-align: center;
		}
		.pagination-right {
			text-align: right;
		}
		.pagination-large ul > li > a,
		.pagination-large ul > li > span,
		.pagination-large #lastspan{
			padding: 11px 19px;
			font-size: 17.5px;
		}
		.pagination-large ul > li:first-child > a,
		.pagination-large ul > li:first-child > span {
			-webkit-border-top-left-radius: 6px;
			-moz-border-radius-topleft: 6px;
			border-top-left-radius: 6px;
			-webkit-border-bottom-left-radius: 6px;
			-moz-border-radius-bottomleft: 6px;
			border-bottom-left-radius: 6px;
		}
		.pagination-large ul > li:last-child > a,
		.pagination-large ul > li:last-child > span,
		.pagination-large #lastspan {
			-webkit-border-top-right-radius: 6px;
			-moz-border-radius-topright: 6px;
			border-top-right-radius: 6px;
			-webkit-border-bottom-right-radius: 6px;
			-moz-border-radius-bottomright: 6px;
			border-bottom-right-radius: 6px;
		}
		.pagination-mini ul > li:first-child > a,
		.pagination-small ul > li:first-child > a,
		.pagination-mini ul > li:first-child > span,
		.pagination-small ul > li:first-child > span {
			-webkit-border-top-left-radius: 3px;
			-moz-border-radius-topleft: 3px;
			border-top-left-radius: 3px;
			-webkit-border-bottom-left-radius: 3px;
			-moz-border-radius-bottomleft: 3px;
			border-bottom-left-radius: 3px;
		}
		.pagination-mini ul > li:last-child > a,
		.pagination-small ul > li:last-child > a,
		.pagination-mini ul > li:last-child > span,
		.pagination-small ul > li:last-child > span {
			-webkit-border-top-right-radius: 3px;
			-moz-border-radius-topright: 3px;
			border-top-right-radius: 3px;
			-webkit-border-bottom-right-radius: 3px;
			-moz-border-radius-bottomright: 3px;
			border-bottom-right-radius: 3px;
		}
		.pagination-small ul > li > a,
		.pagination-small ul > li > span {
			padding: 2px 10px;
			font-size: 11.9px;
		}
		.pagination-mini ul > li > a,
		.pagination-mini ul > li > span {
			padding: 0 6px;
			font-size: 10.5px;
		}
	</style>
	<link rel="stylesheet" href="/Public/lib/layui/css/layui.css" media="all">

	</head>
	<body>
		
	<div class="page-container">
		<table class="table table-border table-bordered table-hover table-bg mb-20">
			<thead>
				<tr>
					<th scope="col" colspan="9">
						<?php if(_rbac_btn_show(124,0)): ?><a class="layui-btn layui-btn-normal" href="javascript:;" onclick="admin_pianqu_add('添加片区','<?php echo U('Ziyuan/addPianqu');?>','960','500')" style="text-decoration:none">
								<i class="Hui-iconfont">&#xe600;</i> 添加片区
							</a><?php endif; ?>
						<span style="float: right;">
							<a class="layui-btn layui-btn-radius layui-btn-primary" href="javascript:location.replace(location.href);" title="刷新" style="text-decoration:none">
								<i class="Hui-iconfont">&#xe68f;</i> 刷新
							</a>
							<a class="layui-btn layui-btn-radius layui-btn-primary" href="javascript:;" onclick="parent.removeIframe()" style="text-decoration:none">
								<i class="Hui-iconfont">&#xe706;</i> 关闭
							</a>
						</span>
					</th>
				</tr>
				<tr class="text-c">
					<th>序号</th>
					<th>片区名称</th>
					<th>拼音检索</th>
					<th>所属行政区</th>
					<th>坐标</th>
					<th>添加部门</th>
					<th>添加人</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody id="xsjpianq">
				<?php if(is_array($pianqu)): $i = 0; $__LIST__ = $pianqu;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$pq): $mod = ($i % 2 );++$i;?><tr class="text-c">
						<td><?php echo ($i+$firstRow); ?></td>
						<td><?php echo ($pq['pianqum']); ?></td>
						<td><?php echo ($pq['pinyinjs']); ?></td>
						<td>
							<?php if(is_array($ssxzq)): foreach($ssxzq as $key=>$xzq): if($pq["ssxzq"] == $xzq["id"]): echo ($xzq["xzqming"]); endif; endforeach; endif; ?>
						</td>
						<td><?php echo ($pq['dituzb']); ?></td>
						<td>
							<?php echo bumen($pq['bumen']);?>
						</td>
						<td>
							<?php echo ($pq['ygmingcheng']); ?>
						</td>
						<td class="f-14">
							<?php if(_rbac_btn_show(126,0,$pq['adduid'])): ?><a class="layui-btn layui-btn-warm layui-btn-small" title="更新片区" href="javascript:;" onclick="admin_pianqu_edit('更新片区','<?php echo U('Ziyuan/editPianqu',array('id'=>$pq['id']));?>','960','500')" style="text-decoration:none">
									<i class="Hui-iconfont">&#xe6df;</i> 编辑
								</a><?php endif; ?>
							<?php if(_rbac_btn_show(533,0,$pq['adduid'])): ?><a class="layui-btn layui-btn-small" title="片区信息转移" href="javascript:;" onclick="layer_show('片区信息转移','<?php echo U('Ziyuan/xxzhuanyi',array('pqid'=>$pq['id']));?>','540')" style="text-decoration:none;background: royalblue;">
									<i class="Hui-iconfont">&#xe6ea;</i> 转移
								</a><?php endif; ?>
							<?php if(_rbac_btn_show(128,0,$pq['adduid'])): ?><a class="ml-5 layui-btn layui-btn-small" title="删除片区" href="javascript:;" onclick="admin_pianqu_del(this,'<?php echo ($pq["id"]); ?>')" style="text-decoration:none;background: red;">
									<i class="Hui-iconfont">&#xe6e2;</i> 删除
								</a><?php endif; ?>
						</td>
					</tr><?php endforeach; endif; else: echo "" ;endif; ?>
			</tbody>
		</table>
		<div style="line-height: 10px;">&nbsp;</div>
		<div class="pagination" style="width:100%;height:30px;margin:0 auto;background:#fff;position:fixed;bottom:0;text-align:center;">
			<?php echo ($page); ?>
		</div>
	</div>

		<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 type="text/javascript">
		/*管理员-片区-添加*/
		function admin_pianqu_add(title,url,w,h){
			layer_show(title,url,w,h);
		}
		/*管理员-片区-编辑*/
		function admin_pianqu_edit(title,url,w,h){
			layer_show(title,url,w,h);
		}
		/*管理员-片区-删除*/
		function admin_pianqu_del(obj,id){
			layer.confirm('片区删除须谨慎，确认要删除吗？',function(index){
				$.ajax({
					type: 'POST',
					url: '<?php echo U('Ziyuan/delPianqu');?>',
					data: {'id':id},
					dataType: 'json',
					success: function(data){
						if (data.status==1) {
							$(obj).parents("tr").remove();
							layer.msg(data.info);
						}else{
							layer.msg(data.info,{anim: 6});//错误提示
						}
					},
					error:function(data) {
						console.log(data.msg);
					},
				});
			});
		}
		function xsjpianq(){
			$.ajax({
				url:'<?php echo U('ajax/get_pianqxsj_ziyuan');?>',
				type:"get",
				dataType:"json",
				success:function(data){
					var pics = data.pics;
					var sj='<tr class="text-c"><td style="color:red">new</td><td>'+pics["pianqum"]+'</td><td>'+pics["pinyinjs"]+'</td><td></td><td></td><td></td><td></td><td></td></tr>';
					$("#xsjpianq").prepend(sj);
				}
			});
		};
	</script>

	</body>
</html>