admin_user.asp
上传用户:comthink
上传日期:2021-05-06
资源大小:1280k
文件大小:7k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

HTML/CSS

  1. <!--#include file="conn.asp"-->
  2. <!-- #include file="inc/const.asp" -->
  3. <!--#include file="md5.asp"-->
  4. <title><%=txl_info(0)%>--管理页面</title>
  5. <!--#include file="inc/admin_css.asp"-->
  6. <meta NAME=GENERATOR Content="Microsoft FrontPage 3.0" CHARSET=GB2312>
  7. <BODY leftmargin="0" bottommargin="0" rightmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor="#DDEEFF">
  8. <%
  9. if not supermaster or session("flag")="" then
  10. Errmsg=Errmsg+"<br>"+"<li>本页面为管理员专用,请<a href=admin_index.asp target=_top>登陆</a>后进入。<br><li>您没有管理本页面的权限。"
  11. call txl_error()
  12. response.end
  13. end if
  14. dim trs
  15. dim userinfo
  16. dim usertitle
  17. %>
  18. <table cellpadding="2" cellspacing="1" border="0" width="95%" class="tableBorder" align=center>
  19. <tr>
  20. <th align=left colspan=6 height=23>用户管理</th>
  21. </tr>
  22. <tr>
  23. <td width=20% class=txlrow>注意事项</td>
  24. <td width=80% class=txlrow colspan=5 style="line-height: 150%">①点删除按钮将删除所选定的用户,此操作是不可逆的,请谨慎操作;<br>②当前状态栏显示用户当前是否需要验证、被锁定等状态;<br>③点击正常功能,可以将需要验证和被锁定的用户设置为正常;<br>④点用户名进行相应的资料操作;</td>
  25. </tr>
  26. <form action="?" method=post>
  27. <tr>
  28. <td width=20% class=txlrow>快速搜索</td>
  29. <td width=80% class=txlrow colspan=5>
  30. <select size=1 name="userSearch" onchange="javascript:submit()">
  31. <option value="0">请选择查询条件</option>
  32. <option value="1" <%if request("userSearch")=1 then%>selected<%end if%>>列出所有注册用户</option>
  33. <option value="2" <%if request("userSearch")=2 then%>selected<%end if%>>列出等待验证用户</option>
  34. <option value="3" <%if request("userSearch")=3 then%>selected<%end if%>>列出被锁定的用户</option>
  35. <option value="4" <%if request("userSearch")=4 then%>selected<%end if%>>列出所有班级客人</option>
  36. <option value="5" <%if request("userSearch")=5 then%>selected<%end if%>>列出所有班级成员</option>
  37. <option value="6" <%if request("userSearch")=6 then%>selected<%end if%>>列出所有班级贵宾</option>
  38. <option value="7" <%if request("userSearch")=7 then%>selected<%end if%>>版主及管理员</option>
  39. </select>
  40. </td>
  41. </tr>
  42. </form>
  43. <%if request("action")="" then%>
  44. <tr>
  45. <th colspan=6 align=left height=23>搜索结果</th>
  46. </tr>
  47. <%
  48. dim currentpage,page_count,Pcount
  49. dim totalrec,endpage
  50. currentPage=request("page")
  51. if currentpage="" or not isInteger(currentpage) then
  52. currentpage=1
  53. else
  54. currentpage=clng(currentpage)
  55. if err then
  56. currentpage=1
  57. err.clear
  58. end if
  59. end if
  60. Set rs= Server.CreateObject("ADODB.Recordset")
  61. select case request("userSearch")
  62. case 1
  63. sql="select userid,realname,usergroup,lasttime,lockuser,usergroupid from [user] order by regtime desc"
  64. case 2
  65. sql="select userid,realname,usergroup,lasttime,lockuser,usergroupid from [user] where usergroupid=4 and lockuser=1 order by regtime desc"
  66. case 3
  67. sql="select userid,realname,usergroup,lasttime,lockuser,usergroupid from [user] where lockuser=2 order by regtime desc"
  68. case 4
  69. sql="select userid,realname,usergroup,lasttime,lockuser,usergroupid from [user] where usergroupid=4 order by regtime desc"
  70. case 5
  71. sql="select userid,realname,usergroup,lasttime,lockuser,usergroupid from [user] where usergroupid=3 order by regtime desc"
  72. case 6
  73. sql="select userid,realname,usergroup,lasttime,lockuser,usergroupid from [user] where usergroupid=5 order by regtime desc"
  74. case 7
  75. sql="select userid,realname,usergroup,lasttime,lockuser,usergroupid from [user] where usergroupid=1 order by regtime desc"
  76. case else
  77. sql="select userid,realname,usergroup,lasttime,lockuser,usergroupid from [user] order by regtime desc"
  78. end select
  79. rs.open sql,conn,1,1
  80. if rs.eof and rs.bof then
  81. response.write "<tr><td colspan=6 class=txlrow>没有找到相关记录。</td></tr>"
  82. else
  83. %>
  84. <FORM METHOD=POST ACTION="?action=touser">
  85. <tr align=center>
  86. <td class=txlHeaderBackgroundAlternate><B>用户名</B></td>
  87. <td class=txlHeaderBackgroundAlternate><B>用户类别</B></td>
  88. <td class=txlHeaderBackgroundAlternate><B>当前状态</B></td>
  89. <td class=txlHeaderBackgroundAlternate><B>最后登陆</B></td>
  90. <td class=txlHeaderBackgroundAlternate><B>权限</B></td>
  91. <td class=txlHeaderBackgroundAlternate><B>操作</B></td>
  92. </tr>
  93. <%
  94. rs.PageSize = Cint(txl_set(12))
  95. rs.AbsolutePage=currentpage
  96. page_count=0
  97. totalrec=rs.recordcount
  98. while (not rs.eof) and (not page_count = Cint(txl_set(12)))
  99. %>
  100. <tr>
  101. <td class=txlrow align=center><a href="admin_uedit.asp?userid=<%=rs("userid")%>"><%=rs("realname")%></a></td>
  102. <td class=txlrow width=30% align=center><%=rs("usergroup")%></a></td>
  103. <td class=txlrow width=20% align=center><%if rs("lockuser")=0 then%>正常<%elseif rs("lockuser")=1 then%>验证<%elseif rs("lockuser")=2 then%>锁定<%end if%></a></td>
  104. <td class=txlrow width=15% align=center><%if rs("lasttime")<>"" and isdate(rs("lasttime")) then%><%=Formatdatetime(rs("lasttime"),2)%><%end if%></td>
  105. <td class=txlrow width=8% align=center><a href="admin_uedit.asp?userid=<%=rs("userid")%>">编辑</a></td>
  106. <td class=txlrow align=center><input type="checkbox" name="userid" value="<%=rs("userid")%>" <%if rs("usergroupid")=1 then response.write "disabled"%>></td>
  107. </tr>
  108. <%
  109. page_count = page_count + 1
  110. rs.movenext
  111. wend
  112. Pcount=rs.PageCount
  113. %>
  114. <tr><td colspan=6 class=txlrow align=center>分页:
  115. <%
  116. if currentpage > 4 then
  117. response.write "<a href=""?page=1"">[1]</a> ..."
  118. end if
  119. if Pcount>currentpage+3 then
  120. endpage=currentpage+3
  121. else
  122. endpage=Pcount
  123. end if
  124. for i=currentpage-3 to endpage
  125. if not i<1 then
  126. if i = clng(currentpage) then
  127. response.write " <font color=#ce0000>["&i&"]</font>"
  128. else
  129. response.write " <a href=""?page="&i&""">["&i&"]</a>"
  130. end if
  131. end if
  132. next
  133. if currentpage+3 < Pcount then
  134. response.write "... <a href=""?page="&Pcount&""">["&Pcount&"]</a>"
  135. end if
  136. %>
  137. </td>
  138. </tr>
  139. <tr>
  140. <td colspan=6 class=txlrow align=center><B>请选择您需要进行的操作</B>: <input type="radio" name="useraction" value=3 checked> 验证 <input type="radio" name="useraction" value=2> 锁定<input type="radio" name="useraction" value=1> 删除</td>
  141. </tr>
  142. <tr>
  143. <td colspan=6 class=txlrow align=center><input type=submit name=submit1 value="执行选定的操作"  onclick="{if(confirm('确定执行选择的操作吗?')){return true;}return false;}"></td>
  144. </tr>
  145. </FORM>
  146. <%
  147. end if
  148. rs.close
  149. set rs=nothing
  150. elseif request("action")="touser" then
  151. response.write "<tr><th colspan=6 height=23 align=left>执行结果</th></tr>"
  152. if request("useraction")="" then
  153. response.write "<tr><td colspan=6 class=txlrow>请指定相关参数。</td></tr>"
  154. founderr=true
  155. end if
  156. if request("userid")="" then
  157. response.write "<tr><td colspan=6 class=txlrow>请选择相关用户。</td></tr>"
  158. founderr=true
  159. end if
  160. if not founderr then
  161. if request("useraction")=1 then
  162. conn.execute("delete from [user] where userid in ("&replace(request("userid"),"'","")&")")
  163. response.write "<tr><td colspan=6 class=txlrow>操作成功。</td></tr>"
  164. elseif request("useraction")=2 then
  165. conn.execute("update [user] set lockuser=2 where userid in ("&replace(request("userid"),"'","")&")")
  166. response.write "<tr><td colspan=6 class=txlrow>操作成功。</td></tr>"
  167. elseif request("useraction")=3 then
  168. conn.execute("update [user] set lockuser=0 where userid in ("&replace(request("userid"),"'","")&")")
  169. response.write "<tr><td colspan=6 class=txlrow>操作成功。</td></tr>"
  170. else
  171. response.write "<tr><td colspan=6 class=txlrow>错误的参数。</td></tr>"
  172. end if
  173. end if
  174. end if
  175. %>