<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="gb2312" Inherits="b2bNet.Admin_Article_uploadfile" %>
<%On Error Resume Next%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><%=C_name%>上传文件管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="inc/admin_style.css" rel="stylesheet" type="text/css" />
</head>
<script type="Text/JavaScript" language=javascript>
function unselectall()
{
    if(document.myform.chkAll.checked){
	document.myform.chkAll.checked = document.myform.chkAll.checked & 0;
    } 	
}

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>
<body style="margin-top:0; margin-left:2" marginwidth="0" marginheight="0">
<table style="width:100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
  <tr class="topbg"> 
    <td style="height:22" colspan="2" align="center"><b><%=C_name%>上传文件管理</b></td>
  </tr>
</table>
<table width='100%' border="0" cellpadding="0" cellspacing="0">
  <tr>
     <td>
  <form name="myform" method="Post" action="Article_UploadFile.aspx?Action=del&channelid=<%=channelid%>" onsubmit="return confirm('确定要删除选中的文件吗？');">
<table style="width:100%" border="0" align="center" cellpadding="0" cellspacing="3" class="border">
  <tr class="tdbg">
    <%If theFolder Is Nothing Then%><td align="center"><font color="red"><strong>暂时没有上传文件！</strong></font></td><%Else%>
    <%For i As Integer = 0 To theFolder.Length - 1 Step 1%>
    <td>
      <table style="height:100%; width:100%" border="0" cellpadding="0" cellspacing="2">
        <tr>
          <td colspan="2" align="center">
            <%showFileImage(i)%>
          </td>
        </tr>
        <tr>
          <td align="right">文 件 名：</td>
          <td><a target='_blank' href="<%=UploadDir & theFolder(i).Name%>" <%If Not isUsed(i) Then%>title="无用的上传文件"<%End If%>><%=theFolder(i).Name%></a>
		  </td>
        </tr>
        <tr>
          <td align="right">文件大小：</td>
          <td><%=Math.Ceiling(theFolder(i).Length / 1024) & " K"%></td>
        </tr>
        <tr>
          <td align="right">文件类型：</td>
          <td><%=GetFileTypeName(i)%></td>
        </tr>
        <tr>
          <td align="right">修改时间：</td>
          <td><%=theFolder(i).LastWriteTime%></td>
        </tr>
        <tr>
          <td align="right">操作选项：</td>
          <td><%If isUsed(i) Then%><font color="#ff3300"><strong>使用中</strong></font><%Else%>
            <input name="FileName" type="checkbox" id="FileName" value="<%=theFolder(i).Name%>" onclick="unselectall()" />选中&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="Article_UploadFile.aspx?Action=del&channelid=<%=channelid%>&FileName=<%=theFolder(i).Name%>" onclick="return confirm('你真的要删除此文件吗!')">删除</a>
            <%End If%></td>
        </tr>
      </table>
    </td>
    <%  If (i + 1) Mod 4 = 0 AndAlso i < theFolder.Length - 1 Then Response.Write("</tr><tr class=""tdbg"">")
    Next : End If%>
  </tr>
</table>
<table style="width:100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td colspan="2"><%=Pagination(0, IsNull(Request("page"), 1), fileCount, 20, "&channelid=" & channelid)%></td>
    </tr>
  <tr>
    <td style="height:30; width:200"><input name="chkAll" type="checkbox" id="chkAll" onclick="CheckAll(this.form)" value="checkbox" />
      选中本页显示的所有文件</td>
    <td><input name="Action" type="hidden" id="Action" value="Del" />
      <input name="UploadDir" type="hidden" id="UploadDir" value="<%=left(UploadDir,len(UploadDir)-1)%>" />
              <input type="submit" name="Submit" value="删除选中的文件" />
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              <input type="submit" name="Submit2" value="删除所有文件" onclick="document.myform.Action.value='DelAll';" />
              </td>
  </tr>
    <tr>
        <td align="center" colspan="2">
        <br />
        共 <strong><%=fileCount%></strong> 个文件，占用 <strong><%=Math.Ceiling(allSizeCount / 1024.0)%> </strong>K，本页共显示 <strong><%=IIf(theFolder Is Nothing, 0, theFolder.Length)%></strong> 个文件， 占用 <strong><%=Math.Ceiling(pageSizeCount / 1024.0)%> </strong>K。
        <br />
        </td>
    </tr>
</table>
</form></td>
</tr></table>
</body>
<%Page_Loaded()%> 
</html>
