⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sort.asp

📁 柠檬树聊天服务器
💻 ASP
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<%Response.Expires=0%>
<!--#include file="conn.asp"-->
<!--#include file="adovbs.inc" --->

 <%Dim username,class1,orderby
class1=Session("class")
 if class1="" then Response.Write "没有权限" : Response.end

 orderby = Request.QueryString("order")
 if orderby = "" then
    orderby="score"
 end if

 username=Request.Form("username")
 if len(username)>16 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 recdcount

    Dim strSQL
	strSQL = "select count(*) as f1 from Chatuser"
	set rs=conn.execute(strSQL)

    recdcount= rs("f1")
	rs.Close

     if username<>"" then
        strSQL = "select * from Chatuser where username='"&username&"' order by score DESC"
     else
        strSQL = "select top 200 * from Chatuser order by "&orderby&" DESC"
     end if

     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

    '计算最多有多少页
    
    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 method="post" action="sort.asp">
<table border="0" cellspacing="2" cellpadding="1" bgcolor="F6FeF6" align="center" width="98%">
<tr>
<td align=center>共 <font color=red><%=recdcount%></font> 位注册用户 每页 15 条记录 
</td>
</tr>
<tr>
<td align=center>
<%if CurPage=1 then
Response.Write("<font color=666666>[上一页</font>")
else
Response.Write("[<a href=Sort.asp?curpage=" &CurPage-1& ">上一页</a>")
end if

if CurPage=Cstr(TotalPages) then
Response.Write("<font color=666666> 下一页</font>")
else
Response.Write(" <a href=Sort.asp?curpage=" &CurPage+1& ">下一页</a>")
end if%>
 <a href=javascript:history.go(0) title=刷新本页>第<%=CurPage%>页]</a>

&nbsp;&nbsp;&nbsp;&nbsp;匿 称:<input maxLength="10" name="username" size="10" class="p9" tabIndex="1" style="width: 70; background-color: #FAFCEF; border: 1 solid #20663B">
<input type="submit" style="font-size:12px" value="查询">
</td></tr>
<tr><td align=center>
<hr noshade size="1" color=009900>
<a href=Sort.asp?order=score>[按累积分排序]</a> <a href=Sort.asp?order=month_score>[按月积分排序]</a> <a href=Sort.asp?order=times>[按访问次数排序]</a>
</td></tr>
</table>



<table align="center" bgcolor="#a0a0a0" border="0" cellpadding="2" cellspacing="1" width="98%">
<tr bgcolor="#3399FF"> 
    <td width='5%'><font color=#ffffff>名次</font></td>
    <td width='18%'><font color=#ffffff>用户名</font></td>
    <td width='12%'><font color=#ffffff>累积分</font></td>
    <td width='10%'><font color=#ffffff>月积分</font></td>
    <td width='5%'><font color=#ffffff>次数</font></td>
    <td width='6%'><font color=#ffffff>天数</font></td>
</tr>
 <%dim countno,days
     countno=0
   Do While Not rs.EOF And countno < rs.PageSize
   Response.Write("<tr bgcolor=#f0f0f0><td>" & NumPerPage*(curpage-1)+Countno+1 & "</td>")
   Response.Write("<td>" & rs("username") & "</td>")
   Response.Write("<td>" & rs("score") & "</td>")
   Response.Write("<td>" & rs("month_score") & "</td>")
   Response.Write("<td>"&rs("times")&"</td>")
   days=DateDiff("d",rs("first_t"),now)
   Response.Write("<td>"&days&"</td></tr>")
    countno=countno+1
    rs.MoveNext
    Loop
rs.Close%>
</table></form>
</body><html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -