<!--#include file="../conn2.asp"-->
<!--#include file="../inc/config.asp"-->
<!--#include file="set.asp"-->

<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}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
<body>
<%
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="../upload"

Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set uploadFolder=objFSO.GetFolder(Server.MapPath(uploadimages&"\"))
Set uploadFiles=uploadFolder.Files
%>
<br>
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
   <form name="form1" method="post" action="del_img.asp"> 
    <tr bgcolor="f1f1f1"> 
      <td height="25" colspan="5" class="norightbuttonborder2"><div align="center" class="style1">社区图片管理</div></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="25" colspan="5" class="norightbuttonborder3"><%=replace(uploadimages,"../","")%>目录下 
        <input type="hidden" name="url" value="ImgList.asp"> <input type="hidden" name="photofile" value="<%=uploadimages%>"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <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"> <input type='submit' class='go-wenbenkuang' value='删除'> 
      </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="#FFFFFF"> 
      <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="#FFFFFF"> 
      <td colspan="5" align="center" class="TableBody1">选中全部项目 
        <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&" 个文件" 
 
%>
      </td>
    </tr></form> 
</table> 

 
</body> 
