public function addAction() { if ($this->getRequest()->isPost()) { $_data = $this->getRequest()->getPost(); $_model = new Registrar_Model_DbTable_DbwuRegister(); //print_r($_data);exit(); $_model->AddNewStudent($_data); } $frm = new Registrar_Form_FrmRegister(); $frm_register = $frm->FrmRegistarWU(); Application_Model_Decorator::removeAllDecorator($frm_register); $this->view->frm_register = $frm_register; // $_marjor =array(); // $this->view->marjorlist = $_marjor; // $model = new Application_Model_DbTable_DbGlobal(); // $_marjorlist = $model->getMarjorById(); // $this->view->marjorlist = $_marjorlist; $key = new Application_Model_DbTable_DbKeycode(); $this->view->keycode = $key->getKeyCodeMiniInv(TRUE); $model = new Application_Form_FrmGlobal(); $this->view->footer = $model->getReceiptFooter(); $this->view->invoice_no = Application_Model_GlobalClass::getInvoiceNo(); // echo Application_Model_GlobalClass::getInvoiceNo(); $__student_card = array(); $this->view->student_card = $__student_card; $db = new Registrar_Model_DbTable_DbwuRegister(); $this->view->invoice_num = $db->getGaneratInvoiceWU(); // echo $db->getGaneratInvoiceWU(); }
public function getReceiptFooter() { $_dbmodel = new Application_Model_DbTable_DbKeycode(); $keycode = $_dbmodel->getKeyCodeMiniInv(TRUE); $str = ""; $str .= "<tr bgcolor='6D5CDD'>"; $str .= '<td colspan="4" style="text-align: center; color:#fff;background:#6D5CDD;">'; $brachs = explode('/', $keycode['footer_branch']); $str .= '<ul style="list-style-type: none;float:left; text-align: left;padding-left:10px;">'; foreach ($brachs as $key => $branch) { $str .= "<li> {$branch};</li>"; } $str .= '</ul>'; $phones = explode('/', $keycode['foot_phone']); $str .= '<ul style="list-style-type: none;float:left;text-align: left;padding-left:10px;">'; foreach ($phones as $key => $phone) { $str .= "<li> {$phone} </li>"; } $str .= '</ul>'; $contacts = explode('/', $keycode['f_email_website']); $str .= '<ul style="list-style-type: none;float:left;text-align: left;padding-left:10px;">'; foreach ($contacts as $key => $contact) { $str .= "<li> {$contact} </li>"; } $str .= '</ul>'; $str .= '</td>'; $str .= '</tr>'; return $str; }
public function addAction() { $frm = new Registrar_Form_FrmRegister(); $frm_request = $frm->FrmStudentRequest(); Application_Model_Decorator::removeAllDecorator($frm_request); $this->view->frm_request = $frm_request; $key = new Application_Model_DbTable_DbKeycode(); $this->view->keycode = $key->getKeyCodeMiniInv(TRUE); }
public function rateAction() { $db_rate = new Application_Model_DbTable_DbRate(); if ($this->getRequest()->isPost()) { $formdata = $this->getRequest()->getPost(); $db_rate->setNewRate($formdata); } $this->view->ratelist = $db_rate->getCurrentRate(); $db_keycode = new Application_Model_DbTable_DbKeycode(); $this->view->keycode = $db_keycode->getKeyCodeMiniInv(); $session_user = new Zend_Session_Namespace('auth'); $this->view->user_name = $session_user->last_name . ' ' . $session_user->first_name; }
function editAction() { if ($this->getRequest()->isPost()) { $data = $this->getRequest()->getPost(); $db = new Setting_Model_DbTable_DbLabel(); $db->updateLabel($data); Application_Form_FrmMessage::Sucessfull('ការកែប្រែជោគជ័យ', '/setting/Label'); } $key = new Application_Model_DbTable_DbKeycode(); $id = $this->getRequest()->getParam('id'); $rs = $key->getLabelVaueById($id); $this->view->rs = $rs; }
public function wuRegisterAction() { $frm = new Registrar_Form_FrmRegister(); $frm_register = $frm->FrmRegistarWU(); Application_Model_Decorator::removeAllDecorator($frm_register); $this->view->frm_register = $frm_register; // $_marjor = array(); // array_unshift($_marjor, array ( 'id' => -1, 'name' => 'បន្ថែមអ្នកទទួលថ្មី') ); // $this->view->marjorlist = $_marjor; $key = new Application_Model_DbTable_DbKeycode(); $this->view->keycode = $key->getKeyCodeMiniInv(TRUE); $model = new Application_Form_FrmGlobal(); $this->view->footer = $model->getReceiptFooter(); }
function editAction() { $db_rate = new Application_Model_DbTable_DbRate(); if ($this->getRequest()->isPost()) { $formdata = $this->getRequest()->getPost(); //$db_rate=new Application_Model_DbTable_DbRate(); try { $db_rate->setNewRate($formdata); Application_Form_FrmMessage::Sucessfull('ការបញ្ចូលជោគជ័យ', '/exchange/exchangrate'); } catch (Exception $e) { echo $e->getMessage(); exit; $this->view->msg = 'ការបញ្ចូលមិនជោគជ័យ'; } } $this->view->ratelist = $db_rate->getCurrentRate(); $db_keycode = new Application_Model_DbTable_DbKeycode(); $this->view->keycode = $db_keycode->getKeyCodeMiniInv(); $session_user = new Zend_Session_Namespace('auth'); $this->view->user_name = $session_user->last_name . ' ' . $session_user->first_name; }
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 indexAction() { // action body $key = new Application_Model_DbTable_DbKeycode(); $data = $key->getKeyCode(); $this->view->data = $data; if ($this->getRequest()->isPost()) { $post = $this->getRequest()->getPost(); try { $db = $key->updateKeyCode($post, $data); Application_Form_FrmMessage::Sucessfull('ការបញ្ចូលជោគជ័យ', self::REDIRECT_URL); } catch (Exception $e) { $this->view->msg = 'ការបញ្ចូលមិនជោគជ័យ'; } } //with xml file // action body /*$company_info = new Zend_Config_Xml(APPLICATION_PATH.'/configs/Config.xml'); $this->view->company_info = $company_info; $xml = simplexml_load_file(APPLICATION_PATH.'/configs/Config.xml'); //transforming the object in xml format $xmlFormat = $xml->asXML(); if($this->getRequest()->isPost()){ $company_data=$this->getRequest()->getPost(); try { //loop to get data update to xml file foreach ($company_data as $key => $val){ $xml->$key = $val; } $xml->saveXML(APPLICATION_PATH.'/configs/Config.xml'); Application_Form_FrmMessage::Sucessfull('ការបញ្ចូលជោគជ័យ', self::REDIRECT_URL); } catch (Exception $e) { $this->view->msg = 'ការបញ្ចូលមិនជោគជ័យ'; } }*/ }
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 editedAction() { $tr_id = $this->getRequest()->getParam('tr_id'); $tr_id = empty($tr_id) ? 0 : $tr_id; $db = new Application_Model_DbTable_DbCustomerLoan(); if ($this->getRequest()->isPost()) { try { $data = $this->getRequest()->getPost(); $db->updateTranLoanById($data); Application_Form_FrmMessage::Sucessfull('ការកែប្រែប្រតិបត្តិការនេះជោគជ័យ', self::REDIRECT_URL); } catch (Exception $e) { echo $e->getMessage(); exit; Application_Form_FrmMessage::Sucessfull('ការកែប្រែប្រតិបត្តិការនេះបរាជ័យ', self::REDIRECT_URL); } } $rs = $db->getTranLaonById($tr_id); if (empty($rs)) { Application_Form_FrmMessage::Sucessfull('មិនអាចទាញយកទិន្នន័យមកកែប្រែបានទេ ', self::REDIRECT_URL . '/index/index'); } $this->view->rs = $rs; $result = array(); $db_tran = new Application_Model_DbTable_DbCustomerLoan(); $rows = $db_tran->getBorrowDetail($tr_id); $result = array('amount_dollar' => '', 'rate_dollar' => '', 'amount_bath' => '', 'rate_bath' => '', 'amount_riel' => '', 'rate_riel' => ''); foreach ($rows as $key => $rs) { if ($rs['currency_type'] == 1) { $result['amount_dollar'] = $rs['loan_amount']; $result['rate_dollar'] = $rs['laon_rate']; } elseif ($rs['currency_type'] == 2) { $result['amount_bath'] = $rs['loan_amount']; $result['rate_bath'] = $rs['laon_rate']; } else { $result['amount_riel'] = $rs['loan_amount']; $result['rate_riel'] = $rs['laon_rate']; } } $this->view->row = $result; // print_r($result); $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(); $sender = new Application_Model_DbTable_DbSender(); $_sender = $sender->getAllSenderKbank(2); $this->view->sender = $_sender; $db_rate = new Application_Model_DbTable_DbRate(); $this->view->rate = $db_rate->getCurrentRate(); $cur = new Application_Model_DbTable_DbCurrencies(); $this->view->currency = $cur->getCurrencyList(); }
public function indexAction() { try { $db_tran = new Application_Model_DbTable_Dbpsc(); //create sesesion $session_capital = new Zend_Session_Namespace('search_capital'); if (empty($session_capital->limit)) { $session_capital->limit = Application_Form_FrmNavigation::getLimit(); $session_capital->type_money = -1; $session_capital->staff_name = -1; $session_capital->from_date = date('Y-m-d'); $session_capital->to_date = date('Y-m-d'); $session_capital->lock(); } //start page nevigation $limit = $session_capital->limit; $start = $this->getRequest()->getParam('limit_satrt', 0); $this->view->from_date = $session_capital->from_date; $this->view->to_date = $session_capital->to_date; $this->view->staff = $session_capital->staff; $cur = new Application_Model_DbTable_DbCurrencies(); $this->view->currencylist = $cur->getCurrencyList(); $this->view->type_money = $session_capital->type_money; if ($this->getRequest()->isPost()) { $formdata = $this->getRequest()->getPost(); $session_capital->unlock(); $session_capital->limit = $formdata['rows_per_page']; $session_capital->type_money = $formdata['type_money']; $session_capital->staff_name = $formdata['staff_name']; $session_capital->from_date = $formdata['from_date']; $session_capital->to_date = $formdata['to_date']; $session_capital->lock(); $this->view->type_money = $formdata['type_money']; $this->view->staff_name = $formdata['staff_name']; $this->view->from_date = $session_capital->from_date; $this->view->to_date = $session_capital->to_date; $limit = $session_capital->limit; } else { $formdata = array('from_date' => $session_capital->from_date, 'to_date' => $session_capital->to_date, 'type_money' => $session_capital->type_money, 'staff_name' => $session_capital->staff_name); } $trans = $db_tran->getPscAmountListBy($formdata, $start, $limit); $record_count = $db_tran->getAllPscList($formdata); $result = array(); $row_num = $start; if (!empty($trans)) { foreach ($trans as $i => $tran) { $expired = ''; $is_expired = 0; $volum = Application_Model_DbTable_DbGlobal::CurrencyOption($tran['currency_type'], $tran['volum']); $result[$i] = array('num' => ++$row_num, 'id' => $tran['id'], 'staff_name' => $tran['staff_name'], 'currency_type' => $this->curr_type[$tran['currency_type']], 'volum' => number_format($volum) . ' ' . $this->curr_type[$tran['currency_type']], 'psc_amount' => $tran['psc_amount'] . " សន្លឹក", 'total_amount' => number_format($volum * $tran['psc_amount']) . ' ' . $this->curr_type[$tran['currency_type']], 'note' => $tran['note'], 'date' => date_format(date_create($tran['date']), "d/m/Y"), 'img' => $tran['id']); } } else { $result = array('err' => 1, 'msg' => 'មិនទាន់មានទន្និន័យនូវឡើយទេ!'); } $this->view->tranlist = Zend_Json::encode($result); $page = new Application_Form_FrmNavigation(self::REDIRECT_URL, $start, $limit, $record_count); $page->init(self::REDIRECT_URL, $start, $limit, $record_count); $this->view->nevigation = $page->navigationPage(); $this->view->rows_per_page = $page->getRowsPerPage($limit, 'frmlist_mt'); $this->view->result_row = $page->getResultRows(); $usr_mod = new Application_Model_DbTable_DbUsers(); $user_list = $usr_mod->getUserListSelect(); array_unshift($user_list, array('id' => '-1', "name" => "ជ្រើសរើសឈ្មោះបុគ្គលិក")); $this->view->users = $user_list; $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(); $this->view->rpt_list = $db_tran->countAllStaffpcsAmount($formdata); $this->view->curr_type = $this->curr_typesimble; } catch (Exception $e) { } }
public function extendDateAction() { $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->extendDateByTran($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::getInvoiceWithdraw(2); $db = new Application_Model_DbTable_DbKbank(); $this->view->new_acc = $acc_no = $db->getAccountNumberForKBank(); }
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(); }
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' => ''); }
public function rptsummaryTransferAlluserAction() { // Get Session User $from_date = date('Y-m-d'); $to_date = date('Y-m-d'); if ($this->getRequest()->isPost()) { $formdata = $this->getRequest()->getPost(); $from_date = $formdata['from_date']; $to_date = $formdata['to_date']; } $this->view->from_date = $from_date; $this->view->to_date = $to_date; $db_keycode = new Application_Model_DbTable_DbKeycode(); $this->view->keycode = $db_keycode->getKeyCodeMiniInv(); // For view $db_exc = new Application_Model_DbTable_DbMoneyTransactions(); $trans = $db_exc->getTransactionSummaryReports(-1, $from_date, $to_date, true); // print_r($trans); exit(); if (empty($trans)) { $trans = array('err' => 1, 'msg' => 'មិនទាន់មានទន្និន័យនូវឡើយទេ!'); } $this->view->tranlist = $trans; }
function rptLoanTrasferAction(){//release all loan $db = new Report_Model_DbTable_DbLoan(); $key = new Application_Model_DbTable_DbKeycode(); $this->view->data=$key->getKeyCodeMiniInv(TRUE); if($this->getRequest()->isPost()){ $search = $this->getRequest()->getPost(); } else{ $search = array( 'branch_id'=>'', 'client_name'=>'', 'pay_every'=>-1, 'co_id'=>'', 'start_date'=> date('Y-m-d'), 'end_date'=>date('Y-m-d')); } $this->view->loantrasfer=$db->getAllTransferoan($search); $this->view->list_end_date=$search; $frm = new Loan_Form_FrmSearchLoan(); $frm = $frm->AdvanceSearch(); Application_Model_Decorator::removeAllDecorator($frm); $this->view->frm_search = $frm; }
public function indexAction() { // action body /* set this to login page to change the character charset of browsers to Utf-8 ...*/ $this->_helper->layout()->disableLayout(); $form = new Application_Form_FrmLogin(); $form->setAction('index'); $form->setMethod('post'); $form->setAttrib('accept-charset', 'utf-8'); $this->view->form = $form; $key = new Application_Model_DbTable_DbKeycode(); $this->view->data = $key->getKeyCodeMiniInv(TRUE); $session_user = new Zend_Session_Namespace('auth'); //redirect page if web broswer still have session if (!empty($session_user->arr_module)) { foreach ($session_user->arr_module as $i => $d) { if ($d !== 'transfer') { $url = '/' . $session_user->arr_module[0]; } else { $url = self::REDIRECT_URL; break; } } Application_Form_FrmMessage::redirectUrl($url); exit; } if ($this->getRequest()->isPost()) { $formdata = $this->getRequest()->getPost(); if ($form->isValid($formdata)) { $db_user = new Application_Model_DbTable_DbUsers(); $user_name = $form->getValue('txt_user_name'); $password = $form->getValue('txt_password'); if ($db_user->userAuthenticate($user_name, $password)) { $db_access = new Application_Model_DbTable_DbAmountPC(); $pc_name = strtolower(gethostname()); $amount_pc = $db_access->pcAccess($pc_name, 4); // Validate number of user login,params 4 amount of pc limit login if ($amount_pc == true) { //for check user access of using system $user_id = $db_user->getUserID($user_name); $user_info = $db_user->getUserInfo($user_id); $arr_acl = $db_user->getArrAcl($user_info['user_type']); $session_user->user_id = $user_id; $session_user->user_name = $user_name; $session_user->pwd = $password; $session_user->level = $user_info['user_type']; $session_user->last_name = $user_info['last_name']; $session_user->first_name = $user_info['first_name']; $a_i = 0; $arr_actin = array(); for ($i = 0; $i < count($arr_acl); $i++) { $arr_module[$i] = $arr_acl[$i]['module']; if ($arr_acl[$i]['module'] == 'exchange') { if ($arr_acl[$i]['action'] == "index" || $arr_acl[$i]['action'] == "add" || $arr_acl[$i]['action'] == "edited") { continue; } $arr_actin[$a_i++] = $arr_acl[$i]['action']; } } $arr_module = $this->sortMenu($arr_module); $session_user->arr_acl = $arr_acl; $session_user->arr_module = $arr_module; $session_user->arr_actin = $arr_actin; $session_user->lock(); $log = new Application_Model_DbTable_DbUserLog(); $log->insertLogin($user_id); // Check expired date of transactions. // $db_mt = new Application_Model_DbTable_DbMoneyTransactions(); // $db_mt->checkExpired(); foreach ($arr_module as $i => $d) { if ($d !== 'transfer') { $url = '/' . $arr_module[0]; } else { $url = self::REDIRECT_URL; break; } } Application_Form_FrmMessage::redirectUrl($url); exit; } else { //if over amount of PC $this->view->msg = 'ការប្រើប្រាស់លើសចំនួនកំណត់!'; } } else { $this->view->msg = 'ឈ្មោះអ្នកប្រើប្រាស់ និង ពាក្យសំងាត់ មិនត្រឺមត្រូវទេ'; } } else { $this->view->msg = 'សូមទំនាក់ទំនងជាមួយនឹង អ្នកគ្រប់គ្រងរបស់អ្នកអំពីបញ្ហានេះ'; } } }
public function indexAction() { // action body $this->_helper->layout()->disableLayout(); /* set this to login page to change the character charset of browsers to Utf-8 ...*/ $this->_helper->layout()->disableLayout(); $form = new Application_Form_FrmLogin(); $form->setAction('index'); $form->setMethod('post'); $form->setAttrib('accept-charset', 'utf-8'); $this->view->form = $form; $key = new Application_Model_DbTable_DbKeycode(); $this->view->data = $key->getKeyCodeMiniInv(TRUE); if ($this->getRequest()->isPost()) { $formdata = $this->getRequest()->getPost(); if ($form->isValid($formdata)) { $session_lang = new Zend_Session_Namespace('lang'); $session_lang->lang_id = $formdata["lang"]; //for creat session Application_Form_FrmLanguages::getCurrentlanguage($session_lang->lang_id); //for choose lang for when login $user_name = $form->getValue('txt_user_name'); $password = $form->getValue('txt_password'); $db_user = new Application_Model_DbTable_DbUsers(); if ($db_user->userAuthenticate($user_name, $password)) { // $this->view->msg = 'Authentication Sucessful!'; // $this->view->err="0"; $session_user = new Zend_Session_Namespace('auth'); $user_id = $db_user->getUserID($user_name); $user_info = $db_user->getUserInfo($user_id); $arr_acl = $db_user->getArrAcl($user_info['user_type']); $session_user->user_id = $user_id; $session_user->user_name = $user_name; $session_user->pwd = $password; $session_user->level = $user_info['user_type']; $session_user->last_name = $user_info['last_name']; $session_user->first_name = $user_info['first_name']; $session_user->theme_style = $db_user->getThemeByUserId($user_id); $a_i = 0; $arr_actin = array(); for ($i = 0; $i < count($arr_acl); $i++) { $arr_module[$i] = $arr_acl[$i]['module']; if ($arr_acl[$i]['module'] == 'exchange') { if ($arr_acl[$i]['action'] == "index" || $arr_acl[$i]['action'] == "add" || $arr_acl[$i]['action'] == "edited") { continue; } $arr_actin[$a_i++] = $arr_acl[$i]['action']; } } $arr_module = $this->sortMenu($arr_module); // print_r($arr_module); exit; $session_user->arr_acl = $arr_acl; $session_user->arr_module = $arr_module; $session_user->arr_actin = $arr_actin; $session_user->lock(); $log = new Application_Model_DbTable_DbUserLog(); $log->insertLogin($user_id); foreach ($arr_module as $i => $d) { if ($d !== 'user') { $url = '/' . @$arr_module[2]; } else { $url = self::REDIRECT_URL; break; } } Application_Form_FrmMessage::redirectUrl("/home"); } else { $this->view->msg = 'ឈ្មោះអ្នកប្រើប្រាស់ និង ពាក្យសំងាត់ មិនត្រឺមត្រូវទេ '; } } else { $this->view->msg = 'លោកអ្នកមិនមានសិទ្ធិប្រើប្រាស់ទេ!'; } } }
public function editAction() { $id = $this->getRequest()->getParam('id',0); $db_exc=new Tellerandexchange_Model_DbTable_DbxChangeMoney(); if($this->getRequest()->isPost()){ $formdata=$this->getRequest()->getPost(); try { $formdata['id']=$id; $id = $db_exc->editExchange($formdata); Application_Form_FrmMessage::message("EDIT_SUCESS"); $this->_redirect('tellerandexchange/xchanges'); } catch (Exception $e) { $this->view->msg = 'ការបញ្ចូលមិនជោគជ័យ'; echo $e->getMessage();exit(); } } // action body //Get value from url $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); $this->view->inv_no = Application_Model_GlobalClass::getInvoiceNo(); $rs=$db_exc->getxchangById($id); // print_r($rs); $this->view->dataedit=$rs; }
function ilQuickPaymentAction(){ $db = new Loan_Model_DbTable_DbLoanILPayment(); if($this->getRequest()->isPost()){ $data = $this->getRequest()->getPost(); //print_r($data); $db->quickPayment($data); } $frm = new Loan_Form_FrmIlPayment(); $frm_loan=$frm->quickPayment(); Application_Model_Decorator::removeAllDecorator($frm_loan); $db_keycode = new Application_Model_DbTable_DbKeycode(); $this->view->keycode = $db_keycode->getKeyCodeMiniInv(); $this->view->graiceperiod = $db_keycode->getSystemSetting(9); $this->view->frm_ilpayment = $frm_loan; $this->view->co = $db->getAllCo(); }
function editAction() { $id = $this->getRequest()->getParam("id"); $db = new Loan_Model_DbTable_DbLoanILPayment(); $db_global = new Application_Model_DbTable_DbGlobal(); if($this->getRequest()->isPost()){ $data = $this->getRequest()->getPost(); //print_r($data);exit(); $db->editQuickPayment($id,$data); // $db->cancelPaymnet($data); if(isset($data["save_new"])){ Application_Form_FrmMessage::Sucessfull("INSERT_SUCCESS!","/loan/ilquickpayment/add"); }elseif(isset($data["save_close"])){ Application_Form_FrmMessage::Sucessfull("INSERT_SUCCESS!","/loan/ilquickpayment"); } } $last_pay_date = $db_global->getLastDatePayment($id); $current_date = $db_global->getCurrentDatePayment($id); if($current_date<$last_pay_date){ Application_Form_FrmMessage::Sucessfull("WARNNING_EDIT_LOAN","/loan/ilquickpayment/"); } $quickPayment = $db->getIlQuickPaymentById($id); $this->view->quickPayment = $quickPayment; $quickPaymentDetail = $db->getIlQuickPaymentDetailById($id); $this->view->quickPaymentDetail = $quickPaymentDetail; $frm = new Loan_Form_FrmIlPayment(); $frm_loan=$frm->quickPayment(); Application_Model_Decorator::removeAllDecorator($frm_loan); $db_keycode = new Application_Model_DbTable_DbKeycode(); $this->view->keycode = $db_keycode->getKeyCodeMiniInv(); $this->view->graiceperiod = $db_keycode->getSystemSetting(9); $this->view->frm_ilpayment = $frm_loan; $this->view->co = $db->getAllCo(); }
function addAction() { $key = new Application_Model_DbTable_DbKeycode(); $data = $key->getKeyCode(); $this->view->data = $data; }
public function viewAction() { $id = $this->getRequest()->getParam("id"); if ($this->getRequest()->isPost()) { //if have post = delete $_data = $this->getRequest()->getPost(); try { $_dbmodel = new Application_Model_DbTable_DbPayout(); $_data["id"] = $id; $_dbmodel->deletePayout($_data); Application_Form_FrmMessage::Sucessfull('ការបញ្ចូលជោគជ័យ', "/loan/payout/index"); } catch (Exception $e) { echo $e->getMessage(); exit; $this->view->msg = 'ការបញ្ចូលមិនជោគជ័យ'; } } $sender = new Application_Model_DbTable_DbSender(); $this->view->senderlist = $sender->getAllSenderNameOweAll(); $_dbmodel = new Application_Model_DbTable_DbPayout(); $row = $_dbmodel->getPayoutbyInvoice($id); $this->view->edite_found = $row; $this->view->po_invoice_no = $row['po_invoice_no']; $db_keycode = new Application_Model_DbTable_DbKeycode(); $this->view->keycode = $db_keycode->getKeyCodeMiniInv(); $session_user = new Zend_Session_Namespace('auth'); $this->view->user_name = $session_user->last_name . ' ' . $session_user->first_name; }
function rptClientblacklistAction(){ $key = new Application_Model_DbTable_DbKeycode(); $this->view->data=$key->getKeyCodeMiniInv(TRUE); $db = new Group_Model_DbTable_DbClientBlackList(); if($this->getRequest()->isPost()){ $search=$this->getRequest()->getPost(); }else{ $search = array( 'adv_search' => '', 'status_search' => -1, 'start_date'=> date('Y-m-d'), 'end_date'=>date('Y-m-d')); } $this->view->calleteral_list = $db->getAllBlackList($search);//call frome model $frm = new Group_Form_FrmClientBlackList(); $frm = $frm->FrmClientBlackList(); Application_Model_Decorator::removeAllDecorator($frm); $this->view->frm_search = $frm; $this->view->list_end_date =$search; }
function editAction() { $id = $this->getRequest()->getParam("id"); $db = new Loan_Model_DbTable_DbGroupPayment(); $db_global = new Application_Model_DbTable_DbGlobal(); if($this->getRequest()->isPost()){ $_data = $this->getRequest()->getPost(); $identity = $_data["identity"]; try { if($identity==""){ Application_Form_FrmMessage::Sucessfull("Group Client no loan to pay!", "/loan/grouppayment"); }else{ $db->updateGroupPayment($_data); // Application_Form_FrmMessage::Sucessfull("Update Success!", "/loan/GroupPayment"); exit(); } }catch (Exception $e) { $err =$e->getMessage(); Application_Model_DbTable_DbUserLog::writeMessageError($err); } } $last_pay_date = $db_global->getLastDatePayment($id); $current_date = $db_global->getCurrentDatePayment($id); if($current_date<$last_pay_date){ Application_Form_FrmMessage::Sucessfull("WARNNING_EDIT_LOAN","/loan/grouppayment/"); } $rs = $db->getGroupPaymentById($id); $frm = new Loan_Form_FrmIlPayment(); $frm_loan=$frm->FrmGroupPayment(); Application_Model_Decorator::removeAllDecorator($frm_loan); $this->view->frm_ilpayment = $frm_loan; $this->view->reciept_money = $rs; $this->view->client = $db->getAllClient(); $this->view->clientCode = $db->getAllClientCode(); $db_keycode = new Application_Model_DbTable_DbKeycode(); $this->view->keycode = $db_keycode->getKeyCodeMiniInv(); $this->view->graiceperiod = $db_keycode->getSystemSetting(9); $session_user=new Zend_Session_Namespace('auth'); $this->view->user_name = $session_user->last_name .' '. $session_user->first_name; $list = new Application_Form_Frmtable(); $rs_receipt_detail = $db->getGroupPaymentDetail($id); $this->view->reciept_moneyDetail = $rs_receipt_detail; $this->view->group_id = $rs["group_id"]; $this->view->loan_numbers = $db_global->getLoanNumberByBranch(2); }
public function selectAction() { if ($this->getRequest()->isPost()) { $_data = $this->getRequest()->getPost(); //print_r($_data);exit(); try { $_dbmodel = new Application_Model_DbTable_DbPayment(); $_dbmodel->addTransFound($_data); Application_Form_FrmMessage::Sucessfull('ការបញ្ចូលជោគជ័យ', "/payment/index/index"); } catch (Exception $e) { echo $e->getMessage(); exit; $this->view->msg = 'ការបញ្ចូលមិនជោគជ័យ'; } } $this->view->invoice_no = Application_Model_GlobalClass::getInvoiceWithdraw(4); $sender = new Application_Model_DbTable_DbSender(); $this->view->senderlist = $sender->getAllSenderNameOwe(); $db_keycode = new Application_Model_DbTable_DbKeycode(); $this->view->keycode = $db_keycode->getKeyCodeMiniInv(); $session_user = new Zend_Session_Namespace('auth'); $this->view->user_name = $session_user->last_name . ' ' . $session_user->first_name; $cur = new Application_Model_DbTable_DbCurrencies(); $currency = $cur->getCurrencyList(); $this->view->currency = $this->_helpfilteroption($currency); $curr = $this->_helpfilteroption($currency); array_unshift($curr, array('id' => '-1', "name" => "សងប្រភេទប្រាក់ផ្សេង", 'symbol' => 'other')); $this->view->pay_currencytype = $curr; $db_rate = new Application_Model_DbTable_DbPayment(); $this->view->rate = $db_rate->getRateAll(); }
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->editWithDrawById($data); Application_Form_FrmMessage::Sucessfull('ការកែប្រែប្រតិបត្តិការនេះជោគជ័យ', self::REDIRECT_URL . '/withdraw/index'); } catch (Exception $e) { Application_Form_FrmMessage::Sucessfull('ការកែប្រែប្រតិបត្តិការនេះបរាជ័យ', self::REDIRECT_URL . '/withdraw/index'); } } $db = new Application_Model_DbTable_DbKbank(); $rs = $db->getTranWithDrawById($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(); $sender = new Application_Model_DbTable_DbSender(); $_sender = $sender->getAllSenderKbank(); $this->view->sender = $_sender; }
public function calculatorAction() { $frm_cal = new Global_Form_FrmCal(); $myform = $frm_cal->FrmCalculator(); Application_Model_Decorator::removeAllDecorator($myform); $this->view->frm_cal = $myform; $key = new Application_Model_DbTable_DbKeycode(); $this->view->keycode = $key->getKeyCodeMiniInv(TRUE); }
public function indexAction() { // action body $this->_helper->layout()->disableLayout(); /* set this to login page to change the character charset of browsers to Utf-8 ...*/ $this->_helper->layout()->disableLayout(); $form = new Application_Form_FrmLogin(); $form->setAction('index'); $form->setMethod('post'); $form->setAttrib('accept-charset', 'utf-8'); $this->view->form = $form; $key = new Application_Model_DbTable_DbKeycode(); $this->view->data = $key->getKeyCodeMiniInv(TRUE); if ($this->getRequest()->isPost()) { $formdata = $this->getRequest()->getPost(); if ($form->isValid($formdata)) { $session_lang = new Zend_Session_Namespace('lang'); $session_lang->lang_id = $formdata["lang"]; //for creat session Application_Form_FrmLanguages::getCurrentlanguage($session_lang->lang_id); //for choose lang for when login $user_name = $form->getValue('txt_user_name'); $password = $form->getValue('txt_password'); $db_user = new Application_Model_DbTable_DbUsers(); if ($db_user->userAuthenticate($user_name, $password)) { // $this->view->msg = 'Authentication Sucessful!'; // $this->view->err="0"; $session_user = new Zend_Session_Namespace('auth'); $user_id = $db_user->getUserID($user_name); $user_info = $db_user->getUserInfo($user_id); $arr_acl = $db_user->getArrAcl($user_info['user_type']); $session_user->user_id = $user_id; $session_user->user_name = $user_name; $session_user->pwd = $password; $session_user->level = $user_info['user_type']; $session_user->last_name = $user_info['last_name']; $session_user->first_name = $user_info['first_name']; $session_user->theme_style = $db_user->getThemeByUserId($user_id); $a_i = 0; $arr_actin = array(); // print_r($arr_acl); for ($i = 0; $i < count($arr_acl); $i++) { $arr_module[$i] = $arr_acl[$i]['module']; // if($arr_acl[$i]['module'] == 'exchange'){ // if($arr_acl[$i]['action'] == "index" || $arr_acl[$i]['action'] == "add" || $arr_acl[$i]['action'] == "edit" ) { // continue; // } $arr_actin[$a_i++] = $arr_acl[$i]['module'] . '/' . $arr_acl[$i]['controller'] . '/' . $arr_acl[$i]['action']; // } } // print_r($arr_actin);exit(); $arr_module = array_unique($arr_module); $arr_actin = array_unique($arr_actin); // print_r($arr_module); echo "<br />============<br />"; $arr_module = $this->sortMenu($arr_module); // print_r($arr_module);exit(); // print_r($arr_module); exit; $session_user->arr_acl = $arr_acl; $session_user->arr_module = $arr_module; $session_user->arr_actin = $arr_actin; $session_user->lock(); $log = new Application_Model_DbTable_DbUserLog(); $log->insertLogin($user_id); foreach ($arr_module as $i => $d) { if ($d !== 'user') { $url = '/' . @$arr_module[2]; } else { $url = self::REDIRECT_URL; break; } } Application_Form_FrmMessage::redirectUrl("/home"); } else { $this->view->msg = 'ឈ្មោះ​អ្នក​ប្រើ​ប្រាស់ និង ពាក្យ​​សំងា�់ មិន​�្រឺម​�្រូវ​ទ� '; } } else { $this->view->msg = 'លោកអ្នកមិនមានសិទ្ធិប្រើប្រាស់ទ�!'; } } }