コード例 #1
0
ファイル: BranchController.php プロジェクト: samlanh/lynacr
 function editAction()
 {
     $id = $this->getRequest()->getParam("id");
     if ($this->getRequest()->isPost()) {
         $data = $this->getRequest()->getPost();
         $db = new Other_Model_DbTable_DbBranch();
         try {
             $db->updateBranch($data, $id);
             Application_Form_FrmMessage::Sucessfull($this->tr->translate("EDIT_SUCCESS"), self::REDIRECT_URL . "/branch/index");
         } catch (Exception $e) {
             Application_Form_FrmMessage::message($this->tr->translate("EDIT_FAIL"));
             $err = $e->getMessage();
             Application_Model_DbTable_DbUserLog::writeMessageError($err);
         }
     }
     $db = new Other_Model_DbTable_DbBranch();
     $row = $db->getBranchById($id);
     $frm = new Other_Form_Frmbranch();
     $update = $frm->FrmBranch($row);
     $this->view->frm_branch = $update;
     Application_Model_Decorator::removeAllDecorator($update);
 }