显示所有和试验相关的文献

This commit is contained in:
wlx 2010-07-02 10:07:53 +00:00
parent 265ecab54a
commit 09440f0a13
2 changed files with 26 additions and 2 deletions

View File

@ -7,6 +7,15 @@ class WaterController extends DataController
}
function documentAction()
{
$page=(int)$this->_request->getParam('page');
if (empty($page)) $page=1;
$offset=$this->limit*($page-1);
$row=$this->db->fetchAll("select count(*) from reference where id in (select refid from mdref where uuid in (select uuid from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d'))");
$sum=$row[0]['count'];
$sql="select * from reference where id in (select refid from mdref where uuid in (select uuid from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d')) order by reference limit ? offset ?";
$this->view->refs=$this->db->fetchAll($sql,array($this->limit,$offset));
$this->view->page=new Pagination($sum,$page,$this->limit,"文献");
$this->view->offset=$offset+1;
}
function coldAction()
{

View File

@ -35,6 +35,21 @@ doi:10.1029/2008JD011590. <a href="/images/water/water_02.pdf">下载</a>
黑河流域上游寒区水文遥感地面同步观测试验介绍。冰川冻土2009, 31(2): 189-197. <a href="/images/water/water_03.pdf">下载</a>
</p>
<hr />
<h3>设计文档</h3>
<h3>试验成果(数据相关)</h3>
<?php if ($this->refs) : ?>
<?php echo $this->page->getNavigation(); ?>
<div id="mdlist">
<ol start="<?php echo $this->offset; ?>">
<?php foreach($this->refs as $md) : ?>
<li><?php echo $md['reference'];
if ($md['link'])
{
echo ' <a href="'.$md['link'].'">下载</a>';
}
?>
</li>
<?php endforeach; ?>
</ol>
</div>
<?php endif; ?>
</div>