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

📄 showlist.asp

📁 一个网络相册
💻 ASP
字号:
<!-- #include file="conn1.asp" -->
<!-- #include file="function.asp" -->
<!-- #include file="iXs_Ip.asp" -->
<%
  const MaxPerPage=45
   	dim totalPut
   	dim CurrentPage
   	dim TotalPages
   	dim i,j
   	dim sql,ip,countnum,online,UserName
   	dim rs
   	if not isempty(request("page")) then
      		currentPage=cint(request("page"))
   	else
      		currentPage=1
   	end if
  set Rs=server.createobject("adodb.recordset")
%>
<HTML><HEAD><TITLE>访问记录</TITLE>
<LINK href="style.css" type=text/css rel=stylesheet>
</HEAD>
<BODY vLink=#000000 link=#000000>
<table width="98%" border=0 align="center" cellpadding=1 cellspacing=1 bgcolor="#cccccc">
  <tr bgcolor="#f0f0f0"  height=25>
    <td width="12%" align="center">用户</td>
    <td width="20%" align="center">访问时间</td>
    <td width="20%" align="center"  nowrap>活动时间</td>
    <td width="20%" align="center"  nowrap>用户IP</td>
    <td width="28%" align="center"  nowrap>地址</td>
    <td width="13%" align="center"  nowrap>访问次数</td>
  </tr>
      <% 
	  dim tmprs1
      tmprs1=conn.execute("select sum(times) from list")
      countnum=tmprs1(0)
      set tmprs1=nothing
	  sql="select * from list order by lastimebk Desc"
	  rs.open sql,conn,1,1 
  	  if rs.eof and rs.bof then 
       		response.write "<table><tr><td border=""0"" width=""100%"" height=""100%"" cellspacing=""1"" cellpadding=""0"" bgcolor=""#FFFFFF""><p align=""center"">没有或没有找到任何在线用户,</p></td></tr></table>" 
      else 
     		totalPut=rs.recordcount
      		if currentpage<1 then
          		currentpage=1
      		end if
      		if (currentpage-1)*MaxPerPage>totalput then
	   		if (totalPut mod MaxPerPage)=0 then
	     			currentpage= totalPut \ MaxPerPage
	  		else
	      			currentpage= totalPut \ MaxPerPage + 1
	   		end if
      		end if
       		if currentPage=1 then
            		showContent
            		showpage totalput,MaxPerPage,"showlist.asp"
       		else
          		if (currentPage-1)*MaxPerPage<totalPut then
            			rs.move  (currentPage-1)*MaxPerPage
            			dim bookmark
            			bookmark=rs.bookmark
            			showContent
             			showpage totalput,MaxPerPage,"showlist.asp"
        		else
	        		currentPage=1
           			showContent
           			showpage totalput,MaxPerPage,"showlist.asp"
	      		end if
	   	end if
   	rs.close 	
   	end if 
	         
   	sub showContent 
       	dim i 
	   	i=0 
%>
  <% do while not rs.eof
    ip=rs("ip")
    username=rs("username")
  if rs("ip")="61.131.62.133" then
  ip="*.*.*.*"
  end if
   tmprs1=conn.execute("select count(*) from online where id="&rs("id")&"and UserName='"&username&"'")
   online=tmprs1(0)
   set tmprs1=nothing%>
   <%if online>=1 then%>
  <tr bgcolor="#6BEB9C">
  <%else%>
     <tr bgcolor="#FFFFFF"> 
  <%end if%>
    <td align="center"><%= rs("UserName") %></td>
    <td align="center"><%= rs("startime") %></td>
    <td align="center"><%= rs("lastimebk") %></td>
    <td align="center"><%= trim(ip) %></td>
    <td align="center"><%= rs("address") %></td>
    <td align="center"><%= rs("times") %></td>
  </tr>
  <%
	      i=i+1
	      if i>=MaxPerPage then exit do
	      rs.movenext
	    loop
	%>
  <tr bgcolor="#FFFFFF">
    <td colspan="8" height="20">
      <%
   end sub 

	function showpage(totalnumber,maxperpage,filename)
  	dim n

  	if totalnumber mod maxperpage=0 then
     		n= totalnumber \ maxperpage
  	else
     		n= totalnumber \ maxperpage+1
  	end if
  	response.write "<table cellspacing=1 width='100%' border=0 colspan='4' ><form method=Post action="""&filename&"""><tr><td align=right> "
  	if CurrentPage<2 then
    		response.write "共有<strong><font color=red>"&totalnumber&"</font></strong>个用户,<strong><font color=red>"&countnum&"</font></strong>次访问本站&nbsp;首页 上一页&nbsp;"
  	else
    		response.write "共有<strong><font color=red>"&totalnumber&"</font></strong>个用户,<strong><font color=red>"&countnum&"</font></strong>次访问本站&nbsp;<a href="&filename&"?page=1&"">首页</a>&nbsp;"
    		response.write "<a href="&filename&"?page="&CurrentPage-1&">上一页</a>&nbsp;"
  	end if

  	if n-currentpage<1 then
    		response.write "下一页 尾页"
  	else
    		response.write "<a href="&filename&"?page="&(CurrentPage+1)&">"
    		response.write "下一页</a> <a href="&filename&"?page="&n&">尾页</a>"
  	end if
   	       response.write "&nbsp;页次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>页 "
           response.write "&nbsp;<b>"&maxperpage&"</b>条/页 "
%>
      转到:<form name="form1" method="post" action="showlist.asp">
      <select name='page' size='1' style="font-size: 9pt" onChange='javascript:submit()'>
        <%for i = 1 to n%>
        <option value='<%=i%>' <%if CurrentPage=cint(i) then%> selected <%end if%>>第<%=i%>页</option>
        <%next%>
      </select></form>
      <%   
	response.write "</td></tr></FORM></table>"
end function
%>
    </td>
  </tr>
</table>
<div align="right">
<div align="center"><a href="Showonline.Asp"><br>查看在线情况</a>
</div>
</BODY></HTML>
<%
  set rs=nothing
CloseDatabase
%>

⌨️ 快捷键说明

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