public function editAction() { $db_model = new Driverguide_Model_DbTable_DbDriver(); if ($this->getRequest()->isPost()) { $data = $this->getRequest()->getPost(); try { $id = $db_model->updateDriver($data); Application_Form_FrmMessage::Sucessfull("EDIT_SUCCESSS", "/driverguide"); } catch (Exception $e) { Application_Form_FrmMessage::message("Application Error"); Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage()); } } $db = new Application_Model_DbTable_DbGlobal(); $client_type = $db->getclientdtype(); array_unshift($client_type, array('id' => -1, 'name' => '---Add New ---')); $this->view->clienttype = $client_type; $dbpop = new Application_Form_FrmPopupGlobal(); $this->view->frm_popup_clienttype = $dbpop->frmPopupclienttype(); $id = $this->getRequest()->getParam("id"); $row = $db_model->getDriverById($id); $this->view->rs = $row; $fm = new Group_Form_FrmClient(); $frm = $fm->FrmaddGuide($row); Application_Model_Decorator::removeAllDecorator($frm); $this->view->frm_client = $frm; }
function addAction() { if($this->getRequest()->isPost()){ $_data = $this->getRequest()->getPost(); try { $_dbmodel = new Loan_Model_DbTable_DbLoanIL(); $_dbmodel->addNewLoanIL($_data); // Application_Form_FrmMessage::Sucessfull("INSERT_SUCCESS","/loan/index/index"); }catch (Exception $e) { echo $err =$e->getMessage();exit(); Application_Form_FrmMessage::message("INSERT_FAIL"); $err =$e->getMessage(); Application_Model_DbTable_DbUserLog::writeMessageError($err); } } $frm = new Loan_Form_FrmLoan(); $frm_loan=$frm->FrmAddLoan(); Application_Model_Decorator::removeAllDecorator($frm_loan); $this->view->frm_loan = $frm_loan; $frmpopup = new Application_Form_FrmPopupGlobal(); $this->view->frmpupopclient = $frmpopup->frmPopupClient(); $this->view->frmPopupCO = $frmpopup->frmPopupCO(); $this->view->frmPopupZone = $frmpopup->frmPopupZone(); $this->view->frmPopupCommune = $frmpopup->frmPopupCommune(); $this->view->frmPopupDistrict = $frmpopup->frmPopupDistrict(); $this->view->frmPopupVillage = $frmpopup->frmPopupVillage(); }
function addAction() { if($this->getRequest()->isPost()){ $_data = $this->getRequest()->getPost(); try { $_dbmodel = new Loan_Model_DbTable_DbRepaymentSchedule(); $_dbmodel->addRepayMentSchedule($_data); if(!empty($_data['saveclose'])){ Application_Form_FrmMessage::Sucessfull("INSERT_SUCCESS","/loan/repaymentschedule"); }else{ Application_Form_FrmMessage::message("INSERT_SUCCESS"); } }catch (Exception $e) { Application_Form_FrmMessage::message("INSERT_FAIL"); $err =$e->getMessage(); Application_Model_DbTable_DbUserLog::writeMessageError($err); } } $frm = new Loan_Form_FrmLoan(); $frm_loan=$frm->FrmAddLoan(); Application_Model_Decorator::removeAllDecorator($frm_loan); $this->view->frm_loan = $frm_loan; $db = new Application_Model_DbTable_DbGlobal(); $this->view->allclient = $db->getAllClient(); $this->view->allclient_number = $db->getAllClientNumber(); $frmpopup = new Application_Form_FrmPopupGlobal(); $this->view->frmpupoploantype = $frmpopup->frmPopupLoanTye(); $this->view->frmPopupZone = $frmpopup->frmPopupZone(); $db_keycode = new Application_Model_DbTable_DbKeycode(); $this->view->keycode = $db_keycode->getKeyCodeMiniInv(); $this->view->graiceperiod = $db_keycode->getSystemSetting(9); $db = new Setting_Model_DbTable_DbLabel(); $this->view->setting=$db->getAllSystemSetting(); }
public function editAction(){ $db = new Group_Model_DbTable_DbClient(); if($this->getRequest()->isPost()){ try{ $data = $this->getRequest()->getPost(); //print_r($data);exit(); $id= $db->addClient($data); if($data['chackcall']==1){ Application_Form_FrmMessage::message("វានឹងបន្ថែមទ្រព្យបញ្ចាំរបស់អតិថិជនដោយស្វ័យប្រវត្តិ!"); Application_Form_FrmMessage::redirectUrl("/group/callteral/add/id/".$id); } Application_Form_FrmMessage::Sucessfull('EDIT_SUCCESS',"/group/index"); }catch (Exception $e){ Application_Form_FrmMessage::message("EDIT_FAILE"); echo $e->getMessage(); Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage()); } } $id = $this->getRequest()->getParam("id"); $row = $db->getClientById($id); $this->view->row=$row; $this->view->photo = $row['photo_name']; if(empty($row)){ $this->_redirect("/group/client"); } $fm = new Group_Form_FrmClient(); $frm = $fm->FrmAddClient($row); Application_Model_Decorator::removeAllDecorator($frm); $this->view->frm_client = $frm; $dbpop = new Application_Form_FrmPopupGlobal(); $this->view->frm_popup_village = $dbpop->frmPopupVillage(); $this->view->frm_popup_comm = $dbpop->frmPopupCommune(); $this->view->frm_popup_district = $dbpop->frmPopupDistrict(); $this->view->frm_popup_clienttype = $dbpop->frmPopupclienttype(); $db = new Application_Model_DbTable_DbGlobal(); $client_type = $db->getclientdtype(); array_unshift($client_type,array( 'id' => -1, 'name' => '---Add New ---', ) ); $this->view->clienttype = $client_type; }
public function editProgramChargeAction() { if ($this->getRequest()->isPost()) { try { $_data = $this->getRequest()->getPost(); $_model = new Accounting_Model_DbTable_DbServiceCharge(); $rs = $_model->upDateServiceCharge($_data); if (!empty($rs)) { Application_Form_FrmMessage::Sucessfull("EDIT_SUCCESS", "/accounting/ServiceCharge/index"); } } catch (Exception $e) { Application_Form_FrmMessage::message("INSERT_FAIL"); Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage()); } } $id = $this->getRequest()->getParam('id'); $_model = new Accounting_Model_DbTable_DbServiceCharge(); $_rs = $_model->getServiceChargeById($id); $db = new Accounting_Model_DbTable_DbServiceCharge(); $model = new Application_Model_DbTable_DbGlobal(); $row = 0; $key = 0; if (!empty($_rs)) { foreach ($_rs as $id => $rs) { $rows = $db->getServiceFeebyId($rs['service_id']); $fee_row = 1; if (!empty($rows)) { foreach ($rows as $payment_tran) { if ($payment_tran['pay_type'] == 1) { $rs_rows[$key] = $this->headAddRecordService($rs, $key); $rs_rows[$key]['remark'] = $payment_tran['remark']; $term = $model->getAllServicePayment($fee_row); $rs_rows[$key]['price_' . $payment_tran['pay_type']] = $payment_tran['price']; $key_old = $key; $key++; } elseif ($payment_tran['pay_type'] == 2) { $term = $model->getAllServicePayment($payment_tran['pay_type']); $rs_rows[$key_old]['price_' . $payment_tran['pay_type']] = $payment_tran['price']; } elseif ($payment_tran['pay_type'] == 3) { $term = $model->getAllServicePayment($payment_tran['pay_type']); $rs_rows[$key_old]['price_' . $payment_tran['pay_type']] = $payment_tran['price']; } else { $term = $model->getAllServicePayment($payment_tran['pay_type']); $rs_rows[$key_old]['price_4'] = $payment_tran['price']; } } } } } $this->view->service_exist = $rs_rows; $frm = new Accounting_Form_FrmServicePrice(); $frm_set_price = $frm->frmAddServiceCharge($_rs); // Application_Model_Decorator::removeAllDecorator($frm_set_price); // $this->view->frm_set_charge = $frm_set_price; // $_model = new Application_Model_GlobalClass(); // $this->view->service_options = $_model->getAllServiceItemOption(); // $model = new Application_Model_DbTable_DbGlobal(); // $this->view->payment_term = $model->getAllServicePayment(); // $frm=new Application_Form_FrmPopupGlobal(); // $frm_service = $frm->addProgramName(); // Application_Model_Decorator::removeAllDecorator($frm_service); // $this->view->frm_service_name=$frm_service; // $frm_ser_category = $frm->addProServiceCategory(); // Application_Model_Decorator::removeAllDecorator($frm_ser_category); $frm = new Accounting_Form_FrmServicePrice(); $frm_set_price = $frm->frmAddProgramCharge(); Application_Model_Decorator::removeAllDecorator($frm_set_price); $this->view->frm_set_charge = $frm_set_price; $_model = new Application_Model_GlobalClass(); $this->view->service_options = $_model->getAllServiceItemOption(2); $model = new Application_Model_DbTable_DbGlobal(); $this->view->payment_term = $model->getAllGEPPrgramPayment(); $frm = new Application_Form_FrmPopupGlobal(); $frm_service = $frm->addProgramName(null, 2); Application_Model_Decorator::removeAllDecorator($frm_service); $this->view->frm_service_name = $frm_service; $frm_ser_category = $frm->addProServiceCategory(); Application_Model_Decorator::removeAllDecorator($frm_ser_category); $this->view->frm_ser_category = $frm_ser_category; }
function editAction() { if($this->getRequest()->isPost()){ $_data = $this->getRequest()->getPost(); try { $db = new Loan_Model_DbTable_DbLoanGroup(); $effect = $db->upDateLoanDisburse($_data); if($effect==true){ Application_Form_FrmMessage::Sucessfull("EDIT_SUCCESS","/loan/GroupDisburse/index"); }else{ Application_Form_FrmMessage::Sucessfull("EDIT_FAIL","/loan/groupdisburse/index"); } }catch (Exception $e) { Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage()); Application_Form_FrmMessage::Sucessfull("EDIT_FAIL","/loan/groupdisburse/index"); } } $id = $this->getRequest()->getParam('id'); $db = new Loan_Model_DbTable_DbLoanIL(); $row = $db->getTranLoanByIdWithBranch($id,2); $db_g = new Application_Model_DbTable_DbGlobal(); $rs = $db_g->getLoanFundExist($id); if($rs==true){ Application_Form_FrmMessage::Sucessfull("LOAN_FUND_EXIST","/loan/groupdisburse/index"); } $frm = new Loan_Form_FrmLoan(); $frm_loan=$frm->FrmAddLoan($row); $this->view->client_id = $row['client_id']; $db = new Loan_Model_DbTable_DbLoanGroup(); $rows = $db->getAllMemberLoanById($id); $this->view->list_members = $rows; if(empty($rows)){ Application_Form_FrmMessage::Sucessfull("RECORD_NOT_EXIST","/loan/groupdisburse/index"); } Application_Model_Decorator::removeAllDecorator($frm_loan); $this->view->frm_loan = $frm_loan; $frmpopup = new Application_Form_FrmPopupGlobal(); $this->view->frmpupopclient = $frmpopup->frmPopupClient(); $this->view->frmPopupCO = $frmpopup->frmPopupCO(); $this->view->frmPopupZone = $frmpopup->frmPopupZone(); $this->view->frmPopupCommune = $frmpopup->frmPopupCommune(); $this->view->frmPopupDistrict = $frmpopup->frmPopupDistrict(); $this->view->frmPopupVillage = $frmpopup->frmPopupVillage(); $db_option = new Application_Model_GlobalClass(); $this->view->member_option = $db_option->getAllClientGroupOption(); $this->view->code_option = $db_option->getAllClientCodeOption(); $db = new Setting_Model_DbTable_DbLabel(); $this->view->setting=$db->getAllSystemSetting(); }
public function editAction(){ $db = new Other_Model_DbTable_Dbvillage(); if($this->getRequest()->isPost()){ $_data = $this->getRequest()->getPost(); try{ $db->addVillage($_data); Application_Form_FrmMessage::Sucessfull($this->tr->translate('EDIT_SUCCESS'),self::REDIRECT_URL . '/village/index'); }catch(Exception $e){ Application_Form_FrmMessage::message($this->tr->translate('EDIT_FAIL')); $err =$e->getMessage(); Application_Model_DbTable_DbUserLog::writeMessageError($err); } } $id = $this->getRequest()->getParam("id"); $row = $db->getVillageById($id); $this->view->row=$row; if(empty($row)){ $this->_redirect('other/village'); } $fm = new Other_Form_FrmVillage(); $frm = $fm->FrmAddVillage($row); Application_Model_Decorator::removeAllDecorator($frm); $this->view->frm_village = $frm; $dbpop = new Application_Form_FrmPopupGlobal(); $this->view->frm_popup_comm = $dbpop->frmPopupCommune(); $this->view->frm_popup_district = $dbpop->frmPopupDistrict(); }
public function addAction(){ if($this->getRequest()->isPost()){ $data = $this->getRequest()->getPost(); //print_r($data);exit(); $db = new Group_Model_DbTable_DbClient(); try{ if(isset($data['save_new'])){ $id= $db->addClient($data); Application_Form_FrmMessage::message("ការបញ្ចូលជោគជ័យ !"); if($data['chackcall']==1){ Application_Form_FrmMessage::message("វានឹងបន្ថែមទ្រព្យបញ្ចាំរបស់អតិថិជនដោយស្វ័យប្រវត្តិ!"); Application_Form_FrmMessage::redirectUrl("/group/Callteral/add/id/".$id); } } else if (isset($data['save_close'])){ $id= $db->addClient($data); Application_Form_FrmMessage::message("ការបញ្ចូលជោគជ័យ !"); if($data['chackcall']==1){ Application_Form_FrmMessage::message("វានឹងបន្ថែមទ្រព្យបញ្ចាំរបស់អតិថិជនដោយស្វ័យប្រវត្តិ!"); Application_Form_FrmMessage::redirectUrl("/group/Callteral/add/id/".$id); } Application_Form_FrmMessage::redirectUrl("/group/index"); } }catch (Exception $e){ Application_Form_FrmMessage::message("Application Error"); Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage()); } } $db = new Application_Model_DbTable_DbGlobal(); $this->view->allclient = $db->getAllClient();// for filter $this->view->allclient_number = $db->getAllClientNumber();//for filter $client_type = $db->getclientdtype(); array_unshift($client_type,array( 'id' => -1, 'name' => '---Add New ---', ) ); $this->view->clienttype = $client_type; $districts = $db->getAllDistricts(); array_unshift($districts,array( 'id' => -1, 'name' => '---Add New ---', 'pro_id' => -1 ) ); $this->view->district = $districts; $commune = $db->getCommune(); array_unshift($commune,array( 'id' => -1, 'name' => '---Add New ---', 'district_id' => -1 ) ); $this->view->commune_name = $commune; $village = $db->getVillage(); array_unshift($village,array( 'id' => -1, 'name' => '---Add New Village Name---', 'commune_id' => -1 ) ); $this->view->village_name =$village; $fm = new Group_Form_FrmClient(); $frm = $fm->FrmAddClient(); Application_Model_Decorator::removeAllDecorator($frm); $this->view->frm_client = $frm; $dbpop = new Application_Form_FrmPopupGlobal(); $this->view->frm_popup_village = $dbpop->frmPopupVillage(); $this->view->frm_popup_comm = $dbpop->frmPopupCommune(); $this->view->frm_popup_district = $dbpop->frmPopupDistrict(); $this->view->frm_popup_clienttype = $dbpop->frmPopupclienttype(); }
function addAction(){ if($this->getRequest()->isPost()){ $_data = $this->getRequest()->getPost(); $db_co = new Other_Model_DbTable_DbCreditOfficer(); try{ $db_co->addCreditOfficer($_data); if(!empty($_data['save_new'])){ Application_Form_FrmMessage::message('ការបញ្ចូលជោគជ័យ'); }else{ Application_Form_FrmMessage::Sucessfull('ការបញ្ចូលជោគជ័យ', self::REDIRECT_URL . '/co/index'); } }catch(Exception $e){ Application_Form_FrmMessage::message("ការបញ្ចូលមិនជោគជ័យ"); $err =$e->getMessage(); Application_Model_DbTable_DbUserLog::writeMessageError($err); } } $frm = new Other_Form_FrmCO(); $frm_co=$frm->FrmAddCO(); Application_Model_Decorator::removeAllDecorator($frm_co); $this->view->frm_co = $frm_co; $frmpopup = new Application_Form_FrmPopupGlobal(); $this->view->frmpopupdepartment = $frmpopup->frmPopupDepartment(); }
function addAction() { if($this->getRequest()->isPost()){ $_data = $this->getRequest()->getPost(); try { $_dbmodel = new Loan_Model_DbTable_DbLoanIL(); $_dbmodel->addNewLoanIL($_data); if(!empty($_data['saveclose'])){ Application_Form_FrmMessage::Sucessfull("INSERT_SUCCESS","/loan"); }else{ Application_Form_FrmMessage::message("INSERT_SUCCESS"); } }catch (Exception $e) { Application_Form_FrmMessage::message("INSERT_FAIL"); Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage()); } } $frm = new Loan_Form_FrmLoan(); $frm_loan=$frm->FrmAddLoan(); Application_Model_Decorator::removeAllDecorator($frm_loan); $this->view->frm_loan = $frm_loan; // $db = new Application_Model_DbTable_DbGlobal(); // $client=$db->getAllClient(); // // $client_type = $db->getclientdtype(); // array_unshift($client,array( // 'id' => -1, // 'name' => '---Add New ---', // 'branch_id' => -1 // ) ); // $this->view->allclient = $client; // $client_number= $db->getAllClientNumber(); // array_unshift($client_number,array( // 'id' => -1, // 'name' => '---Add New ---', // 'branch_id' => -1 // ) ); // $this->view->allclient_number=$client_number; $frmpopup = new Application_Form_FrmPopupGlobal(); $this->view->frmpupoploantype = $frmpopup->frmPopupLoanTye(); $this->view->frmPopupZone = $frmpopup->frmPopupZone(); $this->view->frmpupopinfoclient = $frmpopup->frmPopupindividualclient(); $this->view->frmPopupCO = $frmpopup->frmPopupCO(); $db = new Setting_Model_DbTable_DbLabel(); $this->view->setting=$db->getAllSystemSetting(); $db = new Application_Model_DbTable_DbGlobal(); $co_name = $db->getAllCoNameOnly(); array_unshift($co_name,array( 'id' => -1, 'name' => '---Add New ---', ) ); $this->view->co_name=$co_name; }