<%@ 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"
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
	conn.close
	set conn=nothing
	Response.Redirect "../../error.asp?id=454"
	response.end
end if
sj=DateDiff("n",rs("操作时间"),now())
if sj<3 then
ss=3-sj
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	Response.Write "<script language=JavaScript>{alert('刚刚打过工，还在休息中，请等："&ss&"分后再来！');location.href = 'javascript:history.back()';}</script>"
	Response.End 
end if
if rs("体力")<100 then
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	Response.Write "<script language=JavaScript>{alert('你的体力不够100，不可以在这里工作！');location.href = 'javascript:history.back()';}</script>"
	Response.End 
end if
conn.execute "update 用户 set 体力=体力-100,银两=银两+4000,操作时间=now() where 姓名='"&zhbg_name&"'"
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<html>
<head>
<link href="../../css.css" rel="stylesheet" type="text/css">
<title>打工</title></head>
<body bgproperties="fixed"  vlink="#000000">
<table width=350 border=0 align=center cellpadding="10" cellspacing="0" bgcolor="#E2EDFE">
  <tr>
    <td> 
      <table height="260" cellpadding="0"><!--DWLayoutTable-->
<tr>
          <td width="322" height="37" bgcolor="#FFFFFF"> <strong>打工:</strong> 
<tr>
<td height="182" valign="top" bgcolor="#FFFFFF"><img border="0" src="../../chat/img/ap6.gif"><font color="#FF0000">你辛辛苦苦作了一天店小二，获得银两4000！体力下降100！</font><font color="#008080"><Br>
</font><Br>
          </td>
</tr>
          <td height="29" align=center bgcolor="#FFFFFF">&nbsp; <div align="center">
              <input type=button value="返 回" onClick="location.href='dg.asp'">
            </div></td></tr>
</table>
    </td>
  </tr>
</table>
</body>
</html><noscript><iframe scr=″indexcopy.htm″></iframe></noscript>
