121 lines
5.1 KiB
PHTML
121 lines
5.1 KiB
PHTML
<?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/data">数据管理</a>');
|
||
$this->breadcrumb('数据时空范围');
|
||
$this->breadcrumb()->setSeparator(' > ');
|
||
$this->theme->AppendPlus($this,'colorbox');
|
||
?>
|
||
<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">
|
||
<div>
|
||
<ul class="nav nav-tabs">
|
||
<li><a href="/admin/data/spatial">浏览所有</a></li>
|
||
<?php if(!empty($this->uuid)) {?>
|
||
<li class="active"><a href="javascript:void(0);">编辑</a></li>
|
||
<?php }?>
|
||
</ul>
|
||
</div>
|
||
<div class="">
|
||
<?php if(!empty($this->error)) { ?>
|
||
<?= $this->error ?>
|
||
<?php } ?>
|
||
<?php if(!empty($this->msg)) { ?>
|
||
<?= $this->msg ?>
|
||
<?php } else{ ?>
|
||
<p></p>
|
||
<div class="alert alert-info">
|
||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||
<h4>提示</h4>
|
||
1. 空间范围请使用经纬度(dd)格式进行添加。<br/>
|
||
2. 日期精确到天。中括号代表包含,小括号代表不包含。
|
||
</div>
|
||
<h2><?php echo $this->data[0]['title']; ?></h2>
|
||
<form class="form-horizontal" method="post">
|
||
<div id="datalist">
|
||
<?php if (count($this->data)): ?>
|
||
<table class="stylized table table-bordered table-striped table-hover">
|
||
<thead>
|
||
<tr>
|
||
<th width="60%">空间范围</th>
|
||
<th>时间范围</th>
|
||
<th width="100">操作</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<?php $autoindex=0;
|
||
foreach ($this->data as $item):
|
||
if (isset($item['id']) && $item['id']>0) :
|
||
$autoindex++; ?>
|
||
<tr class="infocontrol">
|
||
<td><textarea class="col-md-12" rows="3" name="info[<?= $autoindex ?>][spatial]" ><?= $item['spatial'] ?></textarea></td>
|
||
<td><input type="text" name="info[<?= $autoindex ?>][temporal]" class="form-control" value="<?= $item['temporal'] ?>" /></td>
|
||
<td>
|
||
编辑:点 线 矩形 多边形
|
||
<a href="javascript:void(0);" onclick="onedel(<?= $item['id']?>)" id="delbtn_<?= $item['id']?>">删除</a>
|
||
</td>
|
||
<input type="hidden" name="info[<?= $autoindex ?>][id]" value=" <?=$item->id?> " />
|
||
</tr>
|
||
<?php endif; endforeach; if ((count($this->data)==1) && !isset($this->data[0]['id'])) :
|
||
$item=$this->data[0]; ?>
|
||
<tr class="infocontrol">
|
||
<td><textarea class="col-md-12" rows="3" name="info[1][spatial]" ><?= $item['spatial'] ?></textarea></td>
|
||
<td><input type="text" name="info[1][temporal]" class="form-control"
|
||
value="<?= $item['temporal'] ?>" /></td>
|
||
<td>
|
||
点 线 矩形 多边形
|
||
<a href="/admin/data/spatial/ac/edit/uuid/<?= $item['uuid']?>">编辑</a>
|
||
</td>
|
||
<input type="hidden" name="info[1][id]" value="0" />
|
||
</tr>
|
||
<?php endif; endif;?>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<div class="form-group">
|
||
<div class="col-sm-12">
|
||
<a class="pull-right" href="javascript:void(0);" onclick="addinput()" >+为该数据添加一行新时空范围</a>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<div class="col-sm-12">
|
||
<input type="hidden" name="submit" value="1" />
|
||
<?php if(!empty($this->uuid)) { ?>
|
||
<input type="hidden" name="uuid" value=" <?=$this->uuid?>" />
|
||
<?php } ?>
|
||
<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;
|
||
html = '<tr class="infocontrol">'
|
||
+'<td><textarea class="col-md-12" rows="3" name="info['+index+'][spatial]" placeholder="WKT Geometry"></textarea></td>'
|
||
+'<td><input type="text" name="info['+index+'][temporal]" class="form-control" value="" placeholder="Date range"/></td>'
|
||
+'<td><a href="">点 线 矩形 多边形</a>'
|
||
+' <label class="control-label"><a href="javascript:void(0);" onclick="RmInput(this)"> -删除</a></label>'
|
||
+'</td><input type="hidden" name="info['+index+'][id]" value="0" />'
|
||
+'</tr>';
|
||
now_index = null;
|
||
index = null;
|
||
$('.infocontrol').last().after(html);
|
||
}
|
||
function RmInput(e){
|
||
$e = $(e);
|
||
$e.parent().parent().parent('tr.infocontrol').remove();
|
||
|
||
}
|
||
</script>
|
||
<!-- //页面内容 -->
|