<?php
if (!defined('ROOT'))
	exit ;
?>
<!DOCTYPE html>
<html>

	<head>
		<title>修改个人资料</title>
		<meta name="description" content="">
		<meta name="keywords" content="">
		<?php
		include 'Inc_files.php';
		?>
		<link rel="stylesheet" type="text/css" href="/static/member/css/wap.1.0.0.css?v=20171117">
	</head>

	<body data-type="index">
		<script src="<?php echo C('TMPL_PARSE_STRING.__TPL__'); ?>/assets/js/theme.js"></script>
		<div class="am-g tpl-g">
			<?php include 'Inc_head.php'?>
			<!-- 侧边导航栏 -->
			<?php
				include 'Inc_left.php';
			?>
			<!-- 内容区域 -->
			<div class="tpl-content-wrapper">
				<div class="row-content am-cf">
					<div class="row">
	                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
	                        <div class="widget am-cf">
	                            <div class="widget-head am-cf">
	                                <div class="widget-title am-fl">修改二级密码</div>
	                            </div>
	                            <div class="widget-body am-fr">
	                            	<?php $modval = M('member')->find(session('user_auth.id'));?>
	                                <form action="/member/safe" class="am-form tpl-form-border-form tpl-form-border-br password2">
	                                	<input type="hidden" name="model_id" value="27" />
	                                	<input type="hidden" name="id" value="<?php echo session('user_auth.id');?>" />
	                                    <div class="am-form-group">
	                                        <label for="user-name" class="am-u-sm-3 am-form-label">原密码 </label>
	                                        <div class="am-u-sm-9">
	                                            <input type="password" name="oldpassword2" placeholder="未设置则留空" style="width: 200px; display: inline;" class="tpl-form-input"> <a href="#findpwd" data-am-modal>忘记密码</a>
	                                            <small></small>
	                                        </div>
	                                    </div>
	                                    <div class="am-form-group">
	                                        <label for="user-name" class="am-u-sm-3 am-form-label">新密码 </label>
	                                        <div class="am-u-sm-9">
	                                            <input type="password" name="password2" style="width: 300px;" class="tpl-form-input">
	                                            <small></small>
	                                        </div>
	                                    </div>
	                                    <div class="am-form-group">
	                                        <label for="user-name" class="am-u-sm-3 am-form-label">确认新密码 </label>
	                                        <div class="am-u-sm-9">
	                                            <input type="password" name="repassword2" style="width: 300px;" class="tpl-form-input">
	                                            <small></small>
	                                        </div>
	                                    </div>
	                                    <div class="am-form-group">
	                                        <label for="user-name" class="am-u-sm-3 am-form-label">验证码 </label>
	                                        <div class="am-u-sm-9">
	                                            <input type="text" name="code" style="width: 100px; float: left;" class="tpl-form-input"><img class="pointer" title="点击切换" height="33" src="/api/verify" onClick="this.src='/api/verify?time='+Math.random()" >
	                                            <small></small>
	                                        </div>
	                                    </div>
	                                    
	                                    <div class="am-form-group">
	                                        <div class="am-u-sm-9 am-u-sm-push-3">
	                                            <button type="button" class="btn_submit am-btn am-btn-primary tpl-btn-bg-color-success ">
	                                            	提交
	                                            </button>
	                                        </div>
	                                    </div>
	                                </form>
	                            </div>
	                        </div>
	                    </div>
	                </div>
				</div>
			</div>
		</div>
		<?php
		include 'Inc_files_boot.php';
		?>
		<div class="am-modal am-modal-prompt" tabindex="-1" id="findpwd">
		  <div class="am-modal-dialog">
		    <div class="am-modal-hd">找回二级密码</div>
		    <div class="am-modal-bd">
		      	输入账号绑定的邮箱或手机号
		      <form class="findpwd"><input type="text"  name="mobile" class="am-modal-prompt-input"></form>
		    </div>
		    <div class="am-modal-footer">
		      <span class="am-modal-btn" data-am-modal-cancel>取消</span>
		      <span class="am-modal-btn btn_findpwd" data-am-modal-confirm>提交</span>
		    </div>
		  </div>
		</div>
		<script type="text/javascript">
		jQuery(document).on('click','.btn_submit',function () {
		    var the=jQuery(this);
		    jQuery.ajax({
		    	url:"/member/safe2",
		        data:jQuery('form.password2').serializeArray(),
		        dataType: "json",
		        type: "post",
		        timeout: 10000,
		        success: function(data) {
		        	if (data.status==1) {
		        		location.href="/member/safeinfo";
		        	}else{
		        		wd_alert({msg:data.info,background:'#f00'});
		        	}
		        },
		        error: function() {
		            mui.toast("网络连接超时");
		        }
		    });          
		})
		//找回二级密码
		jQuery(document).on('click','.btn_findpwd',function () {
		    jQuery.ajax({
		    	url:"/member/findpwd2",
		        data:jQuery('form.findpwd').serializeArray(),
		        dataType: "json",
		        type: "post",
		        timeout: 10000,
		        success: function(data) {
		        	if (data.status==1) {
		        		wd_alert({"msg":data.info});
		        	}else{
		        		wd_alert({"msg":data.info,'background':'#f00'});
		        	}
		        },
		        error: function() {
		            mui.toast("网络连接超时");
		        }
		    });          
		})
		</script>		
	</body>

</html>