?? list.asp
字號:
<!--#include file="_conn.asp" -->
<%
Call Header(" - 字條列表"&Request("page"))
%>
<table width="76%" border="0" cellpadding="0" cellspacing="1" align=center class="List">
<tr>
<th>字條編號</th>
<th>字條內容</th>
<th>發送人</th>
<th>接收人</th>
<th>日期</th>
</tr>
<%
Dim Sql
Sql="Select * From LOVE Order By Id DESC"
Dim Rs
Set Rs=Server.CreateObject("ADODB.RecordSet")
Rs.PageSize=LOVE_SIZE
Rs.CacheSize=Rs.PageSize
Rs.Open Sql,Conn,1,1
Dim Page
If Request("page")="" Then
Page=1
Else
Page=Request("page")
End If
If Not(Rs.Eof And Rs.Bof) Then Rs.AbsolutePage=Page
Dim I
For I=1 To Rs.PageSize
If Rs.Eof Then Exit For
Response.Write "<tr class=""tr""><td class=""ListA"">"&Rs("ID")&"</td><td class=""ListB""><a href=""default.asp?id="&Rs("ID")&""">"&Rs("Info")&"</a>"
If Session("_ASPK")="ok" Then Response.Write " ("&Rs("IP")&" <a href=""admin.asp?cmd=del&id="&Rs("ID")&"""><img src=""images/close.gif"" alt=""刪除"" /></a>)"
Response.Write "</td><td class=""ListC"">"&Rs("Send")&"</td><td class=""ListC"">"&Rs("Pick")&"</td><td class=""ListD"">"&Rs("PostDate")&"</td></tr>"
Rs.MoveNext
If Rs.Eof Or I=Rs.PageSize Then Exit For
Response.Write "<tr><td class=""ListA"">"&Rs("ID")&"</td><td class=""ListB""><a href=""default.asp?id="&Rs("ID")&""">"&Rs("Info")&"</a>"
If Session("_ASPK")="ok" Then Response.Write " ("&Rs("IP")&" <a href=""admin.asp?cmd=del&id="&Rs("ID")&"""><img src=""images/close.gif"" alt=""刪除"" /></a>)"
Response.Write "</td><td class=""ListC"">"&Rs("Send")&"</a></td><td class=""ListC"">"&Rs("Pick")&"</td><td class=""ListD"">"&Rs("PostDate")&"</td></tr>"
I=I+1
Rs.MoveNext
Next
Dim PageCount,RecordCount
PageCount=Rs.PageCount
RecordCount=Rs.RecordCount
Rs.Close
Set Rs=Nothing
Conn.Close
Set Conn=Nothing
%>
<tr>
<td colspan="5" class="ListP">
<%If Session("_ASPK")="ok" Then Response.Write "<a href=""login.asp?q=q"">修改密碼</a> "
Response.Write "(字條總數:"&RecordCount&") "
Call PageBar(Int(PageCount),Int(Page))%>
</td>
</tr>
</table>
<%
Call Footer()
Function PageBar(pages,page)
If page>1 Then
response.write "<a href=""?page=1"">1</a>..."
Else
response.write "<strong>1</strong>..."
End If
Dim p,pp,n,i
p=page-5
pp=pages-1
If p<2 Then p=2
For n=p To pp
i=i+1
If n=page Then
response.write "<strong>"&n&"</strong> "
Else
response.write " <a href=""?page="&n&""">"&n&"</a> "
End If
If i>=11 Then Exit For
Next
If page<pages Then
response.write "...<a href=""?page="&pages&""">"&pages&"</a>"
Else
response.write "...<strong>"&pages&"</strong>"
End If
End Function
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -