<%@ LANGUAGE=VBScript codepage ="936" %>
<%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")
if zhbg_name="" then Response.Redirect "../../error.asp?id=440"


%>
<body   >
<%my=zhbg_name
money=abs(request.form("money"))
if money<>10000 and  money<>50000 and money<>100000 and money<>200000 then 
	Response.Write "<script Language=Javascript>alert('你想作什么？！');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.eof or rs.bof then
	rs.close
	set rs=nothing
	coon.close
	set conn=nothing
	Response.Redirect "../error.asp?id=210"
	response.end
end if
sj=DateDiff("n",rs("操作时间"),now())
if sj<10 then
	s=10-sj
	rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
	Response.Write "<script language=JavaScript>{alert('对不起系统限制，请等["&s&"分钟]再操作！');}</script>"
	Response.End
end if	
if rs("银两")<money then
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	Response.Write "<script Language=Javascript>alert('你没有钱呀，你想作什么？！');javascript:history.go(-1);</script>"
	response.end
end if
conn.execute "update 用户 set 防御=防御+"&int(money/1000)&",银两=银两-"& money &",操作时间=now() where 姓名='"&zhbg_name&"'"
Response.Write "<script Language=Javascript>alert('您向“武馆”捐献了"& money &"两，防御上涨"&int(money/1000)&"点！');javascript:history.go(-1);</script>"
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
