<?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">
		#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; 
			display: none;
		}
		#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>

	</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/kyneirong/daikan" method="post" style="margin-top: 20px;">
		<input type="hidden" name="kyid" value="<?php echo ($_GET['kyid']); ?>">
		<input type="hidden" name="kywhr" value="<?php echo ($_GET['kywhr']); ?>">
		<div class="layui-form-item layui-form-text" style="margin-top: 20px;">
			<label class="layui-form-label" style="color: #f00;width: 120px;">
				来访小区：
			</label>
			<div class="layui-input-inline" style="width: 444px;">
				<textarea placeholder="点击搜索" name="dkfangyuan" id="sousuo1" class="layui-textarea" lay-verify="required" readonly=""></textarea>
				<input type="hidden" name="lfxiaoquid" id="xiaoqu">
				<div id="greetings">
					<input type="text" name="" autocomplete="off" placeholder="请搜索小区并选择" class="layui-input" id="sousuo">
					<ul id="tcontent"></ul>
				</div>
			</div>
			<div class="layui-form-mid layui-word-aux">
				<a class="layui-btn layui-btn-primary" id="cz1">重置</a>
			</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">
					<input type="text" name="dkshijian" id="test1" placeholder="yyyy-mm-dd" lay-verify="required" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label" style="color:#f00;">
					客户等级
				</label>
				<div class="layui-input-inline">
					<select name="kydengji" lay-filter="aihao" lay-verify="required">
						<option value="">请选择</option>
						<?php if(is_array($kydengji)): foreach($kydengji as $key=>$pz): ?><option value="<?php echo ($pz["lxid"]); ?>" <?php if($dengji == $pz["lxid"]): ?>selected=""<?php endif; ?>><?php echo ($pz["lxming"]); ?></option><?php endforeach; endif; ?>
					</select>
				</div>
			</div>
		</div>
		<div class="layui-form-item layui-form-text">
			<label class="layui-form-label" style="color: #f00;width: 120px;">
				客户评价：
			</label>
			<div class="layui-input-inline" style="width: 555px;">
				<textarea placeholder="请输入内容" name="kehupj" class="layui-textarea" lay-verify="required"></textarea>
			</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'], function(){
			var form = layui.form
			,layer = layui.layer
			,layedit = layui.layedit
			,laydate = layui.laydate;
			laydate.render({
				elem: '#test1'
				,type: 'datetime'
				,max: '<?php echo date("Y-m-d H:i:s",time());?>'
			});
			//监听提交
			form.on('submit(demo1)', function(data){
				$.ajax({
					url:'<?php echo U('Kyneirong/daikan');?>',
					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.layer.close(index);//关闭弹出的子页面窗口
						}else{
							layer.msg(data.info,function(){});//错误提示
						}
					},
					error:function(data) {
						console.log(data.msg);
					},
				});
				return false;
			});
			$("#sousuo1").click(function(){
				var display =$('#greetings').css('display');
				if(display == 'none'){
					$("#greetings").show();
				}else{
					$("#greetings").hide();
				}
			});
			$("#sousuo").keyup(function(){
				$("#greetings").show();
				var txt=$("#sousuo").val();
				if (txt!="") {
					$.ajax({
						url:'<?php echo U('ajax/get_xiaoqu_txt');?>',
						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).attr('dataid',district[i]['id']);
								$(li).html(district[i]['xiaoqum']);
								$("#tcontent").append(li);
							}
						}
					});
				}
			});
			$("#tcontent").on("click","li", function() {
				$("#greetings").show();
				var Uarry=$("#tcontent li");
				var count=$(this).index();
				var Tresult=Uarry.eq(count).text();
				var xiaoquid=Uarry.eq(count).attr('dataid');
				var bb=$("#sousuo1").val();
				bb+=Tresult+'；';
				$("#sousuo1").val(bb);
				var cc=$("#xiaoqu").val();
				cc+=xiaoquid+',';
				$("#xiaoqu").val(cc);
				$("#sousuo").val("");
				$("#greetings").hide();
			});
			$("#cz1").click(function(){
				$("#sousuo1").val("");
			});
		});
	</script>

	</body>
</html>