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

📄 admin_user.asp

📁 为中小型企业与欲创业的个人提供一个合适的企业型网站
💻 ASP
字号:
<!--#include file="Include/Tyi86_setup.asp"-->
<!--#include file="Conn_User.asp" -->
<!--#include file=Include/check.asp-->
<!--#include file="other/Tyi86_md5.asp" -->
<link href="other/Admin.css" rel="stylesheet" type="text/css">
<%
    '日期格式转换函数
    function DateTimeFormat(DateTime,Format) 
    select case Format
    case "1"
    DateTimeFormat=""&year(DateTime)&"年"&month(DateTime)&"月"&day(DateTime)&"日"
    case "2"
    DateTimeFormat=""&month(DateTime)&"月"&day(DateTime)&"日"
    case "3" 
    DateTimeFormat=""&year(DateTime)&"-"&month(DateTime)&"-"&day(DateTime)&""
    case "4" 
    DateTimeFormat=""&year(DateTime)&"/"&month(DateTime)&"/"&day(DateTime)&""
    case "5"
    DateTimeFormat=""&month(DateTime)&"/"&day(DateTime)&""
    case "6"
    DateTimeFormat=""&year(DateTime)&"年"&month(DateTime)&"月"&day(DateTime)&"日<font color=red> "&FormatDateTime(DateTime,4)&"</font>"
    case "7"
    temp="星期日,星期一,星期二,星期三,星期四,星期五,星期六"
    temp=split(temp,",") 
    DateTimeFormat=temp(Weekday(DateTime)-1)
    case else
    DateTimeFormat=DateTime
    end select
    end function
%>
<% CheckAdmin3 %>
<HTML><HEAD><TITLE>用户管理 </TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
</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_User.execute("delete from "&Tyi86_DBTable&" where "&Tyi86_UserID&" in ("&selUserID&")")
    end sub
    sub isActive()
	Conn_User.execute("update "&Tyi86_DBTable&" set isActive=1 where "&Tyi86_UserID&" in ("&selUserID&")")
    end sub
    sub noActive()
	Conn_User.execute("update "&Tyi86_DBTable&" set isActive=0 where "&Tyi86_UserID&" in ("&selUserID&")")
    end sub
    sub general()
	Conn_User.execute("update "&Tyi86_DBTable&" set UserGrade=0 where "&Tyi86_UserID&" in ("&selUserID&")")
    end sub
    sub vipuser()
	Conn_User.execute("update "&Tyi86_DBTable&" set UserGrade=1 where "&Tyi86_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 = "Admin_User.asp"
    if not isnull(keyword) and keyword<>"" then 
        keyword=replace(replace(replace(keyword,"'","‘"),"<","&lt;"),">","&gt;")
		sql="select * from "&Tyi86_DBTable&" where "&Tyi86_UserName&" like '%"&keyword&"%'"
		sql=sql&" order by "&Tyi86_UserID&" desc"
    else  	
	sql = "select * from "&Tyi86_DBTable&" order by "&Tyi86_UserID&" desc"
    end if
    Rs.OPEN sql, Conn_User,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
    '显示多少页
    pagestart=CurrentPage-3
    pageend=CurrentPage+3
    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="Admin_User.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"><%=rs(Tyi86_UserID)%></td>
      <td align="center" class="forumRow"><input type="checkbox" name="selUserID" id="selUserID" value="<%=rs(Tyi86_UserID)%>" style="border:0PX "></td>
      <td align="center" class="forumRow"><a href="Admin_UserSet.asp?userID=<%=rs(Tyi86_UserID)%>" title=修改用户名及密码 class="ArticleList"><%=rs(Tyi86_UserName)%></a></td>
      <td align=center nowrap class="forumRow"><%=rs(Tyi86_UserEmail)%></td>
      <td align=center nowrap class="forumRow"><%=DateTimeFormat(rs(Tyi86_JoinDate),1)%></td>
      <td nowrap class="forumRow"><%=rs(Tyi86_UserIP)%>*
          <font color=red><%if rs(Tyi86_UserGrade)=0 then%> 
          普通用户
<%end if%>
<%if rs(Tyi86_UserGrade)=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>暂时还没有注册用户</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='Admin_User.asp'" >      </td>
    </tr>
  </form>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="7" class="forumRow"> <%call showpage()%> </td>
  </tr>
</table> 
</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 + -