public function downloadAction() { $this->_helper->viewRenderer->setNoRender(true); $this->_helper->layout->disableLayout(); $request = $this->getRequest(); $start = $this->_helper->IdConvert->hexToStr($request->getParam('date_for')); $end = $this->_helper->IdConvert->hexToStr($request->getParam('date_to')); $date = new Zend_Date(); if (empty($start) || empty($end) || (!$date->setDate($start, "YYYY-MM-dd")->isDate($start, "YYYY-MM-dd") || !$date->setDate($end, "YYYY-MM-dd")->isDate($end, "YYYY-MM-dd"))) { $this->_helper->messenger()->error("Nie podano zakresu dat"); return $this->_helper->redirector('index'); } $logic = new Logic_Raports_Render($start, $end, $this->_helper->currentip()); $logic->render(); }
public function indexAction() { $raportsModel = new Raports(); $request = $this->getRequest(); $hash = $request->getParam('hash'); if (empty($hash)) { return; } $raport = $raportsModel->getRaportByHash($hash); if ($raport === null) { return; } $start = $raport->date_for; $end = $raport->date_to; $date = new Zend_Date(); if (empty($start) || empty($end) || (!$date->setDate($start, "YYYY-MM-dd")->isDate($start, "YYYY-MM-dd") || !$date->setDate($end, "YYYY-MM-dd")->isDate($end, "YYYY-MM-dd"))) { return; } $logic = new Logic_Raports_Render($start, $end, $this->_helper->currentip()); $logic->render(); }