|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324 |
- <!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=<?php echo $cfg_soft_lang; ?>">
- <title>文件管理器</title>
- <link rel="stylesheet" href="../static/web/css/bootstrap.min.css">
- <link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css">
- <link rel="stylesheet" href="../static/web/css/admin.css">
- <style>
- .linerow {
- border-bottom:1px solid #CBD8AC;
- height:26px
- }
- </style>
- </head>
- <body>
- <table width='98%' border='0' cellspacing='1' cellpadding='2' align='center' class="table maintable mt-3 mb-3">
- <tr height="26" align="center">
- <td width="36%" background="../static/web/img/wbg.gif">文件名称</td>
- <td width="12%" background="../static/web/img/wbg.gif">文件大小</td>
- <td width="20%" background="../static/web/img/wbg.gif">修改时间</td>
- <td width="30%" background="../static/web/img/wbg.gif">操作</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 height='26'>
- <a href=file_manage_main.php?activepath=".urlencode($tmp)."><img src='../static/web/img/dir2.gif'>上级目录</a>
- </td>
- <td colspan='3'>
- 当前目录:$activepath
-
- </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 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='../static/web/img/dir.gif'>$file</a></td>
- <td> </td>
- <td> </td>
- <td>
- <a href=file_manage_view.php?filename=".urlencode($file)."&activepath=".urlencode($activepath)."&fmdo=rename class='btn btn-success btn-sm'><i class='fa fa-address-card-o' aria-hidden='true'></i> 改名</a>
- <a href=file_manage_view.php?filename=".urlencode($file)."&activepath=".urlencode($activepath)."&type=dir&fmdo=del class='btn btn-success btn-sm'><i class='fa fa-trash' aria-hidden='true'></i> 删除</a>
- </td>
- </td>
- </tr>";
- $dirs[] = $line;
- }
- else if(preg_match("#\.(gif|png)#i",$file))
- {
- $line = "\n<tr height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
- <td>
- <a href=$activeurl/$file target=_blank><img src='../static/web/img/gif.gif'>$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)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o' aria-hidden='true'></i> 改名</a>
- <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-trash' aria-hidden='true'></i> 删除</a>
- <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square' aria-hidden='true'></i> 移动</a>
- </td>
- </tr>";
- $files[] = $line;
- }
- else if(preg_match("#\.(jpg)#i",$file))
- {
- $line = "\n<tr height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
- <td>
- <a href=$activeurl/$file target=_blank><img src='../static/web/img/jpg.gif'>$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)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o' aria-hidden='true'></i> 改名</a>
- <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-trash' aria-hidden='true'></i> 删除</a>
- <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square' aria-hidden='true'></i> 移动</a>
- </td>
- </tr>";
- $files[] = $line;
- }
- else if(preg_match("#\.(swf|fla|fly)#i",$file))
- {
- $line = "\n<tr height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
- <td>
- <a href=$activeurl/$file target=_blank><img src='../static/web/img/flash.gif'>$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)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o' aria-hidden='true'></i> 改名</a>
- <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-trash' aria-hidden='true'></i> 删除</a>
- <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square' aria-hidden='true'></i> 移动</a>
- </td>
- </tr>";
- $files[] = $line;
- }
- else if(preg_match("#\.(zip|rar|tar.gz)#i",$file))
- {
- $line = "\n<tr height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
- <td>
- <a href=$activeurl/$file target=_blank><img src='../static/web/img/zip.gif'>$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)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o' aria-hidden='true'></i> 改名</a>
- <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-trash' aria-hidden='true'></i> 删除</a>
- <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square' aria-hidden='true'></i> 移动</a>
- </td>
- </tr>";
- $files[] = $line;
- }
- else if(preg_match("#\.(exe)#i",$file))
- {
- $line = "\n<tr height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
- <td>
- <a href=$activeurl/$file target=_blank><img src='../static/web/img/exe.gif'>$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)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o' aria-hidden='true'></i> 改名</a>
- <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-trash' aria-hidden='true'></i> 删除</a>
- <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square' aria-hidden='true'></i> 移动</a>
- </td>
- </tr>";
- $files[] = $line;
- }
- else if(preg_match("#\.(mp3|wma)#i",$file))
- {
- $line = "\n<tr height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
- <td>
- <a href=$activeurl/$file target=_blank><img src='../static/web/img/mp3.gif'>$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)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o' aria-hidden='true'></i> 改名</a>
- <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-trash' aria-hidden='true'></i> 删除</a>
- <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square' aria-hidden='true'></i> 移动</a>
- </td>
- </tr>";
- $files[] = $line;
- }
- else if(preg_match("#\.(wmv|api)#i",$file))
- {
- $line = "\n<tr height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
- <td>
- <a href=$activeurl/$file target=_blank><img src='../static/web/img/wmv.gif'>$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)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o' aria-hidden='true'></i> 改名</a>
- <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-trash' aria-hidden='true'></i> 删除</a>
- <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square' aria-hidden='true'></i> 移动</a>
- </td>
- </tr>";
- $files[] = $line;
- }
- else if(preg_match("#\.(rm|rmvb)#i",$file))
- {
- $line = "\n<tr height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
- <td>
- <a href=$activeurl/$file target=_blank><img src='../static/web/img/rm.gif'>$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)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o' aria-hidden='true'></i> 改名</a>
- <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'> <i class='fa fa-trash' aria-hidden='true'></i> 删除</a>
- <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square' aria-hidden='true'></i> 移动</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 onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
- <td>
- <a href=$activeurl/$file target=_blank><img src='../static/web/img/txt.gif'>$file</a></td>
- <td>$filesize KB</td>
- <td align='center'>$filetime</td>
- <td>
- <a href='$edurl' class='btn btn-success btn-sm'><i class='fa fa-pencil-square-o' aria-hidden='true'></i> 编辑</a>
- <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o' aria-hidden='true'></i> 改名</a>
- <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'> <i class='fa fa-trash' aria-hidden='true'></i> 删除</a>
- <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square' aria-hidden='true'></i> 移动</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 height='26'onMouseMove=\"javascript:this.bgColor='#F9FBF0';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
- <td>
- <a href=$activeurl/$file target=_blank><img src='../static/web/img/htm.gif'>$file</a></td>
- <td>$filesize KB</td>
- <td align='center'>$filetime</td>
- <td>
- <a href='$edurl' class='btn btn-success btn-sm'><i class='fa fa-pencil-square-o' aria-hidden='true'></i> 编辑</a>
- <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o' aria-hidden='true'></i> 改名</a>
- <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-trash' aria-hidden='true'></i> 删除</a>
- <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square' aria-hidden='true'></i> 移动</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 height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
- <td>
- <a href=$activeurl/$file target=_blank><img src='../static/web/img/php.gif'>$file</a></td>
- <td>$filesize KB</td>
- <td align='center'>$filetime</td>
- <td>
- <a href='$edurl' class='btn btn-success btn-sm'><i class='fa fa-pencil-square-o' aria-hidden='true'></i> 编辑</a>
- <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o' aria-hidden='true'></i> 改名</a>
- <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-trash' aria-hidden='true'></i> 删除</a>
- <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square' aria-hidden='true'></i> 移动</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 height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
- <td>
- <a href=$activeurl/$file target=_blank><img src='../static/web/img/js.gif'>$file</a></td>
- <td>$filesize KB</td>
- <td align='center'>$filetime</td>
- <td>
- <a href='$edurl' class='btn btn-success btn-sm'><i class='fa fa-pencil-square-o' aria-hidden='true'></i> 编辑</a>
- <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o' aria-hidden='true'></i> 改名</a>
- <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'> <i class='fa fa-trash' aria-hidden='true'></i> 删除</a>
- <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square' aria-hidden='true'></i> 移动</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 height='26' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
- <td>
- <a href=$activeurl/$file target=_blank><img src='../static/web/img/css.gif'>$file</a></td>
- <td>$filesize KB</td>
- <td align='center'>$filetime</td>
- <td>
- <a href='$edurl' class='btn btn-success btn-sm'><i class='fa fa-pencil-square-o' aria-hidden='true'></i> 编辑</a>
- <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o' aria-hidden='true'></i> 改名</a>
- <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'> <i class='fa fa-trash' aria-hidden='true'></i> 删除</a>
- <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square' aria-hidden='true'></i> 移动</a>
- </td>
- </tr>";
- $files[] = $line;
- } else {
- $line = "\n<tr 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)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o' aria-hidden='true'></i> 改名</a>
- <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'> <i class='fa fa-trash' aria-hidden='true'></i> 删除</a>
- <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square' aria-hidden='true'></i> 移动</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='#f8f8f8'>
- <a href='file_manage_main.php' class="btn btn-success btn-sm">根目录</a>
- <a href='file_manage_view.php?fmdo=newfile&activepath=<?php echo urlencode($activepath)?>' class="btn btn-success btn-sm">新建文件</a>
- <a href='file_manage_view.php?fmdo=newdir&activepath=<?php echo urlencode($activepath)?>' class="btn btn-success btn-sm">新建目录</a>
- <a href='file_manage_view.php?fmdo=upload&activepath=<?php echo urlencode($activepath)?>' class="btn btn-success btn-sm">文件上传</a>
- <a href='file_manage_control.php?fmdo=space&activepath=<?php echo urlencode($activepath)?>' class="btn btn-success btn-sm">空间检查</a>
- </td>
- </tr>
- </table>
- </body>
- </html>
|