/** * deltrancheAction * Delete a tranche */ public function deltrancheAction() { $tranches = new ProductsTranches(); $id = $this->getRequest()->getParam('id'); if (is_numeric($id)) { $tranche = $tranches->getTranchebyId($id); if (!empty($tranche)) { $tranches->delTranchebyId($id); $this->_helper->redirector('edit', 'products', 'admin', array('id' => $tranche['product_id'], 'mex' => 'The tranche has been deleted.', 'status' => 'success')); } else { $this->_helper->redirector('list', 'products', 'admin', array('mex' => 'The tranche has been not deleted.', 'status' => 'danger')); } } else { $this->_helper->redirector('list', 'products', 'admin', array('mex' => 'The tranche has been not deleted.', 'status' => 'danger')); } }