<%@ LANGUAGE=VBScript codepage ="936" %>
<!--#include file="func.ASP"-->
<%Response.Buffer=true
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = 0

zhbg_name=Session("zhbg_name")
zhbg_grade=Session("zhbg_grade")
zhbg_jhdj=Session("zhbg_jhdj")
nowinroom=session("nowinroom")
if zhbg_name="" then Response.Redirect "../../error.asp?id=440"
if zhbg_jhdj<35 then
	Response.Write "<script language=JavaScript>{alert('提示：领取存点需要35级才可以操作！');}</script>"
	Response.End
end if
temp=int(abs(clng(Application("zhbg_zdff3"))))
if temp<>tl then
	Response.Write "<script Language=Javascript>alert('提示：滚，你想搞什么，按回车键不行了!');</script>"
	response.end
end if
zzfff=Application("zhbg_zzfafang3")
if zzfff="" then
	Response.Write "<script language=JavaScript>{alert('【非凡国度】提示：目前没有站长发放。');}</script>"
	Response.End 
end if
fffdata=split(zzfff,"|")
randomize timer
ffsl=int(rnd()*1000000)+123
ffsj=fffdata(1)
erase fffdata
nowsj=DateDiff("s",ffsj,now())
if nowsj>=60 then
        Application.Lock
	Application("zhbg_zzfafang3")=""
        Application.UnLock
	Response.Write "<script language=JavaScript>{alert('【非凡国度】提示：站长发放有效时间60秒，过期作废。');}</script>"
	Response.End
end if
name=zhbg_name
myip=Request.ServerVariables("REMOTE_ADDR")
if application("zhbg_zzffjl3")<>"" then
	ff=split(application("zhbg_zzffjl3"),";")
	jsq=ubound(ff)-1
	for i=0 to jsq
		fsz=split(ff(i),"|")
		if fsz(0)=zhbg_name and clng(fsz(1))=hour(time()) then
			erase fsz
			erase ff
			Response.Write "<script language=JavaScript>{alert('【非凡国度】提示：你已经领过存点了还来领呀？');}</script>"
			Response.End
		end if
		if clng(fsz(1))=hour(time()) and fsz(2)=myip then
			erase fsz
			erase ff
			Response.Write "<script language=JavaScript>{alert('【非凡国度】提示：对不起，同一IP只能领取一次存点。');}</script>"
			Response.End
		end if
		erase fsz
	next
	erase ff
end if
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("zhbg_usermdb")
rs.open "select 操作时间 from 用户 where 姓名='"&zhbg_name&"'",conn,2,2
s=Hour(time())
f=Minute(time())
m=Second(time())
if len(s)=1 then s="0" & s
if len(f)=1 then f="0" & f
if len(m)=1 then m="0" & m
xianzaisj=s & ":" & f & ":" & m
tt="<font class=t>(" & xianzaisj & ")</font>"
woczsj=DateDiff("s",rs("操作时间"),now())
if  woczsj<0 then
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	Response.Write "<script Language=Javascript>alert('【非凡国度】提示：["&zhbg_name &"]你刚才领过发放了，不能再要了！');window.close();</script>"
	response.end
end if
newjl=application("zhbg_zzffjl3")&zhbg_name&"|"&hour(time())&"|"&myip&";"
application.lock()
application("zhbg_zzffjl3")=newjl
application.unlock()
fffff="<font color=green>【领取存点】</font><font color=red>"&zhbg_name&"</font>领到了非凡国度发放的<font color=red><b>"&ffsl&"银两，一个小时领一次，感觉站长好好哦！</b></font>！"&tt
conn.execute "update 用户 set 银两=银两+"&ffsl&",操作时间=now()+(31/86400) where 姓名='"&zhbg_name&"'"
conn.close
set conn=nothing
says=fffff
says=replace(says,chr(39),"\'")
says=replace(says,chr(34),"\"&chr(34))
act="消息"
towhoway=0
towho="大家"
addwordcolor="660099"
saycolor="008888"
addsays="对"
saystr="<script>parent.sh("& chr(39) & addwordcolor & chr(39) &","& chr(39) & saycolor & chr(39) &","& chr(39) & act & chr(39) &","& chr(39) & zhbg_name & chr(39) &","& chr(39) & addsays & chr(39) &","& chr(39) & towho & chr(39) &"," & chr(39) & says & chr(39) &"," & towhoway &  ","& nowinroom & ");<"&"/script>"
addmsg saystr
Function Yushu(a)
	Yushu=(a and 31)
End Function
Sub AddMsg(Str)
Application.Lock()
Application("SayCount")=Application("SayCount")+1
i="SayStr"&YuShu(Application("SayCount"))
Application(i)=Str
Application.UnLock()
End Sub
%>