<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!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" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>修改超级管理员</title>
</head>
<body>
<div class="pd-20">
	<form method="post" class="form form-horizontal" id="form-change-password">
		<div class="row cl">
			<label class="form-label col-4"><span class="c-red">*</span>账户：</label>
			<div class="formControls col-4">${adminName }</div>
			<input type="hidden" value="${adminNameID }" name="adminId" id="adminId">
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-4"><span class="c-red">*</span>新密码：</label>
			<div class="formControls col-4">
				<input type="password" class="input-text" autocomplete="off" placeholder="不修改请留空" name="adminLoginPwd" id="adminLoginPwd" datatype="*6-18" ignore="ignore" >
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-4"><span class="c-red">*</span>确认密码：</label>
			<div class="formControls col-4">
				<input type="password" class="input-text" autocomplete="off" placeholder="不修改请留空" name="new-password2" id="adminLoginPwd2" recheck="new-password" datatype="*6-18" errormsg="您两次输入的密码不一致！" ignore="ignore" >
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
		<label class="form-label col-4"><span class="c-red">*</span></label>
					<div class="formControls col-5">
						<input class="input-text size-L" id="verifycode" name="verifyCode"
							type="text" placeholder="验证码"
							onblur="if(this.value==''){this.value='验证码:'}"
							onclick="if(this.value=='验证码:'){this.value='';}" value="验证码:"
							style="width: 150px;"> <img
							src="${pageContext.request.contextPath }/verify.image"
							id="verifyCode"> <a id="kanbuq" href="javascript:;">看不清，换一张</a>
					</div>
				</div>
		<div class="row cl">
			<div class="col-8 col-offset-4">
				<input class="btn btn-primary radius" onclick="update_start();" type="button" value="&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 update_start(){
 			if(checkLogin()){
 			 $.ajax({
 	              url: '${pageContext.request.contextPath }/admin/admin/updateAdminPwd',
 	              type: "POST",
 	              dataType: "json",
 	              data: {adminid:$("#adminId").val(),adminLoginPwd:$("#adminLoginPwd").val(),verifyCode:$("#verifycode").val()},
 	              error:function(){
 	            	  layer.msg(data.status,{icon: 5,time:3000});
 	              },
 	              success:  function(data){
 	            	 layer.msg(data.status,{icon: 1,time:3000});
 	              }
 	          });
 			}
 	}
 	
 	
 	$(function() {
			$("#kanbuq").click(
					function() {
						$("#verifyCode").attr(
								"src",
								"${pageContext.request.contextPath }/verify.image?date="
										+ new Date().getTime());
						return false;//取消动作
					});
			$("#adminLoginPwd").blur(function() {
				var adminLoginPwd = $(this).val();
				var re = /^[a-zA-z]\w{5,15}$/;
				if (!(re.test(adminLoginPwd))) {
					 layer.msg("密码必须以字母、数字、下划线组成，字母开头，6-16位",{icon: 1,time:3000});
				}
			});
			$("#adminLoginPwd2").blur(function() {
				var adminLoginPwd = $(this).val();
				var re = /^[a-zA-z]\w{5,15}$/;
				if (!(re.test(adminLoginPwd))) {
					layer.msg("确认密码必须以字母、数字、下划线组成，字母开头，6-16位",{icon: 1,time:3000});
				}
			});
			$("#verifycode").blur(function() {
				var verifyCode = $(this).val();
				if (verifyCode.length != 6) {
					layer.msg("验证码必须必须为6位",{icon: 1,time:3000});
				}
			});
		});
 	function checkLogin() {
			var adminLoginPwd = $("#adminLoginPwd").val();
			var re = /^[a-zA-z]\w{5,15}$/;
			if (!(re.test(adminLoginPwd))) {
				 layer.msg("密码必须以字母、数字、下划线组成，字母开头，6-16位",{icon: 1,time:3000});
				 return false;
			}
			var adminLoginPwd = $("#adminLoginPwd2").val();
			var re = /^[a-zA-z]\w{5,15}$/;
			if (!(re.test(adminLoginPwd))) {
				layer.msg("确认密码必须以字母、数字、下划线组成，字母开头，6-16位",{icon: 1,time:3000});
				return false;
			}
			var verifyCode = $("#verifycode").val();
			if (verifyCode.length != 6) {
				layer.msg("验证码必须必须为6位",{icon: 1,time:3000});
				return false;
			}
		return true;
	}
	</script>
	<script>
		var _hmt = _hmt || [];
		(function() {
			var hm = document.createElement("script");
			hm.src = "//hm.baidu.com/hm.js?080836300300be57b7f34f4b3e97d911";
			var s = document.getElementsByTagName("script")[0];
			s.parentNode.insertBefore(hm, s);
		})();
		var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://"
				: " http://");
		document
				.write(unescape("%3Cscript src='"
						+ _bdhmProtocol
						+ "hm.baidu.com/h.js%3F080836300300be57b7f34f4b3e97d911' type='text/javascript'%3E%3C/script%3E"));
	</script>
</body>
</html>