admin_user.asp
资源名称:txl.zip [点击查看]
上传用户:comthink
上传日期:2021-05-06
资源大小:1280k
文件大小:7k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
HTML/CSS
- <!--#include file="conn.asp"-->
- <!-- #include file="inc/const.asp" -->
- <!--#include file="md5.asp"-->
- <title><%=txl_info(0)%>--管理页面</title>
- <!--#include file="inc/admin_css.asp"-->
- <meta NAME=GENERATOR Content="Microsoft FrontPage 3.0" CHARSET=GB2312>
- <BODY leftmargin="0" bottommargin="0" rightmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor="#DDEEFF">
- <%
- if not supermaster or session("flag")="" then
- Errmsg=Errmsg+"<br>"+"<li>本页面为管理员专用,请<a href=admin_index.asp target=_top>登陆</a>后进入。<br><li>您没有管理本页面的权限。"
- call txl_error()
- response.end
- end if
- dim trs
- dim userinfo
- dim usertitle
- %>
- <table cellpadding="2" cellspacing="1" border="0" width="95%" class="tableBorder" align=center>
- <tr>
- <th align=left colspan=6 height=23>用户管理</th>
- </tr>
- <tr>
- <td width=20% class=txlrow>注意事项</td>
- <td width=80% class=txlrow colspan=5 style="line-height: 150%">①点删除按钮将删除所选定的用户,此操作是不可逆的,请谨慎操作;<br>②当前状态栏显示用户当前是否需要验证、被锁定等状态;<br>③点击正常功能,可以将需要验证和被锁定的用户设置为正常;<br>④点用户名进行相应的资料操作;</td>
- </tr>
- <form action="?" method=post>
- <tr>
- <td width=20% class=txlrow>快速搜索</td>
- <td width=80% class=txlrow colspan=5>
- <select size=1 name="userSearch" onchange="javascript:submit()">
- <option value="0">请选择查询条件</option>
- <option value="1" <%if request("userSearch")=1 then%>selected<%end if%>>列出所有注册用户</option>
- <option value="2" <%if request("userSearch")=2 then%>selected<%end if%>>列出等待验证用户</option>
- <option value="3" <%if request("userSearch")=3 then%>selected<%end if%>>列出被锁定的用户</option>
- <option value="4" <%if request("userSearch")=4 then%>selected<%end if%>>列出所有班级客人</option>
- <option value="5" <%if request("userSearch")=5 then%>selected<%end if%>>列出所有班级成员</option>
- <option value="6" <%if request("userSearch")=6 then%>selected<%end if%>>列出所有班级贵宾</option>
- <option value="7" <%if request("userSearch")=7 then%>selected<%end if%>>版主及管理员</option>
- </select>
- </td>
- </tr>
- </form>
- <%if request("action")="" then%>
- <tr>
- <th colspan=6 align=left height=23>搜索结果</th>
- </tr>
- <%
- dim currentpage,page_count,Pcount
- dim totalrec,endpage
- currentPage=request("page")
- if currentpage="" or not isInteger(currentpage) then
- currentpage=1
- else
- currentpage=clng(currentpage)
- if err then
- currentpage=1
- err.clear
- end if
- end if
- Set rs= Server.CreateObject("ADODB.Recordset")
- select case request("userSearch")
- case 1
- sql="select userid,realname,usergroup,lasttime,lockuser,usergroupid from [user] order by regtime desc"
- case 2
- sql="select userid,realname,usergroup,lasttime,lockuser,usergroupid from [user] where usergroupid=4 and lockuser=1 order by regtime desc"
- case 3
- sql="select userid,realname,usergroup,lasttime,lockuser,usergroupid from [user] where lockuser=2 order by regtime desc"
- case 4
- sql="select userid,realname,usergroup,lasttime,lockuser,usergroupid from [user] where usergroupid=4 order by regtime desc"
- case 5
- sql="select userid,realname,usergroup,lasttime,lockuser,usergroupid from [user] where usergroupid=3 order by regtime desc"
- case 6
- sql="select userid,realname,usergroup,lasttime,lockuser,usergroupid from [user] where usergroupid=5 order by regtime desc"
- case 7
- sql="select userid,realname,usergroup,lasttime,lockuser,usergroupid from [user] where usergroupid=1 order by regtime desc"
- case else
- sql="select userid,realname,usergroup,lasttime,lockuser,usergroupid from [user] order by regtime desc"
- end select
- rs.open sql,conn,1,1
- if rs.eof and rs.bof then
- response.write "<tr><td colspan=6 class=txlrow>没有找到相关记录。</td></tr>"
- else
- %>
- <FORM METHOD=POST ACTION="?action=touser">
- <tr align=center>
- <td class=txlHeaderBackgroundAlternate><B>用户名</B></td>
- <td class=txlHeaderBackgroundAlternate><B>用户类别</B></td>
- <td class=txlHeaderBackgroundAlternate><B>当前状态</B></td>
- <td class=txlHeaderBackgroundAlternate><B>最后登陆</B></td>
- <td class=txlHeaderBackgroundAlternate><B>权限</B></td>
- <td class=txlHeaderBackgroundAlternate><B>操作</B></td>
- </tr>
- <%
- rs.PageSize = Cint(txl_set(12))
- rs.AbsolutePage=currentpage
- page_count=0
- totalrec=rs.recordcount
- while (not rs.eof) and (not page_count = Cint(txl_set(12)))
- %>
- <tr>
- <td class=txlrow align=center><a href="admin_uedit.asp?userid=<%=rs("userid")%>"><%=rs("realname")%></a></td>
- <td class=txlrow width=30% align=center><%=rs("usergroup")%></a></td>
- <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>
- <td class=txlrow width=15% align=center><%if rs("lasttime")<>"" and isdate(rs("lasttime")) then%><%=Formatdatetime(rs("lasttime"),2)%><%end if%></td>
- <td class=txlrow width=8% align=center><a href="admin_uedit.asp?userid=<%=rs("userid")%>">编辑</a></td>
- <td class=txlrow align=center><input type="checkbox" name="userid" value="<%=rs("userid")%>" <%if rs("usergroupid")=1 then response.write "disabled"%>></td>
- </tr>
- <%
- page_count = page_count + 1
- rs.movenext
- wend
- Pcount=rs.PageCount
- %>
- <tr><td colspan=6 class=txlrow align=center>分页:
- <%
- if currentpage > 4 then
- response.write "<a href=""?page=1"">[1]</a> ..."
- end if
- if Pcount>currentpage+3 then
- endpage=currentpage+3
- else
- endpage=Pcount
- end if
- for i=currentpage-3 to endpage
- if not i<1 then
- if i = clng(currentpage) then
- response.write " <font color=#ce0000>["&i&"]</font>"
- else
- response.write " <a href=""?page="&i&""">["&i&"]</a>"
- end if
- end if
- next
- if currentpage+3 < Pcount then
- response.write "... <a href=""?page="&Pcount&""">["&Pcount&"]</a>"
- end if
- %>
- </td>
- </tr>
- <tr>
- <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>
- </tr>
- <tr>
- <td colspan=6 class=txlrow align=center><input type=submit name=submit1 value="执行选定的操作" onclick="{if(confirm('确定执行选择的操作吗?')){return true;}return false;}"></td>
- </tr>
- </FORM>
- <%
- end if
- rs.close
- set rs=nothing
- elseif request("action")="touser" then
- response.write "<tr><th colspan=6 height=23 align=left>执行结果</th></tr>"
- if request("useraction")="" then
- response.write "<tr><td colspan=6 class=txlrow>请指定相关参数。</td></tr>"
- founderr=true
- end if
- if request("userid")="" then
- response.write "<tr><td colspan=6 class=txlrow>请选择相关用户。</td></tr>"
- founderr=true
- end if
- if not founderr then
- if request("useraction")=1 then
- conn.execute("delete from [user] where userid in ("&replace(request("userid"),"'","")&")")
- response.write "<tr><td colspan=6 class=txlrow>操作成功。</td></tr>"
- elseif request("useraction")=2 then
- conn.execute("update [user] set lockuser=2 where userid in ("&replace(request("userid"),"'","")&")")
- response.write "<tr><td colspan=6 class=txlrow>操作成功。</td></tr>"
- elseif request("useraction")=3 then
- conn.execute("update [user] set lockuser=0 where userid in ("&replace(request("userid"),"'","")&")")
- response.write "<tr><td colspan=6 class=txlrow>操作成功。</td></tr>"
- else
- response.write "<tr><td colspan=6 class=txlrow>错误的参数。</td></tr>"
- end if
- end if
- end if
- %>
English
