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

📄 adminuser.asp

📁 网站代码
💻 ASP
字号:
<!--#include file="Include/conn.asp" -->
<!--#include file="Include/check.asp"-->
<!--#include file="Include/md5.asp" -->
<!--#include file="include/char.asp" -->
<!--#include file="Include/Pw_Function.asp" -->
<% CheckAdmin3%>
<HTML><HEAD><TITLE>用户管理 </TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<link href="Img/Admin.css" rel="stylesheet" type="text/css">
</HEAD>
<SCRIPT LANGUAGE=javascript>
<!--
function SelectAll() {
	for (var i=0;i<document.selform.selUserID.length;i++) {
		var e=document.selform.selUserID[i];
		e.checked=!e.checked;
	}
}
//-->
</script>
<BODY>
<% 
   	dim totalPut
   	dim CurrentPage
   	dim TotalPages
   	dim pubUserName,j,selUserID	
	if not isempty(request("selUserID")) then
     		selUserID=request("selUserID")
            if request("action")="删除" then
			call delUser()
			elseif request("action")="激活" then
			call isActive()
			elseif request("action")="锁定" then
			call noActive()
			elseif request("action")="设为普通用户" then
			call general()
			elseif request("action")="设为VIP用户" then
			call vipuser()
			else
			response.write "无效参数!"
			 response.end
			end if			
  	end if 
	sub delUser()
    conn.execute("delete from [User] where UserID in ("&selUserID&")")
	end sub
	
	sub isActive()
	conn.execute("update [User] set isActive=1 where UserID in ("&selUserID&")")
	end sub
	
	sub noActive()
	conn.execute("update [User] set isActive=0 where UserID in ("&selUserID&")")
	'response.write "无效参数!"
	end sub

	sub general()
	conn.execute("update [User] set Grade=0 where UserID in ("&selUserID&")")
	end sub

	sub vipuser()
	conn.execute("update [User] set Grade=1 where UserID in ("&selUserID&")")
	end sub

	set rs=server.createobject("adodb.recordset") %>
<table width="550" border="0" cellspacing="1" cellpadding="3"  align=center>
<tr> 
<td height="23" colspan="2" ><B>说明</B>:<BR>点击用户名可以查看及修改用户信息,点EMAIL图标给用户发电子邮件。<BR>
管理操作,删除用户、激活、锁定用户,设置用户级别为普通用户还是VIP用户。
</td>
</tr>
</table>     
<table width="550" border=0 align="center" cellpadding=3 cellspacing=1 bgcolor="#CCCCCC">
  <tr bgcolor="#FFFFFF"  height=25> 
    <th height="25" colspan="7">用户管理</th>
  </tr>
  <tr align="center" bgcolor="#EAEAEA" height=25> 
    <td width="20" height="24" class="forumRowHighlight">ID</td>
    <td width="31" class="forumRowHighlight">选择</td>
    <td width="53" class="forumRowHighlight">用户名</td>
    <td width="37"  nowrap class="forumRowHighlight">邮件</td>
    <td width="104"  nowrap class="forumRowHighlight">注册时间</td>
    <td  nowrap bgcolor="#EAEAEA" class="forumRowHighlight">用户IP*级别</td>
    <td width="26"  nowrap class="forumRowHighlight">状态</td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="7" > 
      <% dim n,pagename,keyword,maxpagecount,TotalNumber
         dim pagestart,pageend,strurl,ii
keyword=Trim(Request("keyword"))	
if not isempty(request("page")) then
      		CurrentPage=cint(request("page"))
   	else
      		CurrentPage=1
   	end if
Set Rs = Server.CreateObject("ADODB.Recordset")
  const MaxPerPage = 20  '###每页显示数
  pagename = "AdminUser.asp"
if not isnull(keyword) and keyword<>"" then 
        keyword=replace(replace(replace(keyword,"'","‘"),"<","&lt;"),">","&gt;")
		sql="select * from [User] where UserName  like '%"&keyword&"%'"
		sql=sql&" order by RegTime desc"
else  	
	sql = "select * from [User] order by RegTime desc"
end if
Rs.OPEN sql, Conn,1,3

if not(Rs.BOF or Rs.EOF) then
Rs.pagesize = MaxPerPage 
maxpagecount=Rs.pagecount  '###记录总页数
TotalNumber=cint(Rs.RecordCount)'###记录总数
Rs.absolutepage = CurrentPage '###当前页数
 ii=0
Rem #######显示多少页##########
pagestart=CurrentPage-3
pageend=CurrentPage+3
Rem ##########################
n=CurrentPage
if pagestart<1 then
pagestart=1
end if
if pageend>maxpagecount then
pageend=maxpagecount
end if
if n<maxpagecount then
n=maxpagecount
end if
%>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <form name="searchsoft" method="POST" action="Adminuser.asp" target="main"><tr>
    <td>
按用户名称搜索:<input class=smallInput type="text" name="keyword" size="25"> <input type="submit" value="搜索用户" name="submit" class="kuang">
    </td>
  </tr></form>
</table></td>
  </tr>
  <form name="selform" method="post" >
    <% do while not Rs.eof and ii <Rs.pagesize %>
    <tr bgcolor="#FFFFFF"> 
      <td height="25" align="center" class="forumRow"><%=ii%></td>
      <td align="center" class="forumRow"> 
      <input type="checkbox" name="selUserID" id="selUserID" value="<%=rs("UserID")%>" style="border:0PX ">      </td>
      <td align="center" class="forumRow"><a href="AdminUserSet.Asp?userID=<%=rs("UserID")%>" title=修改用户名及密码 class="ArticleList"><%=rs("UserName")%></a></td>
      <td align=center nowrap class="forumRow"><%=rs("UserEmail")%></td>
      <td align=center nowrap class="forumRow"><%=DateTimeFormat(rs("RegTime"),1)%></td>
      <td  nowrap class="forumRow"><%=rs("UserIP")%>*
          <font color=red><%if rs("Grade")=0 then%> 
          普通用户
          <%end if%>
          <%if rs("Grade")=1 then%> 
          VIP 用户
          <%end if%>
      </font></td>
      <td align=center nowrap class="forumRow"> 
      <% if rs("isActive")=true then 
			  response.write "正常"
			  else 
			  response.write "<font color=red>锁定<font>"
			  end if %> </td>
    </tr>
   <% 
               Rs.movenext
               ii=ii+1                     
                 loop       
               set  Rs=nothing
              %>  
<%else%>
<p align="center"> 
          <br>
          暂时还没有注册用户,<a href="ChkReg.asp">请你添加用户!</a><br><br></p>
<%end if%>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="7" class="forumRow">管理操作:反选 
        <input type="checkbox" name="checkbox" value="checkbox" onClick="javascript:SelectAll()" style="border:0PX ">  
        <input class="kuang" onClick="{if(confirm('确定删除选定的用户吗?')){this.document.selform.submit();return true;}return false;}" type=submit value=删除 name=action> 
        <input class="kuang" onClick="{if(confirm('确定激活选定的用户吗?')){this.document.selform.submit();return true;}return false;}" type=submit value=激活 name=action> 
        <input class="kuang" onClick="{if(confirm('确定锁定选定的用户吗?')){this.document.selform.submit();return true;}return false;}" type=submit value=锁定 name=action> 
        <input class="kuang" onClick="{if(confirm('确定用户为普通用户吗?')){this.document.selform.submit();return true;}return false;}" type=submit value=设为普通用户 name=action> 
        <input class="kuang" onClick="{if(confirm('确定用户为VIP用户吗?')){this.document.selform.submit();return true;}return false;}" type=submit value=设为VIP用户 name=action> 
      <input class="kuang" type=button name="Submit" value="所有用户" onClick="self.location='AdminUser.asp'" >      </td>
    </tr>
  </form>

  <tr bgcolor="#FFFFFF"> 
    <td colspan="7" class="forumRow"> <%call showpage()%>    </td>
  </tr>
</table> 
     <p align="center"><%=Ver%><BR><%=Copyright%></p>
</BODY></HTML>
<%sub showpage()%>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="2">
                <tr><form method="POST" action="<%=PageName%>" >
                  <td class="td1" align="center">共有<%=TotalNumber%>位用户   <a href=<%=PageName%>?page=1 title=返回第一页><font face="Webdings">97</font></a> <% for i=pagestart to pageend
            if i=0 then 
            i=1
            end if
            strurl="<a href="&pagename&"?page="&i&" title=第"&i&"页>["&i&"]</a>"
response.write strurl
response.write " "
next
            %><a href=<%=PageName%>?page=<%=maxpagecount%> title=尾页><font face="Webdings">8:</font></a> 页次:<font color=red><%=CurrentPage%></font> / <%=maxpagecount%>页   每页:<%=MaxPerPage%>              
      转到:<select name='page' align="absmiddle" size='1' style="font-size: 9pt" onChange='javascript:submit()'>
            <%for i = 1 to n%>
            <option value='<%=i%>' <%if CurrentPage=cint(i) then%> selected <%end if%>>第<%=i%>页</option>
            <%next%>
          </select>
                </td></form>
                </tr>
</table>
<%end sub
%>

⌨️ 快捷键说明

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