📄 adminuser.asp
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="conn.asp"-->
<%
if session("admin")="" then
response.redirect "admin.asp"
else
if session("flag")<>2 then
response.write "<script>alert('对不起!你不是高级管理员!');history.back();</script>"
response.end
end if
end if
%>
<title>管理系统用户 | WLONG3D文件上传系统wlup3.5</title>
<link rel="stylesheet" href="FORUM.CSS" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<body bgcolor="#FFFFFF" text="#000000" link="#000000" vlink="#000000" alink="#FF0000">
<table width="95%" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="#6699FF">
<tr bgcolor="#99CCFF">
<td colspan="2" height="22">
<div align="center"><b>WLONG3D文件上传系统wlup3.5</b></div>
</td>
</tr>
<tr>
<td width="21%" bgcolor="#FFFFCC" valign="top">
<!--#include file="left.asp" -->
</td>
<td width="79%" bgcolor="#FFFFFF" align="center" valign="top">
<% const MaxPerPage=20
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim idlist
dim title
dim sql
dim rs
title=request("txtitle")
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
if not isempty(request("selid")) then
idlist=request("selid")
if instr(idlist,",")>0 then
dim idarr
idArr=split(idlist)
dim id
for i = 0 to ubound(idarr)
id=clng(idarr(i))
call del(id)
next
else
call del(clng(idlist))
end if
end if
%>
<form name="searchuser" method="POST" action="adminuser.asp">
<div align="center"><font color=red>用户查询</font>>>> 用户姓名:
<input name="txtitle" type="text" class="buttonface" size="13">
<input name="title" type="submit" class="buttonface" value="搜索">
</div>
</form>
<form method=Post action="adminuser.asp">
<%
if title<>"" then
sql="select * from [user] where nickname like '%"&trim(title)&"%' or username like '%"&trim(title)&"%' order by userid desc"
else
sql="select * from [user] order by userid desc"
end if
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'>目前没有任何用户资料</p>"
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
showContent
showpage totalput,MaxPerPage,"adminuser.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"adminuser.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"adminuser.asp"
end if
end if
rs.close
end if
sub showContent
dim i
i=0
%>
<table border="1" cellspacing="1" width="100%" cellpadding="0" bordercolor="#6699FF">
<tr bgcolor="#FFCC00">
<td width="8%" height="20" align="center"><strong>ID</strong></td>
<td width="21%" align="center"><strong>用户昵称</strong></td>
<td width="18%" align="center"><b>真实姓名</b></td>
<td width="12%" align="center"><b>上传文件</b></td>
<td width="7%" align="center"><b>性别</b></td>
<td width="22%" align="center"><b>注册时间</b></td>
<td width="12%" align="center">
<input name="submit" type='submit' class="buttonface" value='删除'>
</td>
</tr>
<%do while not rs.eof%>
<tr align="center">
<td height="23" width="8%"> <%=rs("userid")%> </td>
<td> <a href="#" onClick="MM_openBrWindow('showuser.asp?userid=<%=rs("userid")%>','','width=500,height=500')"><%=rs("nickname")%> </a></td>
<td width="18%"><%=rs("username")%></td>
<td width="12%"><%=rs("upnum")%></td>
<td width="7%"><%if rs("sex")=true then%>男<% else %>女<% end if %></td>
<td width="22%"><%=datevalue(rs("indate"))%> </td>
<td width="12%"> <input type='checkbox' name='selid' value='<%=cstr(rs("userID"))%>' class="buttonface">
</td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
</form>
<%
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 "<p align='center'> "
if CurrentPage<2 then
response.write "首页 上一页 "
else
response.write "<a href="&filename&"?page=1&txtitle="&request("txtitle")&">首页</a> "
response.write "<a href="&filename&"?page="&CurrentPage-1&"&txtitle="&request("txtitle")&">上一页</a> "
end if
if n-currentpage<1 then
response.write "下一页 尾页"
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)&"&txtitle="&request("txtitle")&">"
response.write "下一页</a> <a href="&filename&"?page="&n&"&txtitle="&request("txtitle")&">尾页</a>"
end if
response.write " 页次:</font><strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>页 "
response.write " 共<b>"&totalnumber&"</b>个用户 <b>"&MaxPerPage&"</b>个用户/页 "
end function
sub del(id)
dim rs,sql
set rs=server.createobject("adodb.recordset")
sql="delete from [user] where userid="&cstr(id)
conn.execute sql
if err.Number<>0 then
err.clear
response.write "删 除 失 败 !<br>"
else
response.write "用户"&cstr(id)&"被删除了!<br>"
end if
End sub
%>
</td>
</tr>
<tr>
<td colspan="2" bgcolor="#FFCC00" height="22" align="center"> 版权所有 © 2003-2006 <a href="http://www.wlong3d.com">www.wlong3d.com</a>
</td>
</tr>
</table>
<% set rs=nothing
conn.close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -