<!--#include file="head.asp"-->
<!--#include file="subleft.asp"-->

<%
response.Write "该功能未开通"
response.end
%>
<script>document.getElementById('o_1').setAttribute("class", "ed"); document.getElementById("t_1").style.display="";document.getElementById('s_1_3').setAttribute("class", "ed4");</script>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title><%=webname%>-支付密码修改</title>
<%

if SafeRequestform("fangshi")<>"" then fangshi=SafeRequestform("fangshi")
if SafeRequest("fangshi")<>"" then fangshi=SafeRequest("fangshi")
act=SafeRequestform("act")

if act="del" then
sql="select aynameid,ayanquan from ayname where aynameid="&request.Cookies("aynameid")&"" 
rs.open sql,conn,1,3
rs("ayanquan")="0"
rs.update
rs.close
response.Cookies("isrenzheng")="no"
call logadd(request.Cookies("aynameid"),"支付密码删除成功",0,0)
call PopErr2("支付密码删除成功","anquan")  
end if 

if act="chongzhi" then
czanquanma=trim(SafeRequestform("czanquanma"))
czanquanma2=trim(SafeRequestform("czanquanma2"))
if czanquanma="" or czanquanma2="" then call PopErr("请填写完整")  
if czanquanma<>czanquanma2 then call PopErr("两次支付密码输入不一致")  
sql="select aynameid,ayanquan from ayname where aynameid="&request.Cookies("aynameid")&"" 
rs.open sql,conn,1,3
rs("ayanquan")=md5(czanquanma)
rs.update
rs.close
response.Cookies("isrenzheng")="no"
call logadd(request.Cookies("aynameid"),"支付密码重置成功",0,0)
call PopErr2("支付密码重置成功","anquan")  
end if 

if act="edit" and fangshi=1 then
xuliehao=SafeRequestform("xuliehao")
con1=SafeRequestform("con1")
con2=SafeRequestform("con2")
con3=SafeRequestform("con3")
id1=SafeRequestform("id1")
id2=SafeRequestform("id2")
id3=SafeRequestform("id3")
if xuliehao="" or con1="" or con2="" or con3="" or id1="" or id2="" or id3="" then call PopErr("请填写完整")  
sql="select aynameid,aymibaoka from ayname where aynameid="&request.Cookies("aynameid")&" and aymibaoka='"&trim(xuliehao)&"'" 
rs.open sql,conn,1,1
if rs.bof and rs.eof then
call logadd(request.Cookies("aynameid"),"支付密码重置验证密保序列号错误",0,1)
 
call PopErr("密保卡序列号不正确") 
response.End()
end if
rs.close
 
sql="select * from aymibao where aymibaoka='"&trim(xuliehao)&"'" 
rs.open sql,conn,1,1
if rs.bof and rs.eof then
rs.close
response.Cookies("isrenzheng")="no"
call logadd(request.Cookies("aynameid"),"支付密码重置验证未找到密保卡序列号",0,1)
call PopErr("未找到该序列号信息")  
response.End()
else
	if md5(trim(con1))<>trim(rs(id1)) then 
	call logadd(request.Cookies("aynameid"),"支付密码重置验证密保卡填写错误",0,1)
	call PopErr("密保卡填写有误")  
	response.End()
	end if
	
	if md5(trim(con2))<>trim(rs(id2)) then 
	call logadd(request.Cookies("aynameid"),"支付密码重置验证密保卡填写错误",0,1)
	call PopErr("密保卡填写有误") 
	response.End()
	end if
	if md5(trim(con3))<>trim(rs(id3)) then 
	call logadd(request.Cookies("aynameid"),"支付密码重置验证密保卡填写错误",0,1)
	call PopErr("密保卡填写有误") 
	response.End()
	end if
	response.Cookies("isrenzheng")="yes"
	rs.close
	fangshi=3
end if

end if


if act="edit" and fangshi=2 then
response.Cookies("isrenzheng")="no"
daan1=trim(SafeRequestform("daan1"))
daan2=trim(SafeRequestform("daan2"))
if daan1="" or daan2="" then call PopErr("请填写完整")  
sql="select aynameid,aymibaoka,aymibaoda1,aymibaoda2 from ayname where aynameid="&clng(request.Cookies("aynameid"))&"" 
rs.open sql,conn,1,3
if md5(daan1)<>trim(rs("aymibaoda1")) then
call logadd(request.Cookies("aynameid"),"支付密码重置验证密保资料填写错误",0,1)

call PopErr("密保资料填写有误")
response.End()
end if
if md5(daan2)<>trim(rs("aymibaoda2")) then 
call logadd(request.Cookies("aynameid"),"支付密码重置验证密保资料填写错误",0,1)

call PopErr("密保资料填写有误") 
response.End()
end if 
response.Cookies("isrenzheng")="yes"
rs.close
fangshi=3
end if
%>


<br>
<DIV id=main2> 
<%call webleft()%>
<DIV id=main_right>
<DIV id=main_right_content>

<H2><SPAN>支付密码修改</SPAN></H2>
<DIV class=main3>
<table width="700" border="0" align="center" cellpadding="0" cellspacing="0" class="table_style_a1">
  	  <tr onmouseover=this.bgColor='#D2FFFF' onmouseout=this.bgColor='#ffffff'>
        <th width="210" align="center" class="border_right">&nbsp;</td>
          <span style="font-weight: bold">选择支付密码修改方式：</span>
        <td width="568" align="center" class="">
		<%
sql="select aynameid,aymibaoka,ayanquan,aymibao1,aymibao2 from ayname where aynameid="&clng(request.Cookies("aynameid"))&"" 
rs.open sql,conn,1,1
'if trim(rs("ayanquan"))="0" then call PopErr2("该用户未绑定了密保卡","anquan") 
if trim(rs("ayanquan"))="0" then
call PopErr2("该账户还未设置安全吗","/") 
response.End()
end if
if trim(rs("aymibaoka"))<>"0" then%>
		<a href="?fangshi=1">通过密保卡修改或删除支付密码</a>	
<%end if
if not isnull(trim(rs("aymibao1"))) and not isnull(trim(rs("aymibao2"))) then%>
		&nbsp;&nbsp;&nbsp;&nbsp;<a href="?fangshi=2">通过密保问题修改或删除支付密码</a>
<%end if%>
<%if trim(rs("aymibaoka"))="0" and isnull(trim(rs("aymibao1"))) and isnull(trim(rs("aymibao2"))) then%>
		&nbsp;&nbsp;&nbsp;&nbsp;密保卡和密保问题都未设置，请先完整帐号资料！
<%end if
rs.close
%>
		</td>
        </tr>
    </table><br>
<%if fangshi=1 then
sql="select aynameid,aymibaoka,ayanquan,aymibao1,aymibao2 from ayname where aynameid="&clng(request.Cookies("aynameid"))&"" 
rs.open sql,conn,1,1
if trim(rs("aymibaoka"))="0" then
call logadd(request.Cookies("aynameid"),"修改安全吗该帐号未绑定密保卡",0,1)

call PopErr("帐号未绑定密保卡")
response.End()
end if
rs.close
%>
     <form action="?act=edit" method="post" name="form" id="form"> 
  <table width="700" border="0" align="center" cellpadding="0" cellspacing="0" class="table_style_a1">
       <tr>
        <th width="210" align="center" class="border_right border_bottom" >密保卡序列号：
        <td width="568" class="border_right border_bottom">&nbsp;&nbsp;
          <input name="xuliehao" class="inputty" type="text" id="xuliehao" size="30" maxlength="20">
          <span style="color: #999999">（请输入密保卡序列号）</span></td>
       </tr>
<%
Function RndNumber(Min,Max) 
Randomize 
RndNumber=Int((Max - Min + 1) * Rnd() + Min) 
End Function 

Const stringmodarr1 = "ABCDEFG"
dim randarr1,strlength1
strlength1 = Len(stringmodarr1)
Randomize
For i = 1 To 1 
randarr1 = randarr1&Mid(stringmodarr1,Int(Rnd * strlength1 + 1),1) 
randarr2 = randarr2&Mid(stringmodarr1,Int(Rnd * strlength1 + 1),1) 
randarr3 = randarr3&Mid(stringmodarr1,Int(Rnd * strlength1 + 1),1) 
Next 
 
id1=randarr1&RndNumber(1,7)
id2=randarr2&RndNumber(1,7)
id3=randarr3&RndNumber(1,7)

%>

	  <tr onmouseover=this.bgColor='#D2FFFF' onmouseout=this.bgColor='#ffffff'>
        <th align="center" class="border_right border_bottom">&nbsp;</td>密保卡对应的数字：
		<td class="border_right border_bottom">
		&nbsp;<span style="font-weight: bold"><%=id1%></span>&nbsp;
		<input name="con1" type="text" class="inputty" id="con1" size="5" maxlength="2">
		&nbsp;
		 <span style="font-weight: bold"><%=id2%></span>&nbsp;<input name="con2" type="text" class="inputty" id="con2" size="5" maxlength="2">
		  &nbsp;
		  <span style="font-weight: bold"><%=id3%></span>&nbsp;<input name="con3" type="text" class="inputty" id="con3" size="5" maxlength="2">
		  <span style="color: #999999">（请输入密保卡相对应的数字）</span>
		  <input name="id1" type="hidden" value="<%=id1%>">
		  <input name="id2" type="hidden" value="<%=id2%>">
		  <input name="id3" type="hidden" value="<%=id3%>">		  
		  <input name="act" type="hidden" id="act" value="edit">
		  <input name="fangshi" type="hidden" id="fangshi" value="<%=fangshi%>">
		  </td>
        </tr>
<%

'rs.close%>
	  

      <tr>
        <td colspan="2" align="center"><input style="cursor:pointer"  class="butbaocun" type="submit" name="Submit" value=" 验 证 密 保 卡 ">
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
      </tr>
    </table>
</form>
<%end if%>
<%if fangshi=2 then

sql="select aynameid,aymibaoka,aymibao1,aymibao2 from ayname where aynameid="&clng(request.Cookies("aynameid"))&"" 
rs.open sql,conn,1,1
if isnull(rs("aymibao1")) or isnull(rs("aymibao2")) then call PopErr2("该账户未设置密保问题","anquan")  
%>
<form action="" method="post" name="form1" id="form1">
<table width="700" border="0" align="center" cellpadding="0" cellspacing="0" class="table_style_a1">
       <tr>
        <th width="210" align="center" class="border_right border_bottom" >密保问题1：
        <td width="568" class="border_right border_bottom">&nbsp;&nbsp;<%=rs("aymibao1")%></td>
       </tr>
       <tr>
         <th align="center" class="border_right border_bottom" >密保答案1：       
         <td width="568" class="border_right border_bottom">&nbsp;&nbsp;<input name="daan1" class="inputty" type="text" id="daan1" size="35" maxlength="20">
           <span style="color: #999999">（请输入密保问题1的答案）</span></td>
       </tr>
       <tr>
         <th align="center" class="border_right border_bottom" >&nbsp;密保问题2：
         <td width="568" class="border_right border_bottom">&nbsp;&nbsp;<%=rs("aymibao2")%></td>
       </tr>


	  <tr onmouseover=this.bgColor='#D2FFFF' onmouseout=this.bgColor='#ffffff'>
        <th align="center" class="border_right border_bottom">密保答案2：
        
        <td class="border_right border_bottom">&nbsp;&nbsp;<input name="daan2" type="text" class="inputty" id="daan2" size="35" maxlength="20">
		  <span style="color: #999999">（请输入密保问题2的答案）</span>
		  <input name="act" type="hidden" id="act" value="edit">
		  <input name="fangshi"type="hidden" id="fangshi" value="<%=fangshi%>">
		</td>
        </tr>
  

      <tr>
        <td colspan="2" align="center"><input style="cursor:pointer"  class="butbaocun" type="submit" name="Submit" value=" 密 保 认 证 ">
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
      </tr>
    </table>
</form>
<%rs.close
end if%>

<%if request.Cookies("isrenzheng")="yes" and fangshi=3 then%>
     
  <table width="700" border="0" align="center" cellpadding="0" cellspacing="0" class="table_style_a1">
  <form action="" method="post" name="formcz" id="formcz"> 
       <tr>
        <th width="210" align="center" class="border_right border_bottom" >重置支付密码：
        <td width="568" class="border_bottom"><br>
          &nbsp;&nbsp;<input name="czanquanma" type="password" class="inputty" id="czanquanma" size="20" maxlength="15">
          <span style="color: #999999">(输入支付密码 不超过15个字符)</span><br>
          <br>
		  &nbsp;&nbsp;<input name="czanquanma2" type="password" class="inputty" id="czanquanma2" size="20" maxlength="15">
		  <span style="color: #999999">(确认支付密码)</span>
		  <input name="act" type="hidden" id="act" value="chongzhi"><br><br>
          &nbsp;&nbsp;<input style="cursor:pointer"  class="butbaocun" type="submit" name="Submit2" value=" 修 改 安 全 码 "><br><br></td>
       </tr>
</form>
<!--
<form method="post" name="formdel" id="formdel">
	  <tr onmouseover=this.bgColor='#D2FFFF' onmouseout=this.bgColor='#ffffff'>
        <th align="center" class="border_right border_bottom">&nbsp;</td>我要删除支付密码：
		  <input name="act" type="hidden" id="act" value="del">
        <td class="border_bottom"><br>
		  &nbsp;&nbsp;<input style="cursor:pointer"  class="butbaocun" type="submit" name="Submit22" value=" 删 除 安 全 码 " onClick="javascript:return confirm('您确定要删除支付密码吗？');">
		    <span style="color: #999999">(删除后 您的库存卡密可能会有被盗的风险！)</span>		<br>
		    <br></td>
        </tr></form>
-->
<%

'rs.close%>
	  


    </table>

<%end if%>

</DIV>
</DIV>
</DIV>
<DIV class=clear></DIV></DIV>
</DIV>

<br>

	<!--#include virtual="/show/foot.asp"-->


