📄 sheepdoctor.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="connsheep.asp"-->
<!--#include file="inc/const.asp"-->
<!-- #include file="inc/DvADChar.asp" -->
<%
Response.Buffer=True
Dvbbs.stats="兽医站"
Dvbbs.nav()
Dvbbs.Head_var 2,0,"",""
call doctor()
sub doctor()
username=dvbbs.membername
dim username,sheepname,typelife,typelifeup
username=dvbbs.membername
if username="" then
response.redirect"login.asp"
exit sub
end if
sheepname=request.form("sheepname")
if sheepname="" then
response.redirect"login.asp"
exit sub
end if
set rs=server.createobject("adodb.recordset")
rs.open"select * from sheep where sheepname='"&sheepname&"' and username='"&username&"'",conn1,1,1
dim sheeptype
sheeptype=rs("type")
dim uplife
rs.close
typelife=trim(request.form("typelife"))
typelifeup=trim(request.form("typelifeup"))
rs.open"select * from rules where type='"&sheeptype&"'",conn1,1,1
uplife=rs("uplife")
rs.close
rs.open "select userWealth from [dv_user] where username='"&username&"' and userWealth>="&uplife,conn,1,1
if rs.eof then
rs.close
errmsg=errmsg+("<li>兽医大怒,你的钱不够怎么给"&sheeptype&"治病!")
dvbbs.FoundIsChallenge=true
Dvbbs.ChkErr
exit sub
end if
if typelife=typelifeup and typelife="健康" then
conn.execute"update [dv_user] set userWealth=userWealth-"&uplife&" where username='"&username&"'"
%>
<script language="Vbscript">
msgbox"兽医一阵窃喜,这家伙真傻,健康良好的<%=sheeptype%>也带着来看病,反正不要白不要,拿起<%=uplife%>两银子就揣入腰包!",0,"提示"
history.back
</script>
<%
exit sub
end if
rs.close
rs.open"select * from sheep where sheepname='"&sheepname&"' and username='"&username&"'",conn1,1,1
if rs.bof then
rs.close
conn1.close
errmsg=errmsg+("<li>你不是这只"&sheeptype&"的主人,想带它治病恐怕是有心无力了。")
dvbbs.FoundIsChallenge=true
Dvbbs.ChkErr
exit sub
end if
rs.close
rs.open"select * from rules ",conn1,1,1
if rs.bof then
rs.close
conn1.close
errmsg=errmsg+("<li>哈哈,兽医找不到关于"&sheeptype&"的治疗手册,看来你的"&sheeptype&"没得治了,劝你还是回去哭一场罢了。")
dvbbs.FoundIsChallenge=true
Dvbbs.ChkErr
exit sub
end if
rs.close
dim tempuserWealth
rs.open"select userWealth from [dv_user] where username='"&username&"'",conn,1,1
tempuserWealth=rs("userWealth")-uplife
if tempuserWealth<0 then
%>
<script language="vbscript">
msgbox"生命由<%=typelife%>变为<%=typelifeup%>需要<%=uplife%>元,您没有足够的钱!先去工作赚点钱吧",0,"flush"
history.back
</script>
<%
rs.close
conn.close
exit sub
end if
rs.close
rs.open"select * from sheep where sheepname='"&sheepname&"' and username='"&username&"'",conn1,1,1
dim life
life=rs("life")+20
if life>100 then
life=100
end if
rs.close
conn1.execute"update sheep set life='"&life&"' where sheepname='"&sheepname&"' and username='"&username&"'"
conn.execute"update [dv_user] set userWealth=userWealth-"&uplife&" where username='"&username&"'"
%>
<script language="vbscript">
msgbox"通过兽医的精心治疗,您的[<%=sheepname%>]已经由[<%=typelife%>]变为[<%=typelifeup%>]!",0,"flush"
history.back
</script>
<%
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -