<%@ LANGUAGE=VBScript codepage ="936" %>
<!--#include file="../sjfunc/sjfunc.asp"-->
<%'轻功暂存
Response.Expires=0
Response.ExpiresAbsolute = Now() - 1
Response.AddHeader "Pragma","No-Cache"
Response.AddHeader "Cache-Control","Private"
Response.CacheControl = "No-Cache"
if Instr(LCase(Application("zhbg_useronlinename"&nowinroom)),LCase(" "&zhbg_name&" "))=0 then 
	Session("zhbg_inthechat")="0" 
	Response.Redirect "chaterr.asp?id=001" 
end if 
towho=Trim(Request.Form("towho"))
towhoway=Request.Form("towhoway")
saycolor=Request.Form("saycolor")
addwordcolor=Request.Form("addwordcolor")
addsays=Request.Form("addsays")
says=Trim(Request.Form("sy"))
call dianzan(towho)
if len(says)>150 then says=Left(says,150)
says=lcase(says)
says=Replace(says,"&amp;","&")
if zhbg_grade<9 then
says=bdsays(says)
end if
act=1
towhoway=0
i=instr(says,"$")
fnn1=mid(says,i+1)
says="<font color=green>【轻功暂存】<font color=" & saycolor & ">"+keep(mid(says,i+1))+"</font>"
towhoway=1
towho=zhbg_name
call chatsay(act,towhoway,towho,saycolor,addwordcolor,addsays,says)
'轻功暂存
function keep(fn1)
Set rs=Server.CreateObject("ADODB.RecordSet")
Set Conn=Server.CreateObject("ADODB.Connection")
conn.open Application("zhbg_usermdb")
rs.open "select 轻功加,结算日期,轻功 from 用户 where 姓名='" & zhbg_name &"'",conn,2,2
bankmoney=rs("轻功加")
lastdate=date()-rs("结算日期")
money=rs("轻功")
newbankmoney=int(bankmoney+bankmoney*0.0001*lastdate)
fn1=abs(fn1)
if fn1<=0 then
	if bankmoney=<0 then
		keep="##你在轻功存放并没有轻功,轻功每天利息为:0.0001%,欢迎存放!"
	else
		keep="##在轻功库存有:"& bankmoney &"点,在:"& rs("结算日期") &"存入,按0.0001%利,轻功库现在有:"& newbankmoney &"点轻功!"
	end if
	rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
	exit function
end if
if money<fn1 then
	Response.Write "<script language=JavaScript>{alert('你哪里有那么多的轻功啊？？');}</script>"
	rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
	Response.End
end if
keep="##在轻功宝塔里放入了:"& fn1 &"点轻功,轻功宝塔现存有轻功点:"& newbankmoney+fn1 &"点,继续存啊，保险啊!"
conn.execute "update 用户 set 轻功=轻功-"  & fn1 & ",轻功加="& newbankmoney+fn1 &",结算日期=date() where 姓名='" & zhbg_name &"'"

rs.close
set rs=nothing	
conn.close
set conn=nothing
end function
%>
