westdc-zf1/application/admin/views/scripts/data/sourceadd.phtml

193 lines
9.1 KiB
PHTML

<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/admin.css');
$this->headScript()->appendFile('/js/jquery-1.6.4.min.js');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin">后台首页</a>');
$this->breadcrumb('<a href="/admin/data">数据管理</a>');
$this->breadcrumb('项目来源管理');
$this->breadcrumb()->setSeparator(' > ');
?>
<div class="row">
<div class="hidden-sm hidden-xs col-md-2">
<?= $this->partial('data/left.phtml'); ?>
</div>
<div class="col-md-10 col-sm-12">
<?php if ($this->msg or $this->messages) :?>
<div id="message" class="alert alert-success">
<?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 class="form-group">
<ul class="nav nav-tabs">
<li><a href="/admin/data/source">项目来源管理</a></li>
<li class="active"><a href="/admin/data/source/do/add">添加项目来源</a></li>
</ul>
</div>
<form method="post" action="/admin/data/source" class="form-horizontal">
<div class="form-group">
<label for="title" class="col-md-2 col-sm-2 control-label">标题</label>
<div class="col-md-4 col-sm-4">
<input class="form-control" type="text" name="title" value="<?php echo $this->info['title'];?>" />
</div>
</div>
<div class="form-group">
<label class="col-md-2 col-sm-2 control-label">uuid:</label>
<div class="col-md-4 col-sm-4">
<input class="form-control" type="text" name="uuid" value="<?php echo $this->info['uuid'];?>" />
</div>
</div>
<div class="form-group">
<label class="col-md-2 col-sm-2 control-label">Code:</label>
<div class="col-md-4 col-sm-4">
<input class="form-control" type="text" name="code" value="<?php echo $this->info['code'];?>" />
</div>
</div>
<div class="form-group">
<label class="col-md-2 col-sm-2 control-label">项目管理机构</label>
<div class="col-md-2 col-sm-2">
<label class="radio-inline">
<input type="radio" name="admin_status" value="0" <?php if(empty($this->info['admin_status']) | $this->info['admin_status'] =='0') echo 'checked="checked"';?> />
暂无管理机构 </label>
</div>
<div class="col-md-2 col-sm-2">
<label class="radio-inline">
<input type="radio" name="admin_status" value="1" <?php if($this->info['admin_status']=='1') echo 'checked="checked"';?> />
由专家委员会管理 </label>
</div>
<div class="col-md-2 col-sm-2">
<label class="radio-inline">
<input type="radio" name="admin_status" value="2" <?php if($this->info['admin_status']=='2') echo 'checked="checked"';?> />
委托数据中心管理 </label>
</div>
</div>
<?php if(!empty($this->info['admin_email'])) {
# 去除数组数据中的{}
$emailarry = explode(',',substr($this->info['admin_email'],1,-1));
$uuidarry = explode(',',substr($this->info['exclude_data'],1,-1));
?>
<div id="emails">
<?php foreach($emailarry as $email):?>
<div class="form-group subemail">
<label class="col-md-2 col-sm-2 control-label">管理邮箱</label>
<div class="col-md-4 col-sm-4">
<input class="form-control" type="text" name="admin_email[]" value="<?php echo $email;?>" />
</div>
<div class="col-md-1 col-sm-1"><a href="javascript:void(0);" onclick="addemail()" class="glyphicon glyphicon-plus "></a>&nbsp;&nbsp;&nbsp;<a href="javascript:void(0);" onclick="rminput(this)" class="glyphicon glyphicon-minus "></a></div>
</div>
<?php endforeach;?>
</div>
<div id="plusuuid">
<?php foreach($uuidarry as $uuid):?>
<div class="form-group subuuid">
<label class="col-md-2 col-sm-2 control-label">不管理数据UUID:</label>
<div class="col-md-4 col-sm-4">
<input class="form-control" type="text" name="exclude_data[]" value="<?php echo $uuid;?>" />
</div>
<div class="col-md-1 col-sm-1"><a href="javascript:void(0);" onclick="adduuid()" class="glyphicon glyphicon-plus "></a>&nbsp;&nbsp;&nbsp;<a href="javascript:void(0);" onclick="rminput(this)" class="glyphicon glyphicon-minus "></a></div>
</div>
<?php endforeach;?>
</div>
<?php }else{ ?>
<div id="emails">
<div class="form-group subemail">
<label class="col-md-2 col-sm-2 control-label">管理邮箱</label>
<div class="col-md-4 col-sm-4">
<input class="form-control" type="text" name="admin_email[]" />
</div>
<div class="col-md-1 col-sm-1"><a href="javascript:void(0);" onclick="addemail()" class="glyphicon glyphicon-plus "></a>&nbsp;&nbsp;&nbsp;<a href="javascript:void(0);" onclick="rminput(this)" class="glyphicon glyphicon-minus "></a></div>
</div>
</div>
<div id="plusuuid">
<div class="form-group subuuid">
<label class="col-md-2 col-sm-2 control-label">不管理数据UUID:</label>
<div class="col-md-4 col-sm-4">
<input class="form-control" type="text" name="exclude_data[]" />
</div>
<div class="col-md-1 col-sm-1"><a href="javascript:void(0);" onclick="adduuid()" class="glyphicon glyphicon-plus "></a>&nbsp;&nbsp;&nbsp;<a href="javascript:void(0);" onclick="rminput(this)" class="glyphicon glyphicon-minus "></a></div>
</div>
</div>
<?php }?>
<div class="form-group">
<label class="col-md-2 col-sm-2 control-label">描述</label>
<div class="col-md-4 col-sm-4">
<textarea id="form-control" class="samll half form-control" name="description">
<?php echo $this->info['description'];?>
</textarea>
</div>
</div>
<div class="form-group">
<label class="col-md-2 col-sm-2 control-label">has_pages</label>
<div class="col-md-2 col-sm-2">
<label class="radio-inline">
<input type="radio" name="has_pages" value="true" <?php if($this->info['has_pages']) echo 'checked="checked"';?> />
True </label>
</div>
<div class="col-md-2 col-sm-2">
<label class="radio-inline">
<input type="radio" name="has_pages" value="false" <?php if(!$this->info['has_pages']) echo 'checked="checked"';?> />
False </label>
</div>
</div>
<div class="form-group">
<label class="col-md-2 col-sm-2 control-label">has_agreement</label>
<div class="col-md-2 col-sm-2">
<label class="radio-inline">
<input type="radio" name="has_agreement" value="true" <?php if($this->info['has_agreement']) echo 'checked="checked"';?> />
True </label>
</div>
<div class="col-md-2 col-sm-2">
<label class="radio-inline">
<input type="radio" name="has_agreement" value="false" <?php if(!$this->info['has_agreement']) echo 'checked="checked"';?> />
False </label>
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-sm-6">
<input type="hidden" name="id" value="<?php echo $this->info['id'];?>" />
<input type="hidden" name="do" value="<?php if($this->info['uuid']!='') echo 'edit';else echo 'add';?>" />
<input type="hidden" name="submit" value="1" />
<input type="submit" value="提交" class="btn btn-primary pull-right" />
</div>
</div>
</form>
</div>
</div>
<script>
function addemail(){
$("#emails").append('<div class="form-group subemail">'
+'<label class="col-md-2 col-sm-2 control-label">管理邮箱</label>'
+'<div class="col-md-4 col-sm-4">'
+'<input class="form-control" type="text" name="admin_email[]" value="" />'
+'</div>'
+'<div class="col-md-1 col-sm-1"><a href="javascript:void(0);" onclick="addemail()" class="glyphicon glyphicon-plus "></a>&nbsp;&nbsp;&nbsp;<a href="javascript:void(0);" onclick="rminput(this)" class="glyphicon glyphicon-minus "></a></div>'
+'</div>');
}
function adduuid(){
$("#plusuuid").append('<div class="form-group subuuid">'
+'<label class="col-md-2 col-sm-2 control-label">不管理数据UUID:</label>'
+'<div class="col-md-4 col-sm-4">'
+'<input class="form-control" type="text" name="exclude_data[]" value="" />'
+'</div>'
+'<div class="col-md-1 col-sm-1"><a href="javascript:void(0);" onclick="adduuid()" class="glyphicon glyphicon-plus "></a>&nbsp;&nbsp;&nbsp;<a href="javascript:void(0);" onclick="rminput(this)" class="glyphicon glyphicon-minus "></a></div>'
+'</div>');
}
function rminput(e){
$e = $(e);
$e.parent().parent().remove();
};
</script>