<?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"/>
		
	</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>
	<link rel="stylesheet" type="text/css" href="/Public/lib/layui/css/layui.css">
	<form class="layui-form" action="/admin/ziyuan/editXiaoqu" method="post">
		<input type="hidden" name="id" value="<?php echo ($xiaoqu['id']); ?>"/>
		<div style="line-height:30px;">&nbsp;</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label" style="color:#f00;width: 120px;">
					小区名称：
				</label>
				<div class="layui-input-inline" style="width: 180px;">
					<input type="text" name="xiaoqum" id="xiaoqum" placeholder="" class="layui-input" lay-verify="required" value="<?php echo ($xiaoqu['xiaoqum']); ?>">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label" style="width: 120px;">
					出售均价：
				</label>
				<div class="layui-input-inline" style="width: 180px;">
					<input type="text" name="csjunjia" placeholder="" class="layui-input" value="<?php echo ($xiaoqu['csjunjia']); ?>">
				</div>
				<div class="layui-form-mid layui-word-aux">元 / m²</div>
			</div>
			<?php if(($qxpdzt) == "1"): ?><input type="checkbox" name="status" title="显示" value="1" <?php if(($xiaoqu['status']) == "1"): ?>checked=""<?php endif; ?>><?php endif; ?>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label" style="color:#f00;width: 120px;">
					责任部门：
				</label>
				<div class="layui-input-inline" style="width: 180px;">
					<select name="zrbm" lay-filter="zrbumen" lay-verify="required">
						<option>选择部门</option>
						<?php if(is_array($bumen)): foreach($bumen as $key=>$v): ?><option value="<?php echo ($v['id']); ?>" <?php if($xiaoqu['bumen'] == $v['id']): ?>selected=""<?php endif; ?>><?php echo ($v['bmming']); ?></option><?php endforeach; endif; ?>
					</select>
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label" style="color:#f00;width: 120px;">
					责任人：
				</label>
				<div class="layui-input-inline" style="width: 180px;">
					<select name="zruid" id="zrren" lay-verify="required">
						<option>选择员工</option>
						<?php if(is_array($ygmingcheng)): foreach($ygmingcheng as $key=>$v): ?><option value="<?php echo ($v['id']); ?>" <?php if($xiaoqu['adduid'] == $v['id']): ?>selected=""<?php endif; ?>><?php echo ($v['ygmingcheng']); ?></option><?php endforeach; endif; ?>
					</select>
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label" style="color:#f00;width: 120px;">
					绑定部门：
				</label>
				<div class="layui-input-inline" style="width: 180px;">
					<select name="bdbm" id="bdbumen" lay-verify="required">
						<option>选择部门</option>
						<?php if(is_array($bdbumen)): foreach($bdbumen as $key=>$v): ?><option value="<?php echo ($v['id']); ?>" <?php if($xiaoqu['bdbumen'] == $v['id']): ?>selected=""<?php endif; ?>><?php echo ($v['bmming']); ?></option><?php endforeach; endif; ?>
					</select>
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label" style="width: 120px;">
					地图坐标：
				</label>
				<div class="layui-input-inline" style="width: 180px;">
					<input type="text" name="dituzb" id="zuobiao" placeholder="" class="layui-input" readonly="readonly" value="<?php echo ($xiaoqu['dituzb']); ?>">
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label" style="color:#f00;width: 120px;">
					所属行政区：
				</label>
				<div class="layui-input-inline" style="width: 180px;">
					<select id="province_id" lay-filter="province_id" name="ssxzq" lay-verify="required">
						<?php if(is_array($ssxzq)): foreach($ssxzq as $key=>$xzq): ?><option value="<?php echo ($xzq["id"]); ?>" <?php if($xiaoqu["ssxzq"] == $xzq["id"]): ?>selected=""<?php endif; ?>><?php echo ($xzq["xzqming"]); ?></option><?php endforeach; endif; ?>
					</select>
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label" style="color:#f00;width: 120px;">
					所属片区：
				</label>
				<div class="layui-input-inline" style="width: 180px;">
					<select id="city_id" lay-filter="city_id" name="sspianqu" lay-verify="required">
						<?php if(is_array($sspianqu)): foreach($sspianqu as $key=>$pq): if($xiaoqu["ssxzq"] == $pq["ssxzq"]): ?><option value="<?php echo ($pq["id"]); ?>" <?php if($xiaoqu["sspianqu"] == $pq["id"]): ?>selected=""<?php endif; ?>><?php echo ($pq["pianqum"]); ?></option><?php endif; endforeach; endif; ?>
					</select>
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label" style="width: 120px;">
					拼音检索：
				</label>
				<div class="layui-input-inline" style="width: 666px;">
					<input type="text" name="pinyinjs" id="pinyinjs" placeholder="" class="layui-input" value="<?php echo ($xiaoqu['pinyinjs']); ?>">
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label" style="width: 120px;">
					邮政编码：
				</label>
				<div class="layui-input-inline" style="width: 180px;">
					<input type="text" name="youzheng" placeholder="" class="layui-input" value="<?php echo ($xiaoqu['youzheng']); ?>">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label" style="width: 120px;">
					街道：
				</label>
				<div class="layui-input-inline" style="width: 180px;">
					<input type="text" name="jiedao" placeholder="" class="layui-input" value="<?php echo ($xiaoqu['jiedao']); ?>">
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label" style="width: 120px;">
					小区地址：
				</label>
				<div class="layui-input-inline" style="width: 666px;">
					<input type="text" name="xiaoqudz" placeholder="" class="layui-input" value="<?php echo ($xiaoqu['xiaoqudz']); ?>">
				</div>
			</div>
		</div>
		<div class="layui-form-item layui-form-text">
			<label class="layui-form-label" style="width: 120px;">
				小区简介：
			</label>
			<div class="layui-input-inline" style="width: 666px;">
				<textarea placeholder="请输入小区简介" class="layui-textarea" name="jianjie"><?php echo ($xiaoqu['jianjie']); ?></textarea>
			</div>
		</div>
		<div style="line-height:50PX;">&nbsp;</div>
		<div class="layui-form-item" style="width:100%;height:50px;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;">
			<div class="layui-form-item" 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'], function(){
			var form = layui.form
			,layer = layui.layer
			,layedit = layui.layedit
			,laydate = layui.laydate;
			//监听提交
			form.on('submit(demo1)', function(data){
				$.ajax({
					url:'<?php echo U('Ziyuan/editXiaoqu');?>',
					type:"post",
					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.location.reload();
							parent.layer.close(index);//关闭弹出的子页面窗口
						}else{
							layer.msg(data.info,{anim: 6});//错误提示
						}
					},
				});
				return false;
			});
			form.on('select(province_id)', function(data){
				var province_id=data.value;
				$.ajax({
					url:'<?php echo U('ajax/get_pianqu_ld');?>',
					type:"get",
					data:"quyuxzq="+province_id,
					dataType:"json",
					success:function(data){
						var city = data.lists;
						for(var i in city){
							if (i==0) {
								var option=$("<option></option>");
								$(option).val(city[i]['id']);
								$(option).html(city[i]['pianqum']);
								$("#city_id").html(option);
							}
						}
						for(var i in city){
							if (i>0) {
								var option=$("<option></option>");
								$(option).val(city[i]['id']);
								$(option).html(city[i]['pianqum']);
								$("#city_id").append(option);
							}
						}
						form.render('select');
					}
				});
			});
			form.on('select(zrbumen)', function(data){
				$('.hide1').remove();
				$('.hide2').remove();
				var val = data.value;
				$.ajax({
					url:"<?php echo U('Ajax/select_yuangong');?>",
					type:"get",
					data:{"id":val,"isjl":1},
					dataType:"json",
					success:function(data){
						if(data.status==0){
							var no_yonghu='<option value="" id="yuangong_last">无员工</option>';
							$("#zrren").empty();
							$("#zrren").append(no_yonghu);
							form.render('select');
						}else{
							var user = data;
							var you_yonghu='<option value="" id="yuangong_last">选择员工</option>';
							for(var i in user){
								you_yonghu +='<option value="'+user[i].id+'" class="hide1">'+user[i].ygmingcheng+'</option>';
							}
							$('#zrren').html(you_yonghu);
							form.render('select');
						}
					}
				});
				$.ajax({
					url:"<?php echo U('Ajax/select_bumen');?>",
					type:"get",
					data:"id="+val,
					dataType:"json",
					success:function(data){
						if(data.status==0){
							var no_bumen='<option value="" id="bumen_last">无部门</option>';
							$("#bdbumen").empty();
							$("#bdbumen").append(no_bumen);
							form.render('select');
						}else{
							var bumen = data;
							var you_bumen='<option value="" id="bumen_last">选择部门</option>';
							for(var i in bumen){
								you_bumen +='<option value="'+bumen[i].id+'" class="hide2">'+bumen[i].bmming+'</option>';
							}
							$('#bdbumen').html(you_bumen);
							form.render('select');
						}
					}
				});
			});
			$("#xiaoqum").keyup(function(){
				var xiaoqum=$("#xiaoqum").val();
				$.ajax({
					url:'<?php echo U('ajax/get_pinyin');?>',
					type:"get",
					data:"txt="+xiaoqum,
					dataType:"json",
					success:function(data){
						$("#pinyinjs").val(data.pyjs);
					}
				});
			});
		});
		$("#zuobiao").click(function(){
			layer.open({
				type: 2,
				title: '添加经纬度',
				skin: 'demo-class',
				area: ['800px', '450px'],
				closeBtn: 1,
				maxmin: true,
				scrollbar: false,
				content: '<?php echo U('ajax/addzb');?>?zuobiao='+$(this).val(),
			});
		});
	</script>

	</body>
</html>