public function xchange() { /* Form Elements & Other Definitions Here ... */ $Onetomany = new Zend_Dojo_Form_Element_FilteringSelect('onetomany'); $Onetomany->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect')); $name = array(1 => 'ពីមួយទៅច្រើន', 2 => 'ពីច្រើនទៅមួយ', 3 => 'ពីមួយទៅមួយ'); $Onetomany->setMultiOptions($name); $moneyinaccount = new Zend_Dojo_Form_Element_TextBox('moneyinaccount'); $moneyinaccount->setAttribs(array('dojoType' => 'dijit.form.TextBox')); $Date = new Zend_Dojo_Form_Element_DateTextBox('date'); $Date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox')); $Date->setValue(date('Y-m-d')); $Cusomer = new Zend_Dojo_Form_Element_FilteringSelect('cusomer'); $Cusomer->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect')); $name = array(1 => 'General Customer'); $Cusomer->setMultiOptions($name); $number_code = new Zend_Dojo_Form_Element_TextBox('number_code'); $number_code->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'readOnly' => true, 'style' => 'color:red')); $db = new Application_Model_DbTable_DbGlobal(); $iv_numbber = $db->getNewInvoiceExchange(); $number_code->setValue($iv_numbber); // $_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch_id'); // $_branch_id->setAttribs(array( // 'dojoType'=>'dijit.form.FilteringSelect', // // 'class'=>'fullside', // 'required' =>'true' // )); // $rows = $db->getAllBranchName(); // $options=''; // if(!empty($rows))foreach($rows AS $row){ // $options[$row['br_id']]=$row['branch_namekh']; // } // // $_branch_id->setMultiOptions($options); $Payusa = new Zend_Dojo_Form_Element_TextBox('payusa'); $Payusa->setAttribs(array('dojoType' => 'dijit.form.TextBox')); $Payr = new Zend_Dojo_Form_Element_TextBox('payr'); $Payr->setAttribs(array('dojoType' => 'dijit.form.TextBox')); $Payb = new Zend_Dojo_Form_Element_TextBox('payb'); $Payb->setAttribs(array('dojoType' => 'dijit.form.TextBox')); $Getusa = new Zend_Dojo_Form_Element_TextBox('getusa'); $Getusa->setAttribs(array('dojoType' => 'dijit.form.TextBox')); $Getr = new Zend_Dojo_Form_Element_TextBox('getr'); $Getr->setAttribs(array('dojoType' => 'dijit.form.TextBox')); $Getb = new Zend_Dojo_Form_Element_TextBox('getb'); $Getb->setAttribs(array('dojoType' => 'dijit.form.TextBox')); $Returnb = new Zend_Dojo_Form_Element_TextBox('returnb'); $Returnb->setAttribs(array('dojoType' => 'dijit.form.TextBox')); $Returnusa = new Zend_Dojo_Form_Element_TextBox('returnusa'); $Returnusa->setAttribs(array('dojoType' => 'dijit.form.TextBox')); $Returnr = new Zend_Dojo_Form_Element_TextBox('returnr'); $Returnr->setAttribs(array('dojoType' => 'dijit.form.TextBox')); $this->addElements(array($Cusomer, $Date, $Onetomany, $Payusa, $Payr, $Payb, $Getusa, $Getr, $Getb, $Returnusa, $Returnb, $Returnr, $number_code)); return $this; }
public function editAction() { $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(); $db_g = new Application_Model_DbTable_DbGlobal(); $this->view->inv_no = $db_g->getNewInvoiceExchange(); // // action body // //Get value from url // $ex_id = $this->getRequest()->getParam('ex_id',0); // $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(); // $cur = new Application_Model_DbTable_DbCurrencies(); // $currency = $cur->getCurrencyList(); // $this->view->currency = $this->_helpfilteroption($currency); // $db_exc=new Application_Model_DbTable_DbExchange(); // $this->view->dataedit = $db_exc->getDataById($ex_id); // if($this->getRequest()->isPost()){ // $formdata=$this->getRequest()->getPost(); // try { // $result = $db_exc->getDataById($formdata['id']); // $to_type = $db_exc->getCurrencyById("`name`, `symbol`,`country_id`", $formdata["to_amount_type"]); // $from_type = $db_exc->getCurrencyById("`name`, `symbol`,`country_id`", $formdata["from_amount_type"]); // if($result['fromAmountType']==$from_type['country_id'] && $result['toAmountType']==$to_type['country_id']){//if the edit not change the currency // $id = $db_exc->updateData($formdata); // }else{//if edit change the currency we need to add new record // $formdata['inv_no'] = Application_Model_GlobalClass::getInvoiceNo(); // $id = $db_exc->save($formdata); // } // Application_Form_FrmMessage::Sucessfull('ការបញ្ចូលជោគជ័យ', self::REDIRECT_URL); // } catch (Exception $e) { // $this->view->msg = 'ការបញ្ចូលមិនជោគជ័យ'; // } // } }
public function addAction() { if($this->getRequest()->isPost()){ $data=$this->getRequest()->getPost(); // print_r($data);exit(); try { //$db = new tellerandexchange_m(); $db = $db->addXchangeMoney($data); Application_Form_FrmMessage::Sucessfull('', self::REDIRECT_URL); } catch (Exception $e) { Application_Form_FrmMessage::message("INSERT_FAIL"); $err = $e->getMessage(); echo $err;exit(); Application_Model_DbTable_DbUserLog::writeMessageError($err); } } $pructis=new Tellerandexchange_Form_Frmxchange(); $frm = $pructis->xchange(); Application_Model_Decorator::removeAllDecorator($frm); $this->view->frm=$frm; $db = new Application_Model_DbTable_DbGlobal(); $this->view->currency_type = $db->CurruncyTypeOption(); $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(); $db_g = new Application_Model_DbTable_DbGlobal(); $this->view->inv_no = $db_g ->getNewInvoiceExchange(); // $db = new Application_Model_DbTable_DbGlobal(); // $this->view->currency_type = $db->CurruncyTypeOption(); }