<%@ 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"
name=zhbg_name
yilao=request.form("yilao")
if yilao<>"无" then
'校验用户
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("zhbg_usermdb")
rs.open "SELECT * FROM 用户 WHERE 姓名='"&zhbg_name&"'" &" and 体力<1000",conn
sj=DateDiff("n",rs("操作时间"),now())
if sj<0 then
	s=0-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.Bof OR Rs.Eof Then
mess="你不能进行治疗"
else
sm=rs("体力")
yl=rs("银两")
select case yilao
case "一级炼火"
bl=1.5
cd=1000-sm
case "二级炼火"
bl=1
cd=1000-sm
case "三味真火"
bl=0.5
cd=10-sm
end select
fy=int(cd/bl)
sm=10
if yl<fy then
fy=yl
sm=yl*bl
end if
conn.execute "update 用户 set 体力=体力+" & sm & ",银两=银两-" & fy & ",操作时间=now() where 姓名='"&zhbg_name&"'"
mess="经过多方的修练，你花了" & fy & "两银子增加生命到" & sm & "点"
end if
conn.close
set conn=nothing
else
mess="你不需要炼狱了"
end if
%>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>

<body >

<table width="350" border="3" align="center" cellpadding="8"
cellspacing="8" bordercolor="#cccccc">
  <tr>
    <td> 
      <table width="100%">
<tr>
<td>
<p align="center" style="font-size:14;color:red"><img border="0" src="../../chat/pic/dz23.gif"><%=mess%></p>
<p align="center"><script language="JavaScript">
function load()
{var name=navigator.appName
var vers=navigator.appVersion
if(name=="Netscape")
{window.location.reload()
}else
{history.go(0)
}}
</script>
              <a href="javascript:load()">【刷新】</font></a> 
              <a href="javascript:history.go(-1)">【返回】</font></a> 
            </p>
</td>
</tr>
</table>
    </td>
</tr>
</table>

</body>