<?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-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;
		}
		.xlk {
			display: block;
			width: 120px;
			height: 34px;
			padding: 6px 12px;
			font-size: 14px;
			line-height: 1.42857143;
			color: #555;
			background-color: #fff;
			background-image: none;
			border: 1px solid #ccc;
			border-radius: 4px;
			-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
			box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
			-webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
			-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
			transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
		}
	</style>

	</head>
	<body>
		
	<table class="table table-border table-bordered table-hover table-bg">
		<thead>
			<tr>
				<th scope="col" colspan="8">
					<form class="layui-form" action="<?php echo U('Options/xqzdxs');?>" method="get" id="form">
						<input type="hidden" name="uid" id="uid" value="<?php echo ($_GET['uid']); ?>">
						<div class="layui-form-item" style="margin: 20px 0px 0px 0px;">
							<div class="layui-input-inline" style="width: 180px;">
								<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>
							<button class="layui-btn layui-btn-radius" lay-submit="" lay-filter="demo1" style="background: darkslateblue;">
								<i class="Hui-iconfont">&#xe665;</i> 查找
							</button>
							<a href="<?php echo U('Options/xqzdxs',array('uid'=>$_GET['uid']));?>" class="layui-btn layui-btn-radius layui-btn-primary" style="text-decoration:none">
								<i class="Hui-iconfont">&#xe72a;</i> 重置
							</a>
							<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.layer.close(parent.layer.getFrameIndex(window.name));" style="text-decoration:none">
									<i class="Hui-iconfont">&#xe706;</i> 关闭
								</a>
							</span>
						</div>
					</form>
				</th>
			</tr>
			<tr class="text-c">
				<th>序号</th>
				<th>用户名</th>
				<th>小区名</th>
				<th>销售经理</th>
				<th>联系方式</th>
				<th>选择销售</th>
			</tr>
		</thead>
		<tbody>
			<?php if(is_array($xiaoqu)): $i = 0; $__LIST__ = $xiaoqu;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><tr class="text-c xqlb">
					<td>
						<?php echo ($i+$firstRow); ?>
					</td>
					<td>
						<?php echo ($ygmingcheng); ?>
					</td>
					<td>
						<?php echo ($v['xiaoqum']); ?>
					</td>
					<td>
						<?php echo ($v['xqfzr']); ?>
					</td>
					<td>
						<?php echo ($v['xqfzdh']); ?>
					</td>
					<td>
						<select name="zdxs-$v['id']" class="xlk">
							<option>请选择</option>
							<?php if(is_array($yonghu)): foreach($yonghu as $key=>$xs): if($v["id"] == $xs["xqid"]): ?><option value="<?php echo ($xs['id']); ?>" <?php if($v["xsid"] == $xs["id"]): ?>selected=""<?php endif; ?>><?php echo ($xs['ygmingcheng']); ?></option><?php endif; endforeach; endif; ?>
						</select>
						<input type="hidden" class="xqid" value="<?php echo ($v['id']); ?>"/>
						<input type="hidden" class="zdid"/>
					</td>
				</tr><?php endforeach; endif; else: echo "" ;endif; ?>
		</tbody>
	</table>
	<div style="line-height:120px;">&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;z-index: 999;" id="submit">
		<div class="layui-input-block" style="margin-left: -15px;">
			<?php if($xqzdxs == 1): ?><button class="layui-btn layui-btn-radius" onclick="xqzdxs(this)" style="text-decoration:none;background: darkmagenta;">
					<i class="Hui-iconfont">&#xe61d;</i> 绑定
				</button><?php endif; ?>
			<button class="layui-btn layui-btn-radius layui-btn-primary" onClick="parent.layer.close(parent.layer.getFrameIndex(window.name));" ><i class="Hui-iconfont">&#xe706;</i> 关闭</button>
		</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 src="/Public/lib/layui1/layui.js" charset="utf-8"></script>
	<script type="text/javascript">
		layui.use(['form', 'layedit', 'laydate'], function(){
			var form = layui.form
			,layer = layui.layer
			,layedit = layui.layedit
			,laydate = layui.laydate;
			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');
					}
				});
			});
			$("#sousuo").keyup(function(){
				$("#greetings").show();
				var txt=$("#sousuo").val();
				var sspq="<?php echo ($_GET['sspianqu']); ?>";
				if (txt!="") {
					$.ajax({
						url:'<?php echo U('ajax/get_xiaoqu_bdxs');?>',
						type:"get",
						data:{'txt': txt,'sspq': sspq},
						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 Uarry=$("#tcontent li");
				var count=$(this).index();//获取li的下标
				var Tresult=Uarry.eq(count).text();
				$("#sousuo").val(Tresult);
				$("#greetings").hide();
			})
			$("body").click(function(){
				$("#greetings").hide();
			});
			$('.xlk').change(function(){
				var val = $(this).val();
				var xqid = $(this).parents('.xqlb').find('.xqid').val();
				var zdid = xqid+"-"+val;
				$(this).parents('.xqlb').find('.zdid').val(zdid);
			});
		});
		function xqzdxs(obj){
			var uid = $("#uid").val();
			$zdidsz =$(".zdid");
			var zdids = new Array();
			$zdidsz.each(function(){
				if ($(this).val()) {
					zdids.push($(this).val());
				}
			});
			layer.confirm('确认要如此指定吗？',function(index){
				$.ajax({
					type: 'POST',
					url: '<?php echo U('Options/xqzdxs');?>',
					data: {zdids:zdids,'uid':uid},
					dataType: 'json',
					success: function(data){
						if (data.status==1) {
							parent.layer.msg(data.info);
							layer.close(index);
						}else{
							parent.layer.msg(data.info,function(){});
							layer.close(index);
						}
					},
					error:function(data) {
						console.log(data.msg);
					},
				});
			});
		}
	</script>

	</body>
</html>