<?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" type="text/css" href="/Public/lib/layui/css/layui.css">
	<style type="text/css">
		a:hover {
			color: blue;
			text-decoration: none;
		}
	</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>
	<div class="layui-tab">
		<ul class="layui-tab-title">
			<li></li>
			<li class="layui-this">
				基本信息
			</li>
			<li>
				重置密码
			</li>
		</ul>
		<div class="layui-tab-content">
			<div class="layui-tab-item"></div>
			<div class="layui-tab-item layui-show">
				<!--基本信息-->
				<blockquote class="layui-elem-quote">基本信息</blockquote>
				<form class="layui-form" id="form1" action="/admin/rbac/editUser" method="post">
					<input type="hidden" name="id" value="<?php echo ($user['id']); ?>"/>
					<input type="hidden" name="edittype" value="1"/>
					<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: 100px;">
								手机号：
							</label>
							<div class="layui-input-inline" style="width: 180px;">
								<input type="text" name="dianhua" placeholder="" class="layui-input" lay-verify="required" value="<?php echo ($user['dianhua']); ?>">
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label" style="color:#f00;width: 100px;">
								用户名称：
							</label>
							<div class="layui-input-inline" style="width: 180px;">
								<input type="text" name="ygmingcheng" id="ygmingcheng" placeholder="" class="layui-input" lay-verify="required" value="<?php echo ($user['ygmingcheng']); ?>">
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label" style="width: 100px;">
								拼音检索：
							</label>
							<div class="layui-input-inline" style="width: 600px;">
								<input type="text" name="pinyinjs" id="pinyinjs" placeholder="" class="layui-input" value="<?php echo ($user['pinyinjs']); ?>">
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label" style="color:#f00;width: 100px;">
								所属部门：
							</label>
							<div class="layui-input-inline" style="width: 180px;">
								<select name="bumen" lay-verify="required">
									<?php echo ($select_categorys); ?>
								</select>
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label" style="color:#f00;width: 100px;">
								职务岗位：
							</label>
							<div class="layui-input-inline" style="width: 180px;">
								<select name="role" lay-verify="required">
									<?php if(is_array($role)): foreach($role as $key=>$v): ?><option value="<?php echo ($v['id']); ?>" <?php if($role_id == $v['id']): ?>selected<?php endif; ?>><?php echo ($v["remark"]); ?></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: 100px;">
								员工编号：
							</label>
							<div class="layui-input-inline" style="width: 180px;">
								<input type="text" name="ygbianhao" placeholder="" class="layui-input" lay-verify="required" value="<?php echo ($user['ygbianhao']); ?>">
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label" style="color:#f00;width: 100px;">
								性别：
							</label>
							<div class="layui-input-inline" style="width: 180px;">
								<select name="xingbie" lay-verify="required">
									<option value="1" <?php if($user["xingbie"] == 1): ?>selected=""<?php endif; ?>>男</option>
									<option value="2" <?php if($user["xingbie"] == 2): ?>selected=""<?php endif; ?>>女</option>
								</select>
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label" style="width: 100px;">
								用户类型：
							</label>
							<div class="layui-input-inline" style="width: 180px;">
								<select name="leixing">
									<option value="0">请选择</option>
									<option value="1" <?php if($user["leixing"] == 1): ?>selected=""<?php endif; ?>>销售经理</option>
									<option value="2" <?php if($user["leixing"] == 2): ?>selected=""<?php endif; ?>>销售</option>
									<option value="3" <?php if($user["leixing"] == 3): ?>selected=""<?php endif; ?>>销售扩展</option>
								</select>
							</div>
						</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;margin-left: -10px;" id="submit">
						<div class="layui-input-block" style="margin-left: 0px;">
							<button class="layui-btn layui-btn-radius" lay-submit="" lay-filter="form1">
								<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.layer.close(parent.layer.getFrameIndex(window.name))">
								<i class="Hui-iconfont">&#xe706;</i> 关闭
							</button>
						</div>
					</div>
				</form>
			</div>
			<div class="layui-tab-item">
				<!--重置密码-->
				<blockquote class="layui-elem-quote">重置密码</blockquote>
				<form class="layui-form" id="form2" action="/admin/rbac/editUser" method="post">
					<input type="hidden" name="id" value="<?php echo ($user['id']); ?>"/>
					<input type="hidden" name="edittype" value="2"/>
					<div style="line-height:30px;">&nbsp;</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label" style="width: 100px;">
								手机号：
							</label>
							<div class="layui-input-inline" style="width: 180px;">
								<input type="text" name="dianhua" placeholder="" class="layui-input" value="<?php echo ($user['dianhua']); ?>" readonly="">
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label" style="width: 100px;">
								用户名称：
							</label>
							<div class="layui-input-inline" style="width: 180px;">
								<input type="text" name="ygmingcheng" placeholder="" class="layui-input" value="<?php echo ($user['ygmingcheng']); ?>" readonly="">
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label" style="width: 100px;">
								新密码：
							</label>
							<div class="layui-input-inline" style="width: 180px;">
								<input type="text" name="mima" id="mima" placeholder="密码框为空时默认密码：123456" class="layui-input" value="123456">
							</div>
						</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;margin-left: -10px;" id="submit">
						<div class="layui-input-block" style="margin-left: 0px;">
							<button class="layui-btn layui-btn-radius" lay-submit="" lay-filter="form2">
								<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.layer.close(parent.layer.getFrameIndex(window.name))">
								<i class="Hui-iconfont">&#xe706;</i> 关闭
							</button>
						</div>
					</div>
				</form>
			</div>
		</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/Syunew3.js"></script>
	<script src="/Public/lib/layui1/layui.js" charset="utf-8"></script>
	<script>
		layui.use(['element','form', 'layedit', 'laydate'],function(){
			var element = layui.element
			,form = layui.form
			,$ = layui.jquery
			,layer = layui.layer
			,layedit = layui.layedit
			,laydate = layui.laydate;
			//监听提交form1
			form.on('submit(form1)', function(data){
				$.ajax({
					url:'<?php echo U('Rbac/editUser');?>',
					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.$('#submit_two').click(); //刷新父级页面
							parent.layer.close(index);//关闭弹出的子页面窗口
						}else{
							layer.msg(data.info,{anim: 6});//错误提示
						}
					},
				});
				return false;
			});
			//监听提交form2
			form.on('submit(form2)', function(data){
				$.ajax({
					url:'<?php echo U('Rbac/editUser');?>',
					type:"post",
					data:data.field,
					dataType:"json",
					success:function(data){
						if (data.status==1) {
							layer.msg(data.info,{icon:1,time:1000});
						}else{
							layer.msg(data.info,{anim: 6,time:3600});//错误提示
						}
					}
				});
				return false;
			});
			$("#ygmingcheng").keyup(function(){
				var ygmingcheng=$("#ygmingcheng").val();
				$.ajax({
					url:'<?php echo U('ajax/get_pinyin');?>',
					type:"get",
					data:"txt="+ygmingcheng,
					dataType:"json",
					success:function(data){
						$("#pinyinjs").val(data.pyjs);
					}
				});
			});
		});
	</script>

	</body>
</html>