diff --git a/application/default/controllers/GlacierController.php b/application/default/controllers/GlacierController.php
new file mode 100644
index 00000000..377408d1
--- /dev/null
+++ b/application/default/controllers/GlacierController.php
@@ -0,0 +1,311 @@
+_helper->layout->setLayout('glacier');
+ }
+
+ function indexAction()
+ {
+ $sql="select m.uuid,m.title,m.id,m.description from normalmetadata m left join thumbnail t on m.id=t.id where m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and length(t.data)>2 order by random() limit 3";
+ $this->view->meatdata=$this->db->fetchAll($sql);
+ }
+
+ /*
+ * 数据浏览
+ */
+ function browseAction()
+ {
+ $page=(int)$this->_request->getParam('page');
+ if (empty($page)) $page=1;
+ $offset=$this->limit*($page-1);
+ $state=$this->db->query("select count(*) from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') ");
+ $row=$state->fetchAll();
+ $sum=$row[0]['count'];
+ $select=$this->db->select();
+ $select->from('normalmetadata','*')->where(" uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') ")->order('title desc')->limitPage($page,$this->limit);
+ $this->view->metadata = $this->db->fetchAll($select);
+ $this->view->page=new Pagination($sum,$page,$this->limit);
+ $this->view->offset=$offset+1;
+ }
+
+ function thumbAction()
+ {
+ $page=(int)$this->_request->getParam('page');
+ if (empty($page)) $page=1;
+ $offset=$this->limit*($page-1);
+ $state=$this->db->query("select count(*) from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') ");
+ $row=$state->fetchAll();
+ $sum=$row[0]['count'];
+ $select=$this->db->select();
+ $select->from('normalmetadata as m','m.*')
+ ->where(" uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') ")
+ ->order('m.title desc')->limitPage($page,$this->limit);
+ $this->view->metadata = $this->db->fetchAll($select);
+ $this->view->page=new Pagination($sum,$page,$this->limit);
+ }
+
+ 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 normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') ))");
+ $sum=$row[0]['count'];
+ $sql="select * from reference where id in (select refid from mdref where uuid in (select uuid from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') )) 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 baseAction()
+ {
+ $page=(int)$this->_request->getParam('page');
+ if (empty($page)) $page=1;
+ $offset=$this->limit*($page-1);
+ $state=$this->db->query("select count(*) from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keytype='theme' and (keyword='冰川' or keyword='沙漠' or keyword='地貌' or keyword='植被' or keyword='草场' or keyword='沙漠化' or keyword='基础地理' or keyword='遥感影像' or keyword='水文地质' or keyword='社会经济' or keyword='人口' or keyword='SWAT' or keyword='NPP' or keyword='WRF' or keyword='辐射' or keyword='NEP'))");
+ $row=$state->fetchAll();
+ $sum=$row[0]['count'];
+ $sql="select uuid,title from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keytype='theme' and (keyword='冰川' or keyword='沙漠' or keyword='地貌' or keyword='植被' or keyword='草场' or keyword='沙漠化' or keyword='基础地理' or keyword='遥感影像' or keyword='水文地质' or keyword='社会经济' or keyword='人口' or keyword='SWAT' or keyword='NPP' or keyword='WRF' or keyword='辐射' or keyword='NEP')) order by timebegin,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->offset=$offset+1;
+ }
+
+ function geobaseAction()
+ {
+ $this->getmd('基础地理');
+ }
+
+ function coreAction()
+ {
+ $page=(int)$this->_request->getParam('page');
+ if (empty($page)) $page=1;
+ $offset=$this->limit*($page-1);
+ $state=$this->db->query("select count(*) from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keytype='theme' and (keyword='DEM' or keyword='土地利用' or keyword='土壤' or keyword='气象' or keyword='水文观测' or keyword='灌溉' or keyword='试验'))");
+ $row=$state->fetchAll();
+ $sum=$row[0]['count'];
+ $sql="select uuid,title from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keytype='theme' and (keyword='DEM' or keyword='土地利用' or keyword='土壤' or keyword='气象' or keyword='水文观测' or keyword='灌溉' or keyword='试验')) order by timebegin,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->offset=$offset+1;
+ }
+
+ function demAction()
+ {
+ $this->getmd('DEM');
+ }
+
+ function rsAction()
+ {
+ $this->getmd('遥感影像');
+ }
+
+ function waterAction()
+ {
+ $this->getmd('水文地质');
+ }
+
+ function modelAction()
+ {
+ $page=(int)$this->_request->getParam('page');
+ if (empty($page)) $page=1;
+ $offset=$this->limit*($page-1);
+ $state=$this->db->query("select count(*) from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keytype='theme' and (keyword='WRF' or keyword='NPP' or keyword='SWAT' or keyword='NEP' or keyword='辐射'))");
+ $row=$state->fetchAll();
+ $sum=$row[0]['count'];
+ $sql="select uuid,title from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keytype='theme' and (keyword='WRF' or keyword='NPP' or keyword='SWAT' or keyword='NEP' or keyword='辐射')) order by timebegin,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->offset=$offset+1;
+ }
+
+ function economicAction()
+ {
+ $page=(int)$this->_request->getParam('page');
+ if (empty($page)) $page=1;
+ $offset=$this->limit*($page-1);
+ $state=$this->db->query("select count(*) from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keytype='theme' and (keyword='人口' or keyword='社会经济'))");
+ $row=$state->fetchAll();
+ $sum=$row[0]['count'];
+ $sql="select uuid,title from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keytype='theme' and (keyword='人口' or keyword='社会经济')) order by timebegin,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->offset=$offset+1;
+ }
+
+ function landsurfaceAction()
+ {
+ $page=(int)$this->_request->getParam('page');
+ if (empty($page)) $page=1;
+ $offset=$this->limit*($page-1);
+ $state=$this->db->query("select count(*) from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keytype='theme' and (keyword='冰川' or keyword='沙漠' or keyword='地貌' or keyword='植被' or keyword='草场' or keyword='沙漠化'))");
+ $row=$state->fetchAll();
+ $sum=$row[0]['count'];
+ $sql="select uuid,title from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keytype='theme' and (keyword='冰川' or keyword='沙漠' or keyword='地貌' or keyword='植被' or keyword='草场' or keyword='沙漠化')) order by timebegin,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->offset=$offset+1;
+ }
+
+ function landuseAction()
+ {
+ $this->getmd('土地利用','theme');
+ }
+
+ function soilAction()
+ {
+ $this->getmd('土壤','theme');
+ }
+
+ function meteoAction()
+ {
+ $this->getmd('气象','theme');
+ }
+
+ function hydroAction()
+ {
+ $this->getmd('水文观测','theme');
+ }
+ function irragationAction()
+ {
+ $this->getmd('灌溉','theme');
+ }
+
+ function obsAction()
+ {
+ $this->getmd('试验','theme');
+ }
+
+ function listAction()
+ {
+ $sql="select uuid,title from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') order by timebegin,title";
+ $this->view->metadata=$this->db->fetchAll($sql);
+ }
+
+ function tagAction()
+ {
+ $key = $this->_request->getParam('key');
+ $page=(int)$this->_request->getParam('page');
+ if (empty($page)) $page=1;
+ $offset=$this->limit*($page-1);
+ if (!empty($key)) {
+ $this->view->codename=$key;
+ $sql=$this->db->quoteInto('select count(id) from keyword where keyword=?',$key);
+ $state=$this->db->query($sql);
+ $row=$state->fetchAll();
+ $sum=$row[0]['count'];
+ $sql="select uuid,title,id,description from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keyword='".$key."') order by timebegin,title limit ? offset ?";
+ $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset));
+ $this->view->page=new Pagination($sum,$page,$this->limit);
+ } else {
+ $state=$this->db->query("select keyword.keyword,count(*) from keyword left join normalmetadata m on keyword.id=m.id where keyword.keytype='place' and m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') group by keyword.keyword order by count desc");
+ $k1=$state->fetchAll();
+ $state=$this->db->query("select k.keyword,count(k.keyword) from keyword k left join normalmetadata m on k.id=m.id where k.keytype='theme' and m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') group by k.keyword order by k.keyword");
+ $k2=$state->fetchAll();
+ $state=$this->db->query("select k.keyword,count(k.keyword) from keyword k left join normalmetadata m on k.id=m.id where k.keytype='discipline' and m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') group by k.keyword order by k.keyword");
+ $k3=$state->fetchAll();
+ $state=$this->db->query("select k.keyword,count(k.keyword) from keyword k left join normalmetadata m on k.id=m.id where k.keytype='stratum' and m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') group by k.keyword order by k.keyword");
+ $k4=$state->fetchAll();
+ $state=$this->db->query("select keyword.keyword,count(*) from keyword left join normalmetadata m on keyword.id=m.id where keyword.keytype='temporal' and m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') group by keyword.keyword order by keyword.keyword");
+ $k5=$state->fetchAll();
+ $this->view->keywords=array('place'=>$k1,'theme'=>$k2,'discipline'=>$k3,'stratum'=>$k4,'temporal'=>$k5);
+ }
+ }
+
+ 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 normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and ".$where);
+ $sum=$row[0]['count'];
+ $sql="select uuid,title,id,description from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and ".$where." order by timebegin,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;
+ $this->view->offset=$offset+1;
+ }
+ }
+
+ function timemapAction()
+ {
+ $sql="select id,uuid,west,south,north,east,title,timebegin,timeend from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and timebegin is not null";
+ $this->view->rows=$this->db->fetchAll($sql);
+ }
+
+ function timelineAction()
+ {
+ $fn="heihetime.xml";
+ $rows=$this->db->fetchAll("select ts_created from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') order by ts_created desc limit 1");
+ $last_update=strtotime($rows[0]['ts_created']);
+ if (!file_exists($fn) || (filemtime($fn)<$last_update))
+ {
+ $dateformat="M j Y";
+ $rows=$this->db->fetchAll("select id,uuid,description,title,timebegin,timeend from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and timebegin is not null order by timebegin,title");
+ $timexml='';
+ foreach($rows as $row) {
+ $timexml.='
+冰川是最敏感、最直接、最易于辩识、长纪录、高分辨的气候变化信息指示器和储存体,冰川变化信息是全球变化中的重要基础性资源。我国是中、低纬度山 地冰川面积最多的国家(占52%),是两极冰盖之外最重要的冰川集结地,冰川变化信息的挖掘、调查、监测、编目是十分重要的基础性工作。 +
++始于1978年的第一次冰川编目历时24年,查清了截止到第一次全国航空测量时(西部冰川区约为1960s-1980s)中国冰川资源的基本情况。第一次冰川清查工作在国际和国内产生了重大影响,被国际冰川学会主席誉为建立了一座“冰川和气候变化研究的金矿”。 +本次冰川资源调查是在中国科技部和中国科学院的联合支持下开展的一次大规模冰川普查,其目标以第一次冰川编目为参考,以2005-2006年为现状 年,以高分辨率遥感数据与地理信息系统技术为基础,深入研究基于遥感的冰川制图方法,结合冰川野外考察考察,获取我国冰川的分布状况,对有观测历史的典型 冰川进行重点监测;并与第一次冰川编目数据进行比较,查明我国冰川资源变化情况;同时,以此调查数据为基础,综合定位监测与相关资料,评估冰川变化对水资 源的影响,为西部水资源开发利用提供决策依据 。 +
+