<!--#include file="sub/conn.asp"-->
<!--#include file="sub/fun.asp"-->
<!--#include file="inc/UpiConfig.asp"--><!--恒浪整合配置文件-->
<%


chkpostfrom
dim rsusername,b_hour,b,grade,username
IF not isnull(request.Cookies("yzlove")("username")) and trim(request.Cookies("yzlove")("username"))<>"" THEN
'在线人数更新
	set rs=Server.CreateObject("ADODB.recordset")
	rs.open"select username from love_online where username='"&request.Cookies("yzlove")("username")&"'",conn,1,1
		if not rs.bof and not rs.eof then
			conn.execute("delete from love_online where username='"&rs("username")&"'")'删除在线名单
		end if
	rs.close:set rs=nothing
	'结算经验值(泡时间)
	set rs=Server.CreateObject("ADODB.recordset")'查询用户最后登录时间
	rs.open"select username,endtime,loveb,grade from love_main where username='"&request.Cookies("yzlove")("username")&"' and password='"&request.Cookies("yzlove")("password")&"'",conn,1,1
	If rs.bof and rs.eof then'''''''''''''''''''
		rs.close:set rs=nothing:closeconn'''''''''是否非法''''''''''
		response.redirect "login.asp"'''''''''''''''''''
	Else
		username=rs("username")
		b=rs("loveb")
		grade=rs("grade")
		b_hour=clng(datediff("s",rs("endtime"),now()))\60
		If session("yzloveloginout")="" Then''''''''''''''''''''''''''''''''''''''''''''''''''''session
			If int(grade)=2 or int(grade)=3 Then '诚信会员或管理员
				if b_hour>0 then'时间差>1分钟
					b=b+b_hour*2 '200%
					conn.execute "update love_main set loveb='"&b&"',alltime=alltime+"&b_hour&" where username='"&username&"'" '更新主表love币总数和经验值
					call loveb_add(username,b_hour*2,"诚信会员以上级别在线泡币结算200%") '添加币历使记录,在fun.asp中
					session("yzloveloginout")="ok"
           		end if
			Elseif grade=1 and grade<>10 then'普通会员
				if b_hour>0 then'如果时间差在1分钟以上2
					b=b+b_hour '100%
					conn.execute "update love_main set loveb='"&b&"',alltime=alltime+"&b_hour&" where username='"&username&"'" '更新主表love币总数和经验值
					call loveb_add(username,b_hour,"普通会员在线泡币结算") '添加币历使记录
					session("yzloveloginout")="ok"
				end if
			End If
		End If
	End If
	rs.close:set rs=nothing
	session("yzloveloginout")="ok"''''''''''''''''''''''''''''''''''''''''''''''''''''session
	Response.Cookies("yzlove")("username") = ""
	Response.Cookies("yzlove")("password") = ""
	Response.Cookies("yzlove")("sex") = ""
	Response.Cookies("yzlove")("grade") = 0
	Response.Cookies("yzlove")("usercookies")= 0
Else
	session("yzloveloginout")="ok"''''''''''''''''''''''''''''''''''''''''''''''''''''session
	Response.Cookies("yzlove")("username") = ""
	Response.Cookies("yzlove")("password") = ""
	closeconn'''''''''是否非法''''''''''
	response.redirect "login.asp"'''''''''''''''''''
END IF
'Response.Cookies("yzlove").path=cookiepath
closeconn
'//==恒浪整合退出开始==By Howave.Net & SeaShell 2007/05/10==
 Howave_Logout
'//==恒浪整合退出结束====
response.redirect("./")
%>
