<% data_path=""  %>
<!--#include file="conn/conn.asp"--> 
<script language="javascript">
<!--
function clock(){i=i-1
document.title="本窗口将在"+i+"秒后自动关闭!";

if (window.opener!=null){
if(i>0)setTimeout("clock();",1000);
else self.close();
}

}
var i=5
clock();
//-->
</script>

<style type="text/css">
<!--
body {
	background-color: #E1ECF2;
}
-->
</style>

<%
ticket=request("ticket")
userid=request("userid")
if userid="" and ticket="" then

	 response.Write("<script >alert('参数传递错误!');window.opener=null;window.open('','_self');window.close();</script >")
     response.End()
	 END IF
sql="select * from Websen_corporation where id="&userid&""
	set rs=server.CreateObject("adodb.recordset")
	rs.open sql,conn,1,3
	   gradeid=rs("gradeid")
    rs.close
	set rsm=server.CreateObject("adodb.recordset")
sqlm="select *  from Websen_vipgrade where roleid="&gradeid
rsm.open sqlm,conn,1,3
  yxsh=rsm("yxsh")
   rsm.close

	sql1="select * from Websen_corporation where id="&userid&""
	set rs1=server.CreateObject("adodb.recordset")
	rs1.open sql1,conn,1,3
	 if exd="" then 
	   exd=0
 	   end if
	if yxsh=1 then
	
	

if rs1("websen_sjhs")<>ticket and userid="" then
	 response.Write("<script >alert('参数传递错误!');window.opener=null;window.open('','_self');window.close();</script >")
     response.End()
	end if

	if rs1("websen_sjhsshuxin")=1 and  rs1("websen_sjhs")=ticket then
	 Response.write("<script >alert('你已经验证过了! 不能在提交了！');window.opener=null;window.open('','_self');window.close();</script >")
	else
    rs1("websen_sjhsshuxin")=1
    rs1.update	
	startdate=rs1("BeginDate")
	 startdate=date()
	  enddate=dateadd("m",12,date())
conn.execute "update Websen_corporation  set flag=1,websen_sjhsshuxin=1,BeginDate='"&startdate&"',EndDate='"&enddate&"',Exd="&exd&" where id="&userid
	Response.write("<script >alert('邮箱验证成功!');window.opener=null;window.open('','_self');window.close();</script >")
	end if

	else
		if rs1("websen_sjhs")<>ticket and userid="" then
	 response.Write("<script >alert('参数传递错误!');window.opener=null;window.open('','_self');window.close();</script >")
     response.End()
	end if
	if rs1("websen_sjhsshuxin")=1 and  rs1("websen_sjhs")=ticket then
	 Response.write("<script >alert('你已经验证过了! 不能在提交了！');window.opener=null;window.open('','_self');window.close();</script >")
	else
    rs1("websen_sjhsshuxin")=1
    rs1.update	
	Response.write("<script >alert('邮箱验证成功!');window.opener=null;window.open('','_self');window.close();</script >")
	end if
	end if
	rs1.close
	
%>

