page3=request("pag") if page3="" then page3=session("contpag") '分頁數(shù),當前分頁 if page3="" then page3="1"
pa=request("pa") if pa="" then pa=session("contpa") '每頁顯示數(shù) if pa="" then pa=15 '默認每頁顯示15條,可任意改 session("contpag")=page3 session("contpa")=pa pages=pa '每頁顯示數(shù)量***************以上一段程序用于實現(xiàn)分頁功能
SQL="SELECT * FROM tab order by -dat,-id" dim rs Set rs=Server.CreateObject("ADODB.RecordSet") rs.Open sql,conn,1,1 csi=0 cs1=0 cs100=0 csdat1=0 do while not rs.eof csi=csi+rs("cs") if rs("cs")=1 then cs1=cs1+1 if rs("cs")>=100 then cs100+1 if datevalue(rs("dat"))=date then csdat1=csdat1+1 end if rs.movenext loop ZS=RS.RECORDCOUNT '*****************************************************8以下一段程序用于分頁顯示 %>
head> title>卓越電腦統(tǒng)計/title> /head>
body style="font-size: 9pt" bgcolor="#D8EDF8">
共有%Response.Write zs%>條記錄,現(xiàn)在是第%Response.Write page3%>頁 每頁顯示:[a href="dispcont.asp?pag=%=page3%>pa=15">15]條、[a href="dispcont.asp?pag=%=page3%>pa=20">20]條、[a href="dispcont.asp?pag=%=page3%>pa=30">30]條、[a href="dispcont.asp?pag=%=page3%>pa=40">40]條 [a href="dispcont.asp">刷新] div align="left"> table border="0" cellpadding="0" style="font-size: 9pt"> tr>td>頁碼/td>%page2=1 for i=1 to zs step pages if page3=cstr(page2) then %>td >[%Response.Write page2%>]/td> % else %> td >a href="dispcont.asp?pag=%Response.Write page2%>">[%Response.Write page2%>]/td> % end if page2=page2+1 next sn=pages*(page3-1) '當前記錄號=每頁顯示數(shù)*頁數(shù)-每頁顯示數(shù) if sn>zs then sn=0 rs.move sn,1 '**********************************以上一段用于分頁 %> /tr>/table> /div> table style="font-size: 9pt" width="100%" bordercolorlight="#000000" border="1" bordercolordark="#FFFFFF" bgcolor="#A4D1E8" cellspacing="0" cellpadding="3"> tr>td>編號/td>td>最后訪問首頁/td>td>最后訪問IP/td>td>首頁次數(shù)/td>td>首次訪問日期/td>/tr>% for i=1 to pages Response.Write "/tr>" Response.Write "td>"rs("ID")"/td>" Response.Write "td>"rs("dat")"/td>" Response.Write "td>"rs("IP")"/td>" Response.Write "td>"rs("CS")"/td>"
Response.Write "td>"rs("DAT1")" /td>" Response.Write "/tr>" rs.movenext if rs.eof then exit for next rs.close %> tr>td>合計%=zs%>/td>td>訪問次數(shù)為100次以上的有%=cs100%> /td>td>訪問次數(shù)為1的有:%=cs1%>/td>td>總訪問次數(shù)%=csi%>/td>td>今天訪問量:%=csdat1%>/td>/tr> /table>