diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index 4ce0602e..6a9033f9 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -1068,7 +1068,6 @@ class DataController extends Zend_Controller_Action $dataservice = new \data\DataService(); $info = $dataservice->get($uuid); - //暂时只有wsn { $this->_helper->layout->disableLayout(); @@ -1103,6 +1102,40 @@ class DataController extends Zend_Controller_Action } + public function glacierAction() + { + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $uuid = $this->_getParam("uuid"); + $basin = $this->getParam("basin"); + $mountain = $this->getParam("mountain"); + + if(empty($basin) && empty($mountain)) + { + $this->jsonexit(array("error"=>'please select sub dataset')); + return true; + } + + $selections = array( + 'basin' => $basin, + 'mountain' => $mountain + ); + + $order = new Order(); + $state = $order->addOrder($uuid,$selections); + + if($state !== true) + { + $this->jsonexit(array("error"=>$state)); + return true; + }else{ + $this->jsonexit(array('success'=>'Success! You can add more dataset or submit your application.')); + return true; + //$this->view->msg = view::Msg('alert-success',"Success! You can add more dataset or submit your application."); + } + } + public function wsnAction() { $this->_helper->layout->disableLayout(); @@ -2191,6 +2224,7 @@ class DataController extends Zend_Controller_Action $wsn = $this->_request->getParam('wsn'); $pdf = $this->_request->getParam('pdf'); $selections = $this->_request->getParam('data'); + //if (empty($uuid)) $this->_redirect('/data'); $userid = view::User('id'); diff --git a/application/default/views/scripts/data/view.phtml b/application/default/views/scripts/data/view.phtml index 1855bd01..f22bfed8 100755 --- a/application/default/views/scripts/data/view.phtml +++ b/application/default/views/scripts/data/view.phtml @@ -500,8 +500,8 @@ var bound = {
- 黄河流域 - 长江流域 + 黄河流域 + 长江流域 黑河流域 塔里木河流域
diff --git a/application/default/views/scripts/glacier/view-glacier-selection.phtml b/application/default/views/scripts/glacier/view-glacier-selection.phtml new file mode 100644 index 00000000..ae3d21c4 --- /dev/null +++ b/application/default/views/scripts/glacier/view-glacier-selection.phtml @@ -0,0 +1,192 @@ + + + \ No newline at end of file diff --git a/application/default/views/scripts/glacier/view.phtml b/application/default/views/scripts/glacier/view.phtml index 1855bd01..e3f60cae 100755 --- a/application/default/views/scripts/glacier/view.phtml +++ b/application/default/views/scripts/glacier/view.phtml @@ -478,45 +478,20 @@ var bound = {Cannot find the metadata.
+ dataService)) { ?> dataService['service_type'] == 2) { ?> theme->AppendPlus($this,'datepicker'); ?> dataService['service_type'] == 3) {?> theme->AppendPlus($this,'datepicker'); ?> - + dataService)) { ?> dataService['service_type'] == 2) { ?> dataService['service_type'] == 3) {?> - - + = $this->partial('glacier/view-glacier-selection.phtml',array('uuid'=>$md->uuid)); ?> \ No newline at end of file diff --git a/application/module/Order/Order.php b/application/module/Order/Order.php index c3c32dc1..afeddbda 100644 --- a/application/module/Order/Order.php +++ b/application/module/Order/Order.php @@ -124,7 +124,12 @@ class Order $rs = $this->db->query($sql,array($uuid,$uid,1)); }else{ $sql="insert into dataorder (uuid,ts_created,userid,status,selection) values(?,now(),?,?,?)"; - $rs = $this->db->query($sql,array($uuid,$uid,1,$selection)); + if(!is_array($selection)) + { + $rs = $this->db->query($sql,array($uuid,$uid,1,$selection)); + }else{ + $rs = $this->db->query($sql,array($uuid,$uid,1,json_encode($selection,JSON_NUMERIC_CHECK))); + } } if($rs) diff --git a/htdocs/js/lib/custom/models/dataservice.geodata.js b/htdocs/js/lib/custom/models/dataservice.geodata.js new file mode 100644 index 00000000..77f36260 --- /dev/null +++ b/htdocs/js/lib/custom/models/dataservice.geodata.js @@ -0,0 +1,35 @@ +westdc.dataservice = { + geoData : function() + { + $.ajax({ + 'type':"POST", + 'url':'/data/glacier/', + 'data':$('#dataservice-glacier-form').serialize(), + 'success':function(data){ + if(typeof(data) == 'undefined') + { + alert("data source error ,please contact administrator"); + return false; + } + + if(!$.isEmptyObject(data.error)) + { + alert(data.error); + return false; + } + if(!$.isEmptyObject(data.success)) + { + window.location = '/data/order/ac/offline1'; + return true; + }else{ + alert('An error occurred,please try agian'); + return false; + } + }, + 'timeout': 30000, + 'error': function(){ + alert('出现错误,请刷新后重试'); + } + }); + }, +} \ No newline at end of file