<%@ LANGUAGE=VBScript%>
<%Response.Expires=0
Response.ExpiresAbsolute = Now() - 1
Response.AddHeader "Pragma","No-Cache"
Response.AddHeader "Cache-Control","Private"
Response.CacheControl = "No-Cache"
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 Instr(LCase(Application("zhbg_useronlinename"&session("nowinroom")))," "&LCase(zhbg_name)&" ")=0 then
	Response.Write "<script Language=Javascript>alert('你不能进行操作，进行此操作必须进入聊天室！');location.href = 'javascript:history.go(-1)';</script>"
	Response.End
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
if rs("银两")<100 then
rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
Response.Write "<script language=JavaScript>{alert('请交1000两开垦荒地的费用！');window.close();}</script>"
Response.End
end if
if rs("体力")<1000 then
rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
Response.Write "<script language=JavaScript>{alert('体力不够呀！去买些药补补吧..');window.close();}</script>"
Response.End
end if
conn.execute "update 用户 set 银两=银两-100 where 姓名='"& zhbg_name &"'"
conn.execute "update 用户 set 体力=体力-50 where 姓名='"& zhbg_name &"'"
rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
says="<font color=#ff0000>【种花消息】</font>"& zhbg_name &"用了100两银子开垦了一片荒地开始种花了，虽然体力下降了50点，但是花香可以与爱人分享，真是人生一大快事!"			'聊天数据
says=replace(says,"'","\'")
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
Response.Redirect "huayuan.asp"
%>