<!--#include file="head.asp"-->
<style>body{background-color: #fff;}</style>

<%
'call iszizhu()
'call chktel()

Const stringmodarr = "0123456789"
dim randarr2,strlength
strlength = Len(stringmodarr)
Randomize timer
For i = 1 To 16 
randarr2 = randarr2&Mid(stringmodarr,Int(Rnd * strlength + 1),1)  
Next 
randarr =randarr2 & Right(("00" & Second(Now())),2)


act=SafeRequestform("act")
if act="telrenzheng" then

telsum=SafeRequestform("telsum")
if trim(telsum)="" then call PopErr("请填写验证码")
if request.Cookies("yzsum")="" then call PopErr("系统验证码生成错误！请重新获取验证码！") 

sql="select istelrz,aynameid,aytel from ayname where aynameid="&clng(request.Cookies("aynameid"))&"" 
rs.open sql,conn,1,3
if rs("istelrz")=1 then call PopErr2("该手机已经认证，如需更换请联系管理员","renzheng")

	yanzhengmamd5=md5(telsum&rs("aytel")&ptjiami)  '加密验证码
	set rs2=server.CreateObject("adodb.recordset")
	sql2="select * from ayyanzheng where ayyanzhengids='"&telsum&"' and ayyanzhengidc='"&yanzhengmamd5&"'" 
	rs2.open sql2,conn,1,1
	if rs2.bof and rs2.eof then
	call PopErr("收到的验证码输入错误！")
	response.End()
	end if
	rs2.close

rs("istelrz")=1
rs.update
rs.close

response.Cookies("yzsum")=""
call logadd(request.Cookies("aynameid"),"手机认证成功",0,0)
call PopErr2("手机认证成功","renzheng")
end if

%>

<script language=javascript>
  function yanzheng()
  {
   var xmlhttp;
   try
   {
	 xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
   }
   catch (e)
   {
     try
     {
       xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
     }
     catch (e)
     { 
	    try
	    {
			xmlhttp=new XMLHttpRequest();
	    }
	    catch (e)
	    {
	    }
     }
   }
  	 
	document.form1.Submit2.disabled="disabled"; 
	  
   xmlhttp.open("get","/index/checkuser?act=huoquyz&jcact=you&qact=telrz&t=" +  new Date().getTime());
   xmlhttp.onreadystatechange=function()
   {
     if(4==xmlhttp.readyState) 
	 {
	   if(200==xmlhttp.status)
	   {
	   
     		 
	   	    if (xmlhttp.responseText=="ok")
	     	{ 
		 	  alert('验证码已发送，请查收');
		 	  return false;
	     	}
	   	    if (xmlhttp.responseText=="no")
	     	{ 
		 	  alert('出现错误，请联系管理员');
		 	  return false;
	     	}
	   	    if (xmlhttp.responseText=="time")
	     	{ 
		 	  alert('请再一分钟后尝试重新发送验证码');
		 	  return false;
	     	}
	   	    if (xmlhttp.responseText=="telerr")
	     	{ 
		 	  alert('请使用正常手机号码');
		 	  return false;
	     	}
	   	    if (xmlhttp.responseText=="chongfu")
	     	{ 
		 	  alert('该帐号手机已认证');
		 	  return false;
	     	}
			
	   }
	   else
	   {
		 alert('网络链接失败');
		 return false;
	   }
  
	 }
   }
   
   xmlhttp.send(null);  
   return false;
  
   }  
   
  //-->
  </script>
<script language="javascript">
function checkrz()
{   
if(document.form1.telsum.value=="")
{alert("请填写验证码");return false}
 }
</script>

 
<main>
<div  class="container">
<div class="ui-lrctnei">
<%call userleft()%>
<div class="r"> 
<div class="ui-content">
                        
					
                            
<div class="neiye">

                   
                                                     
            <!-------------------------------------- 开始 -------------------------------------->
            <div class="neibiaoti"></div>
            <div class="neibiaoti2">手机认证</div>
                	<div class="gexian"></div>
                    <div class="neitablewu">
					<%
                    'rs.open "select okjyrz from ayquanju",conn,1,1
					'okjyrz=rs("okjyrz")
					'rs.close
					
                    sql="select aytel,aynameid,istelrz,ayusername,aymail,aychengjiao from ayname where aynameid="&clng(request.Cookies("aynameid"))&"" 
                    rs.open sql,conn,1,1
					'if clng(rs("aychengjiao"))=0 and cint(okjyrz)=1 then call PopErr("亲！先完成交易一笔，再进行认证。")
                    %>
                    <%if rs("istelrz")=0 then%>
                    <form action="" method="post" name="form1" id="form1" onSubmit="return checkrz()">
    				<table>
           		  		<tr>
                            <td width="110" align="right">手机号码：</td>
                            <td><%=rs("aytel")%>
                   			<input type="submit" name="Submit2" id="Submit2" class="logindlregedit" value=" 获取验证码 " onClick="return yanzheng();"/>
                            </td>
                        </tr>
           		  		<tr>
                            <td width="110" align="right">验证码：</td>
                          <td><input name="telsum" type="text" id="telsum" size="10" maxlength="6" class="reginputdd"/></td>
                        </tr>
           		  		<tr>
                            <td width="110"><input name="act" type="hidden" id="act" value="telrenzheng"></td>
                            <td><input style="cursor:pointer"  class="logindlregedit" type="submit" name="Submit" value=" 手 机 认 证 " ></td>
                        </tr>
                    </table>
                    </form>
                    <%elseif rs("istelrz")=1 then%>
    				<table>
           		  		<tr>
                            <td width="112" align="right">手机号码：</td>
                          <td width="2664"><%=rs("aytel")%> <span style="color: #FF6600">[已认证]</span></td>
                        </tr>
                        <TR>
                            <TD colspan="2" align="left">如需修改邮箱，请联系管理员</TD>
                        </TR>
                    </table>
                    <%end if%>
					</div>
            <!-------------------------------------- 结束 -------------------------------------->
            
            

            
            
            
            		<div class="gexian20"></div>
                    <div class="mzsmbox2">
                    提示：如需修改邮箱以及预留手机请联系管理员，<%=webname%>在非紧急状况下不会泄露商户邮箱以及手机号,验证码可能会有延时,或查看是否被拦截<br><br>
                    </div>
       				<%rs.close%>
            
            
           

        <div class="clearfix"></div>



</div>








</div>
</div>
</div>
</div>
</main>


<footer>
<div class="container">
</div>
</footer>

</body>
</html>