<?php if(!defined('IN_SDCMS')) exit;?>
{php $self_name='修改密码'}
{php $self_ename='change Password'}
{php $position=[['name'=>'会员中心','url'=>N('user')],['name'=>$self_name,'url'=>THIS_LOCAL]]}
{include file="include/top.php"}
<title>{$self_name}_{sdcms[web_name]}</title>
</head>

<body>
	{include file="include/head.php"}
	{include file="include/banner_inner.php"}

	<div class="container">
		<div class="width row">
			<div class="container-left">
				<div class="ui-fixed" data-parent=".container">
					{include file="user/nav.php"}
				</div>
			</div>
			
			<div class="container-right">
			
				<div class="ui-box">
					<div class="ui-box-h2">{$self_name}</div>
					<div class="ui-box-body">
						<!--begin-->
						<form method="post" class="ui-form mt-40">
							<div class="form-group row">
								<label class="col-2 col-form-label text-right">原密码：</label>
								<div class="col-5">
									<input type="password" name="oldpass" class="form-ip" placeholder="请输入原密码" data-rule="原密码:required;password;">
								</div>
							</div>
							<div class="form-group row">
								<label class="col-2 col-form-label text-right">新密码：</label>
								<div class="col-5">
									<input type="password" name="newpass" id="newpass" class="form-ip" placeholder="请输入新密码" data-rule="新密码:required;password;">
								</div>
							</div>
							<div class="form-group row">
								<label class="col-2 col-form-label text-right">确认新密码：</label>
								<div class="col-5">
									<input type="password" name="repass" class="form-ip" placeholder="请再次输入新密码" data-rule="确认新密码:required;password;match(newpass)">
								</div>
							</div>
							<div class="form-group row">
								<label class="col-2 col-form-label text-right"></label>
								<div class="col-5">
									<input type="submit" class="btn btn-blue" value="修改密码">
								</div>
							</div>
						</form>
						<!--over-->
					</div>
				</div>
			
			</div>
		</div>
	</div>
	
	{include file="include/foot.php"}
	<script>
	$(function()
	{
		$(".ui-form").form(
		{
			type:2,
			align:'center',
			result:function(form)
			{
				$.ajax(
				{
					type:'post',
					cache:false,
					dataType:'json',
					url:'{THIS_LOCAL}',
					data:$(form).serialize(),
					error:function(e){alert(e.responseText);},
					success:function(d)
					{
						if(d.state=='success')
						{
							sdcms.success(d.msg);
							setTimeout(function(){location.href='{THIS_LOCAL}';},1500);
						}
						else
						{
							sdcms.error(d.msg);
						}  
					}
				});
			}
		});
	})
	</script>

</body>
</html>