<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
	<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
	<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> 
<!DOCTYPE HTML>
<html>
<head>
<meta 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" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link
	href="${pageContext.request.contextPath }/common/admin/css/H-ui.min.css"
	rel="stylesheet" type="text/css" />
<link
	href="${pageContext.request.contextPath }/common/admin/css/H-ui.login.css"
	rel="stylesheet" type="text/css" />
<link
	href="${pageContext.request.contextPath }/common/admin/css/style.css"
	rel="stylesheet" type="text/css" />
<link
	href="${pageContext.request.contextPath }/common/admin/lib/Hui-iconfont/1.0.1/iconfont.css"
	rel="stylesheet" type="text/css" />
<title>修改管理员</title>
</head>
<body>
	<div class="pd-20">
		<form class="form form-horizontal" id="form-admin-update">
			<%-- <div class="row cl">
				<label class="form-label col-3"><span class="c-red">*</span>管理员：
				</label>
				<div class="formControls col-5">
					<input type="text" class="input-text"
						value="${adminchildinfo.adminLoginName }" placeholder=""
						id="user-name" name="adminLoginName" datatype="*2-16"
						nullmsg="用户名不能为空">
				</div>
				<div class="col-4"></div>
			</div> --%>
			<%-- <div class="row cl">
				<label class="form-label col-3"><span class="c-red">*</span>密码：

				</label>
				<div class="formControls col-5">
					<input type="text" autocomplete="off"
						class="input-textValidform_error"
						value="${adminchildinfo.adminLoginPwd }" datatype="*"
						recheck="newpassword" id="newpassword1" name="adminLoginPwd">
				</div>
				<div class="col-4"></div>
			</div> --%>
			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*</span>性别：

				</label>
				<div class="formControls col-5 skin-minimal">
					<div class="radio-box">
						<input type="radio" id="sex-1" value="1" name="adminSex"
						<c:if test="${fn:contains(adminchildinfo.adminSex,1)}">checked="checked"</c:if>
							 > <label for="sex-1">男</label>
					</div>
					<div class="radio-box">
						<input type="radio" id="sex-2" value="2" name="adminSex"
						<c:if test="${fn:contains(adminchildinfo.adminSex,2)}">checked="checked"</c:if>
						> <label for="sex-2">女</label>
					</div>
				</div>
				<div class="col-4"></div>
			</div>
			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*</span>手机：

				</label>
				<div class="formControls col-5">
					<input type="text" class="input-text"
						value="${adminchildinfo.adminTel }" placeholder="" id="user-tel"
						name="adminTel" datatype="m" nullmsg="手机不能为空">
				</div>
				<div class="col-4"></div>
			</div>
			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*</span>邮箱：

				</label>
				<div class="formControls col-5">
					<input type="text" class="input-text"
						value="${adminchildinfo.adminEmail }" placeholder="@"
						name="adminEmail" id="email" datatype="e" nullmsg="请输入邮箱！">
				</div>
				<div class="col-4"></div>
			</div>
			<div class="row cl">
				<label class="form-label col-3">简介：</label>
				<div class="formControls col-5">
					<textarea id="adminDesc" name="adminDesc" class="textarea" >${adminchildinfo.adminDesc }</textarea>
					
				</div>
				<div class="col-4"></div>
			</div>
			<div class="row cl">
				<div class="col-9 col-offset-3">
					
					<input type="hidden" value="${adminchildinfo.adminId }" name="adminId" />
						<input type="hidden" value="${adminchildinfo.adminCreateAdminId }" name="adminCreateAdminId" />
						 <input type="hidden" value="${adminchildinfo.adminCreateDate }" name="adminCreateDate" />
						 <input type="hidden" value="${adminchildinfo.adminStatus }" name="adminStatus" />
						 <input  id="submit" class="btn btn-primary radius"
						type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;"
						onclick="admin_update()">&nbsp;&nbsp;&nbsp;&nbsp;
						
				</div>
			</div>
		</form>
	</div>
	<script type="text/javascript"
		src="${pageContext.request.contextPath }/common/admin/lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript"
		src="${pageContext.request.contextPath }/common/admin/lib/layer/1.9.3/layer.js"></script>
	<script type="text/javascript"
		src="${pageContext.request.contextPath }/common/admin/js/H-ui.js"></script>
	<script type="text/javascript"
		src="${pageContext.request.contextPath }/common/admin/js/H-ui.admin.js"></script>
		<script type="text/javascript"
		src="${pageContext.request.contextPath }/common/admin/js/tips.js"></script>
	<script type="text/javascript">
		$(function() {
			$('.skin-minimal input').iCheck({
				checkboxClass : 'icheckbox-blue',
				radioClass : 'iradio-blue',
				increaseArea : '20%'
			});

			$("#form-admin-add").Validform({
				tiptype : 2,
				callback : function(form) {
					form[0].submit();
					var index = parent.layer.getFrameIndex(window.name);
					parent.$('.btn-refresh').click();
					parent.layer.close(index);
				}
			});
		});

		/*管理员-修改*/
		function admin_update() {
			//手机验证
			if(!commonTypeJdg('user-tel','mobile',null,true)){
				layer.msg("手机号不能为空或格式错误",{icon: 5,time:3000});
				return;
			}
			//邮箱验证
			if(!commonTypeJdg('email','mail',null,true)){
				layer.msg("邮箱不能为空或格式错误",{icon: 5,time:3000});
				return;
			}
			$.ajax({
				url : '${pageContext.request.contextPath }/admin/admin/updateUI',
				type : "POST",
				dataType : "json",
				data : $("#form-admin-update").serialize(),
				beforeSubmit: function (data) {
	            	  $("#submit").attr("disabled","disabled");
	            	  $("#shutdown").attr("disabled","disabled");
	              },
				success : function(data) {
					layer.msg(data.status,{icon: 1,time:3000},function(){
						$("#submit").attr("disabled","");
		            	$("#shutdown").attr("disabled","");
		            	returnSuperior();
					});
				},
				error : function(data) {
					layer.msg(data.status,{icon: 5,time:3000});
				}
			});
		}
		//返回查看页面
		function returnSuperior(){
			window.location.href = '${pageContext.request.contextPath }/admin/admin/listUI';
		}
	</script>
</body>
</html>