<?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;
		}
		.layui-form-item{
			margin-bottom: 0;
		}
		#greetings{
			position: absolute;
			height: auto;
			border-left: 1px solid rgba(0, 0, 0, 0.11);
			border-right: 1px solid rgba(0, 0, 0, 0.11);
			left: 0px;
			z-index:5555; 
		}
		#greetings ul{
			list-style: none;
			box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.44);
			-webkit-margin-before: 0em;
			-webkit-margin-after: 0em;
			-webkit-margin-start: 0px;
			-webkit-margin-end: 0px;
			-webkit-padding-start: 0px;
		}
		#greetings li{
			text-align: left;
			padding: 5px;
			font-family: inherit;
			border-bottom: 1px solid rgba(0, 0, 0, 0.16);
			height: 25px;
			width: 180px;
			line-height: 25px;
			background-color: rgba(255, 255, 255, 0.8);
			cursor: pointer;
		}
		#greetings li:hover{
			background-color: rgba(175, 42, 0, 0.52);
			color: white;
		}
	</style>
	<link rel="stylesheet" href="/Public/lib/layui/css/layui.css" media="all">

	</head>
	<body>
		
	<div class="page-container">
		<table id="table" class="table table-border table-bordered table-hover table-bg">
			<thead>
				<tr>
					<th scope="col" colspan="12">
						<form class="layui-form" action="<?php echo U('Ziyuan/xiaoqu');?>" method="get" id="form">
							<?php if(_rbac_btn_show(130,0)): ?><div class="layui-inline" style="margin-right: 20px;">
									<a class="layui-btn layui-btn-normal" href="javascript:;" onclick="layer_show('添加小区','<?php echo U('Ziyuan/addXiaoqu');?>','960','500')" style="text-decoration:none">
										<i class="Hui-iconfont">&#xe604;</i> 添加小区
									</a>
								</div><?php endif; ?>
							<div class="layui-inline" style="margin-right: 20px;">
								<div class="layui-input-inline" style="width:300px;">
									<input type="text" name="sousuo" list="greetings" autocomplete="off" placeholder="请输入小区名" class="layui-input" id="sousuo" value="<?php echo ($_GET['sousuo']); ?>">
									<div id="greetings" >
										<ul id="tcontent"></ul>
									</div>
								</div>
							</div>
							<div class="layui-inline">
								<button class="layui-btn layui-btn-radius" lay-submit="" lay-filter="demo1" style="background: darkslateblue;">
									<i class="Hui-iconfont">&#xe665;</i> 查找小区
								</button>
								<button type="reset" class="layui-btn layui-btn-radius layui-btn-primary">
									<i class="Hui-iconfont">&#xe72a;</i> 重置
								</button>
							</div>
							<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>
						</form>
					</th>
				</tr>
				<tr class="text-c">
					<th>序号</th>
					<th>小区名称</th>
					<th>拼音检索</th>
					<th>所属片区</th>
					<th>所属行政区</th>
					<th>地图坐标</th>
					<th>维护部门</th>
					<th>维护人</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody id="xsjxiaoq">
				<?php if(is_array($xiaoqu)): $i = 0; $__LIST__ = $xiaoqu;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$xq): $mod = ($i % 2 );++$i;?><tr class="text-c" data-href="<?php echo U('Ziyuan/xiaoqurr',array('id'=>$xq['id']));?>" data-title="<?php if($xq.xiaoqum): echo ($xq["xiaoqum"]); endif; ?>" <?php if(_rbac_btn_show(175,0,$xq['adduid'])): ?>ondblclick="Hui_admin_tabb(this)"<?php endif; ?>>
						<td><?php echo ($i+$firstRow); ?></td>
						<td id="td">
							<?php if(_rbac_btn_show(175,0,$xq['adduid'])): ?><a data-href="<?php echo U('Ziyuan/xiaoqurr',array('id'=>$xq['id']));?>" data-title="<?php if($xq.xiaoqum): echo ($xq["xiaoqum"]); endif; ?>" href="javascript:;" style="text-decoration:none;color: royalblue">
									<?php echo ($xq["xiaoqum"]); ?>
								</a>
								<?php else: ?>
								<?php echo ($xq["xiaoqum"]); endif; ?>
						</td>
						<td><?php echo ($xq["pinyinjs"]); ?></td>
						<td>
							<?php echo ($xq["pianqum"]); ?>
						</td>
						<td>
							<?php echo ($xq["xzqming"]); ?>
						</td>
						<td><?php echo ($xq["dituzb"]); ?></td>
						<td>
							<?php echo bumen($xq['bumen']);?>
						</td>
						<td>
							<?php echo ($xq['ygmingcheng']); ?>
						</td>
						<td class="f-14" id="td">
							<?php if(_rbac_btn_show(175,0,$xq['adduid'])): ?><a class="ml-5 layui-btn layui-btn-mini" title="小区详情" data-href="<?php echo U('Ziyuan/xiaoqurr',array('id'=>$xq['id']));?>" data-title="<?php if($xq.xiaoqum): echo ($xq["xiaoqum"]); endif; ?>" href="javascript:;" style="text-decoration:none;background: yellowgreen;">
									<i class="Hui-iconfont">&#xe720;</i> 详情
								</a><?php endif; ?>
							<?php if(_rbac_btn_show(132,0,$xq['adduid'])): ?><a class="ml-5 layui-btn layui-btn-warm layui-btn-mini" title="更新小区" href="javascript:;" onclick="layer_show('更新小区','<?php echo U('Ziyuan/editXiaoqu',array('id'=>$xq['id']));?>','960','500')" style="text-decoration:none">
									<i class="Hui-iconfont">&#xe6df;</i> 编辑
								</a><?php endif; ?>
							<?php if(_rbac_btn_show(533,0,$xq['adduid'])): ?><a class="layui-btn layui-btn-mini" title="小区信息转移" href="javascript:;" onclick="layer_show('小区信息转移','<?php echo U('Ziyuan/xxzhuanyi',array('xqid'=>$xq['id']));?>','540')" style="text-decoration:none;background: royalblue;">
									<i class="Hui-iconfont">&#xe6ea;</i> 转移
								</a><?php endif; ?>
							<?php if(_rbac_btn_show(134,0,$xq['adduid'])): ?><a class="ml-5 layui-btn layui-btn-mini" title="删除小区" href="javascript:;" onclick="admin_xiaoqu_del(this,'<?php echo ($xq["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:30PX;">&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" src="/Public/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
	<script src="/Public/lib/layui/layui.js" charset="utf-8"></script>
	<script type="text/javascript">
		$("#table").on("click","#td a",function(){
			Hui_admin_tab(this);
		});
		function admin_xiaoqu_del(obj,id){
			layer.confirm('小区删除须谨慎，确认要删除吗？',function(index){
				$.ajax({
					type: 'POST',
					url: '<?php echo U('Ziyuan/delXiaoqu');?>',
					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 xsjxiaoq(){
			$.ajax({
				url:'<?php echo U('ajax/get_xiaoqxsj_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["xiaoqum"]+'</td><td>'+pics["pinyinjs"]+'</td><td></td><td></td><td>'+pics["dituzb"]+'</td><td></td><td></td><td></td></tr>';
					$("#xsjxiaoq").prepend(sj);
				}
			});
		};
		layui.use(['form', 'layedit', 'laydate'], function(){
			var form = layui.form()
			,layer = layui.layer
			,layedit = layui.layedit
			,laydate = layui.laydate;
			form.on('checkbox(checkbox)', function(data){
				$('form').submit();
			});
			$("#sousuo").keyup(function(){
				$("#greetings").show();
				var txt=$("#sousuo").val();
				if (txt!="") {
					$.ajax({
						url:'<?php echo U('ajax/get_xiaoqu_bdxs');?>',
						type:"get",
						data:"txt="+txt,
						dataType:"json",
						success:function(data){
							var district = data.lists;
							$("#tcontent li").remove();
							for(var i in district){
								var li=$("<li></li>");
								$(li).html(district[i]['xiaoqum']);
								$("#tcontent").append(li);
							}
						}
					});
				}
			});
			$("#tcontent").on("click","li", function() {  
				$("#greetings").show(); 
				//var v=$(this).text(); alert(v);        
				var Uarry=$("#tcontent li");  
				var count=$(this).index();//获取li的下标  
				var Tresult=Uarry.eq(count).text();  
				$("#sousuo").val(Tresult); 
				$("#greetings").hide(); 
			})
			$("body").click(function(){
				$("#greetings").hide();
			});
		});
	</script>

	</body>
</html>