<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>修改密码 - S2M Admin</title>
		<meta name="description" content="overview &amp; stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<#include "/admin/include/cssjs_up.html" encoding="UTF-8"/>
		<script>
		function changeCode(){
			$("#codeImg").attr("src","/code?rnd=" + Math.random());
		}
		function checkFormMan(obj){
			var message = $.trim($("#message").val());
			var message2 = $.trim($("#message2").val());
			if(message != message2){
				$("#errorMsg").html("两次输入密码不一致");
			}
			$.post("/admin/editPwd/save",$(obj).serialize(),function(result){
				if(result == "noOldPwd"){
					$("#errorMsg").html("请输入原密码");
				}
				if(result == "noPassword"){
					$("#errorMsg").html("请输入新密码");
				}
				if(result == "errorPassword"){
					$("#errorMsg").html("原密码输入错误");
				}
				if(result == "success"){
					$("#errorMsg").html("您的密码已修改成功，请重新登录");
				}
			});
			return false;
		}
		</script>
	</head>

	<body>
		<#include "/admin/include/head.html" encoding="UTF-8"/>
		<div class="main-container" id="main-container">
			<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>
			<div class="main-container-inner">
				<a class="menu-toggler" id="menu-toggler" href="#">
					<span class="menu-text"></span>
				</a>
				<#include "/admin/include/menu.html" encoding="UTF-8"/>
				<div class="main-content">
					<div class="breadcrumbs" id="breadcrumbs">
						<script type="text/javascript">
							try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
						</script>

						<ul class="breadcrumb">
							<li>
								<i class="icon-home home-icon"></i>
								<a href="/admin/">Home</a>
							</li>
							<li class="active">修改密码</li>
						</ul><!-- .breadcrumb -->
					</div>

					<div class="page-content">
						<div class="page-header">
							<h1>
								修改登录密码
								<small>
									<i class="icon-double-angle-right"></i>
									定期修改密码有助于您的账户安全
								</small>
							</h1>
						</div>
						<div class="row">
							<div class="col-xs-12">
								<form role="form" class="form-horizontal" method="post" onsubmit="return checkFormMan(this)">
									<div class="form-group">
										<label for="form-field-2" class="col-sm-3 control-label no-padding-right"> 旧密码： </label>

										<div class="col-sm-9">
											<input name="oldPwd" type="password" class="col-xs-10 col-sm-5" placeholder="旧密码" id="form-field-2">
										</div>
									</div>
									<div class="space-4"></div>
									<div class="form-group">
										<label for="form-field-2" class="col-sm-3 control-label no-padding-right"> 新密码： </label>

										<div class="col-sm-9">
											<input id="message" name="password" type="password" class="col-xs-10 col-sm-5" placeholder="新密码" id="form-field-2">
										</div>
									</div>
									<div class="space-4"></div>
									<div class="form-group">
										<label for="form-field-2" class="col-sm-3 control-label no-padding-right"> 再次输入新密码： </label>

										<div class="col-sm-9">
											<input id="message2" type="password" class="col-xs-10 col-sm-5" placeholder="再次输入新密码" id="form-field-2">
										</div>
									</div>
									<div class="form-group">
										<label for="form-field-2" class="col-sm-3 control-label no-padding-right"></label>
										<div class="col-sm-9">
											<span id="errorMsg" class="text-warning bigger-110 orange"></span>
										</div>
									</div>

									<div class="clearfix form-actions">
										<div class="col-md-offset-3 col-md-9">
											<button type="submit" class="btn btn-info">
												<i class="icon-ok bigger-110"></i>
												Submit
											</button>
											<input name="token" type="hidden" value="${token}" />
											&nbsp; &nbsp; &nbsp;
											<button type="reset" class="btn">
												<i class="icon-undo bigger-110"></i>
												Reset
											</button>
										</div>
									</div>
								</form>
							</div><!-- /.col -->
						</div><!-- /.row -->
					</div><!-- /.page-content -->
				</div><!-- /.main-content -->
			</div><!-- /.main-container-inner -->

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="icon-double-angle-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->
		<#include "/admin/include/cssjs_down.html" encoding="UTF-8"/>
	</body>
</html>