📄 room.asp
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<%Response.Expires=0%>
<!--#include file="conn.asp"-->
<!--#include file="adovbs.inc" --->
<%Dim bottom,class1
class1=Session("class")
if class1<10 then Response.Write "没有权限" : Response.end
bottom=Request.Form("username")
if len(username)>10 then
Response.Write "没有记录" : Response.end
end if
Const NumPerPage = 15 '设置你一页要显示多少记录
Dim CurPage '取得当前所在页
If Request.QueryString("CurPage") = "" then
CurPage = 1
Else
CurPage = Request.QueryString("CurPage")
End If
'设置游标属性
conn.CursorLocation = adUseClient
'设置缓存大小 = 每页需显示的记录数目
conn.CacheSize = NumPerPage
Dim strSQL
strSQL = "select * from room"
set rs=conn.execute(strSQL)
if rs.eof then
Response.Write "<title></title>"
Response.write "<br><br><br><br><br><p align='center'>没有房间信息 <font color=red>"& username &"</font></p>"
Response.write "<p align='center'><a href='javascript:history.go(-1);'>点这里返回</a><BR><br></p></body>"
Response.end
end if
rs.MoveFirst
rs.PageSize = NumPerPage
'计算最多有多少页
Dim TotalPages,recdcount
TotalPages = rs.PageCount
recdcount= rs.recordcount
rs.AbsolutePage = CurPage
Dim count
%>
<html>
<head>
<title>在线用户管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {font-size : 9pt;}
td {font-size : 9pt;}
.p9 {font-size: 9pt;}
A {color:#blue;text-decoration : none;}
A:Hover {color:red;text-decoration:none;}
A:Active {color:black}
-->
</style>
</head>
<body oncontextmenu=self.event.returnValue=false bgcolor="#FFFFFF" topMargin=20>
<form name=modyroom method="POST" action="Roomodify.asp">
<table border="0" cellspacing="2" cellpadding="1" bgcolor="FFeeFF" align="center">
<tr>
<td align=center>当前开设 <font color=red><%=recdcount%></font> 个房间 每页显示 15 个房间 共 <font color=red><%=TotalPages%></font> 页
</td>
</tr>
<tr>
<td align=center>
<%if CurPage=1 then
Response.Write("<font color=666666>[上一页</font>")
else
Response.Write("[<a href=room.asp?curpage=" &CurPage-1& ">上一页</a>")
end if
if CurPage=Cstr(TotalPages) then
Response.Write("<font color=666666> 下一页</font>")
else
Response.Write(" <a href=room.asp?curpage=" &CurPage+1& ">下一页</a>")
end if%>
<a href=javascript:history.go(0) title=刷新本页>第<%=CurPage%>页]</a>
</td></tr>
</table>
<hr noshade size="1" color=009900>
<TABLE bgcolor="#a0a0a0" border="0" cellpadding="2" cellspacing="1" align=center width="98%">
<tr>
<td width=180>
<input maxLength="50" name="RoomName" size="10" class="p9" tabIndex="1" style="width: 170; background-color: #FAFCEF; border: 1 solid #20663B">
</td>
<td width=120>
<input type="submit" value="修改房间信息" name="Option" style="background-color: FFCCFF">
</td><td width=80>
<input type="submit" value="删除房间" name="Option" style="background-color: FFCCFF">
</td><td>
<input type="submit" value="增加房间" name="Option" style="background-color: FFCCFF">
</td>
</tr>
</table>
<TABLE bgcolor="#a0a0a0" border="0" cellpadding="2" cellspacing="1" align=center width="98%">
<tr bgcolor="#66FFCC">
<td width='3%' align="center">ID</td>
<td width='10%'>房间名称</td>
<td width='5%' align="center">最大在线人数</td>
<td width='5%' align="center">级别限制</td>
<td width='8%'>管理员</td>
<td width='20%'>房间欢迎词</td>
<td width='5%' align="center">房间属性</td>
</tr>
<% DIM Croom
Croom=1
Do While Not rs.EOF And Croom < rs.PageSize
Response.Write("<tr bgColor=#f0f0f0><td align=center>" & Croom & "</td>")
Response.Write("<td bgcolor=#F8F8F8><a href='#' onClick=javascript:RoomName.value='"& rs("RName") &"'><font color=#CC00FF>" & rs("RName") & "</font></a></td>")
Response.Write("<td align=center>" & rs("MaxUser") & "</td>")
Response.Write("<td align=center>" & rs("Grade") & "</td>")
Response.Write("<td>" & rs("Admin") & "</td>")
Response.Write("<td>" &rs("Rsub") & " </td>")
Response.Write("<td align=center>" &rs("Hide") & "</td></tr>")
Croom=Croom+1
rs.MoveNext
Loop
rs.Close%>
</table></form>
</body><html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -