function addAction() { if ($this->getRequest()->isPost()) { //check condition return true click submit button $_data = $this->getRequest()->getPost(); $_dbmodel = new Other_Model_DbTable_DbBranch(); try { $_dbmodel->addbranch($_data); if (!empty($_data['save_new'])) { Application_Form_FrmMessage::message($this->tr->translate("INSERT_SUCCESS")); } else { Application_Form_FrmMessage::Sucessfull($this->tr->translate("INSERT_SUCCESS"), self::REDIRECT_URL . "/branch/index"); } } catch (Exception $e) { Application_Form_FrmMessage::message($this->tr->translate("INSERT_FAIL")); $err = $e->getMessage(); Application_Model_DbTable_DbUserLog::writeMessageError($err); } } $fm = new Other_Form_Frmbranch(); $frm = $fm->Frmbranch(); Application_Model_Decorator::removeAllDecorator($frm); $this->view->frm_branch = $frm; }
function rptBranchAction(){ $db = new Report_Model_DbTable_DbParamater(); $this->view->branch_list = $db->getAllBranch(); $key = new Application_Model_DbTable_DbKeycode(); $this->view->data=$key->getKeyCodeMiniInv(TRUE); $fm = new Other_Form_Frmbranch(); $frm = $fm->Frmbranch(); Application_Model_Decorator::removeAllDecorator($frm); $this->view->frm_branch = $frm; if($this->getRequest()->isPost()){ $search = $this->getRequest()->getPost(); if(isset($search['btn_search'])){ $this->view->branch_list = $db->getAllBranch($search); }else { $collumn = array("br_id","branch_namekh","branch_nameen","br_address","branch_code","branch_tel", "status","fax","other","displayby"); $this->exportFileToExcel('ln_branch',$db->getAllBranch(),$collumn); } }else $data = array('adv_search' => ''); }