📄 sheepst.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="connsheep.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="sheepconfig.asp"-->
<!-- #include file="inc/DvADChar.asp" -->
<%
Dvbbs.stats="宠物排行榜"
Dvbbs.nav()
Dvbbs.Head_var 2,0,"",""
%>
<%
dim username
'username=request.cookies("aspsky")("username")
dim orders,ordername
dim id,sname,oname
dim currentpage,page_count,Pcount
dim totalrec,endpage
dim bbsnum,usernum
dim select1,select2,select3,select4,select5,select6,select7,select8
if request("action")="kill" then
call kill()
elseif request("action")="freez" then call freez()
else
currentPage=request("page")
if request("orders")="" then
orders=1
else
orders=request("orders")
end if
select case orders
case 1
orders=1
ordername="产量排队"
select1="selected"
case 2
orders=2
ordername="主人排队"
select2="selected"
case 3
orders=3
ordername="生日排队"
select3="selected"
case 4
orders=4
ordername="喂养日排队"
select3="selected"
case 7
orders=7
ordername="种类排队"
select7="selected"
case else
orders=1
ordername="产量排队"
select1="selected"
end select
Dvbbs.stats=Dvbbs.stats&"-=>"&ordername
call sheephead()
call main()
end if
dvbbs.footer
sub main()
%>
<table cellpadding=6 cellspacing=1 align=center class=tableborder1>
<form method=POST action=sheepst.asp>
<tr>
<td colspan=6 align=right class=tabletitle2>
</td>
<td colspan=6 align=right class=tabletitle2>
<select name=orders onchange='javascript:submit()'>
<option value=1 <%=select1%>>产量排队</option>
<option value=2 <%=select2%>>主人排队</option>
<option value=3 <%=select3%>>生日排队</option>
<option value=4 <%=select3%>>喂养日排队</option>
<option value=7 <%=select7%>>种类排队</option>
</select></td>
</tr></form>
<tr>
<th>主 人</th>
<th>宠物名</th>
<th>生 日</th>
<th>种 类</th>
<th>产量</th>
<th>喂养日期</th>
<th>健康状况</th>
<th>是否冬眠</th>
<th>操作</th>
<%
if currentpage="" then
currentpage=1
else
currentpage=clng(currentpage)
if err then
currentpage=1
err.clear
end if
end if
set rs=server.createobject("adodb.recordset")
select case orders
case 1
sql="select * from [sheep] order by milk desc,username "
case 2
sql="select * from [sheep] order by UserName desc,type "
case 3
sql="select * from [sheep] order by sheepdate desc,username,type "
case 4
sql="select * from [sheep] order by feeddate desc,username,type "
case 7
sql="select * from [sheep] order by type,username"
case else
sql="select * from [sheep] order by milk desc,username "
end select
rs.open sql,conn1,1
if rs.eof and rs.bof then
response.write "<tr><td colspan=9 class=tablebody1> 还没有任何用户购买宠物。</font></td></tr>"
else
if orders=9 then
totalrec=userNum
else
totalrec=rs.recordcount
end if
if totalrec mod 20=0 then
Pcount= totalrec \ 20
else
Pcount= totalrec \ 20+1
end if
RS.MoveFirst
if currentpage > Pcount then currentpage = Pcount
if currentpage<1 then currentpage=1
RS.Move (currentpage-1) * 20
page_count=0
do while not rs.eof and page_count < Clng(20)
dim health
if rs("life")>80 then
health="健康"
elseif rs("life")>60 then
health="良好"
elseif rs("life")>40 then
health="生病"
elseif rs("life")>20 then
health="病危"
else
health="病亡"
end if
dim freez
if rs("freez") then
freez="是"
else
freez="否"
end if
%>
<tr bgcolor=<%=dvbbs.Forum_info(4)%>>
<td class=tablebody1> <%=rs("UserName")%></a></td>
<td align=center class=tablebody1> <%=rs("sheepname")%></td>
<td align=center class=tablebody2><%=rs("sheepdate")%></td>
<td align=center class=tablebody1> <%=rs("type")%></td>
<td align=center class=tablebody2><%=rs("milk")%></td>
<td align=center class=tablebody1><%=rs("feeddate")%></td>
<td align=center class=tablebody1><%=health%></td>
<td align=center class=tablebody1><a href=sheepst.asp?action=freez&id=<%=rs("id")%>><%=freez%></td>
<td align=center class=tablebody2><a href=sheepst.asp?action=kill&id=<%=rs("id")%>>宰杀无主宠物</td>
</tr>
<%
page_count=page_count+1
rs.movenext
loop
end if
%>
</table>
<table border=0 cellpadding=0 cellspacing=3 width="<%=dvbbs.Forum_info(12)%>" align=center>
<tr><td valign=middle nowrap>
<font color=<%=dvbbs.Forum_info(13)%>>页次:<b><%=currentpage%></b>/<b><%=Pcount%></b>页
每页<b><%=20%></b> 总数<b><%=totalrec%></b></font></td>
<td valign=middle nowrap><font color=<%=dvbbs.Forum_info(13)%>><div align=right><p>分页:
<%
if currentpage > 4 then
response.write "<a href=""?page=1&orders="&orders&""">[1]</a> ..."
end if
if Pcount>currentpage+3 then
endpage=currentpage+3
else
endpage=Pcount
end if
for i=currentpage-3 to endpage
if not i<1 then
if i = clng(currentpage) then
response.write " <font color="&dvbbs.Forum_info(8)&">["&i&"]</font>"
else
response.write " <a href=""?page="&i&"&orders="&orders&""">["&i&"]</a>"
end if
end if
next
if currentpage+3 < Pcount then
response.write "... <a href=""?page="&Pcount&"&orders="&orders&""">["&Pcount&"]</a>"
end if
%>
</p></div></font></td></tr></table>
<%
rs.close
set rs=nothing
end sub
sub kill()
id=request("id")
if not dvbbs.master then
errmsg=errmsg+ "<li>农场保安拦在你的面前,说道:没有屠宰证就随便拿小动物来开刀,你是不是疯了?"
dvbbs.FoundIsChallenge=true
dvbbs_error()
exit sub
end if
if not IsNumeric(request("id")) or request("id")="" then
errmsg=errmsg+ "<li>请不要以翻越围墙的方式进入农场屠宰场,否则我们的狼狗会对你的安全不利。"
dvbbs.FoundIsChallenge=true
dvbbs_error()
exit sub
%>
<a href="sheepindex.asp"><font color=red>返回</font></a>
<%
end if
set rs=nothing
set rs=server.createobject("adodb.recordset")
rs.open"select * from [sheep] where id="&id,conn1,1,1
if rs.eof and rs.bof then
errmsg=errmsg+ "<li>请不要翻越围墙进入农场屠宰场,否则我们的狼狗会对你的安全不利。"
dvbbs.founderr=true
dvbbs_error()
exit sub
%>
<a href="sheepindex.asp"><font color=red>返回</font></a>
<%
end if
set rs=nothing
sql="select * from [sheep] where id="&id
set rs=server.createobject("adodb.recordset")
rs.open sql,conn1,1
content="屠宰无主宠物:"&rs("UserName")&"的"&rs("type")&rs("sheepname")
set rs=nothing
sql="delete from [sheep] where id="&id
conn1.Execute(sql)
call logs("农场","农场事务管理",dvbbs.membername)
sucmsg=sucmsg+"<br>"+"<li>您的操作信息已经记录在案"
call bank_suc("")
end sub
sub freez()
id=request("id")
if not dvbbs.master then
errmsg=errmsg+ "<li>农场保安拦在你的面前,说道:你以为你是谁呀,随便就拿动物往冬眠房塞,有没兽医资格证先?"
dvbbs.FoundIsChallenge=true
dvbbs_error()
exit sub
end if
if not IsNumeric(request("id")) or request("id")="" then
errmsg=errmsg+("<li>请不要以翻越围墙的方式进入农场屠宰场,否则我们的狼狗会对你的安全不利。")
dvbbs.FoundIsChallenge=true
Dvbbs_Error()
exit sub
%>
<a href="sheepindex.asp"><font color=red>返回</font></a>
<%
end if
set rs=nothing
set rs=server.createobject("adodb.recordset")
rs.open"select * from [sheep] where id="&id,conn1,1,1
if rs.eof and rs.bof then
errmsg=errmsg+("<li>请不要以翻越围墙的方式进入农场屠宰场,否则我们的狼狗会对你的安全不利。")
dvbbs.FoundIsChallenge=true
Dvbbs_error()
exit sub
%>
<a href="sheepindex.asp"><font color=red>返回</font></a>
<%
end if
set rs=nothing
sql="select * from [sheep] where id="&id
set rs=server.createobject("adodb.recordset")
rs.open sql,conn1,1
content="强制冬眠/解除冬眠:"&rs("UserName")&"的"&rs("type")&rs("sheepname")
call logs("农场","农场事务管理",dvbbs.membername)
conn1.execute"update [sheep] set freez=not(freez) where id="&id
sucmsg=sucmsg+"<br>"+"<li>您的操作信息已经记录在案"
call bank_suc("")
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -