<!--#include virtual="/show/indexhead.asp"-->
<!--#include virtual="/inc/md52.asp"-->

<%

if SafeRequestform("act")="jihuo" then
Mobile=trim(SafeRequestform("Mobile"))
chkcode=SafeRequestform("chkcode")
chkcode2=SafeRequestform("chkcode2")

if int(request.Cookies("GetCode"))<>int(trim(chkcode)) then call PopErr("右侧的验证码输入错误") 

'检测验证码
if trim(chkcode2)="" then call PopErr("请填写收到的验证码") 
if request.Cookies("yzsum")="" then call PopErr("收到的验证码系统获取错误E1") 
tomd5yzm=md5(chkcode2&Mobile&ptjiami)
rs.open "select * from ayyanzheng where ayyanzhengids='"&clng(request.Cookies("yzsum"))&"' and ayyanzhengidc='"&tomd5yzm&"'",conn,1,1
if rs.bof and rs.eof then call PopErr("收到的验证码验证错误")
rs.close
'检测验证码*******************************************************************************************************************

sql="select * from ayname where aytel="&Mobile&" and isjihuo=1"
rs.open sql,conn,1,3
if rs.bof and rs.eof then
call PopErr2("未找到该用户","/index/jihuo") 
else
response.Cookies("GetCode")=""
response.Cookies("yzsum")=""
userid=rs("aynameid")
rs("isjihuo")=0
rs.update
call logadd(userid,Mobile&"重新激活成功",1,0)
call PopErr2("账号重新激活成功","/index/log") 
end if
rs.close

end if


%>

<script language="javascript">
function refreshImage(img)
{
    var imageUrl = '/inc/code/'; 
    img.src = imageUrl + '?' + Math.random();
}
function checklog()
{ 
   if(document.login.Mobile.value=="")
   {alert("请填写手机号");return false}
    if(document.login.chkcode.value=="")
   {alert("请填写后侧的验证码");return false}
    if(document.login.chkcode2.value=="")
   {alert("请填写收到的验证码");return false}
   document.login.next.disabled="disabled";
} 

function huoqu()
{ 
	var xmlhttp;
	try
	{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch (e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch (e){try{xmlhttp=new XMLHttpRequest();}catch (e){}}}

   var Mobile=document.getElementById("Mobile").value
   if (Mobile==""){alert('请填写手机号码');return false;}
   var regu =/^[1][3-9][0-9]{9}$/; 
   var re = new RegExp(regu); 
   if (re.test(Mobile)){}else{alert('请正确填写手机号码');return false;} 
	
   xmlhttp.open("get","/index/checkuser?Mobile="+ Mobile +"&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;
}
 </script>





<div class="mian">
<div class="regbox conter">
<div class="nyclassbt01 conter">账号重新激活</div>

<form name="login" method="post" action="" onSubmit="return checklog()">
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="50" colspan="3"><span style="font-size:15px; color: #F60; padding-left:220px;">>>由于长时间未操作，账号目前为未激活状态，请重新激活您的账号</span></td>
    </tr>
  <tr>
    <td width="280" height="50" class="regtext">商家手机号：</td>
    <td width="303"><input name="Mobile" id="Mobile" type="text" class="reginput" maxlength="11"></td>
    <td width="452"><input type="button" class="btnFn1" id="endtime2" value="获取验证码" onClick="huoqu()"></td>
  </tr>
  <tr>
    <td height="50" class="regtext">收到的验证码：</td>
    <td><input name="chkcode2" type="text" class="reginput" id="chkcode2" maxlength="6"></td>
    <td><div class="regts" >请填写手机收到的验证码</div></td>
  </tr>
  <tr>
    <td height="50" class="regtext">输入右侧验证码：</td>
    <td><input name="chkcode" type="text" class="reginput" id="chkcode" maxlength="4"></td>
    <td><img src="/inc/code/" alt="点击刷新验证码" style="cursor:pointer" border=0 onClick="refreshImage(this);"/></td>
  </tr>
  <tr>
    <td height="69" class="regtext">&nbsp;</td>
    <td align="left"><input style="cursor:pointer" name="tijiao" type="submit" class="logindlreg" id="tijiao" value=" 激 活 "></td>
    <td><input name="act" type="hidden" id="act" value="jihuo" /></td>
  </tr>
  </table>
</form>



<br>

</div>
</div>



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