$o->created = $timestamp; $o->createdby = $xoopsUser->getVar('uid'); $o->updatedby = $xoopsUser->getVar('uid'); if ($o->country_id == "") { $o->country_id = 0; } if ($isactive == 1 || $isactive == "on") { $o->isactive = 1; } else { $o->isactive = 0; } switch ($action) { case "create": // if the token is exist and not yet expired $log->showLog(4, "Accessing create record event, with region name={$o->region_name}"); if ($s->check(true, $token, "CREATE_STD")) { if ($o->insertRegion()) { $latest_id = $o->getLatestRegionID(); redirect_header("region.php", $pausetime, "Your data is saved, redirect to create more record."); } else { $log->showLog(1, "Warning, '{$o->region_name}' cannot be save, please make sure your data is correct"); $token = $s->createToken($tokenlife, "CREATE_STD"); $o->countryctrl = $ctrl->getSelectCountry($o->country_id, 'N'); $o->orgctrl = $ctrl->selectionOrg($o->createdby, $defaultorganization_id, 'N', "", 'Y'); $o->getInputForm("new", -1, $token); $o->showRegionTable(); } } else { // if the token is not valid or the token is expired, it back to previous form with previous inputed data $log->showLog(1, "Warning, '{$o->region_name}' cannot be save due to token expired"); $token = $s->createToken($tokenlife, "CREATE_STD");
$pl->lineqty = $_POST['lineqty']; $pl->lineuom = $_POST['lineuom']; $pl->linesubject = $_POST['linesubject']; $pl->lineamt = $_POST['lineamt']; $pl->lineunitprice = $_POST['lineunitprice']; $pl->lineaccounts_id = $_POST['lineaccounts_id']; $pl->linedescription = $_POST['linedescription']; $pl->linedel = $_POST['linedel']; $chkAddNew = $_POST['chkAddNew']; $o->adddebitcreditnotelineqty = $_POST['adddebitcreditnotelineqty']; switch ($action) { //When user submit new organization case "create": // if the token is exist and not yet expired $log->showLog(4, "Accessing create record event, with debitcreditnote name={$o->debitcreditnote_no}"); if ($s->check(true, $token, "CREATE_NOTE")) { if ($o->insertDebitCreditNote()) { $latest_id = $o->getLatestDebitCreditNoteID(); if ($pl->createDebitCreditNoteLine($latest_id, $o->adddebitcreditnotelineqty, $o->defaultspecies_id, $o->defaultwoodtype)) { if ($chkAddNew == 'on') { redirect_header("debitcreditnote.php", $pausetime, "Your data is saved"); } else { redirect_header("debitcreditnote.php?action=edit&debitcreditnote_id={$latest_id}", $pausetime, "Your data is saved"); } } else { redirect_header("debitcreditnote.php?action=edit&debitcreditnote_id={$latest_id}", $pausetime, "Record header is saved, but some problem exist on creating debitcreditnote child, please create child record manually after form refresh."); } } else { echo "<b style='color:red'>Record cannot save, please reverified data you insert into this record.</b>"; $token = $s->createToken($tokenlife, "CREATE_NOTE"); $o->orgctrl = $ctrl->selectionOrg($o->createdby, $o->organization_id, 'N', "", 'Y');
$pl->linebpartner_id = $_POST['linebpartner_id']; $pl->linedescription = $_POST['linedescription']; $pl->linedel = $_POST['linedel']; $chkAddNew = $_POST['chkAddNew']; $o->addpaymentvoucherlineqty = $_POST['addpaymentvoucherlineqty']; if ($iscomplete == 1 or $iscomplete == "on") { $o->iscomplete = 1; } else { $o->iscomplete = 0; } switch ($action) { //When user submit new organization case "create": // if the token is exist and not yet expired $log->showLog(4, "Accessing create record event, with paymentvoucher name={$o->paidto}"); if ($s->check(true, $token, "CREATE_ACG")) { if ($o->insertPaymentVoucher()) { $latest_id = $o->getLatestPaymentVoucherID(); /* if($o->iscomplete==1){ include_once "class/AccountsAPI.php"; $accapi=new AccountsAPI(); $accountsarray=array($o->accountsto_id,$o->accountsfrom_id); $amtarray=array($o->amt,$o->amt*-1); $currencyarray=array($o->currency_id,$o->currency_id); $conversionarray=array($o->exchangerate,$o->exchangerate); $bpartnerarray=array(0,$o->bpartner_id); $originalamtarray=array($o->originalamt,$o->originalamt*-1); $transtypearray=array("",""); $linetypearray=array(0,1); $documentnoarray=array($o->paymentvoucher_no,$o->paymentvoucher_no);
$o->epf_acc = $_POST['epf_acc']; $o->salary_acc = $_POST['salary_acc']; $o->accrued_acc = $_POST['accrued_acc']; $o->createdby = $xoopsUser->getVar('uid'); $o->updatedby = $xoopsUser->getVar('uid'); $isactive = $_POST['isactive']; if ($isactive == 1 or $isactive == "on") { $o->isactive = 1; } else { $o->isactive = 0; } switch ($action) { //When user submit new organization case "create": // if the token is exist and not yet expired if ($s->check(false, $token, "CREATE_ORG")) { //if organization saved if ($o->insertOrganization()) { $latest_id = $o->getLatestOrganizationID(); redirect_header("organization.php?action=edit&organization_id={$latest_id}", $pausetime, "Your data is saved."); } else { $o->groupctrl = $ctrl->getAllSystemGroup(0); $token = $s->createToken($tokenlife, "CREATE_ORG"); if ($o->country_id == "") { $o->country_id = 0; } if ($o->currency_id == "") { $o->currency_id = 0; } $o->countryctrl = $ctrl->getSelectCountry($o->country_id, 'N'); $o->currencyctrl = $ctrl->getSelectCurrency($o->currency_id, 'N');
$o->cur_name = $cur_name; $o->cur_symbol = $cur_symbol; $isactive = $_POST['isactive']; $o->isAdmin = $xoopsUser->isAdmin(); $o->createdby = $xoopsUser->getVar('uid'); $o->updatedby = $xoopsUser->getVar('uid'); if ($isactive == "Y" or $isactive == "on") { $o->isactive = 'Y'; } else { $o->isactive = 'N'; } switch ($action) { case "create": // if the token is exist and not yet expired $log->showLog(4, "Accessing create record event, with races name={$o->races_name}"); if ($s->check(true, $token, "CREATE_RCE")) { if ($o->insertRaces()) { $latest_id = $o->getLatestRacesID(); redirect_header("races.php", $pausetime, "Your data is saved, the new id={$latest_id}. Redirect to create new races."); } else { $log->showLog(1, "Can't create races '{$o->races_name}', please verified your data!"); $token = $s->createToken($tokenlife, "CREATE_RCE"); $o->getInputForm("new", -1, $token); $o->showRacesTable(); } } else { // if the token is not valid or the token is expired, it back to previous form with previous inputed data $log->showLog(1, "Can't create races '{$o->races_name}' due to token expired!"); $token = $s->createToken($tokenlife, "CREATE_RCE"); $o->getInputForm("new", -1, $token); $o->showRacesTable();
$o->country_code = $_POST['country_code']; $isactive = $_POST['isactive']; $o->defaultlevel = $_POST['defaultlevel']; $o->createdby = $xoopsUser->getVar('uid'); $o->updatedby = $xoopsUser->getVar('uid'); if ($isactive == 1 or $isactive == "on") { $o->isactive = 1; } else { $o->isactive = 0; } switch ($action) { //When user submit new organization case "create": // if the token is exist and not yet expired $log->showLog(4, "Accessing create record event, with country name={$o->country_name}"); if ($s->check(false, $token, "CREATE_WDW")) { if ($o->insertCountry()) { $latest_id = $o->getLatestCountryID(); redirect_header("country.php?action=edit&country_id={$latest_id}", $pausetime, "Your data is saved, the new id={$latest_id}"); } else { $token = $s->createToken(120, "CREATE_WDW"); $o->getInputForm("new", -1, $token); $o->showCountryTable("WHERE country_id>0", "ORDER BY defaultlevel,country_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(120, "CREATE_WDW"); $o->getInputForm("new", -1, $token); $o->showCountryTable("WHERE country_id>0", "ORDER BY defaultlevel,country_name"); } break;
if ($o->organization_id == "") { $o->organization_id = $defaultorganization_id; } if ($uid == "") { $uid = 0; } $userid = $xoopsUser->getVar('uid'); $o->orgctrl = $ctrl->selectionOrg($userid, $o->organization_id); $o->userctrl = $permission->selectAvailableSysUser($o->uid, 'Y'); $o->windowsctrl = $ctrl->getSelectWindows($o->table_name, "Y"); switch ($action) { //When user submit new organization case "create": // if the token is exist and not yet expired $log->showLog(4, "Accessing create record event, with activitysummary name={$o->activitysummary_name}"); if ($s->check(false, $token, "CREATE_STD")) { if ($o->insertActivitysummary()) { $latest_id = $o->getLatestActivitysummaryID(); redirect_header("activitysummary.php?action=edit&activitysummary_id={$latest_id}", $pausetime, "Your data is saved, the new id={$latest_id}"); } else { echo "Can't create activitysummary!"; } } else { // if the token is not valid or the token is expired, it back to previous form with previous inputed data $token = $s->createToken(120, "CREATE_STD"); $o->getInputForm("new", -1, $token); $o->showActivitysummaryTable(); } break; //when user request to edit particular organization //when user request to edit particular organization
//$o->previousopeningbalance=$_POST['previousopeningbalance']; $filterstring = $_GET['filterstring']; /* if($filterstring=="") $filterstring=$o->searchAToZ(); else{ $o->searchAToZ(); } */ $o->searchAToZ(); switch ($action) { //When user submit new organization case "create": // if the token is exist and not yet expired $log->showLog(4, "Accessing create record event, with bpartner name={$o->bpartner_name}"); if ($s->check(true, $token, "CREATE_BPARTNER")) { if ($o->insertBPartner()) { $latest_id = $o->getLatestBPartnerID(); $log->saveLog($latest_id, $tablebpartner, $o->updatesql, "I", "O"); /* if($accountmoduleexist==true && $o->accounts_id>0){ include_once "../simbiz/class/Accounts.php"; $acc = new Accounts(); $acc->fetchAccounts($o->accounts_id); $acc->openingbalance=$o->openingbalance+$acc->openingbalance; $acc->createdby=$o->createdby; $acc->updatedby=$o->updatedby; $effectedamt=$o->openingbalance-$o->previousopeningbalance; $acc->updateLastBalance($o->accounts_id,$o->openingbalance,$o->previousopeningbalance,$latest_id); $acc->updateOpenBalance($o->accounts_id,$effectedamt); $acc->updateOpeningBalanceAccount($o->openingbalance,$o->previousopeningbalance);
$o->issearch = $_POST['issearch']; if ($isactive == "1" || $isactive == "on") { $o->isactive = 1; } else { if ($isactive == "null") { $o->isactive = "null"; } else { $o->isactive = 0; } } switch ($action) { //When user submit new organization case "create": // if the token is exist and not yet expired $log->showLog(4, "Accessing create record event, with contacts name={$o->contacts_name},{$o->bpartner_id}"); if ($s->check(true, $token, "CREATE_CONTACTS")) { if ($o->insertContacts()) { $latest_id = $o->getLatestContactsID(); $log->saveLog($latest_id, $tablecontacts, $o->updatesql, "I", "O"); redirect_header("bpartner.php?action=view&bpartner_id={$o->bpartner_id}", $pausetime, "Your data is saved, redirect to create more record."); } else { $log->saveLog(0, $tablecontacts, $o->updatesql, "I", "F"); redirect_header("bpartner.php?action=view&bpartner_id={$o->bpartner_id}", $pausetime, "Warning! Your data cannot saved, redirect to business partner"); } } else { redirect_header("bpartner.php?action=view&bpartner_id={$o->bpartner_id}", 3, "Cannot save contacts due to token expired."); } break; //when user request to edit particular organization //when user request to edit particular organization case "edit":
$o->issearch = $_POST['issearch']; if ($isactive == "1" || $isactive == "on") { $o->isactive = 1; } else { if ($isactive == "null") { $o->isactive = "null"; } else { $o->isactive = 0; } } switch ($action) { //When user submit new organization case "create": // if the token is exist and not yet expired $log->showLog(4, "Accessing create record event, with followup name={$o->followup_name},{$o->bpartner_id}"); if ($s->check(true, $token, "CREATE_FOLLOWUP")) { if ($o->insertFollowUp()) { $latest_id = $o->getLatestFollowUpID(); $log->saveLog($latest_id, $tablefollowup, $o->updatesql, "I", "O"); redirect_header("bpartner.php?action=view&bpartner_id={$o->bpartner_id}", $pausetime, "Your data is saved, redirect to create more record."); } else { $log->saveLog(0, $tablefollowup, $o->updatesql, "I", "F"); redirect_header("bpartner.php?action=view&bpartner_id={$o->bpartner_id}", $pausetime, "Warning! Your data cannot saved, redirect to business partner"); } } else { redirect_header("bpartner.php?action=view&bpartner_id={$o->bpartner_id}", 3, "Cannot save followup due to token expired."); } break; //when user request to edit particular organization //when user request to edit particular organization case "edit":
$o->cur_name = $cur_name; $o->cur_symbol = $cur_symbol; $isactive = $_POST['isactive']; $o->isAdmin = $xoopsUser->isAdmin(); $o->createdby = $xoopsUser->getVar('uid'); $o->updatedby = $xoopsUser->getVar('uid'); if ($isactive == "Y" or $isactive == "on") { $o->isactive = 'Y'; } else { $o->isactive = 'N'; } switch ($action) { case "create": // if the token is exist and not yet expired $log->showLog(4, "Accessing create record event, with year name={$o->year_name}"); if ($s->check(false, $token, "CREATE_RCE")) { if ($o->insertYear()) { $latest_id = $o->getLatestYearID(); redirect_header("year.php", $pausetime, "Your data is saved, the new id={$latest_id}. Redirect to create new year."); } else { $log->showLog(1, "Can't create year '{$o->year_name}', please verified your data!"); $token = $s->createToken($tokenlife, "CREATE_RCE"); $o->getInputForm("new", -1, $token); $o->showYearTable(); } } else { // if the token is not valid or the token is expired, it back to previous form with previous inputed data $log->showLog(1, "Can't create year '{$o->year_name}' due to token expired!"); $token = $s->createToken($tokenlife, "CREATE_RCE"); $o->getInputForm("new", -1, $token); $o->showYearTable();