/** Page rendering records recorded by county */ public function countyAction() { $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'); $county = $this->getParam('county'); $this->view->county = $county; $this->view->datefrom = $datefrom; $this->view->dateto = $dateto; if (!isset($county)) { $this->view->counties = $this->_finds->getCounties($datefrom, $dateto); } else { $this->view->countyTotal = $this->_finds->getCountyStat($datefrom, $dateto, $county); $this->view->creators = $this->_finds->getUsersStat($datefrom, $dateto, $county); $this->view->periods = $this->_finds->getPeriodTotalsCounty($datefrom, $dateto, $county); $this->view->finders = $this->_finds->getFinderTotalsCounty($datefrom, $dateto, $county); $this->view->averages = $this->_finds->getAverageMonthCounty($datefrom, $dateto, $county); $this->view->year = $this->_finds->getYearFoundCounty($datefrom, $dateto, $county); $this->view->discovery = $this->_finds->getDiscoveryMethodCounty($datefrom, $dateto, $county); $this->view->landuse = $this->_finds->getLandUseCounty($datefrom, $dateto, $county); $this->view->precision = $this->_finds->getPrecisionCounty($datefrom, $dateto, $county); } $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/county/' . $query); } else { $form->populate($data); } } }