<%@ 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<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.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=1000-sm
end select
fy=int(cd/bl)
sm=1000
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><link href="../../css.CSS" rel="stylesheet" type="text/css">

</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"><a href="YILAO.ASP">返回</a></p>
</td>
</tr>
</table>
</td>
</tr>
</table>

</body>
