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('数据管理');
|
|
|
|
$this->breadcrumb()->setSeparator(' > ');
|
2011-11-07 08:34:13 +00:00
|
|
|
$this->headLink()->appendStylesheet('/static/js/uploadify/uploadify.css');
|
2012-05-24 08:05:08 +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-11-07 08:34:13 +00:00
|
|
|
$this->headScript()->appendFile('/static/js/uploadify/swfobject.js');
|
|
|
|
$this->headScript()->appendFile('/static/js/uploadify/jquery.uploadify.v2.1.4.min.js');
|
2011-09-28 01:26:51 +00:00
|
|
|
?>
|
|
|
|
<div id="leftPanel">
|
|
|
|
<?= $this->partial('data/left.phtml'); ?>
|
|
|
|
</div>
|
2011-10-12 14:53:03 +00:00
|
|
|
<div id="rightPanel">
|
2011-11-09 09:54:08 +00:00
|
|
|
|
|
|
|
<div class="ctrlplan">
|
|
|
|
<a href="/admin/data/md/att/1/uuid/<?php echo $this->uuid;?>">返回元数据附件列表</a>
|
2012-12-01 10:59:14 +00:00
|
|
|
<a href="/data/<?php echo $this->uuid; ?>">查看元数据</a>
|
|
|
|
<a href="/admin/data/attachments/">返回附件管理</a>
|
2011-09-28 01:26:51 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<form action="#" method="POST" enctype='multipart/form-data'>
|
|
|
|
<input type="hidden" name="add" value="1" />
|
|
|
|
<input type="hidden" name="submit" value="1" />
|
|
|
|
|
2011-11-07 08:34:13 +00:00
|
|
|
<p>注:可选择多个文件<br />
|
|
|
|
<ul id="datalist"></ul>
|
|
|
|
<input id="file_upload" name="Filedata" type="file" />
|
|
|
|
<input type="button" class="btn btn-small" onclick="$('#file_upload').uploadifyUpload();" value="上传" />
|
|
|
|
</p>
|
|
|
|
|
2011-09-28 01:26:51 +00:00
|
|
|
</form>
|
2011-11-07 08:34:13 +00:00
|
|
|
</div>
|
|
|
|
<script>
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('#file_upload').uploadify({
|
|
|
|
'uploader' : '/static/js/uploadify/uploadify.swf',
|
|
|
|
'scriptData': {'PHPSESSID' : '<?php echo session_id(); ?>'},
|
|
|
|
'script' : '/admin/data/upload/<?php if(!empty($this->uuid)) echo "uuid/".$this->uuid; ?>',
|
|
|
|
'cancelImg' : '/static/js/uploadify/cancel.png',
|
|
|
|
'folder' : '/uploads',
|
|
|
|
'multi' : true,
|
|
|
|
'auto' : false,
|
|
|
|
'displayData' : 'speed',
|
|
|
|
'buttonImg' : '/static/js/uploadify/selectfile.gif',
|
|
|
|
'onComplete' : function(event, ID, fileObj, response, data) {
|
|
|
|
var obj = jQuery.parseJSON(response);
|
|
|
|
var html;
|
|
|
|
if(obj.error=='')
|
|
|
|
{html = obj.html;}else{html = obj.error;}
|
|
|
|
$('<li/>', {
|
|
|
|
"id":'uploadedItem_'+obj.attid,
|
|
|
|
"class":'uploadifyQueueItem',
|
|
|
|
"html": html
|
|
|
|
}).appendTo('#datalist');
|
|
|
|
$('#deletebtn_'+obj.attid).bind('click', function() {
|
|
|
|
deleteatt(obj.attid);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
'onError' : function (event,ID,fileObj,errorObj) {
|
|
|
|
alert(errorObj.type + ' Error: ' + errorObj.info);
|
|
|
|
}
|
|
|
|
});
|
2012-05-24 08:05:08 +00:00
|
|
|
function deleteatt(id){
|
2011-11-07 08:34:13 +00:00
|
|
|
$.ajax({
|
2012-05-24 08:05:08 +00:00
|
|
|
'type': "POST",
|
|
|
|
'url': "/admin/data/attachments/",
|
|
|
|
'data': 'uuid=<?php echo $this->uuid?>&mdattdel='+id,
|
|
|
|
'success': function(data){
|
|
|
|
if(data==null){Alert('遇到错误,请重试');return false;}
|
|
|
|
if(data.error!=null){Alert(data.error);return false;}
|
|
|
|
if(data.status==1){$('#uploadedItem_'+id).fadeOut("slow");}
|
|
|
|
},
|
|
|
|
'beforeSend':function(){},
|
|
|
|
'complete':function(){},
|
|
|
|
'timeout': 20000,
|
|
|
|
'dataType': 'json',
|
|
|
|
'error': function(){Alert('处理中出现问题,请重试');}
|
2011-11-07 08:34:13 +00:00
|
|
|
});
|
|
|
|
}
|
2011-11-09 09:54:08 +00:00
|
|
|
|
|
|
|
$.getJSON("/admin/data/getatts/uuid/<?php echo $this->uuid;?>", function(data) {
|
|
|
|
if(data)
|
|
|
|
{
|
|
|
|
$.each(data, function(key, val) {
|
|
|
|
$('<li/>', {
|
|
|
|
"id":'uploadedItem_'+val['id'],
|
|
|
|
"class":'uploadifyQueueItem',
|
|
|
|
"html": val['html']
|
|
|
|
}).appendTo('#datalist');
|
|
|
|
$('#deletebtn_'+val['id']).bind('click', function() {
|
|
|
|
deleteatt(val['id']);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
2011-11-07 08:34:13 +00:00
|
|
|
});
|
2012-05-24 08:05:08 +00:00
|
|
|
function Alert(html){
|
|
|
|
$.colorbox({'innerWidth':'50%','html':'<h4>'+html+'</h4>'});
|
|
|
|
}
|
2011-11-07 08:34:13 +00:00
|
|
|
</script>
|