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

📄 admin_user.asp

📁 网站 QCNEWS后台管理程序,风格流行功能强大
💻 ASP
字号:
<!--#include file="admin_head.asp"-->
<br><br>

<%
Select Case Request("method")
Case 1 
	Call DelUser()
End Select

	const MaxPerPage=10
   	dim totalPut
   	dim CurrentPage
	if not isempty(request("page")) then
      		currentPage=cint(request("page"))
   	else
      		currentPage=1
   	end if
%>
<table width="95%" border="1" cellspacing="0" cellpadding="3" align="center" bordercolorlight="#ECEEE4" bordercolordark="#CCCABC">
  <tr> 
    <td colspan="7" align="center" height="30" background="image/tablebg.gif"><b>用 
      户 信 息 管 理</b> </td>
  </tr>
  <tr valign="middle"> 
    <td height="25" align="center">ID</td>
    <td height="25" align="center">操作</td>
    <td height="25" align="center">用户名</td>
    <td height="25" align="center">管理级别</td>
    <td height="25" align="center">最后登陆时间</td>
    <td height="25" align="center">最后登陆IP</td>
	<td height="25" align="center">修改</td>
  </tr>
  <tr valign="middle"> 
    <td height="25" colspan="7" align="center">
	<%
  set rs=server.createobject("adodb.recordset")
  Sql = "Select id,username,flag,lastlogin,lastloginip from article_admin order by id desc"
  rs.open sql,conn,1,1
  if rs.eof and rs.bof then
	Response.Write "还没有用户信息。"
  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 action="" name="form1" method="post">
  <%do while not rs.eof%>
  <tr valign="middle"> 
    <td height="25" align="center"><%=rs(0)%></td>
    <td height="25" align="center"><input type="checkbox" name="userid" value="<%=rs(0)%>"></td>
    <td height="25" align="center"><%=Qcdn.HTMLcode(rs(1))%></td>
    <td height="25" align="center">
	<%
	select case rs(2)
		case 1 
			response.Write("管理员")
		case 2 
			response.Write("审核员")
		case 3
			response.Write("录入员")
	end select%></td>
    <td height="25" align="center"><%if isnull(rs(3)) then response.Write("此用户还未登陆过") else response.Write rs(3) end if%></td>
    <td height="25" align="center"><%if isnull(rs(4)) then response.Write("此用户还未登陆过") else response.Write rs(4) end if%></td>
	<td height="25" align="center"><a href="admin_adduser.asp?unid=<%=rs(0)%>">修改</a></td>
  </tr>
  <%
  i=i+1
	      if i>=MaxPerPage then exit do
  rs.movenext
  loop
  %>
  <tr valign="middle"> 
    <td height="25" colspan="7"> 管理操作:全部选择 
      <input type="checkbox" name="chkall" onClick="javascript:CheckAll(this.form)"> 
      <input onClick="{if(confirm('确定删除选定的用户吗?')){this.document.form1.submit();return true;}return false;}" type=submit value=删除 name=action class="tbutton"> 
	  <input type="hidden" name="method" value="1">
	  <input type="button" name="button" value="添加用户" class="tbutton" onClick="self.location='Admin_addUser.asp'">
    </td>
  </tr>
  </form>
  <tr valign="middle"> 
    <td height="25" colspan="7" align="center">
	      <%
   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&"""><tr><td align=right> "
  	if CurrentPage<2 then
    		response.write "共<b><font color=red>"&totalnumber&"</font></b>位用户&nbsp;首页 上一页&nbsp;"
  	else
    		response.write "共<b><font color=red>"&totalnumber&"</font>位用户&nbsp;<a href="&filename&"?page=1>首页</a>&nbsp;"
    		response.write "<a href="&filename&"?page="&CurrentPage-1&">上一页</a>&nbsp;"
  	end if

  	if n-currentpage<1 then
    		response.write "下一页 尾页"
  	else
    		response.write "<a href="&filename&"?page="&(CurrentPage+1)&">"
    		response.write "下一页</a> <a href="&filename&"?page="&n&">尾页</a>"
  	end if
   	response.write "&nbsp;页次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>页 "
    	response.write "&nbsp;<b>"&maxperpage&"</b>位用户/页 "
%>
      转到: 
      <select name='page' 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

Sub DelUser()
	if Request("userid") = "" then
		Errmsg = "<li>发生异常错误<li>错误编号为: error 102。<li>请和青创网络联系解决问题。"
		call Qcdn.Err_List(errmsg,1)
		Response.end
	end if
	userid = Request("userid")
	sql = "Delete from article_admin where id in ("& userid &")"
	conn.execute(sql)
	Response.Write("<script>alert(""删除成功"");location.href=""admin_user.asp"";</script>")
	Response.End()
End Sub
%>
	</td>
  </tr>
</table>
<!--#include file="admin_copy.asp"-->

⌨️ 快捷键说明

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