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

📄 admin_user.asp

📁 网络电视免费版
💻 ASP
字号:
<!--#include file="Config.asp" -->
<HTML><HEAD><TITLE>用户管理 </TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<meta name=keywords content="视听新时空(网络电视,网络广播,免费电影:全球最大的中文网络电视,广播网站)">
<link rel="stylesheet" href="admin.css" 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 leftMargin=0 topmargin="2">
<% 
if not isnull(UserName) and UserName<>"" then 
 if chkMaster(UserName) then   

  const MaxPerPage=25
   	dim totalPut
   	dim CurrentPage
   	dim TotalPages
   	dim i,j
   	dim sql
   	dim rs
	pubUserName=request("pubUserName")
   	if not isempty(request("page")) then
      		currentPage=cint(request("page"))
   	else
      		currentPage=1
   	end if
	
	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()
			else
			response.write "无效参数!"
			 response.end
			end if			
  	end if 
	sub delUser()
    conn.execute("delete from Admin_UserInfo where UserID in ("&selUserID&")")
	end sub
	
	sub isActive()
	conn.execute("update Admin_UserInfo set isActive=1 where UserID in ("&selUserID&")")
	end sub
	
	sub noActive()
	conn.execute("update Admin_UserInfo set isActive=0 where UserID in ("&selUserID&")")
	'response.write "无效参数!"
	end sub
	
	set rs=server.createobject("adodb.recordset") %>
      
<table width="95%" border=0 align="center" cellpadding=3 cellspacing=1 class="tableBorder">
  <tr  height=25> 
    <th height="25" colspan="7">用户管理</th>
  </tr>
  <tr align="center" height=25> 
    <td width="8%" class="forumRowHighlight">ID</td>
    <td width="12%" class="forumRowHighlight">选择</td>
    <td width="16%" class="forumRowHighlight">用户名</td>
    <td width="11%"  nowrap class="forumRowHighlight">邮件</td>
    <td width="21%"  nowrap class="forumRowHighlight">注册时间</td>
    <td width="21%"  nowrap class="forumRowHighlight">管理操作</td>
    <td width="11%"  nowrap class="forumRowHighlight">状态</td>
  </tr>
  <tr> 
    <td colspan="7" class="forumRowHighlight"> 
      <% 	 
		if pubUserName<>"" then
		sql="select * from Admin_UserInfo where  UserName like '%"&trim(pubUserName)&"%' and CategoryName='"&CategoryName&"' order by UserID Desc"
		else
		sql="select * from Admin_UserInfo Where CategoryName='"&CategoryName&"' order by UserID Desc"
		end if
	    rs.open sql,conn,1,1 
  	  if rs.eof and rs.bof then 
       		response.write "<table><tr><td border=""0"" width=""100%"" height=""100%"" cellspacing=""1"" cellpadding=""0"" bgcolor=""#FFFFFF""><p align=""center"">没有或没有找到任何用户,<a href=""Admin_UserSetting.asp"">点此添加新用户<a></p></td></tr></table>" 
   	else 
     		totalPut=rs.recordcount
      		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
           		showpage totalput,MaxPerPage,"Admin_User.asp"
            		showContent
            		showpage totalput,MaxPerPage,"Admin_User.asp"
       		else
          		if (currentPage-1)*MaxPerPage<totalPut then
            			rs.move  (currentPage-1)*MaxPerPage
            			dim bookmark
            			bookmark=rs.bookmark
           			showpage totalput,MaxPerPage,"Admin_User.asp"
            			showContent
             			showpage totalput,MaxPerPage,"Admin_User.asp"
        		else
	        		currentPage=1
           			showpage totalput,MaxPerPage,"Admin_User.asp"
           			showContent
           			showpage totalput,MaxPerPage,"Admin_User.asp"
	      		end if
	   	end if
   	rs.close 	
set rs=nothing
   	end if 
	         
   	sub showContent 
       	dim i 
	   	i=0 
%> </td>
  </tr>
  <form name="selform" method="post" >
    <% do while not rs.eof %>
    <tr> 
      <td height="25" align="center" class="forumRow"><%=rs("UserID")%></td>
      <td align="center" class="forumRow"> 
        <input type="checkbox" name="selUserID" id="selUserID" value="<%=rs("UserID")%>"> 
      </td>
      <td align="center" class="forumRow"><%=rs("UserName")%></td>
      <td align=center nowrap class="forumRow"><a href="mailto:<%=rs("Email")%>"><img src="images/Email.gif" width="16" height="17" border="0"></a></td>
      <td align=center nowrap class="forumRow"><%=DateTimeFormat(rs("RegDate"),1)%></td>
      <td align=center nowrap class="forumRow"><a href="Admin_UserSetting.Asp?UserID=<%=rs("UserID")%>&action=edit" class="ArticleList">设置权限</a></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>
    <%
	      i=i+1
	      if i>=MaxPerPage then exit do
	      rs.movenext
	loop
%>
    <tr> 
      <td colspan="7" class="forumRow">管理操作:选择/反选 
        <input type="checkbox" name="checkbox" value="checkbox" onClick="javascript:SelectAll()">  
        <input onClick="{if(confirm('确定删除选定的用户吗?')){this.document.selform.submit();return true;}return false;}" type=submit value=删除 name=action> 
        <input onClick="{if(confirm('确定激活选定的用户吗?')){this.document.selform.submit();return true;}return false;}" type=submit value=激活 name=action> 
        <input onClick="{if(confirm('确定锁定选定的用户吗?')){this.document.selform.submit();return true;}return false;}" type=submit value=锁定 name=action> 
        <input type=button name="Submit" value="添加用户" onClick="self.location='Admin_UserSetting.asp'" > 
      </td>
    </tr>
  </form>
  <tr> 
    <td colspan="7" class="forumRow"> 
      <%
   end sub 

	function showpage(totalnumber,maxperpage,filename)
  	dim n

  	if totalnumber mod maxperpage=0 then
     		n= totalnumber \ maxperpage
  	else
     		n= totalnumber \ maxperpage+1
  	end if
  	response.write "<table cellspacing=1 width='100%' border=0 colspan='4' ><form method=Post action="""&filename&"?pubUserName="&pubUserName&"""><tr><td align=right> "
  	if CurrentPage<2 then
    		response.write "共"&totalnumber&"位用户&nbsp;首页 上一页&nbsp;"
  	else
    		response.write ""&totalnumber&"位&nbsp;<a href="&filename&"?page=1&pubUserName="&pubUserName&">首页</a>&nbsp;"
    		response.write "<a href="&filename&"?page="&CurrentPage-1&"&pubUserName="&pubUserName&">上一页</a>&nbsp;"
  	end if

  	if n-currentpage<1 then
    		response.write "下一页 尾页"
  	else
    		response.write "<a href="&filename&"?page="&(CurrentPage+1)&"&pubUserName="&pubUserName&">"
    		response.write "下一页</a> <a href="&filename&"?page="&n&"&pubUserName="&pubUserName&">尾页</a>"
  	end if
   	response.write "&nbsp;页次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>页 "
    	response.write "&nbsp;<b>"&maxperpage&"</b>位用户/页 "
%>
      转到: 
      <select name='select' 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> <%   
	response.write "</td></tr></FORM></table>"
end function
%> </td>
  </tr>
</table> 
      <% 	  
  else
  msgtitle="用户管理"
  msginfo="<li>操作错误,你不是系统管理员,没有权限进行此项操作!</li>" 
  call Sysmsg(msgtitle,msginfo) 
  end if
else
  msgtitle="用户管理"
  msginfo="<li>操作错误,你没有登录系统!<li><a href=""User.Asp""  class=""ArticleList"">点此登录系统</a><li><a href=""./""  class=""ArticleList"">返回频道首页</a></li>" 
  call Sysmsg(msgtitle,msginfo) 
end if

		sub Sysmsg(msgtitle,msginfo)
		%>
      <br>
<table width="85%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableBorder" >
  <tr> 
    <th><%=msgtitle%></th>
  </tr>
  <tr> 
    <td class="forumRow"><%=msginfo%></td>
  </tr>
  <tr> 
    <td height="22" align="center" class="forumRowHighlight"><a href="javascript:history.go(-1)" >&lt;&lt; 
      返回上一页</a></td>
  </tr>
</table>
<br> 
      <%end sub %>
</BODY></HTML>
<%
CloseDatabase
%>

⌨️ 快捷键说明

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