diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index a5c1db35..a195013b 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -1,6 +1,7 @@ _request->getPost(); //include_once("bcspamblock.php"); //if ($form->isValid($formData)) { - $page=@(int)$this->_request->getParam('page'); - if (empty($page)) $page=1; - $limit=10; - $offset=$limit*($page-1); - if (!empty($key)) { - $md=new MetadataTable(); - $db=$md->getAdapter(); - $sql=$db->quoteInto('select count(*) from metadata where title ilike ? or description ilike ?','%'.$key.'%'); - $state=$db->query($sql); - $row=$state->fetchAll(); - $sum=$row[0]['count']; - $select=$db->select(); - $select->from('metadata','*')->where('title ilike ? or description ilike ?','%'.$key.'%')->order('title')->limit($limit,$offset); - $this->view->metadata = $db->fetchAll($select); - $this->view->page=new Pagination($sum,$page); - $this->view->key=$key; - } + $page=@(int)$this->_request->getParam('page'); + if (empty($page)) $page=1; + $offset=$this->limit*($page-1); + $search=new Search($key); + $where=$search->sql_expr(array("title","description")); + $row=$this->db->fetchAll("select count(*) from metadata where ".$where); + $sum=$row[0]['count']; + $sql="select uuid,title,id,description from metadata where ".$where." order by title limit ? offset ?"; + $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset)); + $this->view->page=new Pagination($sum,$page,$this->limit); + $this->view->key=$key; } } /* diff --git a/application/default/controllers/WaterController.php b/application/default/controllers/WaterController.php index 9c6daf2d..15d73415 100644 --- a/application/default/controllers/WaterController.php +++ b/application/default/controllers/WaterController.php @@ -107,6 +107,10 @@ class WaterController extends DataController { $this->getmd('降水','theme'); } + function runoffAction() + { + $this->getmd('径流','theme'); + } function hydroAction() { $this->getmd('水文','theme'); @@ -142,6 +146,28 @@ class WaterController extends DataController } } + function searchAction() + { + $this->view->addHelperPath('helper','Zend_View_Helper_'); + $form=new SearchForm(); + $this->view->form=$form; + //$form->submit->setLabel('快速搜索'); + $key=$this->_request->getParam('q'); + if (!empty($key)) { + $search=new Search($key); + $where=$search->sql_expr(array("title","description")); + $page=@(int)$this->_request->getParam('page'); + if (empty($page)) $page=1; + $offset=$this->limit*($page-1); + $row=$this->db->fetchAll("select count(*) from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and ".$where); + $sum=$row[0]['count']; + $sql="select uuid,title,id,description from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and ".$where." order by timebegin limit ? offset ?"; + $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset)); + $this->view->page=new Pagination($sum,$page,$this->limit); + $this->view->key=$key; + } + } + function timelineAction() { $fn="watertime.xml"; diff --git a/application/default/views/scripts/water/index.phtml b/application/default/views/scripts/water/index.phtml index 37319cec..80b4ad61 100755 --- a/application/default/views/scripts/water/index.phtml +++ b/application/default/views/scripts/water/index.phtml @@ -67,19 +67,35 @@ Wang WZ, Ran YH, Xin XZ, Ren HZ. Watershed Allied Telemetry Experimental Research. Journal of Geophysical Research, 2009, 114(D22103), doi:10.1029/2008JD011590. 下载
-马明国, 刘强, 阎广建, 陈尔学, 肖青, 苏培玺, 胡泽勇, 李新, 牛铮,王维真, 钱金 -波, 宋怡, 丁松爽, 辛晓洲, 任华忠, 黄春林, 晋锐, 车涛, 楚荣忠.黑河流域遥感- -地面观测同步试验:森林水文和中游干旱区水文试验.地球科学进展,2009,24(7):681-695. 下载 +
马明国,刘强,阎广建,陈尔学,肖青,苏培玺,胡泽勇,李新,牛铮,王维真,钱金波,宋怡,丁松爽,辛晓洲,任华忠,黄春林,晋锐,车涛,楚荣忠。 +黑河流域遥感-地面观测同步试验:森林水文和中游干旱区水文试验。地球科学进展,2009,24(7):681-695. 下载
-王建,车涛,张立新,晋锐,王维真,李新,梁继,郝小华,李弘毅,吴月茹.黑河流域上游寒区 -水文遥感-地面同步观测试验介绍.冰川冻土, 2009, 31(2): 189-197. 下载 +
王建,车涛,张立新,晋锐,王维真,李新,梁继,郝小华,李弘毅,吴月茹。 +黑河流域上游寒区水文遥感-地面同步观测试验介绍。冰川冻土,2009, 31(2): 189-197. 下载