예제 #1
0
 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);
 }
예제 #2
0
  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' => '');
  }