<!--#include file="../ACT.Function.asp"-->
<!--#include file="../../ACT_inc/cls_pageview.asp"-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>ACTCMS上传文件管理</title>
<link href="../Images/css1/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
  <tr>
    <td class="bg_tr">您现在的位置：系统中心 &gt;&gt; 上传文件管理</td>
  </tr>
</table>
<% If Not ACTCMS.ChkAdmin() Then  Call Actcms.Alert("对不起，您没有操作权限！","")
	    Dim sql, sqlCount,Sqls,intPageSize, strPageInfo,arrRecordInfo, i,pages,intPageNow,strLocalUrl,Action
	    Action=Request("Action")
	    IF Request.QueryString("Action") = "del" Then
		Dim ID,Rs:ID = Request("ID")
		IF ID = "" Then
			Call Actcms.ActErr("请指定要删除的ID","1")
			Response.End 
		End If
		ID = Split(ID,",")
		For I = LBound(ID) To UBound(ID)
			Set Rs=ACTCMS.ACTEXE("Select UpfileDir from Upload_Act where ID="&ID(I)&"")
			If Not Rs.eof Then 
				ACTCMS.DeleteFile(Rs("UpfileDir"))
			End If 
			ACTCMS.ACTEXE("delete from Upload_Act where ID="&ID(I)&"")
		Next 
		Call Actcms.ActErr("删除成功&nbsp;&nbsp;<a href=include/ACT.Upfile.asp>点击这里返回管理首页</a>","")
		Response.end
	  Else
		Call  main()
	  End IF
	  
	Sub   main()
	 Dim ACT_TypeDiY,TypeDiY,Manage
	strLocalUrl = request.ServerVariables("SCRIPT_NAME")
	intPageNow = request.QueryString("page")
	intPageSize =20
	sql = "SELECT [ID],[ArtileID],[UpfileDir],[Extension],[UpdateTime],[ModeID]" & _
		" FROM [Upload_Act]" & _
		" ORDER BY [ID] DESC"
	sqlCount = "SELECT Count([ID])" & _
			" FROM [Upload_Act]"
		Dim clsRecordInfo
		Set clsRecordInfo = New Cls_PageView
			clsRecordInfo.intRecordCount = 2816
			clsRecordInfo.strSqlCount = sqlCount
			clsRecordInfo.strSql = sql
			clsRecordInfo.intPageSize = intPageSize
			clsRecordInfo.intPageNow = intPageNow
			clsRecordInfo.strPageUrl = strLocalUrl
			clsRecordInfo.strPageVar = "page"
		clsRecordInfo.objConn = Conn		
		arrRecordInfo = clsRecordInfo.arrRecordInfo
		strPageInfo = clsRecordInfo.strPageInfo
		Set clsRecordInfo = nothing
	 %>
<table width="99%" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
   <form name="Article" method="post" action="?Action="> <tr>
      <td width="30" align="center" class="bg_tr" ><strong>选中</strong></td>
      <td width="30" align="center" class="bg_tr" ><strong>ID</strong></td>
      <td width="274" align="center" nowrap class="bg_tr"><strong>所属文章</strong></td>
      <td align="center" nowrap class="bg_tr"><strong>路径</strong></td>
      <td width="140" align="center" nowrap class="bg_tr" nowrap><strong>上传时间</strong></td>
      <td width="49" align="center" nowrap class="bg_tr" nowrap><strong>扩展名</strong></td>
    </tr>
   <%
		Dim bgColor
		If IsArray(arrRecordInfo) Then
			For i = 0 to UBound(arrRecordInfo, 2)
			bgColor="#FFFFFF"
			if i mod 2=0 then bgColor="#DFEFFF"
	%>  <tr  onMouseOver=overColor(this) onMouseOut=outColor(this)>
      <td><input type="checkbox" name="ID" value="<%= arrRecordInfo(0,i) %>"></td>
      <td  align="center" ><%= arrRecordInfo(0,i) %></td>
      <td><%

	Dim AName
	Set AName=ACTCMS.ACTEXE("Select title from  "&ACTCMS.ACT_C(arrRecordInfo(5,i),2)&"  where ID = "& arrRecordInfo(1,i))
	If Not Aname.eof Then 
		response.write "<a target=""_blank"" href="&actcms.actsys&"article/typearticle.asp?ModeID="&arrRecordInfo(5,i)&"&ID="&arrRecordInfo(1,i)&">"&Aname("title")&"</a>"
	Else
		response.write "<font color=red>该文章已被删除</font>"
	End If 
  	  %></td>
      <td>
<span id="Zoom<%=i%>"></span><span onclick="window.open('<%= arrRecordInfo(2,i) %>');" onmouseover="zoom('Zoom<%=i%>','<%= arrRecordInfo(2,i) %>');" style="cursor:hand;" onmouseout="Zoom<%=i%>.innerHTML='';" >
<%= arrRecordInfo(2,i) %></span>	  
	  </td>
      <td><%= arrRecordInfo(4,i) %></td>
      <td  align="center" ><%= arrRecordInfo(3,i) %></td>
    </tr><% 
	Next
	End If
	%>
    <tr>
      <td colspan="6"><label for=chk>
        <input id="chk" type="checkbox" name="chkall" value="checkbox" onClick="CheckAll(this.form)">
        选择全部</label>
        <input type="button" class="ACT_btn"  name="yd" value="批量删除" onClick="delpost()"></td>
    </tr>
    <tr>
      <td colspan="6"><%= strPageInfo%></td>
    </tr></form>
</table>
  <p>
  <script language="javascript">
function CheckAll(form)  
  {  
 for (var i=0;i<form.elements.length;i++)  
    {  
    var e = Article.elements[i];  
   if (e.name != 'chkall')  
      e.checked = Article.chkall.checked;  
   }  
  }
//CSS背景控制
function overColor(Obj)
{
	var elements=Obj.childNodes;
	for(var i=0;i<elements.length;i++)
	{
		elements[i].className="tdbg1"
		Obj.bgColor="";
	}
	
}
function outColor(Obj)
{
	var elements=Obj.childNodes;
	for(var i=0;i<elements.length;i++)
	{
		elements[i].className="tdbg";
		Obj.bgColor="";
	}
}
 
function zoom(zid,zimg) {
	var div = document.getElementById(zid);
	div.style.position = 'absolute';
	div.innerHTML = "<img src=" + zimg + " style='padding:1px;border:1px solid #9FD253;background-color:#fff;margin:18px 0px 0px 0px;'>"
}

function delpost(){
    document.Article.method="post";
    document.Article.action="?Action=del";
{
	if(confirm('确认要删除选中的文件吗?')){
	this.document.Article.submit();
	return true;}return false;
}
	}
</script>
  <% end sub
CloseConn %>

</body>
</html>
