www.gusucode.com > 中网景企业网站管理系统 2008源码程序 > admin/users.asp

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="opendb.asp" -->
<%
'Call CheckUserLogin(username)
Call CheckAdmin()
Call CnkAdminRight(20)
Dim action,Submit,i
Dim keyci,top,userclass,theitem,titlename,searchmethod,jibie,setweblevel
action=Request("action")
Submit=Request("Submit")
keyci=Trim(Request("keyci"))
'top=Request("top")
userclass=Request("userclass")
jibie=Request("jibie")
setweblevel=Request("setweblevel")
thispage=request("page_code")
if thispage="" then
	thispage=1
else
	thispage=clng(thispage)
end if
if thispage<1 then thispage=1

PagePara="?top="&top&"&userclass="&userclass&"&keyci="&keyci&"&jibie="&jibie&"&setweblevel="&setweblevel

Select Case Submit
Case "删除"
  for each theitem in Request("checkuserid")
  conn.execute("delete from cnk_users where userid="&theitem)
  next
  Call alertmsg_url("删除成功",PagePara)
Case "删除用户全部帖子"
  for each theitem in Request("checkuserid")
  conn.execute("delete from yfindex where userid="&theitem)
  next
  Call alertmsg_url("删除帖子成功",PagePara)
Case "封锁ID"
  for each theitem in Request("checkuserid")
  conn.execute("update cnk_users set isLocked=1 where userid="&theitem)
  next
  Call alertmsg_url("封锁ID成功",PagePara)
Case "解除封锁ID"
  for each theitem in Request("checkuserid")
  conn.execute("update cnk_users set isLocked=0 where userid="&theitem)
  next
  Call alertmsg_url("解除封锁ID成功",PagePara)
Case "通过审核"
  for each theitem in Request("checkuserid")
  conn.execute("update cnk_users set isPassed=1 where userid="&theitem)
  next
  Call alertmsg_url("审核成功",PagePara)
Case "加入"
  Dim jb,ln,lni,ugp,sqlstr
  ugp=Request("usergroup")
  if ugp="" then Call alertmsg("请选择组")
  for each theitem in Request("checkuserid")
	conn.execute("update cnk_users set weblevel="&ugp&" where userid="&theitem)
  next
  Call alertmsg_url("加入组成功",PagePara)
End Select

sql="select userid,username,LastLoginTime,LastLoginIP,regTime,LastLoginTime,PubNum,RepNum,IsLocked from cnk_users"
if searchmethod="supersearch" then
	
else
	if keyci<>"" then sql=sql&" where username like '%"&keyci&"%'"
	if jibie<>"" then sql=sql&" where jibie='"&jibie&"'"
	if setweblevel<>"" then sql=sql&" where weblevel="&setweblevel
	select case userclass
	case "1" 
		sql=sql&" where weblevel=0"
	case "2" 
		sql=sql&" where weblevel=1"
	case "3" 
		sql=sql&" where isLocked=1"
	case "4"
		sql=sql&" where isPassed=0"
	end select
'	select case top
'	case ""
'		sql=sql&" order by regtime desc"
'		titlename="注册时间"
'	case "1"
'		sql=sql&" order by LastLoginTime desc"
'		titlename="最后登录时间"
'	case "2"
'		sql=sql&" order by PubNum desc"
'		titlename="发帖数"
'	case "3"
'		sql=sql&" order by RepNum desc"
'		titlename="回复数"
'	end select
end if
sql=sql&" order by UserID Desc"
rs.open sql,conn,1,1%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Author" content="CNKBBS Powered by websys.cn - Leung">
<link href="admin.css" rel="stylesheet" type="text/css">
<script language="javascript" src="inc/cnkgl.js"></script>
</head>

<body>
<div class="cnkbox">
  <div class="title">注 册 用 户</div>
  <div class="content" align="center">
    <table width="96%" border="0" cellspacing="1">
      <tr>
        <td width="60%" bgcolor="#FFFFFF"><!--strong>排序</strong>:<a href="?">按注册时间</a> | <a href="?top=1">按登录时间</a> | <a href="?top=2">按发帖数量</a> | <a href="?top=3">按回复数量</a--></td>
        <td width="40%" bgcolor="#FFFFFF"><strong>分类</strong>:<a href="?userclass=1">普通会员</a> | <a href="?userclass=2">VIP组</a> | <a href="?userclass=3">被封ID</a> | <a href="?userclass=4">待审核</a> </td>
      </tr>
    </table>
    <br>
    <%If rs.recordcount=0 Then
	  Response.Write "未有用户"
	  Response.end
	  Else
      	rs.pagesize=30
		if thispage>rs.pagecount then thispage=rs.pagecount
		rs.AbsolutePage = thispage%>
    <table width="96%" border="0" cellspacing="1">
      <tr>
        <td width="50%" bgcolor="#DEEFFE"><% = GetPageList(rs.pagecount,thispage,PagePara,0) %></td>
        <td width="50%" align="right" bgcolor="#DEEFFE">共有 <strong><%=rs.recordcount%></strong>个用户
        <% = GetPage(rs.pagecount,thispage,PagePara,0) %></td>
      </tr>
    </table>
    <form name="form2" method="post" action="users.asp">
    <table width="96%" border="0" cellpadding="3" cellspacing="1" bgcolor="#999999">
      <tr>
        <td width="16%" class="tabletitle"><%= titlename %></td>
        <td width="21%" class="tabletitle">用户名</td>
        <!--td width="14%" class="tabletitle"> 设置权限</td-->
        <td width="16%" class="tabletitle">最后登录IP</td>
		<td width="17%" class="tabletitle">最后登录时间</td>
        <td width="8%" class="tabletitle">状态</td>
        <td width="8%" class="tabletitle">选择</td>
      </tr>
      <% for i=1 to rs.pagesize%>
      <tr bgcolor="#DEEFFE"  onMouseOut="mOut(this,'#DEEFFE');" onMouseOver="mOvr(this,'#EBFFBB');" align="center">
        <td><% if top="" then Response.Write(rs("regTime"))
		if top="1" then Response.Write(rs("LastLoginTime"))
		if top="2" then Response.Write(rs("PubNum"))
		if top="3" then Response.Write(rs("RepNum"))
		%></td>
        <td><a href="user_info.asp?userid=<% =rs("userid")%>"><% =rs("username")%></a></td>
        <!--td><a href="user_right.asp?userid=<%' =rs("userid")%>">设置权限</a></td-->
        <td><a href="LimitIP.asp?limitip=<% =rs("LastLoginIP")%>" title="点击限制这个IP地址">
          <% =rs("LastLoginIP")%></a></td>
		<td><% =rs("LastLoginTime")%></td>
        <td>
		<% If rs("IsLocked")=0 Then
            Response.Write("<span style=""color:#009900"">开放</font>")
         Else 
            Response.Write("<span style=""color:#FF0000"">被封ID</font>")
        End If %></td>
        <td>
          <label>
          <input name="checkuserid" type="checkbox" id="checkuserid" value="<%=rs("userid")%>">
          </label></td>
      </tr>
      <%rs.movenext
       if rs.eof then exit for
       next%>
    </table>
    <br>
    <div>全选:<input type="checkbox" name="checkbox" value="Check All" onClick="mm()">
      <input name="thispage" type="hidden" id="thispage" value="<%= thispage %>">
      <input name="keyci" type="hidden" id="keyci" value="<%= keyci %>">
	  <input name="top" type="hidden" id="top" value="<%= top %>">
	  <input name="userclass" type="hidden" id="userclass" value="<%= userclass %>">
      请您选择后操作:
      <input name="Submit" type="submit" class="button" id="Submit" value="删除" onClick="return cfdel()">
      <input name="Submit" type="submit" class="button" id="Submit" value="删除用户全部帖子" onClick="return cfdel()">
      <input name="Submit" type="submit" class="button" id="Submit" value="封锁ID">
	  <input name="Submit" type="submit" class="button" id="Submit" value="解除封锁ID">
	  <input name="Submit" type="submit" class="button" id="Submit" value="通过审核">
      加入组:
      <select name="usergroup" class="input" id="usergroup">
        <option value="" selected>选择组</option>
        <option value="0">普通会员</option>
		<option value="1">VIP会员</option>
        <!--option value="2">版主组</option>
        <option value="3">超级版主组</option>
        <option value="4">管理员组</option>
		<option value="5">站长组</option-->
      </select>
      <input name="Submit" type="submit" class="button" id="Submit" value="加入">
      <br>
    要让版主管理相应的版块,请在版块管理中添加版主</div>
    </form>
    <table width="96%" border="0" cellspacing="1">
      <tr>
        <td width="41%" bgcolor="#DEEFFE"><% = GetPageList(rs.pagecount,thispage,PagePara,0) %></td>
		<form name="form1" method="post" action="users.asp">
		<td width="16%" align="center" bgcolor="#DEEFFE">
          <label>
          <input name="keyci" type="text" class="input" id="keyci" onFocus="if (this.value=='用户名') this.value='';" value="用户名" size="10" maxlength="20">
            </label>
          <label>
          <input name="Submit" type="submit" class="button" value="搜索">
          </label>
          <!--a href="?action=search">高级搜索</a--> </td>
	    </form>
        <td width="43%" align="right" bgcolor="#DEEFFE">共有 <strong><%=rs.recordcount%></strong> 个用户
        <% = GetPage(rs.pagecount,thispage,PagePara,0) %></td>
      </tr>
    </table>
    <%End If
	rs.close
	 %>
  </div>
</div>
<%set rs=nothing
Call foot()
Call closedb()%>
</body>
</html>