imagelist.asp

来自「1. 硬件环境:MS WINDOWS NT PACK 4 OR LATER /W」· ASP 代码 · 共 147 行

ASP
147
字号
<!-- #include file="setup.asp" -->
<!-- #include file="inc/function.asp" -->
<!-- #include file="inc/Pagination.asp" -->
<%validate "Login.asp",4
if Request.ServerVariables("request_method")="POST" Then
	set MyFileObject=Server.CreateOBject("Scripting.FileSystemObject")
	for each ho in request.form("files")
	MyFileObject.DeleteFile (Server.MapPath(ho))
	'Response.Write ho&"<br>"
	next
	Error 3,"删除成功!","ImageList.asp?Menu="&Request.QueryString("Menu")
End if

Call Top
Call table()%>
	<style>TABLE{BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:1px}TD{BORDER-RIGHT:0px;BORDER-TOP:0px}</style>
			<script>function CheckAll(form){for (var i=0;i<form.elements.length;i++){var e = form.elements[i];if (e.name != 'chkall')e.checked = form.chkall.checked;}}</script>

	<title>附件管理</title>
	<br>
	<TABLE  align=center borderColor=a4b6d7 cellSpacing=0 cellPadding=5 width=100% border=1 style="border-collapse: collapse" background=images/title_sub.gif ID="Table1">
	<TR>
	<TD align="center"><b><font color="#FFFFFF"><a href="?Menu=AllImg"><font color=#ffffff title="">附件管理首页</font></a></b>
	<Td align="center"><b><font color="#FFFFFF"><a href="?Menu=B"><font color="#FFFFFF">所有产品大图片</font></a></b>
	<TD align="center"><b><font color="#FFFFFF"><a href="?Menu=S"><font color="#FFFFFF">所有产品小图片 </font></a></b>
	<TD align="center"><b><font color="#FFFFFF"><a href="?Menu=Voucher"><font color="#FFFFFF">所有发货单</font></a></b>
	<TD align="center"><b><font color="#FFFFFF"><a href="?Menu=Scan"><font color="#FFFFFF">所有汇款单 </font></a></b>
	<TD align="center"><b><font color="#FFFFFF"><a href="?Menu=Bbs"><font color="#FFFFFF">所有社区附件 </font></a> </b>
	<TD align="center"><b><font color="#FFFFFF"><a href="?Menu=UserPhoto"><font color="#FFFFFF">用户上传相片</font></a></b>
	</TR></TABLE>
	<%
	Menu=Request.QueryString("menu")
	Select Case Menu
		Case "AllImg"
				Tab "商城附件目录:"
		%>
			<TABLE borderColor=a4b6d7 cellSpacing=0 cellPadding=0 width="100%" border=1 style="border-collapse: collapse" height="22" bgColor="#ecf5ff" ID="Table2">
			<TR  height=25> 
				<TD width="40%" height="20" align=middle> 
				<div align="center">目录名称</div></TD>
				<TD align=middle width=60%> <div align="center">文件总数</div></TD>
			</TR>
			</TABLE>


			<TABLE borderColor=a4b6d7 cellSpacing=0 cellPadding=0 width="100%" border=1 style="border-collapse: collapse" height="22" ID="Table6">
			<TR  height=25> 
			<TD width="40%" height="20" align=middle><div align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.<a href="?Menu=B">产品大图片目录</a></div></TD>
			<TD align=middle width=60%> <div align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 共有 <font color=#cc0033><%=DirNum("./UpProductimg/B")%></font> 个文件,占用空间:<font color=#cc0033><%=Spacess("./UpProductimg/B")%></font></div></TD></TR>
			<TR  height=25> <TD width="40%" height="20" align=middle><div align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.<a href="?Menu=S">产品小图片目录</a></div></TD>
			<TD align=middle width=60%> <div align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 共有 <font color=#cc0033><%=DirNum("./UpProductimg/S")%></font> 个文件,占用空间:<font color=#cc0033><%=Spacess("./UpProductimg/S")%></font></div></TD></TR>
			<TR  height=25> 
			<TD width="40%" height="20" align=middle><div align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3.<a href="?Menu=Voucher">发货单图片目录</a></div></TD>
			<TD align=middle width=60%> <div align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;共有 <font color=#cc0033><%=DirNum("./UpProductimg/Voucher")%></font> 个文件,占用空间:<font color=#cc0033><%=Spacess("./UpProductimg/Voucher")%></font></div></TD></TR>
			<TR  height=25> 
			<TD width="40%" height="20" align=middle><div align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4.<a href="?Menu=Scan">汇款单图片目录</a></div></TD>
			<TD align=middle width=60%> <div align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 共有 <font color=#cc0033><%=DirNum("./UpProductimg/Scan")%></font> 个文件,占用空间:<font color=#cc0033><%=Spacess("./UpProductimg/Scan")%></font></div></TD></TR>
			<TR  height=25>
			<TD width="40%" height="20" align=middle><div align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5.<a href="?Menu=Bbs">社区附件</a></div></TD>
			<TD align=middle width=60%> <div align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 共有 <font color=#cc0033><%=DirNum("./images/upfile")%></font> 个文件,占用空间:<font color=#cc0033><%=Spacess("./images/upfile")%></font></div></TD></TR>
			<TR  height=25>
			<TD width="40%" height="20" align=middle><div align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6.<a href="?Menu=UserPhoto">用户上传相片</a></div></TD>
			<TD align=middle width=60%> <div align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 共有 <font color=#cc0033><%=DirNum("./images/upphoto")%></font> 个文件,占用空间:<font color=#cc0033><%=Spacess("./images/upphoto")%></font></div></TD>
			</TR>
			</TABLE>
		<%Case "B"
			FileList("UpProductimg/B")
		Case "S"
			FileList("UpProductimg/S")
		Case "Voucher"
			FileList("UpProductimg/Voucher")
		Case "Scan"
			FileList("UpProductimg/Scan")
		Case "Bbs"
			FileList("images/upfile")
		Case "UserPhoto"
			FileList("images/upphoto")
		Case Else
			Error 1,"错误的传递信息!\n您的IP已被记录!",""
	End Select
	htmlend
	
	Function DirNum(DirPath)
			thisdir=server.mappath(DirPath)
			Set fs=Server.CreateObject("Scripting.FileSystemObject")
			Set fdir=fs.GetFolder(thisdir)
			DirNum=fdir.Files.count
			Set fdir=Nothing
			Set fs=Nothing
	End Function
	
	Sub FileList(DirPath)
			thisdir=server.mappath(DirPath)
			Set fs=Server.CreateObject("Scripting.FileSystemObject")
			Set fdir=fs.GetFolder(thisdir)
			count=fdir.Files.count
			pagesize=20
			
			Tab "共有 <font color=FF0000><b>"&count&"</b></font> 个文件"%>
			<TABLE borderColor=a4b6d7 cellSpacing=0 cellPadding=0 width="100%" border=1 style="border-collapse: collapse" height="24" ID="Table4">
			<form method=post name=form action="ImageList.asp?Menu=<%=Menu%>" ID="Form1">
			<TR  height=25 bgColor="#ecf5ff"> 
			<TD width=13% align=middle> <p align="center"><input type=checkbox name=chkall onclick=CheckAll(this.form) value="ON" ID="Checkbox2"></TD>
			<TD align=middle width="27%"><div align="center" >名称</div></TD>
			<TD align=middle width="20%"> <div align="center">大小</div></TD>
			<TD align=middle width="20%"><div align="center">类型</div></TD>
			<TD width="20%" align=middle><div align="center">修改时间</div></TD>

			<%
			page=request.querystring("page")
			if page="" or not isnumeric(page) then
				page=1
			else
				page=int(page)
			end if
			filenum=fdir.Files.count
			pagenum=int(filenum/pagesize)

			if filenum mod pagesize>0 then pagenum=pagenum+1
			if page> pagenum then page=1
			i=0
			For each thing in fdir.Files
				i=i+1
				if i>(page-1)*pagesize and i<=page*pagesize then
					response.write "<tr class=a3><td align=center><input type='CheckBox' value='"&DirPath&"/"&thing.Name&"' name=files></td><td>   <a target=_blank href="&DirPath&"/"&thing.Name&"><img src="&DirPath&"/"&thing.Name&" border=0 width=20 height=20> "&thing.Name&"</a></td><td align=center>" & cstr(thing.size) & " byte</td><td align=center>" & thing.type & "</td><td align=center>" & cstr(thing.datelastmodified) & "</td></tr>"
				elseif i>page*pagesize then
					exit for
				end if
			Next
		%></table></div>
		<table width=100% cellpadding=2 cellspacing=2 ID="Table3">
		<tr><td  width=3%><INPUT type=submit value=" 删 除 " name=Submit ID="Submit1"></td>
		<td width=97% align="right">页码:<%=Page%>/<%=pagenum%>  [ <%Npage page,pagenum,"menu="&menu&""%> ]</td>
		</tr></form>
		</table>
	<%	
		Set fdir=Nothing
		Set fs=Nothing
	End Sub
	
	
	Sub Tab(Msg)%>
		<TABLE borderColor=#a4b6d7 cellSpacing=0 cellPadding=3 width=100% border=1 style="border-collapse: collapse" ID="Table5">
		<TR> 
		<TD  height=12 width="75%" >&nbsp;<img src="images/2.gif" width="60" height="9"><%= Msg %></TD>
		</TR></TABLE>
	<%End Sub%>

⌨️ 快捷键说明

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