public function editAction()
 {
     $db = new Group_Model_DbTable_DbChangeCollteral();
     if ($this->getRequest()->isPost()) {
         $data = $this->getRequest()->getPost();
         try {
             //print_r($data);exit();
             if (!empty($data['save_new'])) {
                 $db = $db->updateChangeCollteral($data);
                 Application_Form_FrmMessage::message('ការ​បញ្ចូល​​ជោគ​ជ័យ');
             } else {
                 $db = $db->updateChangeCollteral($data);
                 Application_Form_FrmMessage::Sucessfull('ការ​បញ្ចូល​​ជោគ​ជ័យ', self::REDIRECT_URL . '/chengcallecterall/index');
             }
         } catch (Exception $e) {
             $this->view->msg = 'ការ​បញ្ចូល​មិន​ជោគ​ជ័យ';
         }
     }
     $id = $this->getRequest()->getParam('id');
     if (empty($id)) {
         Application_Form_FrmMessage::Sucessfull('ការ​បញ្ចូល​​ជោគ​ជ័យ', self::REDIRECT_URL);
     }
     $row = $db->getChangeCollteralbyid($id);
     $fm = new Group_Form_Frmchangecollteral();
     $frm = $fm->FrmChangeCollteral($row);
     Application_Model_Decorator::removeAllDecorator($frm);
     $this->view->frm_changeCollteral = $frm;
 }
	public function editAction()
	{
		$db = new Group_Model_DbTable_DbChangeCollteral();
		if($this->getRequest()->isPost()){
			$data=$this->getRequest()->getPost();
			$db = new Group_Model_DbTable_DbChangeCollteral();
		try {
				$db->updateChangeCollteral($data);
				Application_Form_FrmMessage::Sucessfull('ការ​បញ្ចូល​​ជោគ​ជ័យ', self::REDIRECT_URL . '/changecollteral/index');
			} catch (Exception $e) {
				$this->view->msg = 'ការ​បញ្ចូល​មិន​ជោគ​ជ័យ';
			}
		}
		
		$id = $this->getRequest()->getParam('id');
		if(empty($id)){
			Application_Form_FrmMessage::Sucessfull($this->tr->translate('EDIT_SUCCESS'), self::REDIRECT_URL);
		}
		$row  = $db->getChangeCollteralbyid($id);
		$this->view->row = $row;
		$this->view->rows = $db->getAllCollateralDetailById($id);
		
		
		$fm = new Group_Form_Frmchangecollteral();
		$frm = $fm->FrmChangeCollteral($row);
		Application_Model_Decorator::removeAllDecorator($frm);
		$this->view->frm_changeCollteral = $frm;
		
		$db = new Application_Model_DbTable_DbGlobal();
		$this->view->allclient = $db->getAllClient();
		$this->view->allclient_number = $db->getAllClientNumber();
		$db = new Application_Model_GlobalClass();
		$this->view->collect_option = $db->getCollecteralOption();
		$this->view->owner_type = $db->getCollecteralTypeOption();
    }
Example #3
0
  function rptCalleteralChangeAction(){
  	$key = new Application_Model_DbTable_DbKeycode();
  	$this->view->data=$key->getKeyCodeMiniInv(TRUE);
  	$db = new Report_Model_DbTable_DbLnClient(); 	
  	if($this->getRequest()->isPost()){
  		$search = $this->getRequest()->getPost();
  	}else{
		$search = array(
			'start_date'=> date('Y-m-d'),
		    'end_date'=>date('Y-m-d'),
			'adv_search' => '',
			'status_search' => -1);
	}
	$this->view->calleteral_list = $db->getAllChangeCollteral($search);//call frome model
	$this->view->result=$search;
  	$fm = new Group_Form_Frmchangecollteral();
  	$frm = $fm->FrmChangeCollteral();
  	Application_Model_Decorator::removeAllDecorator($frm);
  	$this->view->frm_changeCollteral = $frm;
//   	print_r($db->getAllChangeCollteral($search));
  }