<?php
require "../e/class/connect.php";
require "../e/class/db_sql.php";
require "../e/member/class/user.php";
$link=db_connect();
$empire=new mysqlquery;
require "class/fun.php";
$ur=user_returnlogin();
$userid=$ur[userid];
$usercheck=checklogin($userid);
$username=$ur[username];
$email=$ur[email];
$passsay=$email?'请输入密码':'QQ登陆用户初始密码：123456';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>密码设置 - 会员中心 -奇热网</title>
<? include_once "temp/header.php"; ?>
<!-- // i-header end -->
<div id="content" class="layout">
  <div class="ui-box ui-qire fn-clear" id="i-box">
<? include_once "temp/left.php"; ?>

    <div class="i-box-cnt" id="i-cnt">
      <form id="changepsw" action="/e/member/doaction.php" method="post"> 
      <input type="hidden" name="enews" value="EditSafeInfo" /><input type="hidden" name="ecmsfrom" value="/user/pass.php" />
        <div id="i-password">
          <div class="ui-title i-tab-nav-box">
            <ul class="i-tab-nav fn-clear">
              <li ><a href="info.php" hidefocus>基本资料</a></li>
              <li class="line"></li>
              <li ><a href="avatar.php" hidefocus>头像设置</a></li>
              <li class="line"></li>
              <li class="current"><a href="pass.php" hidefocus>密码设置</a></li>
            </ul>
          </div>
          <div class="ui-form">
            <div class="ui-form-item fn-clear">
              <label for="password" class="ui-label w130">原密码：</label>
              <input type="password" id="password" name="oldpassword" maxlength="20" class="ui-input w250" value="" />
              <p class="ui-message" id="passwordTip">请输入当前密码,QQ登陆用户初始密码为123456</p>
            </div>
            <div class="ui-form-item fn-clear">
              <label for="newpass" class="ui-label w130">新密码：</label>
              <input type="password" id="newpass" name="password" maxlength="20" class="ui-input w250" value="" />
              <p class="ui-message"  id="newpassTip">6-16个字符</p>
            </div>
            <div class="ui-form-item fn-clear">
              <label for="verifypass" class="ui-label w130">重复密码：</label>
              <input type="password" id="verifypass" name="repassword" maxlength="20" class="ui-input w250" value="" />
              <p class="ui-message" id="verifypassTip">请再一次输入密码</p>
            </div>
            <div class="ui-form-item fn-clear">
              <label for="email" class="ui-label w130">电子邮件：</label>
              <input type="text" id="email" name="email" class="ui-input w250" value="<?=$email?>"/>
              <p class="ui-message" id="emailTip">请输入邮箱</p>
            </div>            
            <div class="ui-form-item fn-clear">
              <label class="ui-label w130"></label>
              <input type="submit" id="savebt" class="ui-button w150" value="保 存" />
              <a href="getpass.php">忘记密码了？</a></div>
          </div>
          <!-- // ui-form End -->
        </div>
      </form>
    </div>
    <!-- // i-cnt End -->
    <script type="text/javascript">
			$.formValidator.initConfig({
				formID:"changepsw",
				debug:false,
				submitOnce:false,
				onSuccess:function(){
					/*
					$("#changepsw").qiresub({
						curobj:$("#savebt"),
						txt:'数据提交中,请稍后...',
						onsucc:function(result){
							//$.showfloatdiv({offset:$("#register").offset(),txt:'成功注册'});
							$.hidediv(result);
							if(parseInt(result.rcode)>0)
							{
								$("#password").val('');
								$("#newpass").val('');
								$("#verifypass").val('');
							}
							//alert(result.msg);
						}
					}).post({url:'class/ajax.php?action=editpass'});
					return false;
					*/
					$("#changepsw").submit();
				},
				onError:function(msg,obj,errorlist){
					$("#errorlist").empty();
					$.map(errorlist,function(msg){
						$("#errorlist").append("<li>" + msg + "</li>")
					});
					//alert(msg);
				},
				submitAfterAjaxPrompt : '有数据正在异步验证，请稍等...'
			});
			
			$("#password").formValidator({
				onShow:"<?=$passsay?>",
				onFocus:"至少6个长度",
				onCorrect:"密码输入正确",
				onError:'密码不能为空'
			})
			.inputValidator({
				min:6,
				empty:{
					leftEmpty:false,
					rightEmpty:false,
					emptyError:"密码两边不能有空符号"
				},onError:"密码在6-16位"
			});
			
			$("#newpass").formValidator({
				onShow:"请输入密码",
				onFocus:"至少6个长度",
				onCorrect:"密码合法"
			})
			.inputValidator({
				min:6,
				empty:{
					leftEmpty:false,
					rightEmpty:false,
					emptyError:"密码不能为空"
				},
				onError:"密码在6-16位"
			});
			
			// Verifypassword
			$("#verifypass").formValidator({
				onShow:"输再次输入密码",
				onFocus:"至少6个长度",
				onCorrect:"密码一致"
			})
			.inputValidator({
				min:6,
				empty:{
					leftEmpty:false,
					rightEmpty:false,
					emptyError:"重复密码必须和新密码一致"
				},onError:"重复密码必须和新密码一致"
			})
			.compareValidator({
				desID:"newpass",
				operateor:"=",
				onError:"2次密码不一致,请确认"
			});
			$("#email").formValidator({
				onShow:"请输入邮箱",
				onFocus:"邮箱至少6个字符,最多100个字符",
				onCorrect:"填写正确",
				defaultValue:""
			})
			.inputValidator({
				min:6,
				max:100,
				onError:"你输入的邮箱长度非法,请确认"
			})
			.regexValidator({
				regExp:"^([\\w-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([\\w-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$",onError:"你输入的邮箱格式不正确"
			});
		</script>
  </div>
  <!-- // maxBox End -->
</div>
<? include_once "temp/footer.php"; ?>
</body>
</html>