<!--#include file="conn.asp"-->
<!--#include file="adminset.asp"-->
<%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='login.asp';</script>"
response.End
end if
if session("flag")>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！请配备“管理”权限！</b></font></div>"
response.End
end if
if qx14<>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！请配备“系统管理”权限后来操作！</b></font></div>"
response.End
end if
if request.QueryString("action")="del" then
     Dim FSO,filepath,photofile,file
	 photofile=request("photofile")
	 FileNameList=split(request("photo"))
     filepath=server.mappath(photofile)

    for i=0 to ubound(FileNameList)
	FileName=replace(FileNameList(i),",","")
	 on error resume next
     Set FSO = CreateObject("Scripting.FileSystemObject")
       Set file = FSO.GetFile(""&filepath&"\"&FileName&"")
	   file.delete
   next
response.write "<p align=center><font color=red>删除成功!<br>2秒钟后返回上页!</font>"
response.write "<meta http-equiv=""refresh"" content=""2;url=web_img.asp"">"
response.End
end if
%><head>

<LINK 
href="../css.css" type=text/css rel=stylesheet>
<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>
<style type="text/css">
<!--
.style1 {
	color: #000000;
	font-weight: bold;
}
.style2 {color: #FF0000}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="1%" height="28">&nbsp;</td>
    <td width="99%"><table width="100%" border="0" cellspacing="0" cellpadding="5">
      <tr>
        <td width="77%" height="27" style="font-size:14px;color:#ffffff">&nbsp;<strong><font color="#000000">网软志成购物后台管理系统 &gt;&gt; 系统管理 &gt;&gt; 图片信息管理 </font></strong></td>
        <td width="23%" style="font-size:14px;color:#ffffff"><span class="style2">* 为必添项目</span></td>
      </tr>
    </table></td>
  </tr>
</table>
<%
dim objFSO
dim uploadfolder
dim uploadfiles
dim upname
dim upfilename
dim pagesize,filenum
pagesize=15
page=request("page")
if page="" or not isnumeric(page) then
	page=1
else
	page=int(page)
end if
uploadimages="../uploadpic"

Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set uploadFolder=objFSO.GetFolder(Server.MapPath(uploadimages&"\"))
Set uploadFiles=uploadFolder.Files
%>
<br>
<table width="95%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#999999">
   <form name="form1" method="post" action="?action=del"> 
    <tr bgcolor="#cccccc"> 
      <td height="25" colspan="5" class="norightbuttonborder2"><span class="norightbuttonborder3">仅限于<%=replace(uploadimages,"../","")%>目录下
          <input type="hidden" name="url" value="web_img.asp">
          <input type="hidden" name="photofile" value="<%=uploadimages%>">
      </span></td>
    </tr>

    <tr bgcolor="#F3F3F3"> 
      <td width="30%" align="center" class="TableBody2"><b>图片名称</b></td>
      <td width="15%" align="center" class="TableBody2"><b>文件大小</b></td>
      <td width="20%" align="center" class="TableBody2"><b>最后访问</b> </td>
      <td width="20%" align="center" class="TableBody2"><b>上传时间</b></td>
      <td width="15%" align="center" class="TableBody2">&nbsp;</td>
    </tr>
    <% 
filenum=uploadfiles.count 
pagenum=int(filenum/pagesize) 
if filenum mod pagesize>0 then 
	pagenum=pagenum+1 
end if 
if page> pagenum then 
	page=1 
end if 
i=0 
For Each Upname In uploadFiles 
upfilename=uploadimages&"/"&upname.name 
	i=i+1 
	if i>(page-1)*pagesize and i<=page*pagesize then 
      FileSize=upname.size 
%>
    <tr bgcolor="#F3F3F3"> 
      <td class="TableBody1">&nbsp;<a href="<%=upfilename%>" target="_blank"><%=upname.name%></a></td>
      <td align="center" class="TableBody1"> 
      <%ShowFileSize(FileSize)%>      </td>
      <td align="center" class="TableBody1"><%=upname.datelastaccessed%></td>
      <td align="center" class="TableBody1"><%=upname.datecreated%></td>
      <td align="center" class="TableBody1"> <input type="checkbox" name="photo" value="<%=upname.name%>"></td>
    </tr>
    <% 
	elseif i>page*pagesize then 
		exit for 
	end if 
next 
set uploadFolder=nothing 
set uploadFiles=nothing 
 
 
Function ShowFileSize(FileSize) 
 		showsize="<font  color=#ff0000>"&FileSize & "</font>&nbsp;Byte"  
 		if FileSize>1024 then 
 		   FileSize=(FileSize\1024) 
 		   showsize="<font  color=#ff0000>"&FileSize & "</font>&nbsp;KB" 
 		end if 
 		if FileSize>1024 then 
 		   FileSize=(FileSize/1024) 
 		   showsize="<font  color=#ff0000>"&formatnumber(FileSize,2) & "</font>&nbsp;MB"		 
 		end if 
 		if FileSize>1024 then 
 		   FileSize=(FileSize/1024) 
 		   showsize="<font  color=#ff0000>"&formatnumber(FileSize,2) & "</font>&nbsp;GB"	    
 		end if    
 		response.write "" & showsize & "" 
End Function 
%>
    <tr bgcolor="#F3F3F3"> 
      <td colspan="5" align="center" class="TableBody1"><div align="right"><span class="TableBody2">
        <input name="submit" type='submit' class='go-wenbenkuang' value='删 除 目 标'>
      </span>&nbsp;&nbsp;&nbsp;选中全部 
          <input type="checkbox" name="chkall" value="on" onClick="CheckAll(this.form)">
&nbsp;&nbsp; 
      <% 
if page>1 then 
	response.write "<a href=?page=1&path="&request("path")&">首页</a>&nbsp;&nbsp;<a href=?page="& page-1 &"&path="&request("path")&">上一页</a>&nbsp;&nbsp;" 
else 
	response.write "首页&nbsp;&nbsp;上一页&nbsp;&nbsp;" 
end if 
if page<i/pagesize then 
	response.write "<a href=?page="& page+1 &"&path="&request("path")&">下一页</a>&nbsp;&nbsp;<a href=?page="& pagenum &"&path="&request("path")&">尾页</a>" 
else 
	response.write "下一页&nbsp;&nbsp;尾页" 
end if 
 
response.write " 共 "&filenum&" 个文件" 
 
%>
      </div></td>
    </tr></form> 
</table> 

 <!--#include file="copyright.asp"-->

<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body> 
