$txtfileurl = $_GET['txtfileurl'];
if($txtfileurl !="") {$fileurl = $txtfileurl;}
if($txtfileurl =="") {$fileurl = "EATON";}
$path = 'E:/jane/Downloads/'.$fileurl.'/';
$fileArr = array();
$fileName-"";
$filetime="";
$filesize="";
$filePath="";
if(!is_dir($path))
return;
$handle = dir($path);
while(($file = $handle->read()) != false)
{
if($file!='.' && $file!='..')
{
$path2 = $path.'/'.$file;
$fTime = filemtime($path2);
$fTime=date( "Y-m-d H:i:s", $fTime);
$fileArr[$file] = $fTime;
}
}
//排序
arsort($fileArr);
//echo'<label id="lblfn" style ="color:#6594C2;">'.$txtfileurl.'</label>';
echo'<div style =" overflow-x: auto;">';
echo'<div class ="DownloadTable">';
echo'<div id="MContentDiv1" class="MContentDiv1">';
echo '<table cellspacing="0" cellpadding="0" class="MTableHeader">';
echo'<tbody class="MTbodyHeader">';
echo'<tr style = "background:#6594C2;color: #FFFFFF;" >';
echo'<td width="480">';
echo'<strong id ="fontsize">';
echo'FileName';
echo'</strong>';
echo'</td>';
echo'<td width="90">';
echo'<strong id ="fontsize">';
echo'Size';
echo'</strong>';
echo'</td>';
echo'<td width="140">';
echo'<strong id ="fontsize">';
echo'Date';
echo'</strong>';
echo'</td>';
echo'<td width="70">';
echo'<strong id ="fontsize">';
echo'Delete';
echo'</strong>';
echo'</td>';
echo'</tr>';
echo'</tbody>';
echo'</table>';
echo'</div>';
//弹拉表格
echo'<div id="MContentDiv2" class="MContentDiv2">';
echo '<table class="MContent" cellspacing="0" cellpadding="0" width="867">';
echo'<tbody>';
while($key=key($fileArr))
{
$fileName=$key;
$filetime=$fileArr[$key];
$path2=$path.'/'.$key;
$filesize=filesize($path2);
//$filesize =round($filesize/1048576 ,2)."MB";
$units = array(' B', ' KB', ' MB', ' GB', ' TB');
for ($i = 0; $filesize >= 1024 && $i < 4; $i++) $filesize /= 1024;
$filesize = round($filesize, 2).$units[$i];
echo '<tr>';
echo'<td width="480">';
echo '<a id ="fontsize" href="DownClick.php?file='.$fileName.'&txtfileurl='.$txtfileurl.'">'.$fileName.'</a>';
echo'</td>';
echo'<td id ="fontsize" width="90">';
echo $filesize;
echo'</td>';
echo'<td id ="fontsize" width="140">';
echo $filetime;
echo'</td>';
echo'<td id ="fontsize" width="70">';
echo '<a href="javascript:deletefile(\''.$path2.'\');" >Delete</a>';
echo'</td>';
echo '</tr>';
next($fileArr);
}
echo'</tbody>';
echo '</table>';
if($txtfileurl !="") {$fileurl = $txtfileurl;}
if($txtfileurl =="") {$fileurl = "EATON";}
$path = 'E:/jane/Downloads/'.$fileurl.'/';
$fileArr = array();
$fileName-"";
$filetime="";
$filesize="";
$filePath="";
if(!is_dir($path))
return;
$handle = dir($path);
while(($file = $handle->read()) != false)
{
if($file!='.' && $file!='..')
{
$path2 = $path.'/'.$file;
$fTime = filemtime($path2);
$fTime=date( "Y-m-d H:i:s", $fTime);
$fileArr[$file] = $fTime;
}
}
//排序
arsort($fileArr);
//echo'<label id="lblfn" style ="color:#6594C2;">'.$txtfileurl.'</label>';
echo'<div style =" overflow-x: auto;">';
echo'<div class ="DownloadTable">';
echo'<div id="MContentDiv1" class="MContentDiv1">';
echo '<table cellspacing="0" cellpadding="0" class="MTableHeader">';
echo'<tbody class="MTbodyHeader">';
echo'<tr style = "background:#6594C2;color: #FFFFFF;" >';
echo'<td width="480">';
echo'<strong id ="fontsize">';
echo'FileName';
echo'</strong>';
echo'</td>';
echo'<td width="90">';
echo'<strong id ="fontsize">';
echo'Size';
echo'</strong>';
echo'</td>';
echo'<td width="140">';
echo'<strong id ="fontsize">';
echo'Date';
echo'</strong>';
echo'</td>';
echo'<td width="70">';
echo'<strong id ="fontsize">';
echo'Delete';
echo'</strong>';
echo'</td>';
echo'</tr>';
echo'</tbody>';
echo'</table>';
echo'</div>';
//弹拉表格
echo'<div id="MContentDiv2" class="MContentDiv2">';
echo '<table class="MContent" cellspacing="0" cellpadding="0" width="867">';
echo'<tbody>';
while($key=key($fileArr))
{
$fileName=$key;
$filetime=$fileArr[$key];
$path2=$path.'/'.$key;
$filesize=filesize($path2);
//$filesize =round($filesize/1048576 ,2)."MB";
$units = array(' B', ' KB', ' MB', ' GB', ' TB');
for ($i = 0; $filesize >= 1024 && $i < 4; $i++) $filesize /= 1024;
$filesize = round($filesize, 2).$units[$i];
echo '<tr>';
echo'<td width="480">';
echo '<a id ="fontsize" href="DownClick.php?file='.$fileName.'&txtfileurl='.$txtfileurl.'">'.$fileName.'</a>';
echo'</td>';
echo'<td id ="fontsize" width="90">';
echo $filesize;
echo'</td>';
echo'<td id ="fontsize" width="140">';
echo $filetime;
echo'</td>';
echo'<td id ="fontsize" width="70">';
echo '<a href="javascript:deletefile(\''.$path2.'\');" >Delete</a>';
echo'</td>';
echo '</tr>';
next($fileArr);
}
echo'</tbody>';
echo '</table>';