$log->saveLog(0, $tablebpartner, $o->updatesql, "I", "F"); $o->orgctrl = $ctrl->selectionOrg($o->createdby, $o->organization_id, 'N', "", 'Y'); $o->bpartnergroupctrl = $ctrl->getSelectBPartnerGroup($o->bpartnergroup_id, 'Y', "onchange='getDefaultAccount(this.value)'"); $o->industryctrl = $ctrl->getSelectIndustry($o->industry_id, 'N'); $o->currencyctrl = $ctrl->getSelectCurrency($o->currency_id, 'N'); $o->termsctrl = $ctrl->getSelectTerms($o->terms_id, 'Y'); $o->taxctrl = $ctrl->getSelectTax($o->tax_id, 'Y'); if ($accountmoduleexist == true) { $o->debtoraccountsctrl = $ctrl->getSelectAccounts($o->debtoraccounts_id, 'Y', "onchange=''", "debtoraccounts_id", ""); $o->creditoraccountsctrl = $ctrl->getSelectAccounts($o->creditoraccounts_id, 'Y', "onchange=''", "creditoraccounts_id", ""); } else { $o->debtoraccountsctrl = "Accounting Module doesn't exist <input type='hidden' name='debtoraccounts_id' value=0>"; $o->creditoraccountsctrl = "Accounting Module doesn't exist <input type='hidden' name='creditoraccounts_id' value=0>"; } // $o->accountsctrl=$ctrl->getSelectAccounts($o->accounts_id,'Y',"onchange=''","accounts_id",""); $o->getInputForm("new", -1, $token); $o->showBPartnerTable("WHERE bpartner_id>0 and organization_id={$defaultorganization_id}", "ORDER BY defaultlevel,bp.bpartner_no,bpartner_name"); } } else { // if the token is not valid or the token is expired, it back to previous form with previous inputed data $token = $s->createToken($tokenlife, "CREATE_BPARTNER"); $log->saveLog(0, $tablebpartner, $o->updatesql, "I", "F"); $o->orgctrl = $ctrl->selectionOrg($o->createdby, $o->organization_id, 'N', "", 'Y'); $o->bpartnergroupctrl = $ctrl->getSelectBPartnerGroup($o->bpartnergroup_id, 'Y', "onchange='getDefaultAccount(this.value)'"); $o->currencyctrl = $ctrl->getSelectCurrency($o->currency_id, 'N'); $o->industryctrl = $ctrl->getSelectIndustry($o->industry_id, 'N'); $o->termsctrl = $ctrl->getSelectTerms($o->terms_id, 'Y'); $o->taxctrl = $ctrl->getSelectTax($o->tax_id, 'Y'); if ($accountmoduleexist == true) { $o->debtoraccountsctrl = $ctrl->getSelectAccounts($o->debtoraccounts_id, 'Y', "onchange=''", "debtoraccounts_id", ""); $o->creditoraccountsctrl = $ctrl->getSelectAccounts($o->creditoraccounts_id, 'Y', "onchange=''", "creditoraccounts_id", "");
} if ($ispurchase) { $o->purchasepricelistctrl = '<select name="purchasepricelist_id" id="purchasepricelist_id">' . $simerpctrl->getSelectPriceList($o->purchasepricelist_id, 'Y', " AND issotrx=0 ") . '</select >'; } else { $o->purchasepricelistctrl = "Purchase Module doesn't exist <input type='hidden' name='purchasepricelist_id' value='0'>"; } if ($o->saveBPartner()) { if ($isaddnew == "1") { redirect_header("bpartner.php", $pausetime, "Your data is saved, redirect to add employee."); } else { $getid = $o->getLatestBPartnerID(); redirect_header("bpartner.php?action=edit&bpartner_id={$getid}", $pausetime, "Your data is saved, redirect to employee details."); } } else { echo "<div align='center'><font style='color:red;font-weight:bold'>Failed to saved data. Please try again.</font></div>"; $o->getInputForm("new"); } require XOOPS_ROOT_PATH . '/footer.php'; break; /* start iframe bpartner nitobi */ // /* start iframe bpartner nitobi */ // case "update": //bpartnerinfo tab $o->bpartnergroup_id = $_POST['bpartnergroup_id']; $o->bpartner_no = $_POST['bpartner_no']; $o->bpartner_name = $_POST['bpartner_name']; $o->isactive = $_POST['isactive']; $o->seqno = $_POST['seqno']; $o->organization_id = $_POST['organization_id'];