<?php defined('IN_HS') or exit('Access Denied'); ?>
<?php include template('member','header'); ?>

<script language="javascript">
<?php
sajax_show_javascript();
?>
function n1()
{
document.getElementById("message").style.display="block";
    if(document.getElementById("s_q").selectedIndex==0)
    {
        document.getElementById("message").innerHTML = "<span class='font06'>请选择密码提示问题</span>";
        return;
    }
    if(document.getElementById("t_ans").value=='')
    {
        document.getElementById("message").innerHTML = "<span class='font06'>请填写密码提示答案</span>";
        document.getElementById("t_ans").focus();
        return;
    }
    if(document.getElementById("t_ans").value.length>30)
    {
        document.getElementById("message").innerHTML = "<span class='font06'>密码提示答案最长为30个字符</span>";
        document.getElementById("t_ans").focus();
        return;
    }
    document.getElementById("message").style.display="none";
document.getElementById("t1").style.display="none";
document.getElementById("t2").style.display="block";
}

function n2()
{
    document.getElementById("message").style.display="none";
document.getElementById("t1").style.display="block";
document.getElementById("t2").style.display="none";
}
function doSub()
{
    var c = document.getElementById("message");
var s_q = document.getElementById("s_q").value;
var t_ans = document.getElementById("t_ans").value;
var s_card = document.getElementById("s_card").value;
var card = document.getElementById("card").value;
var rcard = document.getElementById("rcard").value;
    document.getElementById("message").style.display="block";
if(document.getElementById("s_card").selectedIndex==0)
    {
        document.getElementById("message").innerHTML = "<span class='font06'>请选择证件类型</span>";
        return;
    }
    if(document.getElementById("card").value=='')
    {
        c.innerHTML = "<span class='font06'>请输入证件号码</span>";
        document.getElementById("card").focus();
        return;
    }
    if(document.getElementById("card").length>30)
    {
        c.innerHTML = "<span class='font06'>证件号码最长为30个字符</span>";
        document.getElementById("card").focus();
        return;
    }
    if(document.getElementById("rcard").value=='')
    {
        c.innerHTML = "<span class='font06'>请重复证件号码</span>";
        document.getElementById("rcard").focus();
        return;
    }
    if(document.getElementById("rcard").value!=document.getElementById("card").value)
    {
        c.innerHTML = "<span class='font06'>证件号码两次输入不一致</span>";
        document.getElementById("rcard").focus();
        return;
    }

c.innerHTML = "<span class='font06'>正在设置,请稍后...</span>";
x_doSub(s_q,t_ans,s_card,card,rcard,doSub_cb);

function doSub_cb(z) {
  if(z=="true")
  {
alert("恭喜您,密码保护设置成功");
window.location.href="/member";
}
else
{
document.getElementById("message").innerHTML = z;
}
}
}

//-->
</script>

<DIV class=main>
<DIV class=main>

<?php include template('member','left_member'); ?>

<DIV class="ad_rbarB boxC">
<DIV class=columnC><SPAN class="l_tit f_l">设置密码保护</SPAN></DIV>
<?php if(($pwa[question]=="" || $pwa[answer]=="")) { ?>
<DIV class="tipsboxB boxE">
<H5>密码保护提示</H5>
<DIV 
class=cont>密码保护功能可以使您的帐号更安全，当密码遗忘或被盗，可以帮您快速取回新密码。<BR>
  请正确填写并牢记您所填写的内容，这些将作为您取回新密码的凭证。<BR>
  我们在非法律规定情况下，不会对第三方以及以上泄漏您的任何资料。</DIV>
</DIV>
<DIV class=tipsboxC id=message style="DISPLAY: none"></DIV>
<TABLE class=regform id=t1 cellSpacing=0 cellPadding=0 width="90%" align=center 
border=0>
  <TBODY>
  <TR>
    <TH>请选择问题： </TH>
    <TD colSpan=2><LABEL>
      <SELECT id=s_q > <OPTION selected>请选择</OPTION> 
        <OPTION value=母亲的名字>母亲的名字</OPTION>
<OPTION value=爷爷的名字>爷爷的名字</OPTION> 
        <OPTION value=父亲出生的城市>父亲出生的城市</OPTION>
<OPTION value=您其中一位老师的名字>您其中一位老师的名字</OPTION>
<OPTION value=您个人计算机的型号>您个人计算机的型号</OPTION>
<OPTION value=您最喜欢的餐馆名称>您最喜欢的餐馆名称</OPTION>
<OPTION value=驾驶执照的最后四位数字>驾驶执照的最后四位数字</OPTION></SELECT> </LABEL></TD></TR>
  <TR>
    <TH>请输入答案： </TH>
    <TD colSpan=2><INPUT class=inputA id=t_ans>&nbsp;&nbsp;<SPAN 
      class=font04>答案最长为30个字符！</SPAN> </TD></TR>
  <TR>
    <TH>&nbsp; </TH>
    <TD colSpan=2><input type="submit" class="hsbtn" onclick="n1()" value="下一步"> </TD></TR></TBODY></TABLE>
<TABLE class=regform id=t2 style="DISPLAY: none" cellSpacing=0 cellPadding=0 
width="90%" align=center border=0>
  <TBODY>
  <TR>
    <TH>证件类型： </TH>
    <TD colSpan=2><SELECT id=s_card>
    <OPTION selected selected>请选择</OPTION> 
    <OPTION value=学生证>学生证</OPTION> 
        <OPTION value=身份证>身份证</OPTION></SELECT>
       </TD></TR>
  <TR>
    <TH>证件号码： </TH>
    <TD colSpan=2><INPUT class=inputC id=card style="WIDTH: 200px"><SPAN 
      class=font06> (最长为30个字符！)</SPAN> </TD></TR>
  <TR>
    <TH>再填一遍： </TH>
    <TD colSpan=2><INPUT class=inputC id=rcard style="WIDTH: 200px"> </TD></TR>
  <TR>
    <TH>&nbsp; </TH>
    <TD colSpan=2><input type="submit" class="hsbtn" onclick="n2()" value="上一步">&nbsp;&nbsp;<input type="submit" class="hsbtn" onclick="doSub()" value="保存">
    </TD></TR></TBODY></TABLE>
<?php } else { ?>
<h1 style="color:Green;margin-top:100px">您已经设置了密码保护！</h1>
<?php } ?>
</DIV></DIV></DIV>

<?php include template('member','footer'); ?>
