/** Page rendering records recorded by institution * @access public * @return void */ public function institutionAction() { $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'); $institution = $this->getParam('institution'); $this->view->institution = $institution; if (!isset($institution)) { $this->view->institutions = $this->_finds->getInstitutions($datefrom, $dateto); } else { $this->view->instTotal = $this->_finds->getInstStat($datefrom, $dateto, $institution); $this->view->creators = $this->_finds->getUsersInstStat($datefrom, $dateto, $institution); $this->view->periods = $this->_finds->getPeriodTotalsInst($datefrom, $dateto, $institution); $this->view->finders = $this->_finds->getFinderTotalsInst($datefrom, $dateto, $institution); $this->view->averages = $this->_finds->getAverageMonthInst($datefrom, $dateto, $institution); $this->view->year = $this->_finds->getYearFoundInst($datefrom, $dateto, $institution); $this->view->discovery = $this->_finds->getDiscoveryMethodInst($datefrom, $dateto, $institution); $this->view->landuse = $this->_finds->getLandUseInst($datefrom, $dateto, $institution); $this->view->precision = $this->_finds->getPrecisionInst($datefrom, $dateto, $institution); } $this->view->datefrom = $datefrom; $this->view->dateto = $dateto; $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/institution/' . $query); } else { $form->populate($data); } } }