From 2fe5725b9a61ae17fee13ea8a49f48ac64e0f1dd Mon Sep 17 00:00:00 2001 From: wlx Date: Fri, 25 Jun 2010 08:54:04 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E5=BF=AB=E9=80=9F?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E8=87=AA=E5=8A=A8=E5=88=86=E8=AF=8D=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=9B=E5=88=86=E9=A1=B5=E4=B8=AD=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=AF=B4=E6=98=8E=E6=96=87=E5=AD=97=EF=BC=9B=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?water=E4=B8=AD=E5=BE=84=E6=B5=81=E8=A7=82=E6=B5=8B=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/DataController.php | 29 ++++------ .../default/controllers/WaterController.php | 26 +++++++++ .../default/views/scripts/water/index.phtml | 30 +++++++--- .../default/views/scripts/water/navi.phtml | 1 + .../default/views/scripts/water/runoff.phtml | 33 +++++++++++ .../default/views/scripts/water/view.phtml | 2 +- application/models/Pagination.php | 2 +- application/models/Search.php | 57 +++++++++++++++++++ 8 files changed, 154 insertions(+), 26 deletions(-) create mode 100644 application/default/views/scripts/water/runoff.phtml create mode 100644 application/models/Search.php 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. 下载


-

试验数据的关键词列表

-