Ejemplo n.º 1
0
 /** Page rendering records recorded annually
  * @access public
  * @return void
  */
 public function annualAction()
 {
     $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');
     $this->view->annualsum = $this->_finds->getReportTotals($datefrom, $dateto);
     $this->view->officers = $this->_finds->getOfficerTotals($datefrom, $dateto);
     $this->view->institution = $this->_finds->getInstitutionTotals($datefrom, $dateto);
     $this->view->periods = $this->_finds->getPeriodTotals($datefrom, $dateto);
     $this->view->finders = $this->_finds->getFindersTotals($datefrom, $dateto);
     $this->view->averages = $this->_finds->getAverageMonth($datefrom, $dateto);
     $this->view->year = $this->_finds->getYearFound($datefrom, $dateto);
     $this->view->discovery = $this->_finds->getDiscoveryMethod($datefrom, $dateto);
     $this->view->landuse = $this->_finds->getLandUse($datefrom, $dateto);
     $this->view->precision = $this->_finds->getPrecision($datefrom, $dateto);
     $this->view->datefrom = $datefrom;
     $this->view->dateto = $dateto;
     $form = $this->renderForm();
     $this->view->form = $form;
     if ($this->_request->isPost() && $form->isValid($this->_request->getPost())) {
         $params = $this->getCleaner()->array_cleanup($this->_request->getPost());
         $query = '';
         foreach ($params as $key => $value) {
             $query .= $key . '/' . $value . '/';
         }
         $this->redirect('/database/statistics/annual/' . $query);
     } else {
         $form->populate($this->_request->getPost());
     }
 }