2013-09-26 10:28:55 +00:00
|
|
|
|
<?php
|
2014-09-13 02:18:32 +00:00
|
|
|
|
$this->headTitle($this->config->title->site);
|
|
|
|
|
$this->headTitle('后台管理');
|
|
|
|
|
$this->headTitle()->setSeparator(' - ');
|
|
|
|
|
$this->breadcrumb('<a href="/">首页</a>');
|
|
|
|
|
$this->headLink()->appendStylesheet('/css/admin.css');
|
|
|
|
|
$this->breadcrumb('<a href="/admin/data">数据管理</a>');
|
|
|
|
|
$this->breadcrumb('文献管理');
|
|
|
|
|
$this->breadcrumb()->setSeparator(' > ');
|
|
|
|
|
$this->theme->AppendPlus($this,'colorbox');
|
|
|
|
|
$this->theme->AppendPlus($this,"uploadify");
|
|
|
|
|
$this->theme->AppendPlus($this,'admin_plugin');
|
2013-09-26 10:28:55 +00:00
|
|
|
|
?>
|
|
|
|
|
<style>
|
2014-09-13 02:18:32 +00:00
|
|
|
|
table thead tr th { background: #EBF2F6; }
|
2013-09-26 10:28:55 +00:00
|
|
|
|
</style>
|
2014-09-13 02:18:32 +00:00
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="hidden-sm hidden-xs col-md-2">
|
2013-09-26 10:28:55 +00:00
|
|
|
|
<?= $this->partial('data/left.phtml'); ?>
|
|
|
|
|
</div>
|
2014-09-13 02:18:32 +00:00
|
|
|
|
<div class="col-md-10 col-sm-12">
|
2013-09-26 10:28:55 +00:00
|
|
|
|
<div>
|
|
|
|
|
<?= $this->partial('data/ref-nav.phtml',array('ac'=>$this->ac)); ?>
|
|
|
|
|
</div>
|
|
|
|
|
<?php if(!empty($this->error)) { ?>
|
2014-09-13 02:18:32 +00:00
|
|
|
|
<?= $this->error ?>
|
2013-09-26 10:28:55 +00:00
|
|
|
|
<?php } ?>
|
|
|
|
|
<?php if(!empty($this->msg)) { ?>
|
2014-09-13 02:18:32 +00:00
|
|
|
|
<?= $this->msg ?>
|
2013-09-26 10:28:55 +00:00
|
|
|
|
<?php } else{ ?>
|
2014-09-13 02:18:32 +00:00
|
|
|
|
<form class="form-horizontal" method="post" class="form-horizontal">
|
|
|
|
|
<div class="col-md-8">
|
|
|
|
|
<p></p>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 col-sm-2 control-label" for="inputTitle">文章标题</label>
|
|
|
|
|
<div class="col-md-10 col-sm-10">
|
|
|
|
|
<input type="text" name="title" id="inputTitle" class="form-control" value="<?= isset($this->data['title']) ? $this->data['title']:" " ?>">
|
|
|
|
|
</div>
|
2013-09-26 10:28:55 +00:00
|
|
|
|
</div>
|
2014-09-13 02:18:32 +00:00
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 col-sm-2 control-label" for="inputYear">出版年份</label>
|
|
|
|
|
<div class="col-md-10 col-sm-10">
|
|
|
|
|
<input class="form-control" type="text" name="year" id="inputYear" value="<?= isset($this->data['year']) ? $this->data['year']:" " ?>">
|
|
|
|
|
<select class="span2">
|
|
|
|
|
<?php for($i=2000;$i<=(int)date("Y");$i++) {?>
|
|
|
|
|
<option value="<?= $i ?>" onclick="$('#inputYear').val(this.value)"><?= $i ?></option>
|
|
|
|
|
<?php } ?>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
2013-09-26 10:28:55 +00:00
|
|
|
|
</div>
|
2014-09-13 02:18:32 +00:00
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 col-sm-2 control-label" for="inputYear">出版社/期刊</label>
|
|
|
|
|
<div class="col-md-10 col-sm-10">
|
|
|
|
|
<input type="text" name="publisher" id="inputYear" class="form-control" value="<?= isset($this->data['publisher']) ? $this->data['publisher']:" " ?>">
|
|
|
|
|
</div>
|
2013-10-09 08:03:47 +00:00
|
|
|
|
</div>
|
2014-09-13 02:18:32 +00:00
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 col-sm-2 control-label" for="inputReference">引用方式(前台显示)</label>
|
|
|
|
|
<div class="col-md-10 col-sm-10">
|
|
|
|
|
<textarea name="reference" id="inputReference" class="form-control"><?= isset($this->data['reference']) ? $this->data['reference']:"" ?></textarea>
|
|
|
|
|
</div>
|
2013-09-26 10:28:55 +00:00
|
|
|
|
</div>
|
2014-09-13 02:18:32 +00:00
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 col-sm-2 control-label" for="inputLink">链接(自动填写请留空)</label>
|
|
|
|
|
<div class="col-md-10 col-sm-10">
|
|
|
|
|
<input type="text" name="link" id="inputLink" class="form-control" value="<?= isset($this->data['link']) ? $this->data['link']:" " ?>" />
|
|
|
|
|
</div>
|
2013-09-26 10:28:55 +00:00
|
|
|
|
</div>
|
2014-09-13 02:18:32 +00:00
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 col-sm-2 control-label" for="inputType">类型</label>
|
|
|
|
|
<div class="col-md-10 col-sm-10">
|
|
|
|
|
<input type="text" name="type" id="inputType" class="form-control" value="<?= isset($this->data['type']) ? $this->data['type']:" " ?>">
|
|
|
|
|
</div>
|
2013-11-11 04:17:15 +00:00
|
|
|
|
</div>
|
2014-09-13 02:18:32 +00:00
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 col-sm-2 control-label" for="inputLanguage">语言</label>
|
|
|
|
|
<div class="col-md-10 col-sm-10">
|
|
|
|
|
<input type="text" name="language" id="inputLanguage" class="form-control" value="<?= isset($this->data['language']) ? $this->data['language']:" " ?>">
|
|
|
|
|
</div>
|
2013-11-11 04:17:15 +00:00
|
|
|
|
</div>
|
2014-09-13 02:18:32 +00:00
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 col-sm-2 control-label" for="inputDoi">DOI</label>
|
|
|
|
|
<div class="col-md-10 col-sm-10">
|
|
|
|
|
<input type="text" name="doi" id="inputDoi" class="form-control" value="<?= isset($this->data['doi']) ? $this->data['doi']:" " ?>">
|
|
|
|
|
</div>
|
2013-11-11 04:17:15 +00:00
|
|
|
|
</div>
|
2014-09-13 02:18:32 +00:00
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 col-sm-2 control-label" for="inputBibtex">ris</label>
|
|
|
|
|
<div class="col-md-10 col-sm-10">
|
|
|
|
|
<textarea name="ris" id="inputBibtex" class="form-control"><?= isset($this->data['ris']) ? $this->data['ris']:"" ?></textarea>
|
|
|
|
|
</div>
|
2013-10-09 08:03:47 +00:00
|
|
|
|
</div>
|
2014-09-13 02:18:32 +00:00
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 col-sm-2 control-label" for="inputAbstract">摘要</label>
|
|
|
|
|
<div class="col-md-10 col-sm-10">
|
|
|
|
|
<textarea name="abstract" id="inputAbstract" class="form-control"><?= isset($this->data['abstract']) ? $this->data['abstract']:"" ?></textarea>
|
|
|
|
|
</div>
|
2013-11-11 04:17:15 +00:00
|
|
|
|
</div>
|
2014-09-13 02:18:32 +00:00
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 col-sm-2 control-label" for="inputNote">备注</label>
|
|
|
|
|
<div class="col-md-10 col-sm-10">
|
|
|
|
|
<textarea name="note" id="inputNote" class="form-control"><?= isset($this->data['note']) ? $this->data['note']:"" ?></textarea>
|
|
|
|
|
</div>
|
2013-09-26 10:28:55 +00:00
|
|
|
|
</div>
|
2014-09-13 02:18:32 +00:00
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 col-sm-2 control-label" for="inputPDF">PDF:</label>
|
|
|
|
|
<div class="col-md-10 col-sm-10">
|
|
|
|
|
<input type="file" name="Filedata" id="file_upload" />
|
|
|
|
|
<div id="uploadedFile"></div>
|
|
|
|
|
</div>
|
2013-09-26 10:28:55 +00:00
|
|
|
|
</div>
|
2014-09-13 02:18:32 +00:00
|
|
|
|
<div class="form-group">
|
|
|
|
|
<div class="col-md-2 col-sm-2"></div>
|
|
|
|
|
<div class="col-md-5 col-sm-5">
|
|
|
|
|
<input type="hidden" name="submit" value="1" />
|
|
|
|
|
<button type="submit" class="btn btn-primary">保存</button>
|
|
|
|
|
<button type="reset" class="btn btn-default">取消</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
2013-09-26 10:28:55 +00:00
|
|
|
|
<?php } ?>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- //页面内容 -->
|
|
|
|
|
<script>
|
2014-09-13 02:18:32 +00:00
|
|
|
|
$(document).ready(function (e) {
|
|
|
|
|
$('#btn-add-author').click(function (e) {
|
|
|
|
|
html = '';
|
|
|
|
|
$('#author_inputs').append('');
|
|
|
|
|
});
|
2013-11-11 04:17:15 +00:00
|
|
|
|
});
|
2014-09-13 02:18:32 +00:00
|
|
|
|
var _this = {
|
|
|
|
|
SessionID: '<?php echo session_id(); ?>'
|
|
|
|
|
};
|
|
|
|
|
var uploader;
|
|
|
|
|
var param;
|
|
|
|
|
param = {
|
|
|
|
|
"PHPSESSID": _this.SessionID,
|
|
|
|
|
};
|
|
|
|
|
$(function () {
|
|
|
|
|
$('#file_upload').uploadify({
|
|
|
|
|
'swf': '/js/lib/uploadify/uploadify.swf',
|
|
|
|
|
'uploader': '/admin/data/ref/ac/pdfupload',
|
|
|
|
|
'multi': false,
|
|
|
|
|
'auto': true,
|
|
|
|
|
'fileTypeExts': '*.pdf;*.caj',
|
|
|
|
|
'onUploadSuccess': function (file, data, response) {
|
|
|
|
|
upload.onsuccess(file, data, response);
|
|
|
|
|
},
|
|
|
|
|
'onUploadStart': function (file) {
|
|
|
|
|
$('#file_upload').uploadify('settings', 'formData', param);
|
|
|
|
|
}
|
|
|
|
|
});
|
2013-09-26 10:28:55 +00:00
|
|
|
|
});
|
|
|
|
|
|
2014-09-13 02:18:32 +00:00
|
|
|
|
var upload = {
|
|
|
|
|
onsuccess: function (file, data, response) {
|
|
|
|
|
_data = $.parseJSON(data);
|
|
|
|
|
if (!$.isEmptyObject(_data.error)) {
|
|
|
|
|
alert(_data.error);
|
|
|
|
|
} else {
|
|
|
|
|
$('#uploadedFile').html(upload.makeFileHtml(_data));
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
makeFileHtml: function (data) {
|
|
|
|
|
return '<div class="alert alert-success">'
|
|
|
|
|
+ '<button type="button" class="close" data-dismiss="alert" onclick="upload.deleteFile(' + data.id + ')"><i class="icon-trash icon-white"></i></button>'
|
|
|
|
|
+ data.realname
|
|
|
|
|
+ '<input type="hidden" name="attid" value="' + data.id + '"></input>'
|
|
|
|
|
+ '</div>';
|
|
|
|
|
},
|
|
|
|
|
deleteFile: function (id) {
|
|
|
|
|
$.ajax({
|
|
|
|
|
'type': "POST",
|
|
|
|
|
'url': '/admin/data/ref/ac/delete',
|
|
|
|
|
'data': 'attid=' + id,
|
|
|
|
|
'success': function (data) {
|
|
|
|
|
if (typeof (data) == 'undefined') {
|
|
|
|
|
alert("数据源错误,请联系管理员");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!$.isEmptyObject(data.error)) {
|
|
|
|
|
alert(data.error);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
'timeout': 30000,
|
|
|
|
|
'error': function () {
|
|
|
|
|
alert('附件删除出错');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
2013-09-26 10:28:55 +00:00
|
|
|
|
</script>
|
|
|
|
|
<?php if(isset($this->data['attid']) && !empty($this->data['attid'])){ ?>
|
2015-01-31 03:59:50 +00:00
|
|
|
|
<input type="hidden" id="reference_file_content" value='<?= json_encode($this->data['file']) ?>' />
|
2013-09-26 10:28:55 +00:00
|
|
|
|
<script>
|
2014-09-13 02:18:32 +00:00
|
|
|
|
upload.onsuccess('', $('#reference_file_content').val(), "");
|
2013-09-26 10:28:55 +00:00
|
|
|
|
</script>
|
|
|
|
|
<?php } ?>
|