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

<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" />

<%
call gaojiquanxian_old("anquanedit")

act=SafeRequestform("act")


if act="chongzhi" then
fangshi=trim(SafeRequestform("fangshi"))
formcode=trim(SafeRequestform("formcode"))
pass1=trim(SafeRequestform("pass1"))
pass2=trim(SafeRequestform("pass2"))

if formcode="" then call PopErr("请填写收到的验证码")  
if pass1="" then call PopErr("请填写支付密码") 
if pass2="" then call PopErr("请确认支付密码") 
if pass1<>pass2 then call PopErr("两次支付密码输入不一致") 
 
set rsu=server.CreateObject("adodb.recordset")
sqlu="select * from ayname where aynameid="&request.Cookies("aynameid")&"" 
rsu.open sqlu,conn,1,3

	if fangshi="mail" then strcon=trim(rsu("aymail"))
	if fangshi="tel" then strcon=rsu("aytel")
	
	if request.Cookies("yzsum")="" then call PopErr("系统验证码生成错误！请重新获取验证码！") 
	yanzhengmamd5=md5(formcode&strcon&ptjiami)  '加密验证码
	sql="select * from ayyanzheng where ayyanzhengids='"&formcode&"' and ayyanzhengidc='"&yanzhengmamd5&"'" 
	rs.open sql,conn,1,1
	if rs.bof and rs.eof then
	call PopErr("收到的验证码输入错误！")
	response.End()
	end if
	rs.close


rsu("ayanquan")=md5(pass1)
rsu.update
rsu.close
response.Cookies("yzsum")=""
call logadd(request.Cookies("aynameid"),"支付密码重置成功",4,0)
call PopErr2("支付密码重置成功","anquan")  
end if 
%>


<script language=javascript>
var xmlhttp;
try
{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch (e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch (e){try{xmlhttp=new XMLHttpRequest();}catch (e){}}}

function huoqu()
{
    var fangshi=document.getElementById("fangshi").value
   
    if(fangshi=="mail")
	{
	xmlhttp.open("get","/index/checkuser?act=getusermail&t=" +  new Date().getTime());
	}
	if(fangshi=="tel")
	{
	xmlhttp.open("get","/index/checkuser?act=huoquyz&jcact=you&t=" +  new Date().getTime());
	}
   
   xmlhttp.onreadystatechange=function()
   {
		 if(4==xmlhttp.readyState) 
		 {
			   if(200==xmlhttp.status)
			   { 
			   		//alert(xmlhttp.responseText);
					if (xmlhttp.responseText=="ok"){alert('验证码已发送，请注意查收');RemainTime();return false;}
					if (xmlhttp.responseText=="no"){alert('未找到该手机号码');return false;}
					if (xmlhttp.responseText=="time"){alert('请再一分钟后尝试重新发送验证码');return false;}
					if (xmlhttp.responseText=="telerr"){alert('请使用正常手机号码');return false;}
			   }
			   else
			   {
				alert('网络链接失败');
				return false;
			   }
		 }
   }
   xmlhttp.send(null);  
   return false;
}

var CID = "endtime2";
var iTime = "60"; //秒

function RemainTime()
{
	document.getElementById(CID).disabled="disabled";
    var iDay,iHour,iMinute,iSecond;
    var sDay="",sHour="",sMinute="",sSecond="",sTime="";
    if (iTime >= 0)
    {
        iDay = parseInt(iTime/24/3600);if (iDay > 0){sDay = iDay + "天";}
        iHour = parseInt((iTime/3600)%24);if (iHour > 0){sHour = iHour + "小时";}
        iMinute = parseInt((iTime/60)%60);if (iMinute > 0){sMinute = iMinute + "分钟";}
        iSecond = parseInt(iTime%60);
		
        if (iSecond >= 0){sSecond = iSecond + "秒";}
        if ((sDay=="")&&(sHour=="")){sTime= sMinute+sSecond;}else{sTime=sDay+sHour+sMinute+sSecond;}
		
		if(iTime==0){sTime="获取验证码";document.getElementById(CID).disabled="";}else{Account = setTimeout("RemainTime()",1000);}
       	iTime=iTime-1;
    }
    else
    {
       iTime = "61";    //设置+1
	   RemainTime();
    }
    document.getElementById(CID).value = sTime;
}

function chk()
{
	if(form1.formcode.value==""){alert("请填写收到的验证码");return false;}
	if(form1.pass1.value==""){alert("请设置一个支付密码");return false;}
	if(form1.pass2.value==""){alert("请确认填写支付密码");return false;}
	if(form1.pass1.value!=form1.pass2.value){alert("两次支付密码输入不一致");return false;}
}

</script>

<style>
table{font-size:14px; font-weight:normal;line-height:27px;}
.regts{width:440px; height:36px; border:#CCC solid 1px; background:#f1f1f1; color:#666666; line-height:36px; padding-left:10px}
.reginput{width:290px; height:36px; border:#CCC solid 1px; color:#949494; text-indent:10px; line-height:36px}
.gexian20{float:left;width:100%;height:20px;}
.mzsmbox2{width:90%; height:auto; overflow:hidden; background:#fcf8e2; border-left:#edd28a solid 5px; color:#956825; line-height:22px; padding:20px;margin-left:40px; margin-bottom:60px; font-size:13px;padding-top:20px;}
.btnFn1 {cursor:pointer!important;cursor:hand;  height:40px; width:101px; padding:0px 0px 0 0; }
.btnFn2 {cursor:pointer!important;cursor:hand;  height:40px; width:101px; padding:0px 0px 0 0; font-weight:bold; }
</style>

<br>
<DIV id=main2> 

<DIV style="PADDING-LEFT:0px">
<DIV id=main_right_content>

<H2><SPAN>支付密码修改</SPAN></H2>
<DIV class=main4><br>

							<%
                            sql="select * from ayname where aynameid="&clng(request.Cookies("aynameid"))&"" 
                            rs.open sql,conn,1,1
                            %>
                            
							<form action="" method="post" name="form1" id="form1"  onSubmit="return chk()"> 
                            <table class="neitableanquan" width="1080">
                            <tr>
                                <td colspan="2" align="center" width="110">验证方法：</td>
                                <td width="300">
                                <select name="fangshi" id="fangshi" style="height:30px;">
                                <option value="mail">邮箱  <%=trim(rs("aymail"))%></option>
                                <option value="tel">手机  <%=trim(rs("aytel"))%></option>
                                </select>
                                </td>
                                <td><input type="button" class="btnFn1" id="endtime2" value="获取验证码" onClick="huoqu()"></td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center" width="110">收到的验证码：</td>
                                <td width="300"><input name="formcode" type="text" class="reginput" id="formcode" size="20" maxlength="6"></td>
                                <td><div class="regtd" > 请输入收到的验证码</div></td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center" width="110">新的支付密码：</td>
                                <td width="300"><input name="pass1" type="password" class="reginput" id="pass1" size="20" maxlength="15"></td>
                                <td><div class="regtd" > 设置一个新的支付密码</div></td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center">确认支付密码：</td>
                                <td><input name="pass2" type="password" class="reginput" id="pass2" size="20" maxlength="15"></td>
                                <td><div class="regtd" > 确认支付密码</div></td>
                            </tr>
                            <tr>
                                <td colspan="2"><input name="act" type="hidden" id="act" value="chongzhi"></td>
                                <td colspan="2" height="60"><input style="cursor:pointer"  class="logindlreg" type="submit" name="Submit2" value=" 修改支付密码 "></td>
                            </tr>
                       	 	</table>
                        	</form>
							<%rs.close%>
                            
            <div class="gexian20"></div>
            <div class="mzsmbox2">
            提示：由于邮件发信机制限制，邮箱可能会在垃圾邮件箱，请注意查看！
            </div>

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

<br>

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


