<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>会员推广</title>
<link href="style/nav.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!--#include file="../conn.asp"-->
<!--#include file="../Function/Function.asp"-->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
     <tr>
       <td width="100%" valign="top"><table width="690" border="0" align="center" cellpadding="0" cellspacing="0">
         <tr>
           <td height="43" background="images/user_top.gif"><table width="100%" border="0" cellpadding="0" cellspacing="0">
             <tr>
               <td width="6%">&nbsp;</td>
               <td width="94%">会员推广</td>
             </tr>
           </table></td>
         </tr>
       </table><br />
<table width="90%" border="0" align="center" cellpadding="5" cellspacing="0">
         <tr>
           <td bgcolor="#f7f7f7"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="login">
             <tr>
               <td><br>
			   <%Action=Trim(request("Action"))
				    IF Request.Cookies("YWNTUserCookie")("UserName")="" Then Action="UsersLogin"
					Select Case Action
					Case "UsersLogin"
					call UsersLogin()
					Case "UsersTg"
					call UsersTg()
					Case else
					call List()
					End Select
					sub List()
					Set Rs = server.CreateObject(YWNT_TMS_RS)
					sql="select UsersName,UsersType from YWNT_TMS_Users where UsersName='"&Request.Cookies("YWNTUserCookie")("UserName")&"'"  
					Rs.open sql,conn,1,1
					UsersName=Rs("UsersName")
					baoyue=Rs("UsersType")
					Rs.close
					Set Rs=Nothing%>
                 <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                   <tr>
                     <td><table cellspacing="10" cellpadding="0" width="100%" align="center" border="0">
                       <tbody>
                         <tr>
                           <td align="right" width="26%" height="20">我的帐号：</td>
                           <td align="left" colspan="2"><%=UsersName%></td>
                         </tr>
                         <tr>
                           <td align="right" height="20">推广记录：</td>
                           <td align="left" colspan="2" height="20">
						   <%Set Rs = server.CreateObject(YWNT_TMS_RS)
						   sql="select count(ID) from YWNT_TMS_UsersPromotion where UsersID='"&UsersName&"'"
							Rs.open sql,conn,1,1
							response.Write(Rs(0))
							Rs.close
							set Rs=nothing%></td>
                         </tr>
                         <tr>
                           <td align="right" height="20">推广连接： </td>
                           <td width="54%" height="20"><input id=url readonly size=40 value="<%=GetConfig("Weburl")%>/Users/Users_Promotion.asp?Action=UsersTg&UsersID=<%=UsersName%>" name=url>
					 <SCRIPT language=JScript type=text/jscript>
						var obj=document.getElementById("url");
						function copyUrl(){
							if (obj) { 								
							obj.select();
							js=obj.createTextRange();
							js.execCommand("Copy");
							alert("地址已经复制，您可以将它粘贴到任何位置了，如QQ、BBS、聊天室等。");
							}
						}
					</SCRIPT></td>
                           <td width="20%"><img alt=复制本页地址 style="CURSOR: hand" onclick=jscript:copyUrl(); height="24" src="images/b_url.gif" width="75" /></td>
                         </tr>
                         <tr>
                           <td height="20" colspan="3" class="STYLE1"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                             <tr>
                               <td width="14%">&nbsp;</td>
                               <td width="86%"><font color="#FF9900">
通过QQ，EMAIL，WEB，BBS等方式发送此此网址，当有人通过此连接访问本站时，系统会自动为您增加IP记录数，本系统使用了IP筛选，所以作弊是没有用的，甚至会物及必反。每推荐一个系统将自动为您加入<font color=red><%if baoyue=1 then%><%=GetUsersSystem("UsersPromotionDate")%>天包月<%else%><%=GetUsersSystem("UsersPromotionCoin")%>点影币<%end if%></font>。</font></td>
                             </tr>
                           </table></td>
                         </tr>
                       </tbody>
                     </table>
<%end sub
sub UsersTg()				 
UsersID=request.QueryString("UsersID")
if len(trim(UsersID))=0 then response.Redirect("../index.asp")
conn.execute "delete from YWNT_TMS_UsersPromotion WHERE datediff("&DayStr&",UsersDate,"&SqlNow&")>1"
Set Rs = server.CreateObject(YWNT_TMS_RS)
sql="select UsersDate from YWNT_TMS_UsersPromotion where UsersID='"&UsersID&"' and UsersIP='"&UsersIP()&"'"  
Rs.open sql,conn,1,1
if not rs.eof then
if datediff("d",now(),RS("UsersDate"))=0 then response.Redirect("../index.asp")
end if
Rs.close
Set Rs=Nothing

conn.Execute("insert into YWNT_TMS_UsersPromotion (UsersID,UsersIP,UsersDate)values('"&UsersID&"','"&UsersIP()&"',"&SqlNow&")")
Set Rs = server.CreateObject(YWNT_TMS_RS)
sql="select UsersType,UsersCoin,UsersCoinDate from YWNT_TMS_Users where UsersName='"&UsersID&"'"  
Rs.open sql,conn,1,1
baoyue=Rs("UsersType")
UsersCoin=Rs("UsersCoin")
UsersCoinDate=Rs("UsersCoinDate")
Rs.close
Set Rs=Nothing

	if baoyue=1 then
        if UsersCoinDate-now()<1 then
        sql="update YWNT_TMS_Users set UsersCoinDate=DateAdd("&DayStr&","&GetUsersSystem("UsersPromotionDate")&","&SqlNow&") where UsersName='"&UsersID&"'"
        else
		sql="update YWNT_TMS_Users set UsersCoinDate=DateAdd("&DayStr&","&GetUsersSystem("UsersPromotionDate")&",'"&UsersCoinDate&"') where UsersName='"&UsersID&"'"
        end if
	else
		sql="update YWNT_TMS_Users set UsersCoin=UsersCoin+'"&GetUsersSystem("UsersPromotionCoin")&"' where UsersName='"&UsersID&"'"
	end if		
	conn.Execute(sql)
response.Redirect("../index.asp")	
					 end sub%>
                     <br>
              </table></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
   </table>
<%call connclose()%>
</body>
</html>
