<%
'乘风多用户计数器 Sql版
'作者QQ：178575
'作者EMail：yliangcf@163.com
'作者网站：http://www.qqcf.com
'详细简介：http://www.qqcf.com/cfcount.htm
'上面有程序在线演示，安装演示，使用疑难解答，最新版本下载等内容
'因为这些内容可能时常更新，就没有放在程序里，请自己上网站上查看
'有完整版本的演示
%>
<%
Sql="Select * From CFCount_SysInfo Order By ID Desc"
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.open Sql,Conn,1,1

If Not Rs.eof Then
 If ChkStr(Request("Page"),2) = "" Then
  Page = 1
 Else 
  Page = CInt(ChkStr(Request("Page"),2))
 End If
 
 Rs.pagesize=10
 TotalRs=Rs.RecordCount
 TotalPage=Rs.PageCount
 MyPageSize=Rs.PageSize
 Rs.AbsolutePage=Page
End If
%>
<table class="tb_1">
  
  <tr> 
    <td colspan="4"><a href="?Action=infoadd" class="t_button">增加公告</a></td>
  </tr>
  <tr class="tr_1"> 
    <td>序 号</td>
    <td>标题</td>
    <td>时 间</td>
    <td>操作</td>
  </tr>
  <%
While Not Rs.Eof And MyPageSize>0
%>
  <tr class="tr_2"> 
    <td height="18"><%=Rs.RecordCount-Rs.Pagesize*(Page)+MyPageSize%></td>
    <td><%=rs("Title")%></td>
    <td><%=rs("AddDate")%></td>
    <td><a href="?action=infomodify&id=<%=rs("id")%>">修改</a> 
        <a href="AdminUser.aspx?Action=infodel&ID=<%=Rs("ID")%>" onclick="return confirm('确定要删除吗?')">删除</a></td>
  </tr>
  <%
MyPageSize=MyPageSize-1
Rs.MoveNext
Wend
%>
</table>
<table class="tb_3">
  <tr>
    <td><a href="?Action=<%=Action%>&Page=1">第一页</a>
<%
If Page>1 Then
%>
            <a href='?Action=<%=Action%>&Page=<%=Page-1%>'>上一页</a>
<%
End If
%>
<%
If Page<Rs.PageCount   then%>
            <a href='?Action=<%=Action%>&Page=<%=Page+1%>'>下一页</a>
<%
End If
%>
            <a href="?Action=<%=Action%>&Page=<%=totalpage%>">最后一页</a> 页次：<font color="#ff0000"><%=page%></font>/<%=totalpage%>页&nbsp;&nbsp;共<%=totalrs%>条记录&nbsp;&nbsp;每页显示<%=rs.pagesize%>条
<%
Response.write "&nbsp;&nbsp;转到第<select id='page' onChange=""window.location=document.getElementById('page').options[document.getElementById('page').selectedIndex].value"">"
For I=1 To TotalPage
    Response.Write "<option value=?Action="&Action&"&Page="& i     
 If Page=I Then Response.Write " selected"
 Response.Write ">"& I &"</option>"
Next
Response.write "</select>页"
%></td>
  </tr>
</table>