Example #1
0
 public function editedAction()
 {
     $tr_id = $this->getRequest()->getParam('tr_id');
     $tr_id = empty($tr_id) ? 0 : $tr_id;
     if ($this->getRequest()->isPost()) {
         try {
             $data = $this->getRequest()->getPost();
             $db = new Application_Model_DbTable_DbKbank();
             $db->editDepositBySender($data);
             Application_Form_FrmMessage::Sucessfull('ការកែប្រែប្រតិបត្តិការនេះ​​ជោគ​ជ័យ', self::REDIRECT_URL . '/index/index');
         } catch (Exception $e) {
             Application_Form_FrmMessage::Sucessfull('ការ​បញ្ចូលកែប្រែជោគ​ជ័យ', self::REDIRECT_URL . '/index/index');
         }
     }
     if (empty($tr_id)) {
         Application_Form_FrmMessage::Sucessfull('ការ​បញ្ចូល​​ជោគ​ជ័យ', self::REDIRECT_URL . '/index/index');
     }
     $db = new Application_Model_DbTable_DbKbank();
     $rs = $db->getTranKbankById($tr_id);
     if (empty($rs)) {
         Application_Form_FrmMessage::Sucessfull('ការ​បញ្ចូល​​ជោគ​ជ័យ', self::REDIRECT_URL . '/index/index');
     }
     $this->view->rs = $rs;
     $session_user = new Zend_Session_Namespace('auth');
     $this->view->user_name = $session_user->last_name . ' ' . $session_user->first_name;
     $db_keycode = new Application_Model_DbTable_DbKeycode();
     $this->view->keycode = $db_keycode->getKeyCodeMiniInv();
     $pro = new Application_Model_DbTable_DbProvinces();
     $provinces = $pro->getProvinceList();
     array_unshift($provinces, array('id' => '0', "name" => "ជ្រើសរើសខេត្តដកប្រាក់", 'num' => 0));
     $this->view->provinces = $provinces;
     $subagent = new Application_Model_DbTable_DbSubAgent();
     $this->view->subagent = $subagent->getSubAgentListSelectTrns();
     $agent = new Application_Model_DbTable_DbAgents();
     $this->view->agent = $agent->getAgentListSelectTrns();
     $sender = new Application_Model_DbTable_DbSender();
     $_sender = $sender->getAllSenderKbank();
     array_unshift($_sender, array('id' => '-1', "name" => "បន្ថែមឈ្មោះអ្នកផ្ញើរ"));
     $this->view->sender = $_sender;
     $cur = new Application_Model_DbTable_DbCurrencies();
     $this->view->currency = $cur->getCurrencyList();
     $this->view->pay_term = $this->pay_term;
     // 		$this->view->invoice_no = Application_Model_GlobalClass::getInvoiceNo();
     $db = new Application_Model_DbTable_DbKbank();
     $this->view->new_acc = $acc_no = $db->getAccountNumberForKBank();
 }