📄 admin_user.asp
字号:
<%@language=vbscript codepage=936 %>
<%
response.buffer=true
%>
<!--#include file = "include.asp"-->
<!--#include file="Inc/function.asp"-->
<!--#include file = "admin_EnPas.asp"-->
<!--#include file = "admin_checkmana.asp"-->
<%
'=========================================================
'产品目录:风讯产品N系列
'软件名称:风讯站点管理系统
'当前版本:2004.I.0225
'最新更新:2004.2.10
'=========================================================
'Copyright (C) 2002-2004 cooin.com. All rights reserved.
'网站: http://www.cooin.com Foosun.net
'程序制作:轻风云(QQ:655071)
'Email:skeen@cooin.com,skeen@Foosun.net
'论坛支持:风讯在线论坛(http://bbs.cooin.com http://bbs.foosun.net)
'=========================================================
if EnoughPopedom("users")=1 then
Response.write"<script>alert(""[操作失败]\n\n你的权限不足!\n\n请与系统管理员联系获得足够的权限!"");location.href=""javascript:history.back()"";</script>"
Response.end
end if
const MaxPerPage=20
dim strFileName
dim totalPut,CurrentPage,TotalPages
dim rs, sql
dim UserID,UserSearch,Keyword,strField
dim Action,FoundErr,ErrMsg
dim tmpDays
keyword=trim(request("keyword"))
if keyword<>"" then
keyword=ReplaceBadChar(keyword)
end if
strField=trim(request("Field"))
UserSearch=trim(request("UserSearch"))
Action=trim(request("Action"))
UserID=trim(Request("UserID"))
if UserSearch="" then
UserSearch=0
else
UserSearch=Clng(UserSearch)
end if
strFileName="Admin_User.asp?UserSearch=" & UserSearch
if request("page")<>"" then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
<html>
<head>
<title>注册用户管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css/css.css" type="text/css">
<SCRIPT language=javascript>
function unselectall()
{
if(document.myform.chkAll.checked){
document.myform.chkAll.checked = document.myform.chkAll.checked&0;
}
}
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.Name != "chkAll")
e.checked = form.chkAll.checked;
}
}
</SCRIPT>
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#7ED3A7" Class="border">
<tr bgcolor="#F7FFF4" >
<td height="22" colspan=2 align=center>
<table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/bg1.gif">
<tr>
<td height="26"> <div align="center"><b><strong>注 册 用 户 管 理</strong></b></div></td>
</tr>
</table>
</td>
</tr>
<form name="form1" action="Admin_User.asp" method="get">
<tr bgcolor="#F7FFF4" class="tdbg">
<td width="125" height="30"><strong>快速查找用户:</strong></td>
<td width="872" height="30" bgcolor="#F7FFF4">
<select size=1 name="UserSearch" onChange="javascript:submit()">
<option value="0" <%if UserSearch=0 then response.write " selected"%>>列出所有用户</option>
<option value="1" <%if UserSearch=1 then response.write " selected"%>>一般会员</option>
<option value="2" <%if UserSearch=2 then response.write " selected"%>>高级会员</option>
<option value="3" <%if UserSearch=3 then response.write " selected"%>>认证会员</option>
<option value="4" <%if UserSearch=4 then response.write " selected"%>>Vip会员</option>
<option value="5" <%if UserSearch=5 then response.write " selected"%>>系统管理员</option>
<option value="6" <%if UserSearch=6 then response.write " selected"%>>被锁会员</option>
</select>
<a href="Admin_User.asp">用户管理首页</a> | <a href="Admin_User.asp?Action=Add">添加新用户</a></td>
</tr>
</form>
</table>
<br>
<%
if Action="Add" then
call AddUser()
elseif Action="Addsys" then
call Addsys()
elseif Action="SaveAdd" then
call SaveAdd()
elseif Action="SaveAddsys1" then
call SaveAddsys1()
elseif Action="Modify" then
call Modify()
elseif Action="SaveModify" then
call SaveModify()
elseif Action="Del" then
call DelUser()
elseif Action="Lock" then
call LockUser()
elseif Action="UnLock" then
call UnLockUser()
elseif Action="Move" then
call MoveUser()
elseif Action="ModifyPurview" then
call ModifyPurview()
elseif Action="SaveModifyPurview" then
call SaveModifyPurview()
else
call main()
end if
if FoundErr=True then
call WriteErrMsg()
end if
call CloseConn()
sub main()
dim strGuide
strGuide="<table width='100%'><tr><td align='left'>您现在的位置:<a href='Admin_User.asp'>注册用户管理</a> >> "
select case UserSearch
case 0
sql="select * from admin order by userid desc"
strGuide=strGuide & "所有用户"
case 1
sql="select * from admin where level=1 order by userid desc"
strGuide=strGuide & "一般会员"
case 2
sql="select * from admin where level=2 order by userid desc"
strGuide=strGuide & "高级会员"
case 3
sql="select * from admin where level=3 order by userid desc"
strGuide=strGuide & "认证会员"
case 4
sql="select * from admin where level=4 order by userid desc"
strGuide=strGuide & "VIP会员"
case 5
sql="select * from admin where level=5 order by userid desc"
strGuide=strGuide & "系统管理员"
case 6
sql="select * from admin where lock=true order by userid desc"
strGuide=strGuide & "被锁定会员"
case 7
if Keyword="" then
sql="select * from admin order by userid desc"
strGuide=strGuide & "所有用户"
else
select case strField
case "UserID"
if IsNumeric(Keyword)=False then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>用户ID必须是整数</li>"
else
sql="select * from admin where userid=" & Clng(Keyword)
strGuide=strGuide & "用户ID等于<font color=red> " & Clng(Keyword) & " </font>的用户"
end if
case "UserName"
sql="select * from admin where username like '%" & Keyword & "%' order by userid desc"
strGuide=strGuide & "用户名中含有“ <font color=red>" & Keyword & "</font> ”的用户"
end select
end if
case else
FoundErr=True
ErrMsg=ErrMsg & "<br><li>错误的参数!</li>"
end select
strGuide=strGuide & "</td><td align='right'>"
if FoundErr=True then exit sub
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open sql,conn,1,1
if rs.eof and rs.bof then
strGuide=strGuide & "共找到 <font color=red>0</font> 个用户</td></tr></table>"
response.write strGuide
else
totalPut=rs.recordcount
strGuide=strGuide & "共找到 <font color=red>" & totalPut & "</font> 个用户</td></tr></table>"
response.write strGuide
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 strFileName,totalput,MaxPerPage,true,true,"个用户"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage strFileName,totalput,MaxPerPage,true,true,"个用户"
else
currentPage=1
showContent
showpage strFileName,totalput,MaxPerPage,true,true,"个用户"
end if
end if
end if
rs.Close
set rs=Nothing
call ShowSearch()
end sub
sub showContent()
dim i
i=0
%>
<table width='100%' border="0" cellpadding="0" cellspacing="0">
<tr>
<form name="myform" method="Post" action="Admin_User.asp" onsubmit="return confirm('确定要执行选定的操作吗?');">
<td>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#7ED3A7" class="border">
<tr bgcolor="#E3FFD9" >
<td width="30" align="center" class="td0">选中</td>
<td width="30" align="center" class="td0">ID</td>
<td width="80" height="22" align="center" class="td0">用户名</td>
<td width="30" height="22" align="center" class="td0">性别</td>
<td width="91" height="22" align="center" class="td0">邮箱</td>
<td width="91" align="center" class="td0">QICQ</td>
<td width="91" height="22" align="center" class="td0">级别</td>
<td width="119" align="center" class="td0">注册时间</td>
<td width="112" height="22" align="center" class="td0">角色</td>
<td width="40" height="22" align="center" class="td0">状态</td>
</tr>
<%do while not rs.EOF %>
<tr bgcolor="#F7FFF4">
<td width="30" align="center" class="td2">
<input name='userid' type='checkbox' id="userid" value='<%=cstr(rs("userid"))%>'>
</td>
<td width="30" align="center" class="td1"><%=rs("userid")%></td>
<td width="80" align="center" bgcolor="#F7FFF4" class="td2">
<% response.write "<a href='Admin_User.asp?Action=Modify&UserID=" & rs("userid") & "'>"
response.write rs("username") & "</a>" %>
</td>
<td width="30" align="center" class="td1">
<%
if rs("sex")=1 then
response.write "男"
else
response.write "女"
end if
%>
</td>
<td align="center" class="td2"><%=rs("email")%> </td>
<td align="center" class="td1">
<% if rs("oicq")<>"" then
response.write rs("oicq")
else
response.write "未填"
end if%>
</td>
<td align="center" class="td2">
<%
select case rs("level")
case 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -