tj2.asp
上传用户:btntkt
上传日期:2021-04-16
资源大小:5296k
文件大小:3k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

DOS

  1. <!--#include file="conn.asp"-->
  2. <%if session("admin")="" then
  3. response.Write "<script language='javascript'>alert('网络超时或您还没有登陆!');window.location.href='login.asp';</script>"
  4. response.End
  5. end if
  6. %>
  7. <html>
  8. <head>
  9. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  10. <link rel="stylesheet" href="manage.css" type="text/css">
  11. <style type="text/css">
  12. <!--
  13. body {
  14. background-color: #FFFFFF;
  15. }
  16. .STYLE1 {color: #000000}
  17. -->
  18. </style></head>
  19. <BODY>
  20. <table width="98%" border="1"  style="border-collapse: collapse; border-style: dotted; border-width: 0px"  bordercolor="#333333" cellspacing="0" cellpadding="2">
  21. <tr class=backs><td height=18 class=td STYLE1>网站访问数据日报表</td>
  22. </tr>
  23. <tr><td>
  24. <table border="1" width="100%" cellSpacing=0 cellPadding=3 bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" bordercolor="#FFFFFF">
  25.   <tr>
  26.     <td width="33%">日期</td>
  27.     <td width="33%">IP访问量</td>
  28.     <td width="33%">当日明细</td>
  29.   </tr>
  30. <%
  31. set rs=Server.CreateObject("ADODB.recordset")
  32. sql="select count(*) as temp, day from count_shop group by day order by day desc"
  33. rs.cursorlocation = 3     '游标
  34. rs.open sql,conn,1,1 
  35. if rs.eof and rs.bof then
  36. %>
  37.   <tr>
  38.     <td colspan=3>暂时没有统计数据</td>
  39.   </tr>
  40. <%
  41. else
  42. pages = 31 '每页记录数
  43. rs.pageSize = pages
  44. allPages = rs.pageCount '计算一共能分多少页
  45. page = Request("page")
  46. 'if语句属于基本的排错处理
  47. if isEmpty(page) or clng(page) < 1 then
  48. page = 1
  49. elseif clng(page) >= allPages then
  50. page = allPages 
  51. end if
  52. rs.AbsolutePage = page
  53. do while not rs.eof and pages>0
  54. %>
  55.   <tr>
  56.     <td><%=rs("day")%></td><td><%=rs("temp")%></td><td><a href="tj3.asp?day=<%=rs("day")%>">查看当日明细</a></td>
  57.   </tr>
  58. <%
  59. pages = pages - 1
  60. rs.movenext
  61. if rs.eof then exit do
  62. loop
  63. end if
  64. rs.close
  65. set rs=nothing
  66. set rs1=nothing
  67. conn.close
  68. set conn=nothing
  69. %>
  70. </table>
  71. <%
  72. call listpages()
  73. %>
  74. </td></tr>
  75. </table>
  76. </body></html>
  77. <%
  78. '分页
  79. sub listPages() 
  80. if allpages <= 1 then exit sub 
  81. if page = 1 then
  82. response.write "<font color=darkgray>首页 前页</font>"
  83. else
  84. response.write "<a href="&request.ServerVariables("script_name")&"?page=1>首页</a> <a href="&request.ServerVariables("script_name")&"?page="&page-1&">前页</a>"
  85. end if
  86. if page = allpages then
  87. response.write "<font color=darkgray> 下页 末页</font>"
  88. else
  89. response.write " <a href="&request.ServerVariables("script_name")&"?page="&page+1&">下页</a> <a href="&request.ServerVariables("script_name")&"?page="&allpages&">末页</a>"
  90. end if
  91. response.write " 第"&page&"页 共"&allpages&"页"
  92. end sub
  93. %>