<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%
	response.setHeader("Pragma", "No-cache");
	response.setHeader("Cache-Control", "no-cache");
	response.setDateHeader("Expires", -10);
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"	+ request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<%@include file="/WEB-INF/views/base.jsp"%>
<!DOCTYPE html>
<html>

<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>修改密码</title>
<%@include file="/WEB-INF/views/common_base_css.jsp"%>
</head>

<body>

	<div id="wrapper">

		<jsp:include page="../menu.jsp"></jsp:include>

		<div id="page-wrapper" class="gray-bg">
			<jsp:include page="../head.jsp"></jsp:include>
			<jsp:include page="../pageNav.jsp"></jsp:include>
			<!-- 页面 主题内容  开始-->
	        <div class="wrapper wrapper-content animated fadeInRight">
	        <div class="row">
	        	<!-- row开始 -->
	           <div class="row">
                	<div class="col-lg-12">
	                    <div class="ibox float-e-margins">
	                        <div class="ibox-title">
	                            <h5>密码修改</h5>
	                        </div>
	                        <div class="ibox-content">
	                        	<form:form id="form" modelAttribute="sysUser" action="${pageContext.request.contextPath}/person/updatePassword" class="form-horizontal" method="post" >
									<div class="form-group">
										<label class="col-sm-2 control-label">旧密码</label>
										<div class="col-md-10">
											<form:password value="" class="form-control" path="j_password" autocomplete="off"/>
 											<form:errors path="j_password" class="field-has-error"></form:errors> 
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-2 control-label">新密码</label>
										<div class="col-md-10">
										<form:password value="" class="form-control" id="password" path="password" autocomplete="off" />
										</div>
									</div>
									
									<div class="form-group">
										<label class="col-sm-2 control-label">重复密码</label>
										<div class="col-md-10">
										<form:password value="" id="cf_password" path="cf_password" class="form-control" autocomplete="off" /> 
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-2 control-label">邮箱</label>
										<div class="col-md-10">
											<form:input value="${sysUser.emailaddress }"  path="emailaddress" autocomplete="off" class="form-control"  /> 
										</div>
									</div>
									<div class="form-group">
	                                    <div class="col-sm-4 col-sm-offset-2">
	                                        <button onclick="history.go(-1)" class="btn btn-warning" type="button"><i class="fa fa-mail-forward"></i>&nbsp;&nbsp;返回</button>
	                                        <button class="btn btn-primary" type="submit"><i class="fa fa-save"></i>&nbsp;&nbsp;保存</button>
	                                    </div>
	                                </div>
								</form:form>
	                        </div>
	                    </div>
                	</div>
            	</div>
	            <!-- row结束 -->	
	        </div>    
	        </div>
	        <!-- 页面主题内容 结束 -->
		</div>
	</div>
	
<%@include file="/WEB-INF/views/common_base_script.jsp"%>
<script type="text/javascript">
	$(function(){
		//前台js验证
		var ruleObj = {j_password:{required:true},password:{required:true},
						cf_password:{required:true,equalTo:"#password"},emailaddress:{required:true, email:true}};
		var messageObj = {j_password:{required:"请输入旧密码"}, password:{required:"请输入新密码"},cf_password:{required:"请输入再输入新密码",
		equalTo:"两次密码输入不一致"},
		emailaddress:{required:"请输入邮箱",email:"请输入正确格式的邮箱"}};
	    CommonUtils.formValidate("form", ruleObj, messageObj);
	
	})

</script>
</body>

</html>
