📄 adminallfile.asp
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="conn.asp"-->
<!--#include file="const.asp" -->
<!--#include file="chklink.asp"-->
<%
if session("admin")="" then
response.redirect "admin.asp"
else
if session("flag")<1 then
response.write "<script>alert('对不起!你不是管理员!');history.back();</script>"
response.end
end if
end if
Set rs= Server.CreateObject("ADODB.Recordset")
%>
<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="right" valign="top">
<%
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim idlist
dim title,filename
dim selsql,sel,showlink,selmap,selnum
dim MaxAnnouncePerpage
if not isempty(request("mapid")) then
idlist=request("mapid")
if instr(idlist,",")>0 then
dim idarr
idArr=split(idlist)
dim id
for i = 0 to ubound(idarr)
id=clng(idarr(i))
call deleteannounce(id)
next
else
call deleteannounce(clng(idlist))
end if
end if
MaxAnnouncePerpage=25
filename="adminallfile.asp"
sel=request("sel")
title=request("txtitle")
if sel="" then
showlink="全部作品"
if title="" then
sqlsel=""
else
sqlsel=" where username like '%"&trim(title)&"%' or mapname like '%"&trim(title)&"%' or shuoming like '%"&trim(title)&"%' or softwave like '%"&trim(title)&"%' "
end if
else
showlink=sel
if title="" then
sqlsel=" where mapfl='"&sel&"' "
else
sqlsel=" where mapfl='"&sel&"' and (username like '%"&trim(title)&"%' or mapname like '%"&trim(title)&"%' or shuoming like '%"&trim(title)&"%' or softwave like '%"&trim(title)&"%') "
end if
end if
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
<table width="98%" border="0" cellspacing="1" cellpadding="3" bgcolor="#FF9900">
<tr bgcolor="#99CCFF">
<td colspan="2" align="center"> <table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr bgcolor="#99CCFF">
<form name="searchuser" method="POST" action="adminallfile.asp">
<td width="32%" valign="bottom">当前>>><%=showlink%>
<% if title<>"" then %>
>>>搜索[<%=title%>]
<% end if %>
</td>
<td width="68%" align="right" valign="bottom">
<% Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from mapfl order by flid asc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
%>
目前没有分类
<% else %>
搜索:
<input type="text" name="txtitle" size="13" class="buttonface">
<select name="sel" class="buttonface">
<option value="" selected>所有作品</option>
<%
do while not rs.eof
%>
<option value="<%=rs("mapfl")%>"><%=rs("mapfl")%></option>
<%
rs.movenext
loop
%>
</select>
<%
end if
rs.close
%>
<input type="submit" value="提交" name="title" class="buttonface">
</td>
</form>
</tr>
</table></td>
</tr>
<%
sql="select * from upmap "&sqlsel&" order by mapid desc"
' Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
%>
<tr>
<td bgcolor="#FFFFFF" align="center" colspan="2">目前没有任何作品!</td>
</tr>
<%
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
MaxAnnouncePerpage=Clng(MaxAnnouncePerpage)
if (currentpage-1)*MaxAnnouncePerPage>totalput then
if (totalPut mod MaxAnnouncePerPage)=0 then
currentpage= totalPut \ MaxAnnouncePerPage
else
currentpage= totalPut \ MaxAnnouncePerPage + 1
end if
end if
%>
<form name="form1" method="post" action="adminallfile.asp?page=<%=currentpage%>&txtitle=<%=request("txtitle")%>&sel=<%=sel%>">
<tr>
<td bgcolor="#99CCFF" width="10%" align="center"> <input type="submit" name="Submit" value="删除" class="buttonface">
</td>
<td bgcolor="#FFFFFF" width="90%">【操作说明】<font color="#FF0000">点击图片看文件内容或修改文件介绍,点选相应(可以多选)文件,再按“删除”可以批量删除文件。</font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" valign="top" colspan="2">
<%
if currentPage=1 then
showContent
else
if (currentPage-1)*MaxAnnouncePerPage<totalPut then
rs.move (currentPage-1)*MaxAnnouncePerPage
dim bookmark
bookmark=rs.bookmark
showContent
else
currentPage=1
showContent
end if
end if
rs.close
end if
sub showContent
dim i,j
i=0
%>
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<% do while not rs.eof
j=j+1 %>
<td align="center" width="19%"><a href="#" onClick="MM_openBrWindow('showmyfile.asp?mapid=<%=rs("mapid")%>','','scrollbars=yes,width=450,height=550')" title="点击修改文件[<%=rs("mapname")%>]"><%=chkshow(rs("mapurl"))%></a><br>
<br> <input type="checkbox" name="mapid" value="<%=rs("mapid")%>" class="buttonface">
作者:<%=rs("username")%><br> <br> </td>
<% if j=5 then
response.write "</tr><tr>"
j=0
end if
i=i+1
if i>=MaxAnnouncePerPage then exit do
rs.movenext
loop
%>
</tr>
</table>
<% end sub %>
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" align="right" colspan="2">
<% dim n
if totalput mod MaxAnnouncePerPage=0 then
n= totalput \ MaxAnnouncePerPage
else
n= totalput \ MaxAnnouncePerPage+1
end if
if CurrentPage<2 then
response.write "首页 上一页 "
else
response.write "<a href="&filename&"?page=1&txtitle="&request("txtitle")&"&sel="&sel&">首页</a> "
response.write "<a href="&filename&"?page="&CurrentPage-1&"&txtitle="&request("txtitle")&"&sel="&sel&">上一页</a> "
end if
if n-currentpage<1 then
response.write "下一页 尾页"
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)&"&txtitle="&request("txtitle")&"&sel="&sel&">"
response.write "下一页</a> <a href="&filename&"?page="&n&"&txtitle="&request("txtitle")&"&sel="&sel&">尾页</a>"
end if
response.write " 页次:</font><strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>页 "
response.write " 共<b>"&totalput&"</b>个文件 <b>"&MaxAnnouncePerPage&"</b>个文件/页 "
%>
</td>
</tr>
</form>
</table>
<%
sub deleteannounce(id)
dim rs,sql
dim mapurl,delname
set rs=server.createobject("adodb.recordset")
sql="select mapname,mapurl,username from upmap where mapid="&cstr(id)
rs.open sql,conn,1,1
if not(rs.eof and rs.bof) then
mapurl=rs("mapurl")
delname=rs("username")
end if
rs.close
dim fs,path
path=Server.mappath(mapurl)
set fs=createobject("scripting.filesystemobject")
if not fs.fileexists(path) then
sql="delete from upmap where mapid="&cstr(id)
conn.execute sql
sql="update [user] set upnum=upnum-1 where nickname='"&delname&"'"
conn.Execute(sql)
if err.Number<>0 then
err.clear
response.write "删除失败!<br>"
else
response.write "没有文件,数据"&cstr(id)&"被删除了!<br>"
end if
else
fs.DeleteFile(path)
sql="delete from upmap where mapid="&cstr(id)
conn.execute sql
sql="update [user] set upnum=upnum-1 where nickname='"&delname&"'"
conn.Execute(sql)
if err.Number<>0 then
err.clear
response.write "删除失败 !<br>"
else
response.write "文件"&cstr(id)&"被删除了!<br>"
end if
end if
End sub
%>
</td>
</tr>
<tr>
<td colspan="2" bgcolor="#FFCC00" height="22" align="center"> 版权所有 © 2003-2006 <a href="http://www.wlong3d.com">wlong3d.com</a>
</td>
</tr>
</table>
<% set rs=nothing
conn.close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -