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

📄 user_list.asp

📁 对学校物资管理系统的一份设计
💻 ASP
字号:
<!--#include file = "Startup.asp"-->
<!-- #include file="Function.asp" -->
<%
call adminer()
Call Header()
Call ComeUrl()
Call adminqx()


Dim zSql
Set oRs=oConn.Execute("Select id From admin_list Order By id Desc")
If Not oRs.Eof Then
	zSql="delete from admin_list where id not in (select top 200 id from admin_list order by id desc)"
	oConn.Execute zSql
End If
oRs.Close


const MaxPerPage=15   '单独页最大记录数 const 用来申明常量
dim totalPut   '总记录
dim CurrentPage  '当前页次
dim TotalPages   '总页数
dim i

%>
<link href="common.css" type="text/css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#DEDFDE">
  <tr bgcolor="#F7F7F7">
    <td bgcolor="#F7F7F7"><div align="center">用户名</div></td>
    <td bgcolor="#F7F7F7"><div align="center">权 限</div></td>
    <td bgcolor="#F7F7F7"><div align="center">最后登录IP</div></td>
    <td bgcolor="#F7F7F7"><div align="center">最后登录时间</div></td>
  </tr>
  <%
	set ors=server.CreateObject("adodb.recordset")
	ssql="select * from admin_list order by id desc"
	ors.open ssql,oConn,1,1
	
	
	'!-- 分页功能代码块,可独立使用
if not ors.eof then
  ors.MoveFirst  '注意放到前面来,否则到任何页总是在第一个记录上
  end if
  ors.pagesize=MaxPerPage  '设置每页最多显示多少条记录
  If trim(Request("Page"))<>"" then  '如果请求的页次不为空
	CurrentPage= CLng(request("Page"))   'clng是转换成长整型数据类型,并赋值到当前页次上
	If CurrentPage> ors.PageCount then  '如果当前页次大于总页数,则将最大页次赋值到当前页次上
		CurrentPage = ors.PageCount 
	End If 
Else 
	CurrentPage= 1 '一切条件不成立,将当前页设为第一页
End If 

 totalPut=ors.recordcount '将总记录赋值于TOTALPUT
	if CurrentPage<>1 then '如果当前页数不等于第一页
		if (currentPage-1)*MaxPerPage<totalPut then  '如果当前页减一乘以每页最大的记录数小于总记录的话
			ors.move(currentPage-1)*MaxPerPage  '相对当前记录数向后移动
			dim bookmark  '定义书签变量
			bookmark=ors.bookmark '将当前记录的标签赋于变量BOOKMARK上
		end if 
	end if

	dim n,k 
	if (totalPut mod MaxPerPage)=0 then  '总记录数与每页最大记录数求余的结果为零时,则N返回整数页次,否则再加一.
		n= totalPut \ MaxPerPage
	else  
		n= totalPut \ MaxPerPage + 1  
	end if

	%>
  <%
  If Not oRs.Eof Then
  do while not ors.eof and i<MaxPerPage%>
  <tr bgcolor="#FFFFFF">
    <td><div align="center"><%=ors("username")%></div></td>
    <td><div align="center">
        <%
	  If oRs("userclass")=1 Then
	  Response.Write "超级管理员"
	  End If
	  If oRs("userclass")=0 Then
	  Response.Write "普通管理员"
	  End If
	  %>
    </div></td>
    <td><div align="center"><%=oRs("LastLoginIP")%></div></td>
    <td><div align="center"><%=oRs("LastLoginTime")%></div></td>
  </tr>
  <%
	ors.movenext
	i=i+1
	loop
	%>

</table>
<table width="700"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><div align="center">
	<%
	Response.Write "当前第<font color='#ff0000'>"&currentpage&"</font>页 总共<font color='#FF0000'>"&n&"</font>页 共<font color='#FF0000'>"&totalPut&"</font>条记录 " 
    
	 k=currentPage
		if k<>1 then
			response.write "[<b>"+"<a href='user_list.asp?page=1'>首页</a></b>] "
			response.write "[<b>"+"<a href='user_list.asp?page="&cstr(k-1)&"'>上一页</a></b>] "
		else
			Response.Write "[首页] [上一页]"
		end if
		if k<>n then
			response.write "[<b>"+"<a href='user_list.asp?page="&cstr(k+1)&"'>下一页</a></b>] "
			response.write "[<b>"+"<a href='user_list.asp?page="&cstr(n)&"'>尾页</a></b>] "
		else
			Response.Write "[下一页] [尾页]</tr></td></table>"
		end if	
	%></div></td>
  </tr>
  <%
  Else
  Response.Write "<tr><td bgcolor='#FFFFFF' colspan='4'><div align='center'>暂无登陆记录!!</div></td></tr>"
  End If
  %>
</table>
  <%
	ors.close
	set ors=nothing
	oconn.close
	set ors=nothing
	%>

⌨️ 快捷键说明

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