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

📄 admin_listuser.asp

📁 本程序是一款比较完善的图书租赁系统
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="ChkErr.asp"-->
<!--#include file="ChkAdmin.asp"-->
<!--#include file="ChkSQL.asp"-->
<!--#include file="ResultMsg.asp"-->
<%
Dim SearchCondition,SearchStr
Dim UserLevel,LevelStatus,AsCondition
Dim IsAdmin,IsLocked,IsProvider
Dim tmpTD,tmpUserStatus
tmpTD="<td class=TableBody1 align=center width=17% >"

'取得查询条件
SearchStr=ChkSQL(Trim(Request("SearchStr")))
If IsNumeric(Request("UserLevel"))=False Then
	UserLevel=1
Else
	UserLevel=Request("UserLevel")
End If

'根据查询条件制定查询字符串
If SearchStr<>"" Then
	'若有主查询条件则应用
	Select Case Request("SearchCondition")
		Case "UserName"
			strSQL="SELECT * FROM [UserInfo] WHERE UI_Name_S LIKE '%"&SearchStr&"%'"
		Case "Email"
			strSQL="SELECT * FROM [UserInfo] WHERE UI_Email_S LIKE '%"&SearchStr&"%'"
		Case "QQ"
			strSQL="SELECT * FROM [UserInfo] WHERE UI_QQ_S LIKE '%"&SearchStr&"%'"
		Case Else
			strSQL="SELECT * FROM [UserInfo] WHERE UI_Name_S LIKE '%"&SearchStr&"%'"
	End Select
Else
	'若无主查询条件则默认查询所有
	strSQL="SELECT * FROM [UserInfo] WHERE UI_ID_N<>NULL "
End If
'附加查询条件
'用户是否是管理员
If Request("IsAdmin")<>"" Then
	strSQL=strSQL&" AND UI_IsAdmin_B=True"
End If
'用户是否被锁定
If Request("IsLocked")<>"" Then
	strSQL=strSQL&" AND UI_IsLocked_B=True"
End If
'用户是否是供应商
If Request("IsProvider")<>"" Then
	strSQL=strSQL&" AND UI_IsProvider_B=True"
End If
'用户级别
If Request("AsCondition")<>"" Then
	Select Case Request("LevelStatus")
		Case "up"
			strSQL=strSQL&" AND UI_CerRank_N>="&UserLevel
		Case "middle"
			strSQL=strSQL&" AND UI_CerRank_N="&UserLevel
		Case "down"
			strSQL=strSQL&" AND UI_CerRank_N<="&UserLevel
		Case Else
			strSQL=strSQL
	End Select
End If

Set objRS=Server.CreateObject("ADODB.RecordSet")
objRS.Open strSQL,objConn,1,3
objRS.PageSize=20

If objRS.BOF Or objRS.EOF Then
	'如果没有找到任何用户则输出信息
	Call ResultMsg("对不起,没有找到任何用户!")
	Response.End 
End If
Response.Write "<link href=style.css rel=stylesheet type=text/css>"
%>
<!--#include file="ChangePage.asp"-->
<%
Response.Write "<table class=tableborder1 align=center cellspacing=1 cellpadding=3 width=50% height=25% >"
Response.Write "<tr><th id=tabletitlelink height=25 style=font-weight:normal align=center colspan=6><b>用户列表(点击用户名可显示用户详细信息)</b></th></tr>"
Response.Write "<tr><td class=TableBody2 align=right colspan=6>"
'翻页
Call ChangePage("admin_listuser.asp")
Response.Write "共<b>"&ObjRS.RecordCount&"</b>个用户</td></tr>"

Response.Write "<tr>"&tmpTD&"用户ID"&tmpTD&"用户名</td>"&tmpTD&"用户信用"&tmpTD&"用户状态"&tmpTD&"Email"&tmpTD&"QQ</tr>"
For i=1 To objRS.PageSize
	'表头
	tmpUserStatus=""
	Response.Write "<tr>"&tmpTD&objRS("UI_ID_N")&"</td>"&tmpTD&"<a href=javascript:openWindow('modifyuser.asp?uid="&objRS("UI_ID_N")&"',320,340)>"&objRS("UI_Name_S")&"</a></td>"&tmpTD&objRS("UI_CerRank_N")&"</td>"&tmpTD
	'用户状态
	If objRS("UI_IsAdmin_B")=True Then
		tmpUserStatus="管理员&nbsp;"
	End If
	If objRS("UI_IsProvider_B")=True Then
		tmpUserStatus=tmpUserStatus&"供应商&nbsp;"
	End If
	If objRS("UI_IsLocked_B")=True Then
		tmpUserStatus=tmpUserStatus&"锁定&nbsp;"
	End If
	Response.Write tmpUserStatus&tmpTD&objRS("UI_Email_S")&"</td>"&tmpTD&objRS("UI_QQ_S")&"</td></tr>"
	objRS.MoveNext
	If objRS.EOF Then Exit For
Next
Response.Write "</table>"

objRS.Close
Set objRS=Nothing
CloseDatabase
%>

⌨️ 快捷键说明

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