{include "header.inc.html"}
{$adLang = $lang.admin.ad.form}
<div class="content_box">
	<div class="toolbar_box">
		<div class="toolbar"> <span> <strong>修改密码</strong><br />
		<span class="english">Password</span> </span> </div>
	</div>
<div class="adForm">
<form class="form" action="" method="post" id="pwdForm">
<input type="hidden" name="act" value="edit" /><input type="hidden" name="inajax" value="1" /><input type="hidden" name="id" value="{$userInfo.id}" />
<div class="form-line">
<label class="label">登录名：</label><div class="element">{$userInfo.email}</div>
</div>
<div class="form-line">
<label class="label">原密码：</label><div class="element"><input type="password" class="text w200" name="password_old" value=""  maxlength="16"/></div>
</div>
<div class="form-line">
<label class="label">新密码：</label><div class="element"><input type="password" class="text w200" name="password" id="password" value="" maxlength="16"/></div>
</div>
<div class="form-line">
<label class="label">确认新密码：</label><div class="element"><input type="password" class="text w200" name="password_confirm" value=""  maxlength="16"/></div></div>
<div class="form-line">

<div class="form-line">
<label class="label"></label><div class="element"><input class="btn_sub" type="submit" value="{$lang.form.submit}"></div>
</div>
</form>
</div>
</div><!--.content_box-->
<script type="text/javascript">
$(function(){
	$('#pwdForm').validate({
		rules:{
			password_old:{ required:true },
			password:{ required:true,minlength:6,maxlength:16 },
			password_confirm:{ required:true,equalTo:'#password' }
		},
		messages:{
			password_old:{ required:'请填写原密码' },
			password:{ required:'请填写新密码',minlength:'密码最小长度为6',maxlength:'密码最长长度为16' },
			password_confirm:{ required:'请填写确认密码',equalTo:'确认密码与新密码不相同' }
		},
		submitHandler:function(){
			$('#pwdForm').ajaxSubmit({ dataType:'json',success:function(json){ 
					if(json.success){ $("#pwdForm input[type='password']").val(''); qlib.tips({ icon:'success',msg:'修改密码成功' }); }else{ qlib.tips({ icon:'error',msg:'修改密码失败 '+json.message }); }
				}
			});
		}
	});

});
</script>
{include "footer.inc.html"}