<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>文件管理器</title>

<link rel="stylesheet" href="css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
<link rel="stylesheet" type="text/css" href="css/base.css">
<script language="javascript" src="js/jquery.min.js" type="text/javascript"></script>	
<script type="text/javascript" src="js/admin.jquery.configuration.js"></script>

<script language="javascript" src="js/global.js"></script>
<script language="javascript" src="../include/js/dedeajax2.js"></script>

<style>
.napisdiv {left:10;top:0;width:150px;height:100px;position:absolute;z-index:3}
</style>
<script>
function ChangeImage(surl){ document.getElementById('picview').src = surl; }
	//获得选中文件的文件名
function getCheckboxItem(){
	 var allSel="";
	 if(document.form1.aids.value) return document.form1.aids.value;
	 for(i=0;i<document.form1.aids.length;i++)
	 {
		 if(document.form1.aids[i].checked){
			 if(allSel=="")
				 allSel=document.form1.aids[i].value;
			 else
				 allSel=allSel+","+document.form1.aids[i].value;
		 }
	 }
	 return allSel;	
}

function AllSel(){
	for(i=0;i<document.form1.aids.length;i++){
		document.form1.aids[i].checked = true;
	}
}

function NoneSel(){
	for(i=0;i<document.form1.aids.length;i++){
		document.form1.aids[i].checked = false;
	}
}

function DelSel(){
	 var nid = getCheckboxItem();
	 if(nid==""){
		  alert("请选择项目!\r\n");
		  return ;
	 }
	 location.href = "media_edit.php?dopost=del&ids="+nid;
}
</script>
</head>
<body>
<div id="body-wrapper"> <!-- Wrapper for the radial gradient background -->
<?php include(DEDEADMIN.'/templets/menu.htm'); ?>
<script language="javascript">
$("#media").addClass("current");$("#filemanager").addClass("current");</script>				

	<div class="content-box"><!-- Start Content Box -->
				
				<div class="content-box-header">
					
					<h3>文件管理器</h3>
					
					<ul class="content-box-tabs">

					</ul>
					
					<div class="clear"></div>
					
				</div> <!-- End .content-box-header -->
				
				<div class="content-box-content">
					
<div class="tab-content  default-tab" id="tab1">				
<table width='98%' border='0' cellspacing='1' cellpadding='2' align='center' style="background:#cfcfcf;">
<tr bgcolor="#cfcfcf" height="28" align="center">
  <td width="28%" background="images/wbg.gif" ><strong>文件名</strong></td>
  <td width="16%" background="images/newlinebg3.gif"><strong>文件大小</strong></td>
  <td width="22%" background="images/wbg.gif"><strong>最后修改时间</strong></td>
  <td width="34%"  background="images/newlinebg3.gif"><strong>操作</strong></td>
</tr>
<?php
$dh = dir($inpath);
$ty1="";
$ty2="";
$files = $dirs = array();
while(($file = $dh->read()) !== false)
{
	if($file!="." && $file!=".." && !is_dir("$inpath/$file"))
	{
		@$filesize = filesize("$inpath/$file");
		@$filesize=$filesize/1024;
		@$filetime = filemtime("$inpath/$file");
		@$filetime = MyDate("Y-m-d H:i:s",$filetime);
		if($filesize<0.1)
		{
			@list($ty1,$ty2)=explode(".",$filesize);
			$filesize=$ty1.".".substr($ty2,0,2);
		}
		else
		{
			@list($ty1,$ty2)=explode(".",$filesize);
			$filesize=$ty1.".".substr($ty2,0,1);
		}
	}
	if($file == ".")
	{
		continue;
	}
	else if($file == "..")
	{
		if($activepath == "")
		{
			continue;
		}
		$tmp = preg_replace("#[\/][^\/]*$#i","",$activepath);
		$line = "\n<tr>
  <td bgcolor='#ffffff' height='25'>
  <a href=file_manage_main.php?activepath=".urlencode($tmp)."><img src=images/dir2.gif border=0 width=16 height=16 align=absmiddle>上级目录</a>
  </td>
  <td colspan='3' bgcolor='#ffffff'>
   当前目录:$activepath &nbsp;
   <a href='file_pic_view.php?activepath=".urlencode($activepath)."' style='color:red'>[图片浏览器]</a>
   </td>
  </tr>";
		$dirs[] = $line;
	}
	else if(is_dir("$inpath/$file"))
	{
		if(preg_match("#^_(.*)$#i",$file)) continue; #屏蔽FrontPage扩展目录和linux隐蔽目录
		if(preg_match("#^\.(.*)$#i",$file)) continue;
		$line = "\n<tr bgcolor='#FFFFFF' height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\">
   <td>
    <a href=file_manage_main.php?activepath=".urlencode("$activepath/$file")."><img src=images/dir.gif border=0 width=16 height=16 align=absmiddle>$file</a></td>
   <td>　</td>
   <td>　</td>
   <td>
   <a href=file_manage_view.php?filename=".urlencode($file)."&activepath=".urlencode($activepath)."&fmdo=rename>[改名]</a>
   &nbsp;
   <a href=file_manage_view.php?filename=".urlencode($file)."&activepath=".urlencode($activepath)."&type=dir&fmdo=del>[删除]</a>
   </td>
   </td>
   </tr>";
		$dirs[] = $line;
	}
	else if(preg_match("#\.(gif|png)#i",$file))
	{
		$line = "\n<tr bgcolor='#FFFFFF' height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\">
   <td>
   <a href=$activeurl/$file target=_blank><img src=images/gif.gif border=0 width=16 height=16 align=absmiddle>$file</a></td>
   <td>$filesize KB</td>
   <td align='center'>$filetime</td>
   <td>
   <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[改名]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[删除]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[移动]</a>
   </td>
   </tr>";
		$files[] = $line;
	}
	else if(preg_match("#\.(jpg)#i",$file))
	{
		$line = "\n<tr bgcolor='#FFFFFF' height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\">
   <td>
   <a href=$activeurl/$file target=_blank><img src=images/jpg.gif border=0 width=16 height=16 align=absmiddle>$file</a></td>
   <td>$filesize KB</td>
   <td align='center' class='linerow'>$filetime</td>
   <td >
   <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[改名]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[删除]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[移动]</a>
   </td>
   </tr>";
		$files[] = $line;
	}
	else if(preg_match("#\.(swf|fla|fly)#i",$file))
	{
		$line = "\n<tr bgcolor='#FFFFFF' height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\">
   <td>
   <a href=$activeurl/$file target=_blank><img src=images/flash.gif border=0 width=16 height=16 align=absmiddle>$file</a></td>
   <td>$filesize KB</td>
   <td align='center'>$filetime</td>
   <td>
   <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[改名]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[删除]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[移动]</a>
   </td>
   </tr>";
		$files[] = $line;
	}
	else if(preg_match("#\.(zip|rar|tar.gz)#i",$file))
	{
		$line = "\n<tr bgcolor='#FFFFFF' height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\">
   <td>
   <a href=$activeurl/$file target=_blank><img src=images/zip.gif border=0 width=16 height=16 align=absmiddle>$file</a></td>
   <td>$filesize KB</td>
   <td align='center'>$filetime</td>
   <td>
   <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[改名]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[删除]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[移动]</a>
   </td>
   </tr>";
		$files[] = $line;
	}
	else if(preg_match("#\.(exe)#i",$file))
	{
		$line = "\n<tr bgcolor='#FFFFFF' height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\">
   <td>
   <a href=$activeurl/$file target=_blank><img src=images/exe.gif border=0 width=16 height=16 align=absmiddle>$file</a></td>
   <td>$filesize KB</td>
   <td align='center'>$filetime</td>
   <td >
   <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[改名]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[删除]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[移动]</a>
   </td>
   </tr>";
		$files[] = $line;
	}
	else if(preg_match("#\.(mp3|wma)#i",$file))
	{
		$line = "\n<tr bgcolor='#FFFFFF'  height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\">
   <td>
   <a href=$activeurl/$file target=_blank><img src=images/mp3.gif border=0 width=16 height=16 align=absmiddle>$file</a></td>
   <td>$filesize KB</td>
   <td align='center'>$filetime</td>
   <td>
   <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[改名]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[删除]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[移动]</a>
   </td>
   </tr>";
		$files[] = $line;
	}
	else if(preg_match("#\.(wmv|api)#i",$file))
	{
		$line = "\n<tr bgcolor='#FFFFFF' height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\">
   <td>
   <a href=$activeurl/$file target=_blank><img src=images/wmv.gif border=0 width=16 height=16 align=absmiddle>$file</a></td>
   <td>$filesize KB</td>
   <td align='center'>$filetime</td>
   <td>
   <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[改名]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[删除]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[移动]</a>
   </td>
   </tr>";
		$files[] = $line;
	}
	else if(preg_match("#\.(rm|rmvb)#i",$file))
	{
		$line = "\n<tr bgcolor='#FFFFFF' height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\">
   <td>
   <a href=$activeurl/$file target=_blank><img src=images/rm.gif border=0 width=16 height=16 align=absmiddle>$file</a></td>
   <td>$filesize KB</td>
   <td align='center' class='linerow'>$filetime</td>
   <td>
   <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[改名]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[删除]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[移动]</a>
   </td>
   </tr>";
		$files[] = $line;
	}
	else if(preg_match("#\.(txt|inc|pl|cgi|asp|xml|xsl|aspx|cfm)#",$file))
	{
		$edurl = "file_manage_view.php?fmdo=edit&filename=".urlencode($file)."&activepath=".urlencode($activepath);
		$line = "\n<tr bgcolor='#FFFFFF' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\">
   <td>
   <a href=$activeurl/$file target=_blank><img src=images/txt.gif border=0 width=16 height=16 align=absmiddle>$file</a></td>
   <td>$filesize KB</td>
   <td align='center'>$filetime</td>
   <td>
   <a href='$edurl'>[编辑]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[改名]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[删除]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[移动]</a>
   </td>
   </tr>";
		$files[] = $line;
	}
	else if(preg_match("#\.(htm|html)#i",$file))
	{
		$edurl = "file_manage_view.php?fmdo=edit&filename=".urlencode($file)."&activepath=".urlencode($activepath);
		$line = "\n<tr bgcolor='#FFFFFF'  height='26'onMouseMove=\"javascript:this.bgColor='#F9FBF0';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\">
   <td>
   <a href=$activeurl/$file target=_blank><img src=images/htm.gif border=0 width=16 height=16 align=absmiddle>$file</a></td>
   <td>$filesize KB</td>
   <td align='center'>$filetime</td>
   <td>
   <a href='$edurl'>[编辑]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[改名]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[删除]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[移动]</a>
   </td>
   </tr>";
		$files[] = $line;
	}
	else if(preg_match("#\.(php)#i",$file))
	{
		$edurl = "file_manage_view.php?fmdo=edit&filename=".urlencode($file)."&activepath=".urlencode($activepath);
		$line = "\n<tr bgcolor='#FFFFFF' height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\">
   <td>
   <a href=$activeurl/$file target=_blank><img src=images/php.gif border=0 width=16 height=16 align=absmiddle>$file</a></td>
   <td>$filesize KB</td>
   <td align='center'>$filetime</td>
   <td>
   <a href='$edurl'>[编辑]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[改名]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[删除]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[移动]</a>
   </td>
   </tr>";
		$files[] = $line;
	}
	else if(preg_match("#\.(js)#i",$file))
	{
		$edurl = "file_manage_view.php?fmdo=edit&filename=".urlencode($file)."&activepath=".urlencode($activepath);
		$line = "\n<tr bgcolor='#FFFFFF' height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\">
   <td>
   <a href=$activeurl/$file target=_blank><img src=images/js.gif border=0 width=16 height=16 align=absmiddle>$file</a></td>
   <td>$filesize KB</td>
   <td align='center'>$filetime</td>
   <td>
   <a href='$edurl'>[编辑]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[改名]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[删除]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[移动]</a>
   </td>
   </tr>";
		$files[] = $line;
	}
	else if(preg_match("#\.(css)#i",$file))
	{
		$edurl = "file_manage_view.php?fmdo=edit&filename=".urlencode($file)."&activepath=".urlencode($activepath);
		$line = "\n<tr bgcolor='#FFFFFF' height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\">
   <td>
   <a href=$activeurl/$file target=_blank><img src=images/css.gif border=0 width=16 height=16 align=absmiddle>$file</a></td>
   <td>$filesize KB</td>
   <td align='center'>$filetime</td>
   <td>
   <a href='$edurl'>[编辑]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[改名]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[删除]</a>
   &nbsp;
   <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[移动]</a>
   </td>
   </tr>";
		$files[] = $line;
	}
	else
	{
		$line = "\n<tr bgcolor='#FFFFFF' height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\">
    <td><a href=$activeurl/$file target=_blank>$file</td>
    <td>$filesize KB</td>
    <td align='center'>$filetime</td>
    <td>
    <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[改名]</a>
    &nbsp;
    <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[删除]</a>
    &nbsp;
    <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."'>[移动]</a>
    </td>
    </tr>";
		$files[] = $line;
	}
}
$dh->close();
foreach ($dirs as $dir)
{
	echo $dir;
}
foreach ($files as $file)
{
	echo $file;
}
?>
<tr>
  <td colspan="4" height='26' bgcolor='#F9FCEF'>
  	<a href='file_manage_main.php'>[根目录]</a>
  	&nbsp;
  	<a href='file_manage_view.php?fmdo=newfile&activepath=<?php echo urlencode($activepath)?>'>[新建文件]</a>
  	&nbsp;
  	<a href='file_manage_view.php?fmdo=newdir&activepath=<?php echo urlencode($activepath)?>'>[新建目录]</a>
  	&nbsp;
  	<a href='file_manage_view.php?fmdo=upload&activepath=<?php echo urlencode($activepath)?>'>[文件上传]</a>
  	&nbsp;
  	<a href='file_manage_control.php?fmdo=space&activepath=<?php echo urlencode($activepath)?>'>[空间检查]</a>
  	&nbsp;&nbsp;</td>
</tr>
</table>							<div class="clear"></div><!-- End .clear -->
							
						
						
					</div> <!-- End #tab1 -->

					
				</div> <!-- End .content-box-content -->
				
			</div> <!-- End .content-box -->
			
			<div class="clear"></div>
			
           <?php include(DEDEADMIN.'/templets/footer.htm'); ?>
			
		</div> <!-- End #main-content -->	
	</div>
</body>
</html>