<!--#include file="conn/conn.asp"-->
<!--#include file="conn/nosql.asp"-->
<!--#include file="conn/config.asp"-->
<!--#include file="conn/md5.asp"-->
<%
url=Request.ServerVariables("HTTP_REFERER") 
if url="http://www.snsn.net/login.asp" then
url="http://www.snsn.net/index.asp"
end if
if Not ChkPosturl then response.redirect ("login.asp")
Response.Expires = 0
Response.AddHeader "Pragma", "no-cache"
Response.AddHeader "cache-control", "no-store"

if Cint(request("Verifycode"))<>Session("Verifycode") then
if request.form("Verifycode")="" then
response.write""
else
response.write "<script language='javascript'>"
response.write "alert('错误:验证码错误，请重新输入！');"
response.write"this.location.href='"&url&"'</SCRIPT>"
response.end
end if
else
dim UsernameGet,PasswordGet
UsernameGet=nosql(Request("UsernameGet"))
youname=nosql(Request("youname"))
PasswordGet=md5(nosql(Request("PasswordGet")))
if UsernameGet<>"" and PasswordGet<>"" then
sql="select * from snsn_user where [Username]='"&UsernameGet&"' and Pass='"&PasswordGet&"' "
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,3
if rs.eof then
response.write "<script language='javascript'>"
response.write "alert('错误:会员登录名或密码错误,刚才输入的会员名:"&Request("UsernameGet")&",密码是:"&Request("PasswordGet")&",请核对！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
else 
set rs1=conn.execute("select * from snsn_zy where zy='"&rs("zy")&"' and dj="&rs("dj")&" or zy='"&rs("zy")&"' and dj="&rs("dj")+1&" order by dj")

'登陆给自己加分

set rs_ctj=conn.execute("select * from [snsn_user] where datediff(d,getdate(),logindate)=0 and id="&rs("id")&"")
if rs_ctj.eof then
rs("jifen")=rs("jifen")+rs1("jiafen")
end if
rs("logindate")=now()'登录时间

if isnumeric(rs("mini_jg")) then
jgjgjg=rs("mini_jg")
else
jgjgjg=0
end if
if rs("jifen")+jgjgjg>=rs1("jifen") then'升级叛断
rs("dj")=rs("dj")+1
rs1.movenext
end if


'推荐人数转换成分，并清空tjr ，累积ztjr
rs("jifen")=rs("jifen")+rs("tjr")*tjr_qian
rs("ztjr")=rs("ztjr")+rs("tjr")
rs("tjr")=0

rs.update



'养花升级////////////////////////////////////

Set hua= Server.CreateObject("ADODB.Recordset") 
hua.open "select * from snsn_hua where userid="&rs("id"),conn,1,3
if not hua.eof then 

'各项参数都到达多少时才继续升级
if hua("yg")=hua("max1") and hua("yy")=hua("max1") and hua("yl")=hua("max1")  and hua("ax")=hua("max1") then
hua("max1")=hua("max1")+200
hua.update
end if

'花升级
huaf=hua("yg")+hua("yl")+hua("ax")+hua("yy") 

if  hua("huadj")=1 and huaf>99 then
hua("huadj")=2
end if
if  hua("huadj")=2 and huaf>300 then
hua("huadj")=3
end if
if  hua("huadj")=3 and huaf>600 then
hua("huadj")=4
end if
if  hua("huadj")=4 and huaf>799 then
hua("huadj")=5
end if
hua.update


'花匠升级
if hua("userdj")=1  and hua("huaclass")=1 and hua("huadj")=5 then
 hua("userdj")=2
end if
if hua("userdj")=2  and hua("huaclass")=2 and hua("huadj")=5 then
 hua("userdj")=3
end if
if hua("userdj")=3  and hua("huaclass")=3 and hua("huadj")=5 then
 hua("userdj")=4
end if
if hua("userdj")=4  and hua("huaclass")=4 and hua("huadj")=5 then
hua("userdj")=5
end if
hua.update
end if

'end 养花升级////////////////////////////////////
'修改每次隐身值
conn.execute("update [snsn_user] set cz='1' where id="&rs("id")&"")
session("ys")=1

'将用户资料记录到各自的Session变量中去

session("id")=rs("id")
session("user")=rs("username")
session("Email")=rs("Email")
session("name")=rs("name")
session("ch")=rs("ch")
session("uflag")=rs("uflag")
session("jifen")=rs("jifen")
if rs("mini_sl")="" then
session("mini_sl")=0
else
session("mini_sl")=rs("mini_sl")
end if
if rs("mini_jg")="" then
session("mini_jg")=0
else
session("mini_jg")=rs("mini_jg")
end if
session("jine")=rs("jine")
session("logindate")=now()
if rs("reg_ip")="" then
session("ip")="0.0.0.0"
else
session("ip")=rs("reg_ip")
end if
session("jifen_qian")=jfen_qian'积分银两比
session("djzy")=rs1("zy")'职业
session("djname")=rs1("djname")'等级名称
session("youhui")=rs1("youhui")'等级购物优惠
if youname="1" then
Response.Cookies("MyName")=rs("username")
Response.Cookies("MyName").Expires=date()+365
end if

ts1=1'提示的序号
tsstr=""'提示的内容
'VIP会员到期删除
if isnull(rs("vip")) or rs("vip")<1 then
else
'VIP到期提示
if datediff("d",rs("vipdate"),now())>=-3 and not(datediff("d",rs("vipdate"),now())>=0)  then
tsstr=tsstr&ts1&".您的VIP会员资格，将要到期将!请尽快续费!\n"
ts1=ts1+1
end if
if datediff("d",rs("vipdate"),now())>=0 then
tsstr=tsstr&ts1&".您的VIP会员资格，已经到期!请尽快续费!\n"
ts1=ts1+1
rs("vip")=0
rs("url")=1
rs.update
end if
end if
session("snsnvip")=rs("vip")
'结束VIP会员到期删除


'删除宣传到期会员
Set pr= Server.CreateObject("ADODB.Recordset") 
pr.open "select * from mini_pr where ts<=getdate()-adddate and userid="&session("id")&"",conn,1,3
if not pr.eof then
tsstr=tsstr&ts1&".您在宣传广场的宣传时间已经到期!\n"
ts1=ts1+1
conn.execute="delete from [mini_pr] where ts<=getdate()-adddate and userid="&session("id")&""
title="<b>系统通知:您在宣传广场的宣传时间已经到期</b>"
content="您好：<br>你在<a href=/love/pr.asp  target=_blank><b>宣传广场</b></a>中的宣传时间已经到期，系统已经将您从宣传广场中删除！<br>如果要继续宣传,请进行续费,<a href=""javascript:;"" onClick=""window.open('/love/action.asp','show','scrollbars=no,resizable=no,width=420,height=260,menubar=no,top=10,left=10')"" class=over><b>点击进行续费</b></a>！！！"
set rsxx=server.createobject("adodb.recordset")
sql="select * from snsn_getprice where (id is null)" 
rsxx.open sql,conn,1,3
rsxx.addnew
rsxx("title")=title
rsxx("content")=content
rsxx("sendemail")=0
rsxx("sendcontact")=0
rsxx("checkdate")=0
rsxx("mycid")=rs("id")
rsxx("sendcid")=1
rsxx("datetime")=now()
rsxx.update
rsxx.close
end if
pr.close
'结束会员宣传

	 
	'删除过期漂浮物	 
	  conn.execute="delete from [mini_flogood] where syqx<=getdate()-adddate and userid="&session("id")&""
	  set mini=conn.execute("select * from [mini_flogood] where syqx-datediff(d,adddate,getdate())<2 and userid="&session("id")&"")
	 if not mini.eof then 
	 tsstr=tsstr&ts1&".您当前使用的挂件或飘浮物品当中已经有到期商品，请尽快续费！\n"
	 ts1=ts1+1 	 
          end if
	 	mini.close
	  set mini=nothing
	 'end 删除过期漂浮物
	
	 
	 conn.execute="delete from [mini_flogood] where syqx<=getdate()-adddate and userid="&session("id")&""
	 conn.execute="delete from [mini_goods] where sydate<=getdate()-adddate and userid="&session("id")&""
	 set mini=conn.execute("select * from [mini_goods] where sydate-datediff(d,adddate,getdate())<2 and userid="&session("id")&"")
	 if not mini.eof then  
	 tsstr=tsstr&ts1&".您当前使用的家园物品当中已经有到期商品，请尽快续费！\n"
	 ts1=ts1+1 	    
     end if
	 mini.close
     set mini=nothing


end if
rs_ctj.close
set rs_ctj=nothing
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
end if
response.write "<script language='javascript'>"
if tsstr<>"" then
response.write "alert('我的助手提示:\n\n"&tsstr&"');"
end if
response.write"this.location.href='"&url&"';</SCRIPT>"
%>                 