<% @LANGUAGE="VBSCRIPT" CODEPAGE="65001" %>
<!--#include file="../inc.asp"-->
<!--#include file="../ydzq.asp"-->
<!--#INCLUDE file="conn1.asp"-->

<%call head()
call saycardd("张三客栈")
wpid=request("wid")

ids=session("id")
%>
<%
if wpid="1" then
tstl="5"
msg1="喝酒"
yname="你喝了一碗酒"
xyyz="50"
else
xyyz="100"
tstl="10"
msg1="住客店"
yname="你在客店住了一晚"
end if
Server.ScriptTimeout=999
set rs=Server.CreateObject("ADODB.Recordset")
strsQL="select yz from wupin where cstr(ids)='"&myid& "'"
rs.open strsQL,liao,1,1
if clng(xyyz)>rs("yz") then
msg="您不够银两"&msg1&"了！快去赚一点吧，坐食山空啊！"
else
set rs8=Server.CreateObject("ADODB.Recordset")
strsQL="select xue,tl from sx where cstr(ids)='"&myid& "'"
rs8.open strsQL,liao,1,1
myjy=rs8("xue")
mytl=rs8("tl")
 rs8.Close
	Set rs8=Nothing
if mytl=myjy then
msg="您的身体已经够棒了，不能再"&msg1&"了，快去干点活吧！"
elseif clng(tstl+mytl)>=clng(myjy) then
sql="update sx set tl="&myjy&" where cstr(ids)="&myid
  liao.Execute(sql)
sql="update wupin set yz=yz-"&xyyz&" where cstr(ids)="&myid
  liao.Execute(sql)
msg=""&yname&"后,身体完全恢复了."
else
sql="update sx set tl=tl+"&tstl&" where cstr(ids)="&myid
  liao.Execute(sql)
sql="update wupin set yz=yz-"&xyyz&" where cstr(ids)="&myid
  liao.Execute(sql)
msg=""&yname&"后,身体感觉好多了,体力提升"&tstl&".<br/><a href='ke2.asp?wid="&wpid&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>继续"&msg1&"</a>"
END IF
end if
Response.Write ""&msg&"<br/>=========<br/>"
 rs.Close
	Set rs=Nothing
     liao.Close
      Set liao=Nothing
%>
<a href="index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>">[我的江湖]</a><br/>
<a href="/bbs/index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>">[社区首页]</a><br/>
<%call head1()%>