122 lines
3.8 KiB
PHTML
122 lines
3.8 KiB
PHTML
<?php
|
|
$this->headTitle($this->config->title->site);
|
|
$this->headTitle('后台管理');
|
|
$this->headTitle()->setSeparator(' - ');
|
|
$this->breadcrumb('<a href="/">首页</a>');
|
|
$this->breadcrumb('<a href="/admin/data">数据管理</a>');
|
|
$this->breadcrumb('文献管理');
|
|
$this->breadcrumb()->setSeparator(' > ');
|
|
$this->theme->AppendPlus($this,'colorbox');
|
|
$this->theme->AppendPlus($this,'admin_plugin');
|
|
?>
|
|
<style>
|
|
table thead tr th {background:#EBF2F6;}
|
|
</style>
|
|
<div class="row-fluid">
|
|
<div class="span2">
|
|
<?= $this->partial('data/left.phtml'); ?>
|
|
</div>
|
|
<div class="span10">
|
|
<div>
|
|
<?= $this->partial('data/ref-nav.phtml',array('ac'=>$this->ac)); ?>
|
|
</div>
|
|
<?php if(!empty($this->error)) { ?>
|
|
<?= $this->error ?>
|
|
<?php } ?>
|
|
<?php if(!empty($this->msg)) { ?>
|
|
<?= $this->msg ?>
|
|
<?php } else{ ?>
|
|
<button type="button" class="btn btn-primary" onclick="$('#mdref-form').modal('show');">添加一条</button>
|
|
<div id="datalist">
|
|
<?php if (count($this->paginator)): ?>
|
|
<table class="table table-bordered table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>元数据</th>
|
|
<th>排序</th>
|
|
<th width="140">操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php $autoindex=0;
|
|
foreach ($this->paginator as $item):
|
|
$autoindex++;?>
|
|
<tr id="DataLine_<?= $item['id']?>">
|
|
<td><?= $item['title'] ?></td>
|
|
<td><?= $item['place'] ?></td>
|
|
<td>
|
|
<a href="javascript:void(0);" onclick="mdref.edit(<?= $item['id']?>)">编辑</a>
|
|
<a href="/admin/data/ref/ac/delmdref/id/<?= $item['id']?>">移除</a>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
<?php endif; ?>
|
|
<div class="pagenavi"><?= $this->paginator; ?></div>
|
|
</div>
|
|
<?php } ?>
|
|
</div>
|
|
</div>
|
|
<!-- //页面内容 -->
|
|
<?= $this->partial('data/ref-mdref-form.phtml',array('referenceType'=>$this->referenceType,'refid'=>$this->refid)); ?>
|
|
<script>
|
|
$(document).ready(function(e) {
|
|
});
|
|
var mdref = {
|
|
create : function(){
|
|
data = $('#mdref').serialize();
|
|
$.ajax({
|
|
'type':"POST",
|
|
'url':"/admin/data/ref/ac/mdref/",
|
|
'data':data,
|
|
'success':mdref.onsuccessed,
|
|
'timeout': 30000,
|
|
'error': function(){
|
|
$("#alert-info").attr('class','alert alert-error');
|
|
$("#alert-info").html("出现错误,请稍后重试");
|
|
$('#submit-loading').hide();
|
|
return false;
|
|
},
|
|
'beforeSend': function(){
|
|
$("#submit_btn").addClass('disabled');
|
|
$("#submit_btn").attr('disabled','disabled');
|
|
$('#submit-loading').show();
|
|
},
|
|
'complete': function(){
|
|
$("#submit_btn").removeClass('disabled');
|
|
$("#submit_btn").removeAttr('disabled');
|
|
$('#submit-loading').hide();
|
|
}
|
|
});
|
|
},
|
|
onsuccessed : function(data){
|
|
if (typeof(data)=='object')
|
|
{
|
|
if(typeof(data.error)!='undefined')
|
|
{
|
|
$("#alert-info").attr('class','alert alert-error');
|
|
$("#alert-info").html(data.error);
|
|
return false;
|
|
}
|
|
if(typeof(data.success)!='undefined')
|
|
{
|
|
$("#alert-info").attr('class','alert alert-success');
|
|
$("#alert-info").html("添加成功!");
|
|
setTimeout("$('#mdref-form').modal('hide');",1000);
|
|
setTimeout("window.location.href = window.location.href",2000);
|
|
return false;
|
|
}
|
|
}
|
|
else{
|
|
$("#alert-info").attr('class','alert alert-error');
|
|
$("#alert-info").html('请求中发生错误,请重试');
|
|
return false;
|
|
}
|
|
},
|
|
edit : function(id)
|
|
{
|
|
alert(id);
|
|
}
|
|
}
|
|
</script>
|