📄 admin_user.asp
字号:
<!--#include file="setup.asp"-->
<!--#include file="check.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/chkinput.asp"-->
<!--#include file="../api/cls_api.asp"-->
<%
Admin_header
'=====================================================================
' 网站名称:黑客世界
' 当前版本:NewCloud Site Management System Version 2.1
' 文件名称:admin_account.asp
' 更新日期:2008-05-01
' 官方网站:黑客世界【www.skycap.cn】QQ:19901451
'=====================================================================
' Copyright 2008-2010 skycap.cn- All Rights Reserved.
' skycap.cn is a trademark of skycap.cn
'=====================================================================
Dim Action
Dim i,ii,RsObj
Dim keyword,findword,strClass,sUserGroup,foundsql
Dim seluserid,UserGrade,UserGroupStr,UserPassWord,username
Dim maxperpage,CurrentPage,totalnumber,TotalPageNum,userlock
Action = LCase(Request("action"))
Select Case Trim(Action)
Case "save"
If Not ChkAdmin("AddUser") Then
Server.Transfer("showerr.asp")
Response.End
End If
Call SaveUser
Case "modify"
Call ModifyUser
Case "add"
If Not ChkAdmin("AddUser") Then
Server.Transfer("showerr.asp")
Response.End
End If
Call AddUser
Case "edit"
Call EditUser
Case "del"
Call BatDelUser
Case Else
Call MainPage
End Select
If FoundErr = True Then
ReturnError(ErrMsg)
End If
Admin_footer
SaveLogInfo(AdminName)
CloseConn
Sub PageTop()
Response.Write "<table border=0 align=center cellpadding=3 cellspacing=1 class=TableBorder>"
Response.Write " <tr>"
Response.Write " <th colspan=2>会员管理</th>"
Response.Write " </tr>"
Response.Write " <tr><form method=Post name=myform action=admin_user.asp onSubmit='return JugeQuery(this);'>"
Response.Write " <td class=TableRow1>搜索:"
Response.Write " <input name=keyword type=text size=20>"
Response.Write " 条件:"
Response.Write " <select name=queryopt>"
Response.Write " <option value=1 selected>会员名称</option>"
Response.Write " <option value=2>真实姓名</option>"
Response.Write " <option value=3>用户昵称</option>"
Response.Write " </select> <input type=submit name=Submit value='开始搜索' class=Button></td>"
Response.Write " <td class=TableRow1>"
Response.Write " </td></form>"
Response.Write " </tr>"
Response.Write " <tr>"
Response.Write " <td colspan=2 class=TableRow2><strong>操作选项:</strong> <a href='admin_user.asp'>会员管理首页</a> | "
Response.Write " <a href='admin_user.asp?action=add'><font color=blue>添加会员</font></a> | "
Response.Write " <a href='admin_user.asp?lock=1'><font color=blue>等待验证的会员</font></a> "
Set RsObj = Newasp.Execute("Select GroupName,Grades From NC_UserGroup where Grades <> 0 order by Groupid")
Do While Not RsObj.EOF
Response.Write " | <a href=admin_user.asp?UserGrade="
Response.Write RsObj("Grades")
Response.Write ">"
Response.Write RsObj("GroupName")
Response.Write "</a>" & vbCrLf
RsObj.movenext
Loop
Set RsObj = Nothing
Response.Write " </td>"
Response.Write " </tr>"
Response.Write "</table>"
Response.Write "<br>"
End Sub
Sub MainPage()
Call PageTop
If Not ChkAdmin("AdminUser") Then
Server.Transfer("showerr.asp")
Response.End
End If
If Not IsEmpty(Request("seluserid")) Then
seluserid = Request("seluserid")
Select Case Newasp.CheckStr(Request("act"))
Case "删除用户"
Call BatDelUser
Case "激活用户"
Call NolockUser
Case "锁定用户"
Call IslockUser
Case "转移用户"
Call MoveUser
Case Else
Response.Write "无效参数!"
End Select
End If
%>
<table border=0 align=center cellpadding=3 cellspacing=1 class=tableborder>
<tr>
<th width='5%' nowrap>选择</th>
<th width='20%' nowrap>用户名</th>
<th width='10%' nowrap>用户身份证</th>
<th width='10%' nowrap>会员类型</th>
<th width='5%' nowrap>邮箱</th>
<th width='5%' nowrap>性别</th>
<th width='20%' nowrap>操作选项</th>
<th width='15%' nowrap>最后登陆时间</th>
<th width='5%' nowrap>登陆次数</th>
<th width='5%' nowrap>状态</th>
</tr>
<%
If Trim(Request("UserGrade")) <> "" Then
SQL = "SELECT GroupName,Grades FROM [NC_UserGroup] WHERE Grades=" & Request("UserGrade")
Set Rs = Newasp.Execute(SQL)
If Rs.Bof And Rs.EOF Then
Response.Write "Sorry!没有找到任何会员。或者您选择了错误的系统参数!"
Response.End
Else
sUserGroup = Rs("GroupName")
UserGrade = Rs("Grades")
End If
Rs.Close
Else
sUserGroup = "全部会员"
UserGrade = 0
End If
maxperpage = 20 '###每页显示数
If Not IsNumeric(Request("page")) And Len(Request("page")) <> 0 Then
Response.Write ("错误的系统参数!请输入整数")
Response.End
End If
If Not IsEmpty(Request("page")) And Len(Request("page")) <> 0 Then
CurrentPage = CInt(Request("page"))
Else
CurrentPage = 1
End If
userlock =0
If CInt(CurrentPage) = 0 Then CurrentPage = 1
If Not IsNull(Request("keyword")) And Request("keyword") <> "" Then
keyword = Newasp.ChkQueryStr(Request("keyword"))
If CInt(Request("queryopt")) = 1 Then
findword = "where username like '%" & keyword & "%'"
ElseIf CInt(Request("queryopt")) = 2 Then
findword = "where TrueName like '%" & keyword & "%'"
Else
findword = "where nickname like '%" & keyword & "%'"
End If
foundsql = findword
sUserGroup = "查询会员"
Else
If Trim(Request("UserGrade")) <> "" Then
foundsql = "where UserGrade = " & Request("UserGrade")
UserGrade = Request("UserGrade")
Else
If Trim(Request("lock")) <> "" Then
foundsql = "where userlock =1"
userlock =1
Else
foundsql = ""
End If
End If
End If
TotalNumber = Newasp.Execute("SELECT COUNT(userid) FROM NC_User "& foundsql &"")(0)
TotalPageNum = CInt(TotalNumber / maxperpage) '得到总页数
If TotalPageNum < TotalNumber / maxperpage Then TotalPageNum = TotalPageNum + 1
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > TotalPageNum Then CurrentPage = TotalPageNum
Set Rs = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT userid,username,nickname,UserGrade,UserGroup,UserClass,UserLock,userpoint,usermoney,TrueName,UserSex,usermail,HomePage,oicq,JoinTime,ExpireTime,LastTime,userlogin FROM [NC_User] "& foundsql &" ORDER BY JoinTime DESC ,userid DESC"
If IsSqlDataBase=1 Then
If CurrentPage > 100 Then
Rs.Open SQL, Conn, 1, 1
Else
Set Rs = Newasp.Execute(SQL)
End If
Else
Rs.Open SQL, Conn, 1, 1
End If
Newasp.SqlQueryNum = Newasp.SqlQueryNum + 1
If Rs.BOF And Rs.EOF Then
Response.Write "<tr><td align=center colspan=10 class=TableRow1>还没有找到任何会员信息!</td></tr>"
Else
Rs.MoveFirst
If TotalPageNum > 1 then Rs.Move (CurrentPage - 1) * maxperpage
i = 0
Response.Write "<tr>"
Response.Write " <td colspan=10 class=tablerow2>"
Call showpage()
Response.Write "</td>"
Response.Write " <form name=selform method=post action="""">"
Response.Write "</tr>"
Do While Not Rs.EOF And i < CInt(maxperpage)
If Not Response.IsClientConnected Then Response.End
If (i mod 2) = 0 Then
strClass = "class=TableRow1"
Else
strClass = "class=TableRow2"
End If
Response.Write "<tr align=center>"
Response.Write " <td " & strClass & "><input type=checkbox name=seluserid value='" & Rs("userid") & "'></td>"
Response.Write " <td " & strClass & ">"
Response.Write "<a href='?action=edit&userid=" & Rs("userid") & "' title='用户昵称:" & Rs("nickname") & "'>"
If Rs("UserGrade") = 999 Then
Response.Write "<span class=style2>"
Else
Response.Write "<span>"
End If
Response.Write Rs("username")
Response.Write "</span></a>"
Response.Write " </td>"
Response.Write " <td " & strClass & ">"
Response.Write Rs("UserGroup")
Response.Write " </td>"
Response.Write " <td " & strClass & ">"
If Rs("UserGrade") = 999 Then
Response.Write "管理员"
Else
If Rs("UserClass") = 0 Then
Response.Write "计点会员"
ElseIf Rs("UserClass") = 1 Then
Response.Write "计时会员"
Else
Response.Write "计时到期"
End If
End If
Response.Write " </td>"
Response.Write " <td " & strClass & ">"
Response.Write "<a href='admin_mailist.asp?action=mail&useremail="
Response.Write Rs("usermail")
Response.Write "'><img src='images/email.gif' border=0 alt='给用户发邮件'></a>"
Response.Write " </td>"
Response.Write " <td " & strClass & ">"
Response.Write Rs("UserSex")
Response.Write " </td>"
Response.Write " <td nowrap " & strClass & ">"
Response.Write "<a href='?action=edit&userid=" & Rs("userid") & "'>编辑</a> | "
Response.Write "<a href='?action=del&userid=" & Rs("userid") & "'>删除</a>"
Response.Write " </td>"
Response.Write " <td nowrap " & strClass & ">"
If Rs("LastTime") >= Date Then
Response.Write "<font color=red>"
Response.Write Rs("LastTime")
Response.Write "</font>"
Else
Response.Write Rs("LastTime")
End If
Response.Write " </td>"
Response.Write " <td " & strClass & ">"
Response.Write Rs("userlogin")
Response.Write " </td>"
Response.Write " <td " & strClass & ">"
If Rs("UserLock") = 0 Then
Response.Write "<font color=blue>√</font>"
Else
Response.Write "<font color=red>×</font>"
End If
Response.Write " </td>"
Response.Write "</tr>"
Rs.movenext
i = i + 1
If i >= maxperpage Then Exit Do
Loop
End If
Rs.Close:Set Rs = Nothing
%>
<tr>
<td colspan=10 class=tablerow1>
<input class=Button type=button name=chkall value='全选' onClick=CheckAll(this.form)><input class=Button type=button name=chksel value='反选' onClick=ContraSel(this.form)> 管理选项:
<input class=button onClick="{if(confirm('确定删除选定的用户吗?')){this.document.form.submit();return true;}return false;}" type=submit value='删除用户' name=act>
<input class=button onClick="{if(confirm('确定激活选定的用户吗?')){this.document.form.submit();return true;}return false;}" type=submit value='激活用户' name=act>
<input class=button onClick="{if(confirm('确定锁定选定的用户吗?')){this.document.form.submit();return true;}return false;}" type=submit value='锁定用户' name=act>
<input class=button onClick="{if(confirm('确定转移选定的用户吗?')){this.document.form.submit();return true;}return false;}" type=submit value='转移用户' name=act> →
<select name='sUserGrade'>
<option value=''>↓请选择用户组↓</option>
<%
Set RsObj = Newasp.Execute("Select GroupName,Grades From NC_UserGroup where Grades <> 0 order by Groupid")
Do While Not RsObj.EOF
Response.Write Chr(9) & Chr(9) & "<option value=""" & RsObj("Grades") & "," & RsObj("GroupName") & """>"
Response.Write RsObj("GroupName")
Response.Write "</option>" & vbCrLf
RsObj.movenext
Loop
Set RsObj = Nothing
%>
</select>
</td>
</tr></form>
<tr>
<td colspan=10 class=tablerow1><%Call showpage()%></td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -