westdc-zf1/application/admin/views/scripts/data/doi-add.phtml

183 lines
9.7 KiB
PHTML
Raw Normal View History

<?php
$this->headTitle($this->config->title->site);
2013-05-24 14:41:19 +00:00
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
2014-07-23 08:38:32 +00:00
$this->headLink()->appendStylesheet('/css/admin.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin/data">数据管理</a>');
$this->breadcrumb('DOI');
$this->breadcrumb()->setSeparator(' > ');
$this->theme->AppendPlus($this,'colorbox');
?>
2014-07-23 08:38:32 +00:00
<div class="row">
<div class="hidden-sm hidden-xs col-md-2">
<?= $this->partial('data/left.phtml'); ?>
</div>
2014-07-23 08:38:32 +00:00
<div class="col-md-10 col-sm-12">
<div>
<ul class="nav nav-tabs">
<li><a href="/admin/data/doi">浏览所有</a></li>
<?php if(!empty($this->uuid)) {?>
<li class="active"><a href="javascript:void(0);">编辑DOI</a></li>
<?php }?>
</ul>
</div>
<div class="">
<?php if(!empty($this->error)) { ?>
<?= $this->error ?>
<?php } ?>
<?php if(!empty($this->msg)) { ?>
<?= $this->msg ?>
<?php } else{ ?>
2014-07-23 08:38:32 +00:00
<p></p>
2014-01-13 07:28:36 +00:00
<div class="alert alert-info">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<h4>提示</h4>
如果元数据中标题发生了变更在DOI中也需要变更时需要在这里点击“提交”按钮才能生效
</div>
2014-07-23 08:38:32 +00:00
<form class="form-horizontal" method="post">
2014-07-23 08:38:32 +00:00
<div class="form-group">
<label class="col-md-2 col-sm-2 control-label" for="doi">doi</label>
<div class="col-md-10 col-sm-10">
<input type="text" id="doi" name="doi" readonly="readonly" class="form-control"
2014-01-13 07:28:36 +00:00
value="<?= (isset($this->data['doi'])&&!empty($this->data['doi'])) ? $this->data['doi']:"doi:10.3972/westdc.x.2013.db" ?>" />
</div>
</div>
2014-07-23 08:38:32 +00:00
<div class="form-group">
<label class="col-md-2 col-sm-2 control-label" for="uuid">uuid</label>
<div class="col-md-10 col-sm-10">
<input type="text" id="uuid" name="uuid" readonly="readonly" value="<?= isset($this->data['uuid']) ? $this->data['uuid']:"" ?>" class="form-control" />
</div>
</div>
2014-07-23 08:38:32 +00:00
<div class="form-group">
<label class="col-md-2 col-sm-2 control-label" for="publisher">发布者</label>
<div class="col-md-10 col-sm-10">
<input type="text" id="publisher" name="publisher" value="<?= isset($this->data['publisher']) ? $this->data['publisher']:"" ?>" class="form-control" />
</div>
</div>
2014-07-23 08:38:32 +00:00
<div class="form-group">
<label class="col-md-2 col-sm-2 control-label" for="url">url</label>
<div class="col-md-10 col-sm-10">
<input type="text" id="url" name="url" value="<?= isset($this->data['url']) ? $this->data['url']:"" ?>" class="form-control" />
</div>
</div>
2014-07-23 08:38:32 +00:00
<div class="form-group">
<label class="col-md-2 col-sm-2 control-label" for="title">标题</label>
<div class="col-md-10 col-sm-10">
<input type="text" id="title" name="title" readonly="readonly" value="<?= isset($this->data['title']) ? $this->data['title']:"" ?>" class="form-control"/>
</div>
</div>
2014-07-23 08:38:32 +00:00
<div class="form-group">
<label class="col-md-2 col-sm-2 control-label" for="title_en">英文标题</label>
<div class="col-md-10 col-sm-10">
<input type="text" id="title_en" name="title_en" readonly="readonly" value="<?= isset($this->data['title_en']) ? $this->data['title_en']:"" ?>" class="form-control" />
</div>
</div>
2014-07-23 08:38:32 +00:00
<div class="form-group">
<label class="col-md-2 col-sm-2 control-label" for="publisher_en">发布者英文</label>
<div class="col-md-10 col-sm-10">
<input type="text" id="publisher_en" name="publisher_en" value="<?= isset($this->data['publisher_en']) ? $this->data['publisher_en']:"" ?>" class="form-control" />
</div>
</div>
<?php if(empty($this->data['info']) || !is_array($this->data['info'])) {?>
<div class="form-group infocontrol" id="info1">
<label class="col-md-2 col-sm-2 control-label" for="title_en">info</label>
<div class="col-md-10 col-sm-10">
<div class="controls row">
<div class="col-md-2 col-sm-4">
<input type="text" name="info[1][author]" value="" placeholder="作者" class="form-control"/>
</div>
<div class="col-md-2 col-sm-3">
<input type="text" name="info[1][author_en]" value="" placeholder="作者英文" class="form-control"/>
</div>
<div class="col-md-1 col-sm-2">
<input type="text" name="info[1][order]" value="" placeholder="排序" class="form-control"/>
</div>
<div class="col-md-3 col-sm-7">
<input type="text" name="info[1][organization]" value="" placeholder="单位" class="form-control"/>
</div>
<div class="col-md-3 col-sm-6">
<input type="text" name="info[1][organization_en]" value="" placeholder="单位英文" class="form-control"/>
</div>
</div>
</div>
</div>
<?php }else{ ?>
<?php
2014-07-23 08:38:32 +00:00
$index = 0;
foreach($this->data['info'] as $k=>$v){
$index ++;
?>
<div class="form-group infocontrol">
<label class="col-md-2 col-sm-2 control-label">info</label>
<div class="col-sm-10">
<div class="row">
<div class="col-md-2 col-sm-4"><input class="form-control" type="text" name="info[<?= $k ?>][author]" value="<?= $v['author'] ?>" placeholder="作者" /></div>
<div class="col-md-2 col-sm-3">
<input class="form-control" type="text" name="info[<?= $k ?>][author_en]" value="<?= $v['author_en'] ?>" placeholder="作者英文" />
2014-07-23 08:38:32 +00:00
</div>
<div class="col-md-1 col-sm-2"><input class="form-control" type="text" name="info[<?= $k ?>][order]" value="<?= $v['order'] ?>" placeholder="排序" /></div>
<div class="col-md-3 col-sm-7"><input class="form-control" type="text" name="info[<?= $k ?>][organization]" value="<?= $v['organization'] ?>" placeholder="单位" /></div>
2014-07-23 08:38:32 +00:00
<div class="col-md-3 col-sm-6">
<input class="form-control" type="text" name="info[<?= $k ?>][organization_en]" value="<?= $v['organization_en'] ?>" placeholder="单位英文" />
</div>
<div class="col-md-1">
<?php if($index>1){ ?>
2014-07-23 08:38:32 +00:00
<label class="control-label"><a href="javascript:void(0);" onclick="RmInput(this)"> -删除</a></label>
2014-09-04 02:56:47 +00:00
<?php }?>
2014-07-23 08:38:32 +00:00
</div>
</div>
</div>
</div>
<?php } ?>
<?php } ?>
2014-09-04 02:56:47 +00:00
<div class="form-group">
<div class="col-sm-12">
<a class="pull-right" href="javascript:void(0);" onclick="addinput()" >+添加一条</a>
</div>
</div>
2014-07-23 08:38:32 +00:00
<div class="form-group">
<div class="col-sm-12">
<input type="hidden" name="submit" value="1" />
<?php if(!empty($this->id)) { ?>
<input type="hidden" name="id" value=" <?=$this->id?> " />
<?php } ?>
<?php if(!empty($this->uuid)) { ?>
<input type="hidden" name="uuid" value=" <?=$this->uuid?>" />
<?php } ?>
2014-07-23 08:38:32 +00:00
<button type="submit" class="btn btn-primary pull-right">提交</button>
</div>
</div>
</form>
<?php } ?>
</div>
</div>
</div>
<script>
function addinput(){
var now_index = $('.infocontrol').length;
var index = now_index + 1;
2014-07-23 08:38:32 +00:00
html = '<div class="form-group infocontrol"><label class="col-md-2 col-sm-2 control-label">info</label>'
2014-09-04 02:56:47 +00:00
+'<div class="col-sm-10"><div class="controls row">'
+'<div class="col-md-2 col-sm-4"><input class="form-control" type="text" name="info[' + index + '][author]" placeholder="作者" /></div>'
+'<div class="col-md-2 col-sm-3"><input class="form-control" type="text" name="info[' + index + '][author_en]" placeholder="作者英文" /></div>'
2014-09-04 02:56:47 +00:00
+'<div class="col-md-1 col-sm-2"><input class="form-control" type="text" name="info[' + index + '][order]" placeholder="排序" /></div>'
+'<div class="col-md-3 col-sm-7"><input class="form-control" type="text" name="info[' + index + '][organization]" placeholder="单位" /></div>'
2014-09-04 02:56:47 +00:00
+'<div class="col-md-3 col-sm-6"><input class="form-control" type="text" name="info[' + index + '][organization_en]" placeholder="单位英文" /></div>'
+'<div class="col-md-1"><label class="control-label"><a href="javascript:void(0);" onclick="RmInput(this)"> -删除</a></label></div>'
+'</div></div></div>';
now_index = null;
index = null;
$('.infocontrol').last().after(html);
}
function RmInput(e){
$e = $(e);
2014-09-04 02:56:47 +00:00
$e.parent().parent().parent().parent().parent('div.infocontrol').remove();
}
</script>
2013-04-22 10:19:20 +00:00
<!-- //页面内容 -->