/** Delete a period * @access public * @return void */ public function deleteperiodAction() { if ($this->_request->isPost()) { $id = (int) $this->_request->getPost('id'); $del = $this->_request->getPost('del'); if ($del == 'Yes' && $id > 0) { $periods = new Periods(); $where = 'id = ' . $id; $periods->delete($where); } $this->getFlash()->addMessage(self::DELETED); $this->redirect($this->_redirectUrl . 'periods/'); } else { $id = (int) $this->_request->getParam('id'); if ($id > 0) { $periods = new Periods(); $this->view->period = $periods->fetchRow('id=' . $id); } } }