📄 admin_userlist.asp
字号:
<%
Option Explicit
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.CacheControl = "no-cache"
%>
<!--#Include File="../Conn.asp"-->
<!--#include File="Admin_CheckCode.asp"-->
<!--#include File="Class/Admin_ClassAdmin.asp"-->
<!--#include File="Class/Admin_ClassCommon.asp"-->
<%
Sub ApplicationTerminate()
On Error Resume Next
Set EL_Admin = Nothing
Set EL_Common = Nothing
Call CloseConn()
If Err Then Err.Clear
Response.End()
End Sub
Dim EL_Admin, EL_Common
Set EL_Admin = New Class_Admin
Set EL_Common = New Class_Common
If EL_Admin.ErrorCode = 1 Then
Response.Write "请登陆后在使用此功能"
Call ApplicationTerminate()
ElseIf EL_Admin.ErrorCode = 2 Then
Response.Write "<font color=red>系统禁止了两个人使用同一帐号同时登陆系统,此帐号已经在别的地方登陆。</font>"
Call ApplicationTerminate()
End If
Dim ListCmd, rsList, RowCount, i, s
Dim StrFields, StrCondition
Dim Keyword, TotalRowCount, PageCounts, PageSizes, CurrentPage, URLParameters
s = EL_Common.ELRequest("s", 1)
Keyword = EL_Common.ReplaceBadChar(EL_Common.ELRequest("Keyword", 1))
CurrentPage = EL_Common.ELRequest("page", 2)
PageSizes = EL_Common.ELRequest("pagesizes", 2)
If PageSizes = 0 Then PageSizes = 40
URLParameters = Request.ServerVariables("QUERY_STRING")
URLParameters = EL_Common.ReplaceText(URLParameters, "\&{0,}pagesizes=[0-9]*", "")
If CurrentPage<1 Then
CurrentPage = 1
Else
URLParameters = EL_Common.ReplaceText(URLParameters, "\&{0,}page=[0-9]*", "")
End If
StrCondition = "1=1 "
If Keyword <> "" Then
StrCondition = StrCondition &" AND UserName Like '%"& Keyword &"%' "
End If
If s <> "" Then
Dim ArrInfo, aItem
ArrInfo = Split(s, "|")
For i = 0 To Ubound(ArrInfo)
StrCondition = StrCondition &"AND UserName<>'"& Replace(ArrInfo(i), "'", "''") &"' "
Next
End If
StrFields = "UserName"
Call EL_Common.InitCommand(ListCmd, "EL_SP_SplitPage")
With ListCmd
.Parameters.Append .CreateParameter("RETURN", 3, 4, 4)
.Parameters.Append .CreateParameter("@Tables", 200, 1, 50, "EL_User")
.Parameters.Append .CreateParameter("@PrimaryKey", 200, 1, 20, "UserID")
.Parameters.Append .CreateParameter("@Sort", 200, 1, 200, "RegDateTime DESC")
.Parameters.Append .CreateParameter("@CurrentPage", 3, 1, 4, CurrentPage)
.Parameters.Append .CreateParameter("@PageSize", 3, 1, 4, PageSizes)
.Parameters.Append .CreateParameter("@Fields", 200, 1, 1000, StrFields)
.Parameters.Append .CreateParameter("@Filter", 200, 1, 1000, StrCondition)
.Parameters.Append .CreateParameter("@Group", 200, 1, 1, "")
.Parameters.Append .CreateParameter("@TotalRowCount", 3, 2, 4)
.Parameters.Append .CreateParameter("@PageCount", 3, 2, 4)
Set rsList = .Execute()
End With
rsList.Close()
RowCount = ListCmd(0)
TotalRowCount = ListCmd(9)
PageCounts = ListCmd(10)
%>
<html>
<head>
<title>查找用户</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href='Admin_Style.css' type='text/css' rel='stylesheet'>
<script language="javascript" src="../js/Common.js"></script>
<base target="_self">
<script language="javascript">
function OK(){
var frm = getObject("myform");
var ret = "";
for (var i=0;i<frm.elements.length;i++){
var e = frm.elements[i];
if (e.type == 'checkbox' && e.name=='ItemObject' && e.checked == true ){
if(ret==""){
ret = e.value;
}else{
ret = ret +"|"+ e.value;
}
}
}
if(ret!=""){
window.returnValue = ret;
}else{
window.returnValue = null;
}
window.close()
}
</script>
</head>
<body>
<form name="Search" action="Admin_UserList.asp" method="get">
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
<tr>
<td width="5%" nowrap class="td_ItemName">用户名:</td>
<td width="95%" class="td_ItemName">
<input name="Keyword" type="text" id="Keyword" value="<%=Keyword%>">
<input type="submit" name="Submit3" value="搜索">
<input name="s" type="hidden" id="s" value="<%=s%>"> </td></tr>
<% If s <> "" Then %>
<tr>
<td nowrap class="td_ItemName"><strong>已选择的用户</strong></td>
<td nowrap class="item_25"><%=s%></td>
</tr>
<% End If %>
</table>
</form>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td align="right"><%Call ShowPage(URLParameters, CurrentPage, PageSizes, PageCounts, TotalRowCount, "信息", "条")%></td>
</tr>
</table>
<form name="myform" action="" onSubmit="return false" method="post">
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
<tr>
<%
rsList.Open()
For i = 1 To RowCount
Response.Write "<td id=""td_"& i &""" class=""td_25"">"
Response.Write "<input type=""checkbox"" name=""ItemObject"" id=""ItemObject"" value="""& EL_Common.HTMLEncode(rsList(0)) &""" onclick=""getObject('td_"& i &"').className=(this.checked)?'MouseOver_25':'td_25'"">"
Response.Write "<a href='"& InstallDir &"User/ShowUser.asp?UserName="& EL_Common.HTMLEncode(rsList(0)) &"' target='_blank' style='color:blue; text-decoration:underline;'>"& EL_Common.HTMLEncode(rsList(0)) &"</a>"
Response.Write "</td>"
If (i mod 4)=0 And i<RowCount Then Response.Write "</tr><tr>"
If i<RowCount Then rsList.MoveNext
Next
rsList.Close()
Set rsList = Nothing
Set ListCmd = Nothing
%>
</tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td align="center" class="td_50">
<input type="button" name="Submit" value=" 确 定 " onClick="OK()">
<input type="button" name="Submit2" value=" 取 消 " onClick="window.returnValue=null;window.close();"></td>
</tr>
</table>
</form>
<%
Sub ShowPage(ByVal URL, ByVal CurrentPage, ByVal PageSizes, ByVal PageCounts, ByVal TotalRowCount, ByVal ItemName, ByVal ItemUnit)
Dim StrHtml, i, ScriptName
ScriptName = Request.ServerVariables("SCRIPT_NAME") &"?"
If URL = "" Then
ScriptName = ScriptName & URL
Else
ScriptName = ScriptName & URL &"&"
End If
Response.Write "<table border=""0"" cellspacing=""1"" cellpadding=""0"">"
Response.Write "<form name='pageform' action='Admin_SelectFile.asp?"& URL &"' method='Post'><tr><td>"
Response.Write "一共<strong style='color:red'>"& TotalRowCount &"</strong>"& ItemUnit & ItemName &" "
Response.Write "<a href='"& ScriptName &"page=1'>首页</a> "
If CurrentPage = 1 Then
Response.Write "<a disabled>上一页</a> "
Else
Response.Write "<a href='"& ScriptName &"page="& (CurrentPage-1) &"'>上一页</a> "
End If
If CurrentPage >= PageCounts Then
Response.Write "<a disabled>下一页</a> "
Else
Response.Write "<a href='"& ScriptName &"page="& (CurrentPage+1) &"'>下一页</a> "
End If
Response.Write "<a href='"& ScriptName &"page="& PageCounts &"'>尾页</a> "
Response.Write "<strong style='color:red'>"& CurrentPage &"</strong>/<strong>"& PageCounts &"</strong>页 "
Response.Write "<strong>"& PageSizes &"</strong>"& ItemUnit & ItemName &"/页 "
Response.Write "跳转</td><td>"
If PageCounts>3000 Then Response.Flush()
Response.Write "<select onChange=""javascript:submit()"" name='page'>"
For i = 1 To PageCounts
Response.Write "<option value='"& i &"' "& EL_Common.SetObjectSelected(CurrentPage, i) &">第"& i &"页</option>"
Next
Response.Write"</select>"
Response.Write"</td></tr></form></table>"
End Sub
Call ApplicationTerminate()
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -