<?php 


/** 
***************************************************
*欢迎使用免费版SiteTeam企业建站软件！
*这是一个专业为搜索引擎营销而设计的，极稳定、极易维护的建站软件！
*官方客服：help@php.net.cn
*官方下载网址：http://www.SiteTeam.cn 
***************************************************
**/



 if(!defined('IN_SITETEAM')) {exit('Access Denied');}?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>SiteTeam Administrator's Control Panel</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<link rel="stylesheet" href="admin/images/admincp.css" type="text/css" media="all" />
<link rel="stylesheet" href="admin/images/form.css" type="text/css" media="all" />
<script src="admin/js/common.js" type="text/javascript"></script>
</head>
<body>
<script type="text/JavaScript">if(parent.$('admincpnav')) parent.$('admincpnav').innerHTML='开始&nbsp;&raquo;&nbsp;附件管理&nbsp;&raquo;&nbsp;附件列表';</script>
<div class="container" id="cpcontainer">
  <div class="itemtitle">
    <h3>附件列表</h3>
    <ul class="tab1">
    	<li><a href="admin.php?action=attachments&operation=list<?php if(!empty($parent_attachments_dir)){?>&dir=<?=rawurlencode($parent_attachments_dir)?><?php }?>"><span>上级目录</span></a></li>
      	<li><a href="admin.php?action=attachments&operation=list<?php if(!empty($attachments_dir)){?>&dir=<?=rawurlencode($attachments_dir)?><?php }?>"><span>附件列表</span></a></li>
	  	<li><a href="admin.php?action=attachments&operation=upload<?php if(!empty($attachments_dir)){?>&dir=<?=rawurlencode($attachments_dir)?><?php }?>"><span>上传附件</span></a></li>
	  	<li><a href="admin.php?action=attachments&operation=mkdir<?php if(!empty($attachments_dir)){?>&dir=<?=rawurlencode($attachments_dir)?><?php }?>"><span>创建目录</span></a></li>
    </ul>
  </div>
	<table width="95%" class="tb tb2 ">
	  <tr>
	    <td><h4>文件名</h4></td>
	    <td><h4>位置</h4></td>
		<td width="80"><h4>复制URL</h4></td>
		<td width="80"><h4>上传时间</h4></td>
		<td width="50"><h4>删除</h4></td>
	  </tr>
	  <?php if (is_array($dir_list) && count($dir_list) > 0) foreach ($dir_list as $k => $v) {?>
	  <tr>
	    <td><a href="admin.php?action=attachments&operation=list&dir=<?=empty($attachments_dir)?'':"{$attachments_dir}/"?><?=rawurlencode($v['name'])?>" target="_self"><?=$v['name']?></a></td>
	    <td>--</td>
		<td>--</td>
		<td><?=date("Y-m-d H:i", $v['uploadtime'])?></td>
		<td><a onClick="return confirm('确定要删除这个文件夹么？');" href="admin.php?action=attachments&operation=del<?php if(!empty($attachments_dir)){?>&dir=<?=rawurlencode($attachments_dir)?><?php }?>&filename=<?=rawurlencode($v['name'])?>">删除</a></td>
	  </tr>
	  <?php  }?>
	  
	  <?php if (is_array($file_list) && count($file_list) > 0) foreach ($file_list as $k => $v) {?>
	  <tr>
	    <td><a href="http://<?=$site_url?><?=$user_attachments_url?>/<?=rawurlencode($v['name'])?>" target="_blank"><?=$v['name']?></a></td>
	    <td><input type="text" value="http://<?=$site_url?><?=$user_attachments_url?>/<?=rawurlencode($v['name'])?>" size="40" id="url<?=$k?>"> </td>
		<td><a href="javascript:urlCopy('url<?=$k?>')">复制URL</a></td>
		<td><?=date("Y-m-d H:i", $v['uploadtime'])?></td>
		<td><a href="admin.php?action=attachments&operation=del<?php if(!empty($attachments_dir)){?>&dir=<?=rawurlencode($attachments_dir)?><?php }?>&filename=<?=rawurlencode($v['name'])?>">删除</a></td>
	  </tr>
	  <?php  }?>
  </table>
</div>
<script language="javascript" type="text/javascript">
function urlCopy(url) {
	var str=document.getElementById(url);//对象是QQ 
	str.select(); //选择对象 
	document.execCommand("Copy"); //执行浏览器复制命令  
}
</script>



</body>
</html>
