Exemplo n.º 1
0
 /** Page rendering records recorded by region
  * @access public
  * @return void
  */
 public function regionalAction()
 {
     $datefrom = $this->getParam('datefrom') ? $this->getParam('datefrom') : Zend_Date::now()->toString('yyyy') . '-01-01';
     $dateto = $this->getParam('dateto') ? $this->getParam('dateto') : Zend_Date::now()->toString('yyyy-MM-dd');
     $region = $this->getParam('region');
     $this->view->region = $region;
     $this->view->datefrom = $datefrom;
     $this->view->dateto = $dateto;
     if (!isset($region)) {
         $this->view->regions = $this->_finds->getRegions($datefrom, $dateto);
     } else {
         $this->view->regionTotal = $this->_finds->getRegionStat($datefrom, $dateto, $region);
         $this->view->creators = $this->_finds->getUsersRegionStat($datefrom, $dateto, $region);
         $this->view->periods = $this->_finds->getPeriodTotalsRegion($datefrom, $dateto, $region);
         $this->view->finders = $this->_finds->getFinderTotalsRegion($datefrom, $dateto, $region);
         $this->view->averages = $this->_finds->getAverageMonthRegion($datefrom, $dateto, $region);
         $this->view->year = $this->_finds->getYearFoundRegion($datefrom, $dateto, $region);
         $this->view->discovery = $this->_finds->getDiscoveryMethodRegion($datefrom, $dateto, $region);
         $this->view->landuse = $this->_finds->getLandUseRegion($datefrom, $dateto, $region);
         $this->view->precision = $this->_finds->getPrecisionRegion($datefrom, $dateto, $region);
     }
     $form = $this->renderForm();
     $this->view->form = $form;
     if ($this->_request->isPost()) {
         $data = $this->_request->getPost();
         if ($form->isValid($data)) {
             $params = $this->getCleaner()->array_cleanup($this->_request->getPost());
             $query = '';
             foreach ($params as $key => $value) {
                 $query .= $key . '/' . $value . '/';
             }
             $this->redirect('database/statistics/regional/' . $query);
         } else {
             $form->populate($data);
         }
     }
 }