⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filepath.php

📁 不错的一个网站管理系统
💻 PHP
字号:
<?php
require("../../class/connect.php");
include("../../class/config.php");
include("../../class/db_sql.php");
include("../../class/functions.php");
$link=db_connect();
$empire=new mysqlquery();
//验证用户
$logininid=getcvar('loginuserid');
$loginin=getcvar('loginusername');
$loginrnd=getcvar('loginrnd');
$loginlevel=getcvar('loginlevel');
$editor=1;
is_login($logininid,$loginin,$loginrnd);
//验证权限
CheckLevel($logininid,$loginin,$classid,"file");
//基目录
$basepath="../../../d/file";
$filepath=$_GET['filepath'];
if(strstr($filepath,".."))
{
	$filepath="";
}
$openpath=$basepath."/".$filepath;
$hand=@opendir($openpath);
db_close();
$empire=null;
//风格
$loginadminstyleid=(int)getcvar('loginadminstyleid');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理附件</title>
<link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
<script>
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>
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  <tr> 
    <td width="34%">位置:<a href="FilePath.php">管理附件(目录式)</a></td>
    <td width="66%"><div align="right">
        <input type="button" name="Submit5" value="数据库式管理附件" onclick="self.location.href='ListFile.php?type=9';">
        &nbsp;&nbsp; 
        <input type="button" name="Submit52" value="上传多附件" onclick="self.location.href='TranMoreFile.php';">
      </div></td>
  </tr>
</table>
<form name="form1" method="post" action="../enews.php">
  <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
    <tr class="header"> 
      <td height="25"> 
        <div align="center">选择</div></td>
      <td height="25">文件名 
        <input name="enews" type="hidden" id="enews" value="DelPathFile">
        (当前目录:<strong>/ 
        <?=$filepath?>
        </strong>) &nbsp;&nbsp;&nbsp;[<a href="#ecms" onclick="javascript:history.go(-1);">返回</a>]</td>
    </tr>
	<?php
	while($file=@readdir($hand))
	{
		if(empty($filepath))
		{
			$truefile=$file;
		}
		else
		{
			$truefile=$filepath."/".$file;
		}
		if($file=="."||$file=="..")
		{
			continue;
		}
		//目录
		if(is_dir($openpath."/".$file))
		{
			$filelink="'FilePath.php?filepath=".$truefile."'";
			$filename=$file;
			$img="folder.gif";
			$checkbox="";
			$target="";
		}
		//文件
		else
		{
			$filelink="'../../../d/file/".$truefile."'";
			$filename=$file;
			$filetype=GetFiletype($file);
			$img=substr($filetype,1,strlen($filetype))."_icon.gif";
			$checkbox="<input name='filename[]' type='checkbox' value='".$truefile."'>";
			$target=" target='_blank'";
		}
	 ?>
	 <tr> 
      <td width="9%" height="25"> <div align="center"> 
          <?=$checkbox?>
        </div></td>
      <td width="91%" height="25"><img src="../../data/images/dir/<?=$img?>" width="23" height="22"><a href=<?=$filelink?><?=$target?>><?=$filename?></a></td>
    </tr>
	<?
	}
	@closedir($hand);
	?>
    <tr> 
      <td height="25"><div align="center"><input type="checkbox" name="chkall" value="on" onclick="CheckAll(this.form)"></div></td>
      <td height="25"><input type="submit" name="Submit" value="删除文件"></td>
    </tr>
  </table>
</form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -