westdc-zf1/application/default/views/scripts/hiwater/index.phtml

57 lines
2.0 KiB
PHTML

<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->data);
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/water.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>');
$this->headScript()->appendFile('/js/jquery-1.7.min.js');
$this->breadcrumb($this->config->title->heihe);
$this->breadcrumb()->setSeparator(' > ');
?>
<style>.next:hover{cursor:pointer;}</style>
<div id='sidebar'>
<div id='leftnavi'>
<?= $this->partial('hiwater/navi.phtml'); ?>
</div>
</div>
<div id='right'>
<div class="clear">&nbsp;</div>
<div id="intro">
<h1><?php if(!empty($this->info['title'])) echo $this->info['title']; ?></h1>
<table>
<tr><td><?php if(!empty($this->info['body'])) echo $this->info['body'];?></td></tr>
</table>
</div>
<div id="heihe_ad">
<h2>已整理数据展示</h2>
<ul id="heihe_list">
<?php foreach($this->meatdata as $md) : ?>
<li>
<a href="/heihe/view/uuid/<?php echo $md['uuid']; ?>"><span><?php echo $md['title']; ?></span>
<img src="/service/thumb/id/<?php echo $md['id']; ?>" alt="Data Thumbnail" title="<?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?>" />
</a>
</li>
<?php endforeach; ?>
</ul>
<img class="next" src="/images/next.png" onclick="changetlist()" />
</div>
</div>
<script type="text/javascript" language="javascript">
function changetlist(){
$.getJSON("/service/mdjson/source/heihe", function(data){
$('#heihe_list').html('');
if(data.length>0)
{
$.each(data, function(key, val) {
var a = '<a href="/data/'+val['uuid']+'"><span>'+val['title']+'</span>';
var img = '<img src="/service/thumb/id/'+val['id']+'" alt="Data Thumbnail" title="'+val['description']+'" />';
$('<li/>', {
//"class":'list_img',
"html": a+img+'</a>'
}).appendTo('#heihe_list');
});
}
});
}
</script>