From 0ce5031ff6555b6677715f9276cc543d2ca0175c Mon Sep 17 00:00:00 2001 From: wlx Date: Sun, 9 Jun 2013 03:03:47 +0000 Subject: [PATCH] =?UTF-8?q?=E9=9B=86=E6=88=90=E9=AB=98=E7=BA=A7=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E5=88=B0xunsearch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/SearchController.php | 13 +- .../default/views/scripts/data/index.phtml | 2 +- .../views/scripts/search/advance.phtml | 212 ++++++++++++++++++ .../default/views/scripts/search/index.phtml | 31 ++- 4 files changed, 252 insertions(+), 6 deletions(-) create mode 100644 application/default/views/scripts/search/advance.phtml diff --git a/application/default/controllers/SearchController.php b/application/default/controllers/SearchController.php index 76aca128..353d57c9 100644 --- a/application/default/controllers/SearchController.php +++ b/application/default/controllers/SearchController.php @@ -7,6 +7,7 @@ class SearchController extends Zend_Controller_Action $this->view->config = Zend_Registry::get('config'); $this->messenger=$this->_helper->getHelper('FlashMessenger'); $this->view->messages = $this->messenger->getMessages(); + $this->view->theme = new Theme(); $this->view->nav = array( array('link'=>'/','title'=>''), array('link'=>'/data','title'=>$this->view->config->title->data), @@ -38,5 +39,15 @@ class SearchController extends Zend_Controller_Action $this->_helper->viewRenderer->setNoRender(); header("Content-Type: application/json; charset=utf-8"); echo $search->suggest($q); - } + } + function advanceAction() + { + $this->view->east=$this->getParam('east'); + $this->view->west=$this->getParam('west'); + $this->view->south=$this->getParam('south'); + $this->view->north=$this->getParam('north'); + $this->view->begin=$this->getParam('begin'); + $this->view->end=$this->getParam('end'); + $this->view->q=$this->getParam('q'); + } } diff --git a/application/default/views/scripts/data/index.phtml b/application/default/views/scripts/data/index.phtml index e1a1b8e8..5f05f8af 100755 --- a/application/default/views/scripts/data/index.phtml +++ b/application/default/views/scripts/data/index.phtml @@ -26,7 +26,7 @@ $this->headTitle()->setSeparator(' - '); - 高级搜索 + 高级搜索 数据列表浏览 在线数据清单 离线数据清单 diff --git a/application/default/views/scripts/search/advance.phtml b/application/default/views/scripts/search/advance.phtml new file mode 100644 index 00000000..af5cde54 --- /dev/null +++ b/application/default/views/scripts/search/advance.phtml @@ -0,0 +1,212 @@ +headTitle($this->config->title->site); +$this->headTitle($this->config->title->data); +$this->headTitle('高级搜索'); +if (!empty($this->codename)) $this->headTitle($this->codename); +$this->headTitle()->setSeparator(' - '); +$this->headLink()->appendStylesheet('/css/metadata.css'); +$this->breadcrumb('首页'); +$this->breadcrumb(''.$this->config->title->data.''); +$this->breadcrumb('高级搜索'); +$this->breadcrumb()->setSeparator(' > '); +$this->theme->AppendPlus($this,'google_map_v3'); +$this->theme->AppendPlus($this,'google_map_keydragzone'); +$this->theme->AppendPlus($this,'jquery_ui'); +$this->theme->AppendPlus($this,'colorbox'); +?> +
+partial('data/tools.phtml'); ?> +
+metadata)) : + echo $this->page->getNavigation();?> +
+ +metadata as $md) : ?> +
+
+

escape($md['title']);?> +

+ 400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?> +
+ +page->getNavigation();?> + + +
+
+
+ +
+
+ + +
+
搜索说明
  • 关键词:您可以使用一个关键词,比如“沙漠”,也可以使用多个关键词,中间用空格分开。
  • +
  • 空间范围:这是以度为单位的十进制数字。比如,东经125度30分,可以输入为125.5。您也可以通过下面的在线地图工具直接在图上拉框选择一个范围,空间坐标会自动转换到文本框中。
  • +
  • 时间范围:指数据的时间范围,从开始时间到结束时间。开始时间与结束时间可以为空,若仅填写开始时间,则含义为选择大于开始时间的数据。若仅填写结束时间,则含义为选择小于结束时间的数据。时间格式为YYYY-MM-DD。
  • +
  • 还不清楚?您可以到论坛提问。
  • +
+
+ + + + \ No newline at end of file diff --git a/application/default/views/scripts/search/index.phtml b/application/default/views/scripts/search/index.phtml index ebf0a5cf..3d01ccfc 100644 --- a/application/default/views/scripts/search/index.phtml +++ b/application/default/views/scripts/search/index.phtml @@ -1,5 +1,5 @@ nav[] = array('link'=>"/search",'title'=>'全文搜索'); + '; + if ($begin || $end) echo '时间范围'; + if ($begin) echo '开始:'.$begin; + if ($end) echo '结束:'.$end; + if ($east) echo '空间范围 东:'.$east.' 西:'.$west.' 南:'.$south.' 北:'.$north; + echo ''; + } + ?> hot) > 0): ?> @@ -194,11 +212,16 @@ $(function(){ // submit check $('#q-form').submit(function(){ var $input = $('#q-input .text'); - if ($input.val() == $input.attr('title')) { + /*if ($input.val() == $input.attr('title')) { alert('请先输入关键词'); $input.focus(); return false; - } + }*/ + }); + //advance search + $('#advance').click(function(){ + $('#q-form').attr('action','/search/advance'); + $('#q-form').submit(); }); });