update data index

This commit is contained in:
jack 2018-05-11 23:14:42 +08:00
parent 06ea3d9821
commit 5dfd13b408
4 changed files with 368 additions and 205 deletions

View File

@ -50,7 +50,7 @@ class DataController extends Zend_Controller_Action
$k5=$state->fetchAll();
$this->view->keywords=array('place'=>$k1,'theme'=>$k2,'discipline'=>$k3,'stratum'=>$k4,'temporal'=>$k5);
//最新10个入库数据
$state=$this->db->query('select id,uuid,title,ts_published from normalmetadata order by id desc limit 10');
$state=$this->db->query('select id,uuid,title,ts_published,description from normalmetadata order by id desc limit 8');
$this->view->metadata = $state->fetchAll();
//特色数据

View File

@ -0,0 +1,230 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->data);
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/static-sanji/css/data-index.css');
?>
<div class="data-warp">
<!-- <div class="top-special-nav">-->
<!-- <div class="title">专题数据集</div>-->
<!-- <div class="container">-->
<!-- <div class="col-sm-4">-->
<!-- <div>-->
<!-- <p>黑河计划</p>-->
<!-- </div>-->
<!-- <img src="/news/images/data_01.png" alt="">-->
<!-- </div>-->
<!-- <div class="col-sm-4">-->
<!-- <div>-->
<!-- <p>HiWATER</p>-->
<!-- <p>克里斯蒂几个垃圾规范可结果看了几个集都十分广泛</p>-->
<!-- </div>-->
<!-- <img src="/news/images/data_01.png" alt="">-->
<!-- </div>-->
<!-- <div class="col-sm-4">-->
<!-- <div>-->
<!-- <p>HiWATER</p>-->
<!-- <p>克里斯蒂几个垃圾规范可结果看了几个集都十分广泛</p>-->
<!-- </div>-->
<!-- <img src="/news/images/data_01.png" alt="">-->
<!-- </div>-->
<!-- <div class="col-sm-4">-->
<!-- <div>-->
<!-- <p>黑河计划</p>-->
<!-- </div>-->
<!-- <img src="/news/images/data_01.png" alt="">-->
<!-- </div>-->
<!-- <div class="col-sm-4">-->
<!-- <div>-->
<!-- <p>HiWATER</p>-->
<!-- <p>克里斯蒂几个垃圾规范可结果看了几个集都十分广泛</p>-->
<!-- </div>-->
<!-- <img src="/news/images/data_01.png" alt="">-->
<!-- </div>-->
<!-- <div class="col-sm-4">-->
<!-- <div>-->
<!-- <p>HiWATER</p>-->
<!-- <p>克里斯蒂几个垃圾规范可结果看了几个集都十分广泛</p>-->
<!-- </div>-->
<!-- <img src="/news/images/data_01.png" alt="">-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="data-nav">-->
<!-- <div class="title">数据导航</div>-->
<!-- <div class="container">-->
<!-- --><?php
// function genDataSetCol($type, $list){
// $content = "";
// foreach ($list as $cg){
// if($type == 'category'){
// $name = empty($cg['name_zh']) ? $cg['name'] : $cg['name_zh'];
// $content .= '<a class="btn a-btn btn-default col-sm-3" href="/data/category/code/'.$cg['code'].'">'.$name.'</a>';
// }else{
// $content .= '<a class="btn a-btn btn-default col-sm-3" href="/data/series/'. $cg['id']. '">'.$cg['name'].'</a>';
// }
//
// }
// return '<div class="col-sm-6">'. $content . '</div>';
// }
// ?>
<!-- --><?php //$index = 1; ?>
<!-- <div class="title-left"><a href="/data/category">数据集类别</a></div>-->
<!-- --><?php //foreach($this->category as $cg) : ?>
<!-- --><?php
// if($index == 1) $arr = array();
//
// $arr[] = $cg;
// $index ++;
//
// if($index > 4) {
// echo genDataSetCol('category', $arr);
// $index = 1;
// }
// ?>
<!-- --><?php //endforeach; ?>
<!-- </div>-->
<!-- <div class="container">-->
<!-- <div class="title-left"><a href="/data/series">数据集序列</a></div>-->
<!-- --><?php //$index = 1; ?>
<!-- --><?php //foreach($this->serie as $cg) : ?>
<!-- --><?php
// if($index == 1) $arr = array();
//
// $arr[] = $cg;
// $index ++;
//
// if($index > 4) {
// echo genDataSetCol('series', $arr);
// $index = 1;
// }
// ?>
<!-- --><?php //endforeach; ?>
<!-- </div>-->
<!-- </div>-->
<div class="special-nav">
<div class="title">特色导航</div>
<div class="container">
<!-- <div class="col-sm-12">-->
<!-- <form method="get" action="/search" id="search" class="form-search">-->
<!-- <div class="input-append">-->
<!-- <input type="text" value="" id="q" name="q" class="span2 search-query" placeholder="全文搜索">-->
<!-- <button type="submit" class="btn"><i class="icon-search"></i>搜索</button>-->
<!-- </div>-->
<!-- </form>-->
<!-- </div>-->
<div class="col-sm-12">
<a class="btn splBtn btn-default col-sm-2" href="/search/advance">高级搜索</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/browse">数据列表浏览</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/onlinelist">在线数据清单</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/offlinelist">离线数据清单</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/thumb">缩略图浏览</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/timeline">时间轴浏览</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/extent">空间浏览</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/organization">单位浏览</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/fund">项目浏览</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/author">作者浏览</a>
<!-- <button type="button" class="btn splBtn btn-default col-sm-2"><a href="/data/doi">DOI浏览</a></button>-->
</div>
<p style="clear: both"></p>
<?php
function genCol($keywords){
$content = "";
foreach ($keywords as $keyword){
$content .= '<a class="btn a-btn btn-default col-sm-3" href="/data/tag/'.$keyword[0].'">' . $keyword[0] . '</a>';
}
return '<div class="col-sm-6">'. $content . '</div>';
}
$keytypezh=array('place'=>'地点关键词','theme'=>'主题关键词','discipline'=>'学科关键词','temporal'=>'时间关键词');
$type='theme';
?>
<div class="title-left"><a href="/data/tag/keytype/theme"><?php echo $keytypezh[$type]; ?></a></div>
<?php $index = 1; ?>
<?php foreach($this->keywords[$type] as $cg) : ?>
<?php
if($index == 1) $arr = array();
$arr[] = array($cg['keyword'], $cg['count']);
$index ++;
if($index > 4) {
echo genCol($arr);
$index = 1;
}
?>
<?php endforeach; ?>
</div>
<div class="container">
<?php $type='discipline'; ?>
<div class="title-left"><a href="/data/tag/keytype/theme"><?php echo $keytypezh[$type]; ?></a></div>
<?php $index = 1; ?>
<?php foreach($this->keywords[$type] as $cg) : ?>
<?php
if($index == 1) $arr = array();
$arr[] = array($cg['keyword'], $cg['count']);
$index ++;
if($index > 4) {
echo genCol($arr);
$index = 1;
}
?>
<?php endforeach; ?>
</div>
<div class="container">
<?php $type='place'; ?>
<div class="title-left"><a href="/data/tag/keytype/theme"><?php echo $keytypezh[$type]; ?></a></div>
<?php $index = 1; ?>
<?php foreach($this->keywords[$type] as $cg) : ?>
<?php
if($index == 1) $arr = array();
$arr[] = array($cg['keyword'], $cg['count']);
$index ++;
if($index > 4) {
echo genCol($arr);
$index = 1;
}
?>
<?php endforeach; ?>
</div>
<div class="container">
<?php $type='temporal'; ?>
<div class="title-left"><a href="/data/tag/keytype/theme"><?php echo $keytypezh[$type]; ?></a></div>
<?php $index = 1; ?>
<?php foreach($this->keywords[$type] as $cg) : ?>
<?php
if($index == 1) $arr = array();
$arr[] = array($cg['keyword'], $cg['count']);
$index ++;
if($index > 4) {
echo genCol($arr);
$index = 1;
}
?>
<?php endforeach; ?>
</div>
</div>
<div class="data-update data-nav">
<div class="title">数据最近更新</div>
<ul>
<?php foreach($this->metadata as $md) : ?>
<li><a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a><span><?php echo date("Y-m-d",strtotime($md['ts_published'])); ?></span></li>
<?php endforeach; ?>
</ul>
</div>
<div class="data-serves data-nav">
<div class="container">
<div class="server-title">数据服务</div>
<div style="width: 20px;height: 2px;background: #9b58b5;"></div>
<div class="col-sm-4"><a href="/data/offlineapp">+ 离线数据服务记录(最近20个)</a></div>
<div class="col-sm-4"><a href="/data/request">+ 如何从西部数据中心申请数据</a></div>
<div class="col-sm-4"><a href="/data/submit">+ 如何在西部数据中心发布数据</a></div>
</div>
</div>
</div>

View File

@ -2,229 +2,159 @@
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->data);
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/static-sanji/css/data-index.css');
$this->headLink()->appendStylesheet('/static-sanji-v2/css/dataProduct.css');
$this->headLink()->appendStylesheet('/static-sanji-v2/css/header-position.css');
?>
<div class="data-warp">
<!-- <div class="top-special-nav">-->
<!-- <div class="title">专题数据集</div>-->
<!-- <div class="container">-->
<!-- <div class="col-sm-4">-->
<!-- <div>-->
<!-- <p>黑河计划</p>-->
<!-- </div>-->
<!-- <img src="/news/images/data_01.png" alt="">-->
<!-- </div>-->
<!-- <div class="col-sm-4">-->
<!-- <div>-->
<!-- <p>HiWATER</p>-->
<!-- <p>克里斯蒂几个垃圾规范可结果看了几个集都十分广泛</p>-->
<!-- </div>-->
<!-- <img src="/news/images/data_01.png" alt="">-->
<!-- </div>-->
<!-- <div class="col-sm-4">-->
<!-- <div>-->
<!-- <p>HiWATER</p>-->
<!-- <p>克里斯蒂几个垃圾规范可结果看了几个集都十分广泛</p>-->
<!-- </div>-->
<!-- <img src="/news/images/data_01.png" alt="">-->
<!-- </div>-->
<!-- <div class="col-sm-4">-->
<!-- <div>-->
<!-- <p>黑河计划</p>-->
<!-- </div>-->
<!-- <img src="/news/images/data_01.png" alt="">-->
<!-- </div>-->
<!-- <div class="col-sm-4">-->
<!-- <div>-->
<!-- <p>HiWATER</p>-->
<!-- <p>克里斯蒂几个垃圾规范可结果看了几个集都十分广泛</p>-->
<!-- </div>-->
<!-- <img src="/news/images/data_01.png" alt="">-->
<!-- </div>-->
<!-- <div class="col-sm-4">-->
<!-- <div>-->
<!-- <p>HiWATER</p>-->
<!-- <p>克里斯蒂几个垃圾规范可结果看了几个集都十分广泛</p>-->
<!-- </div>-->
<!-- <img src="/news/images/data_01.png" alt="">-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="data-nav">-->
<!-- <div class="title">数据导航</div>-->
<!-- <div class="container">-->
<!-- --><?php
// function genDataSetCol($type, $list){
// $content = "";
// foreach ($list as $cg){
// if($type == 'category'){
// $name = empty($cg['name_zh']) ? $cg['name'] : $cg['name_zh'];
// $content .= '<a class="btn a-btn btn-default col-sm-3" href="/data/category/code/'.$cg['code'].'">'.$name.'</a>';
// }else{
// $content .= '<a class="btn a-btn btn-default col-sm-3" href="/data/series/'. $cg['id']. '">'.$cg['name'].'</a>';
// }
//
// }
// return '<div class="col-sm-6">'. $content . '</div>';
// }
// ?>
<!-- --><?php //$index = 1; ?>
<!-- <div class="title-left"><a href="/data/category">数据集类别</a></div>-->
<!-- --><?php //foreach($this->category as $cg) : ?>
<!-- --><?php
// if($index == 1) $arr = array();
//
// $arr[] = $cg;
// $index ++;
//
// if($index > 4) {
// echo genDataSetCol('category', $arr);
// $index = 1;
// }
// ?>
<!-- --><?php //endforeach; ?>
<!-- </div>-->
<!-- <div class="container">-->
<!-- <div class="title-left"><a href="/data/series">数据集序列</a></div>-->
<!-- --><?php //$index = 1; ?>
<!-- --><?php //foreach($this->serie as $cg) : ?>
<!-- --><?php
// if($index == 1) $arr = array();
//
// $arr[] = $cg;
// $index ++;
//
// if($index > 4) {
// echo genDataSetCol('series', $arr);
// $index = 1;
// }
// ?>
<!-- --><?php //endforeach; ?>
<!-- </div>-->
<!-- </div>-->
<div class="special-nav">
<div class="title">特色导航</div>
<div class="container">
<!-- <div class="col-sm-12">-->
<!-- <form method="get" action="/search" id="search" class="form-search">-->
<!-- <div class="input-append">-->
<!-- <input type="text" value="" id="q" name="q" class="span2 search-query" placeholder="全文搜索">-->
<!-- <button type="submit" class="btn"><i class="icon-search"></i>搜索</button>-->
<!-- </div>-->
<!-- </form>-->
<!-- </div>-->
<div class="col-sm-12">
<a class="btn splBtn btn-default col-sm-2" href="/search/advance">高级搜索</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/browse">数据列表浏览</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/onlinelist">在线数据清单</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/offlinelist">离线数据清单</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/thumb">缩略图浏览</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/timeline">时间轴浏览</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/extent">空间浏览</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/organization">单位浏览</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/fund">项目浏览</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/author">作者浏览</a>
<!-- <button type="button" class="btn splBtn btn-default col-sm-2"><a href="/data/doi">DOI浏览</a></button>-->
<!--搜索框-->
<div class="searchBox">
<div class="container">
<div class="col-sm-12">
<div class="form-group">
<input type="text" class="form-control" placeholder="搜素关键词">
</div>
<p style="clear: both"></p>
<?php
function genCol($keywords){
$content = "";
foreach ($keywords as $keyword){
$content .= '<a class="btn a-btn btn-default col-sm-3" href="/data/tag/'.$keyword[0].'">' . $keyword[0] . '</a>';
}
return '<div class="col-sm-6">'. $content . '</div>';
}
<i></i>
</div>
</div>
</div>
<!--固定搜索框-->
<div class="searchBox searchBox1">
<div class="container">
<div class="col-sm-12">
<div class="form-group">
<input type="text" class="form-control" placeholder="搜素关键词">
</div>
<i></i>
</div>
</div>
</div>
<!--搜索条件-->
<div class="searchOne">
<div class="container">
<div class="col-md-12">
<a href="dataProductList.html">高级搜索</a>
<a href="">数据列表浏览</a>
<a href="">在线数据清单</a>
<a href="">离线数据清单</a>
<a href="">缩略图浏览</a>
<a href="">时间轴浏览</a>
<a href="">空间浏览</a>
<a href="">单位浏览</a>
<a href="">项目浏览</a>
<a href="">作者浏览</a>
</div>
</div>
</div>
$keytypezh=array('place'=>'地点关键词','theme'=>'主题关键词','discipline'=>'学科关键词','temporal'=>'时间关键词');
$type='theme';
?>
<div class="title-left"><a href="/data/tag/keytype/theme"><?php echo $keytypezh[$type]; ?></a></div>
<?php $index = 1; ?>
<!--最近更新数据-->
<div class="intro1">
<div class="container">
<h2 class="title">最近更新数据</h2>
<a href="/data/browse">查看更多</a>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="row">
<?php foreach($this->metadata as $md) : ?>
<div class="col-sm-6 col-md-6">
<a href="/data/<?php echo $md['uuid'];?>">
<div class="dataBox">
<img src="/static-sanji-v2/img/20180206161540_37955.png" alt="" />
<div class="rightBox">
<h6><?php echo $this->escape($md['title']);?></h6>
<p><?= $this->escape($md['description']) ?></p>
<span>发布时间:<?php echo date("Y-m-d",strtotime($md['ts_published'])); ?></span>
</div>
</div>
</a>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
<!--数据资源查找-->
<div class="intro1">
<div class="container">
<h2 class="title">数据资源查找</h2>
</div>
</div>
<div class="container">
<ul id="myTab" class="nav nav-tabs">
<li class="active">
<a href="#tab1" data-toggle="tab">主题关键词</a>
</li>
<li>
<a href="#tab2" data-toggle="tab">学科关键词</a>
</li>
<li>
<a href="#tab3" data-toggle="tab">地点关键词</a>
</li>
<li>
<a href="#tab4" data-toggle="tab">时间关键词</a>
</li>
</ul>
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade in active" id="tab1">
<?php $type='theme'; ?>
<?php foreach($this->keywords[$type] as $cg) : ?>
<?php
if($index == 1) $arr = array();
$arr[] = array($cg['keyword'], $cg['count']);
$index ++;
if($index > 4) {
echo genCol($arr);
$index = 1;
}
?>
<a class="btn a-btn btn-default col-sm-2" href="/data/tag/<?= $cg['keyword'] ?>"><?= $cg['keyword'] ?></a>
<?php endforeach; ?>
</div>
<div class="container">
<div class="tab-pane fade" id="tab2">
<?php $type='discipline'; ?>
<div class="title-left"><a href="/data/tag/keytype/theme"><?php echo $keytypezh[$type]; ?></a></div>
<?php $index = 1; ?>
<?php foreach($this->keywords[$type] as $cg) : ?>
<?php
if($index == 1) $arr = array();
$arr[] = array($cg['keyword'], $cg['count']);
$index ++;
if($index > 4) {
echo genCol($arr);
$index = 1;
}
?>
<a class="btn a-btn btn-default col-sm-2" href="/data/tag/<?= $cg['keyword'] ?>"><?= $cg['keyword'] ?></a>
<?php endforeach; ?>
</div>
<div class="container">
<div class="tab-pane fade" id="tab3">
<?php $type='place'; ?>
<div class="title-left"><a href="/data/tag/keytype/theme"><?php echo $keytypezh[$type]; ?></a></div>
<?php $index = 1; ?>
<?php foreach($this->keywords[$type] as $cg) : ?>
<?php
if($index == 1) $arr = array();
$arr[] = array($cg['keyword'], $cg['count']);
$index ++;
if($index > 4) {
echo genCol($arr);
$index = 1;
}
?>
<a class="btn a-btn btn-default col-sm-2" href="/data/tag/<?= $cg['keyword'] ?>"><?= $cg['keyword'] ?></a>
<?php endforeach; ?>
</div>
<div class="container">
<div class="tab-pane fade" id="tab4">
<?php $type='temporal'; ?>
<div class="title-left"><a href="/data/tag/keytype/theme"><?php echo $keytypezh[$type]; ?></a></div>
<?php $index = 1; ?>
<?php foreach($this->keywords[$type] as $cg) : ?>
<?php
if($index == 1) $arr = array();
$arr[] = array($cg['keyword'], $cg['count']);
$index ++;
if($index > 4) {
echo genCol($arr);
$index = 1;
}
?>
<?php if($cg['keyword'] != '') {?>
<a class="btn a-btn btn-default col-sm-2" href="/data/tag/<?= $cg['keyword'] ?>"><?= $cg['keyword'] ?></a>
<?php } ?>
<?php endforeach; ?>
</div>
</div>
<div class="data-update data-nav">
<div class="title">数据最近更新</div>
<ul>
<?php foreach($this->metadata as $md) : ?>
<li><a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a><span><?php echo date("Y-m-d",strtotime($md['ts_published'])); ?></span></li>
<?php endforeach; ?>
</ul>
</div>
<!--数据服务-->
<div class="intro1">
<div class="container">
<h2 class="title">数据服务</h2>
</div>
<div class="data-serves data-nav">
<div class="container">
<div class="server-title">数据服务</div>
<div style="width: 20px;height: 2px;background: #9b58b5;"></div>
<div class="col-sm-4"><a href="/data/offlineapp">+ 离线数据服务记录(最近20个)</a></div>
<div class="col-sm-4"><a href="/data/request">+ 如何从西部数据中心申请数据</a></div>
<div class="col-sm-4"><a href="/data/submit">+ 如何在西部数据中心发布数据</a></div>
</div>
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="col-sm-6 col-md-4 addOne">
<a href="" class="a1">离线数据服务记录(最近20个)</a>
</div>
<div class="col-sm-6 col-md-4 addOne">
<a href="" class="a2">如何从西部数据中心申请数据</a>
</div>
<div class="col-sm-6 col-md-4 addOne">
<a href="" class="a3">如何在西部数据中心发布数据</a>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
/*顶部固定搜素*/
$(window).scroll(function(){
if($(window).scrollTop() >= 100){
$(".searchBox1").show();
} else{
$(".searchBox1").hide();
}
});
</script>

View File

@ -0,0 +1,3 @@
.header{
position: relative;
}