2011-09-28 01:26:51 +00:00
|
|
|
<?php
|
|
|
|
$this->headTitle($this->config->title->site);
|
|
|
|
$this->headTitle('后台管理');
|
|
|
|
$this->headTitle()->setSeparator(' - ');
|
|
|
|
$this->headLink()->appendStylesheet('/css/admin.css');
|
|
|
|
$this->breadcrumb('<a href="/">首页</a>');
|
|
|
|
$this->breadcrumb('<a href="/admin">后台首页</a>');
|
|
|
|
$this->breadcrumb('数据管理');
|
2012-05-24 09:11:07 +00:00
|
|
|
$this->headScript()->appendFile('/static/js/jquery-1.7.2.min.js');
|
|
|
|
$this->headScript()->appendFile('/js/jquery.colorbox-min.js');
|
|
|
|
$this->headLink()->appendStylesheet('/css/colorbox.css');
|
2011-09-28 01:26:51 +00:00
|
|
|
$this->breadcrumb()->setSeparator(' > ');
|
|
|
|
?>
|
|
|
|
<div id="leftPanel">
|
|
|
|
<?= $this->partial('data/left.phtml'); ?>
|
|
|
|
</div>
|
|
|
|
|
2011-10-12 14:53:03 +00:00
|
|
|
<div id="rightPanel">
|
2011-09-28 01:26:51 +00:00
|
|
|
<?php if ($this->msg or $this->messages) :?>
|
|
|
|
<div id="message">
|
|
|
|
<?php if ($this->msg) : ?>
|
|
|
|
<p><?php echo $this->msg; ?></p>
|
|
|
|
<?php endif; if ($this->messages): foreach($this->messages as $msg): ?>
|
|
|
|
<p><?php echo $msg; ?></p>
|
|
|
|
<?php endforeach;endif; ?>
|
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
<div><a href="/admin/data/attachments/add/1">上传新附件</a> | <a href="attachments/search/my">查看我的附件</a></div>
|
|
|
|
|
|
|
|
<div class="search">
|
|
|
|
<form action="" method="get">
|
|
|
|
<input type="hidden" name="search" value='1' />
|
|
|
|
<ul>
|
|
|
|
<li><label>搜索关键字</label><input type="text" name="keyword" value="<?php echo $this->keyword; ?>" /></li>
|
|
|
|
<li><input type="submit" class="searchbtn" value="搜索" /></li>
|
|
|
|
</ul>
|
|
|
|
</form>
|
|
|
|
</div><!-- search DIV -->
|
|
|
|
|
|
|
|
<?php if (count($this->paginator)): ?>
|
2011-09-29 07:55:05 +00:00
|
|
|
<form method="get" action="/admin/data/md/att/1/addatts/1">
|
2012-05-24 09:11:07 +00:00
|
|
|
<table class="stylized">
|
2011-09-28 01:26:51 +00:00
|
|
|
<thead><tr>
|
2011-09-29 07:55:05 +00:00
|
|
|
<?php
|
|
|
|
if(!empty($this->uuid))
|
|
|
|
echo '<th width="40">选择</th>';
|
|
|
|
?>
|
2012-05-24 09:11:07 +00:00
|
|
|
<th width="50">ID</th>
|
2011-11-04 01:57:51 +00:00
|
|
|
<th width='100'>上传文件名</th>
|
2011-09-28 06:56:03 +00:00
|
|
|
<th width='80'>类型</th>
|
|
|
|
<th width='80'>大小</th>
|
|
|
|
<th width='80'>下载次数</th>
|
|
|
|
<th width='150'>上传时间</th>
|
2011-09-28 01:26:51 +00:00
|
|
|
<th width="150">操作</th>
|
|
|
|
</tr></thead>
|
2012-05-24 09:11:07 +00:00
|
|
|
<tbody id="list">
|
2011-09-28 01:26:51 +00:00
|
|
|
<?php $autoindex=0;?>
|
|
|
|
<?php foreach ($this->paginator as $item): ?>
|
|
|
|
<?php $autoindex++;?>
|
2012-05-24 09:11:07 +00:00
|
|
|
<tr id="att_<?php echo $item['id'];?>">
|
2011-09-29 07:55:05 +00:00
|
|
|
<?php
|
|
|
|
if(!empty($this->uuid))
|
|
|
|
echo '<td><input type="checkbox" value="'.$item['id'].'" name="ids[]" /></td>';
|
|
|
|
?>
|
2012-05-24 09:11:07 +00:00
|
|
|
<td><?php echo $item['id'];?></td>
|
2011-11-04 01:57:51 +00:00
|
|
|
<td><?php echo $item['realname'] ;?></td>
|
2011-09-28 01:26:51 +00:00
|
|
|
<td><?php
|
|
|
|
if($item['filetype']=='image') echo '图片' ;
|
|
|
|
if($item['filetype']=='file') echo '文件' ;
|
|
|
|
if($item['filetype']=='media') echo '多媒体' ;
|
2011-11-04 01:57:51 +00:00
|
|
|
if($item['filetype']=='reviewatt') echo '评审附件' ;
|
2012-05-24 09:11:07 +00:00
|
|
|
if($item['filetype']=='md') echo "数据文件";
|
|
|
|
if($item['filetype']=='literature')echo "文献";
|
|
|
|
if($item['filetype']=='document') echo "文档";
|
2011-09-28 01:26:51 +00:00
|
|
|
?></td>
|
2011-09-28 04:04:25 +00:00
|
|
|
<td><?php if($item['filesize']<1048576) echo round(($item['filesize']/1024),2).'KB'; else echo round(($item['filesize']/1024/1024),2).'MB'; ?></td>
|
|
|
|
<td><?= $item['downtimes']; ?></td>
|
2011-09-28 06:56:03 +00:00
|
|
|
<td><?= date('Y-m-d H:i:s',strtotime($item['ts_created'])); ?></td>
|
2011-09-28 01:26:51 +00:00
|
|
|
<td>
|
2011-09-28 04:04:25 +00:00
|
|
|
<a href="/admin/data/attachments/edit/<?= $item['id']; ?>">编辑</a> |
|
2012-05-24 09:11:07 +00:00
|
|
|
<a href="javascript:delatt(<?= $item['id']; ?>);" onclick="return confirm('是否确定删除该附件?')">删除</a> |
|
2011-09-28 04:04:25 +00:00
|
|
|
<a href="/admin/data/attachments/down/<?= $item['id']; ?>">下载</a>
|
2011-09-28 01:26:51 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php endforeach; ?>
|
2011-09-29 07:55:05 +00:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<?php
|
|
|
|
if(!empty($this->uuid))
|
|
|
|
echo '<input type="hidden" name="uuid" value="'.$this->uuid.'" /><input type="hidden" name="submit" value="1" /><input type="submit" value="将已选择的附件添加到《'.$this->mdtitle.'》" />';
|
|
|
|
?>
|
|
|
|
</form>
|
2011-09-28 01:26:51 +00:00
|
|
|
<?php endif; ?>
|
2011-10-12 14:53:03 +00:00
|
|
|
<div class="pagenavi"><?= $this->paginator; ?></div>
|
2012-05-24 09:11:07 +00:00
|
|
|
</div>
|
|
|
|
<script>
|
|
|
|
function delatt(id){
|
|
|
|
$.ajax({
|
|
|
|
'type': "POST",
|
|
|
|
'url': "/admin/data/attachments/",
|
|
|
|
'data': 'delete='+id,
|
|
|
|
'success': function(data){
|
|
|
|
if(data==null){Alert('遇到错误,请重试');return false;}
|
|
|
|
if(data.error!=null){Alert(data.error);return false;}
|
|
|
|
if(data.status==1){$('#att_'+id).fadeOut("slow");}
|
|
|
|
},
|
|
|
|
'beforeSend':function(){},
|
|
|
|
'complete':function(){},
|
|
|
|
'timeout': 20000,
|
|
|
|
'dataType': 'json',
|
|
|
|
'error': function(){Alert('处理中出现问题,请重试');}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
function Alert(html){
|
|
|
|
$.colorbox({'innerWidth':'50%','html':'<h4>'+html+'</h4>'});
|
|
|
|
}
|
|
|
|
$("#list tr").mouseover(function(){$(this).addClass("high")}).mouseout(function(){$(this).removeClass("high")})
|
|
|
|
</script>
|