private function endSystemLog() { Log::log(self::CLASSNAME, self::cpu_usage()); View::addInLogViews(); Log::log(self::CLASSNAME, 'Load Average: ' . $this->loadAverage()); Log::log(self::CLASSNAME, 'Execution time: ' . number_format($this->_endTime - $this->_startTime, 5) . 's'); if (Settings::$debugShowDebug) { Log::showLog(); } }
$o->country_name = $_POST["country_name"]; $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"); }
$o->window_name = $_POST["window_name"]; $o->filename = $_POST['filename']; $isactive = $_POST['isactive']; $o->seqno = $_POST['seqno']; $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) { //When user submit new organization case "create": // if the token is exist and not yet expired $log->showLog(4, "Accessing create record event, with window name={$o->window_name}"); if ($s->check(false, $token, "CREATE_WDW")) { if ($o->insertWindow()) { $latest_id = $o->getLatestWindowID(); redirect_header("window.php?action=edit&window_id={$latest_id}", $pausetime, "Your data is saved, the new id={$latest_id}"); } else { $token = $s->createToken($tokenlife, "CREATE_WDW"); $o->getInputForm("new", -1, $token); $o->showWindowTable(); } } 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_WDW"); $o->getInputForm("new", -1, $token); $o->showWindowTable(); }
$o->activitytype = $_POST['activitytype']; 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
$o->updatedby = $xoopsUser->getVar('uid'); if ($isactive == 1 or $isactive == "on") { $o->isactive = 1; } else { $o->isactive = 0; } if ($o->istax == 1 or $o->istax == "on") { $o->istax = 1; } else { $o->istax = 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 tax name={$o->tax_name}"); if ($s->check(false, $token, "CREATE_ACG")) { if ($o->insertTax()) { $latest_id = $o->getLatestTaxID(); redirect_header("tax.php?action=edit&tax_id={$latest_id}", $pausetime, "Your data is saved, the new id={$latest_id}"); } else { $token = $s->createToken($tokenlife, "CREATE_ACG"); $o->orgctrl = $ctrl->selectionOrg($o->createdby, $o->organization_id, 'N', "", 'Y'); $o->getInputForm("new", -1, $token); $o->showTaxTable("WHERE tax_id>0 and organization_id={$defaultorganization_id}", "ORDER BY defaultlevel,tax_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_ACG"); $o->orgctrl = $ctrl->selectionOrg($o->createdby, $o->organization_id, 'N', "", 'Y'); $o->getInputForm("new", -1, $token);
if ($trans->refamtvaluecredit == "") { $trans->refamtvaluecredit = 0; } if ($trans->defaultline == "") { $trans->defaultline = 0; } if ($reuse == 1 or $reuse == "on") { $o->reuse = 1; } else { $o->reuse = 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 batch name={$o->batch_name}"); //if ($s->check(true,$token,"CREATE_ACG")){ if ($o->insertBatch()) { $latest_id = $o->getLatestBatchID(); $defaultdebit = $_POST["defaultdebit"]; $defaultcredit = $_POST["defaultcredit"]; $defaultdocno1 = $_POST["defaultdocno1"]; $refdocno1 = $_POST["refdocno1"]; $defaultchequeno = $_POST["defaultchequeno"]; $refchequeno = $_POST["refchequeno"]; $linedescdef = $_POST["linedescdef"]; $linedescref = $_POST["linedescref"]; $defaultamt = 0; if ($trans->defaultaccountsref_id > 0) { if ($trans->refamtvaluecredit > 0) { $defaultamt = $defaultdebit;
$o->description = $_POST['description']; $o->debtoraccounts_id = $_POST['debtoraccounts_id']; $o->creditoraccounts_id = $_POST['creditoraccounts_id']; $o->defaultlevel = $_POST['defaultlevel']; $o->createdby = $xoopsUser->getVar('uid'); $o->updatedby = $xoopsUser->getVar('uid'); if ($o->isactive == 1 or $o->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 bpartnergroup name={$o->bpartnergroup_name}"); if ($s->check(false, $token, "CREATE_ACG")) { if ($o->insertBPartnerGroup()) { $latest_id = $o->getLatestBPartnerGroupID(); redirect_header("bpartnergroup.php", $pausetime, "Your data is saved, redirect to create more business partner group."); } else { $log->showLog(1, "Business partner group '{$o->bpartnergroup_name}' cannot save, please check your data."); $token = $s->createToken($tokenlife, "CREATE_ACG"); $o->orgctrl = $ctrl->selectionOrg($o->createdby, $o->organization_id, 'N', "", 'Y'); //$o->debtoraccountsctrl=$ctrl->getSelectAccounts($o->debtoraccounts_id,'Y',"","debtoraccounts_id","AND placeholder=0 AND account_type =2"); //$o->creditoraccountsctrl=$ctrl->getSelectAccounts($o->creditoraccounts_id,'Y',"","creditoraccounts_id","AND placeholder=0 AND account_type =3"); $o->getInputForm("new", -1, $token); $o->showBPartnerGroupTable("WHERE g.bpartnergroup_id>0 and g.organization_id={$defaultorganization_id}", "ORDER BY g.defaultlevel,g.bpartnergroup_name"); } } else { // if the token is not valid or the token is expired, it back to previous form with previous inputed data
EOF; $o->bpartner_id = 0; if (isset($_POST['action'])) { $action = $_POST['action']; $o->bpartner_id = $_POST["bpartner_id"]; } elseif (isset($_GET['action'])) { $action = $_GET['action']; $o->bpartner_id = $_GET["bpartner_id"]; } else { $action = ""; } $token = $_POST['token']; $accountmoduleexist = false; if (file_exists("../simbiz/class/Accounts.php")) { $log->showLog(3, "Account module exist"); $accountmoduleexist = true; } else { $log->showLog(3, "Account module exist"); $accountmoduleexist = false; } $o->createdby = $xoopsUser->getVar('uid'); $o->updatedby = $xoopsUser->getVar('uid'); $timestamp = date("y/m/d H:i:s", time()); $o->updated = $timestamp; $o->created = $timestamp; $o->isAdmin = $xoopsUser->isAdmin(); $o->bpartnergroup_id = $_POST['bpartnergroup_id']; $o->bpartner_no = $_POST['bpartner_no']; $o->bpartner_name = $_POST['bpartner_name']; $o->isactive = $_POST['isactive'];
// include_once (XOOPS_ROOT_PATH.'/header.php'); include_once "class/Load_Data.inc.php"; include_once "class/EBAGetHandler.php"; include_once "class/Log.inc.php"; include_once "setting.php"; error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); // header('Content-type: text/xml'); $defaultorganization_id = $_SESSION['defaultorganization_id']; $defaultpagesize = 15; $action = $_GET['action']; $log = new Log(); // $log->cleanLog(); $o = new Load_Data(); $getHandler = new EBAGetHandler(); $isadmin = $xoopsUser->isAdmin(); $log->showLog(3, "Load Grid with Query String=" . $_SERVER['QUERY_STRING']); //$getHandler-> $pagesize = $_GET["PageSize"]; $ordinalStart = $_GET["StartRecordIndex"]; $sortcolumn = $_GET["SortColumn"]; $sortdirection = $_GET["SortDirection"]; switch ($action) { case "country": break; case "region": $wherestring = " WHERE region_id>0 "; $o->showReligion($wherestring); break; case "currency": $wherestring = " WHERE currency_id>0"; $o->showCurrency($wherestring);
$defaultorganization_id = $_SESSION['defaultorganization_id']; //$orgid=$_POST['organization_id']; if ($defaultorganization_id == '') { $defaultorganization_id = $o->getDefaultOrganization($userid); $_SESSION['defaultorganization_id'] = $defaultorganization_id; if ($defaultorganization_id == '' || $defaultorganization_id == 0) { $defaultorganization_id = 1; $_SESSION['defaultorganization_id'] = $defaultorganization_id; } } if ($_GET['setSessionDate'] == 'Y') { $_SESSION['defaultDateSession'] = $_GET['defaultDateSession']; } $defaultDateSession = $_SESSION['defaultDateSession']; $permission = new Permission(); $log->showLog(4, "Currenct org session id=" . $_SESSION['defaultorganization_id'] . ",program org_id= {$defaultorganization_id},uid={$userid}"); $arrperm = $permission->checkPermission($userid, $module_id, $usefilename); $menuname = $arrperm[0]; $xoopsTpl->assign('xoops_pagetitle', $menuname); $havewriteperm = $arrperm[1]; $windowsetting = $arrperm[2]; $permissionsetting = $arrperm[3]; $helpurl = $arrperm[4]; $jrxml = $arrperm[5]; if (strpos($permissionsetting, '$') >= 0) { $permissionsetting = explode(",", $permissionsetting); $totalpermissionsetting = count($permissionsetting); $i = 0; while ($i < $totalpermissionsetting) { eval($permissionsetting[$i] . ";"); if (strpos($permissionsetting[$i], '$')) {
//include_once("class/nitobi.xml.php"); include_once "class/EBAGetHandler.php"; include_once "setting.php"; $defaultorganization_id = $_SESSION['defaultorganization_id']; $log = new Log(); $o = new Save_Data(); $saveHandler = new EBASaveHandler(); $saveHandler->ProcessRecords(); $timestamp = date("Y-m-d H:i:s", time()); $createdby = $xoopsUser->getVar('uid'); $uname = $xoopsUser->getVar('uname'); $uid = $xoopsUser->getVar('uid'); $isadmin = $xoopsUser->isAdmin(); $action = $_GET['action']; if ($isadmin) { $log->showLog(3, "Current user is admin user"); } //$log->cleanLog(); switch ($action) { case "country": $o->saveCountry(); break; case "window": $o->saveWindow(); break; case "currency": $o->saveCurrency(); break; case "conversionrate": $o->saveConversionRate(); break;
$o->description = $_POST['description']; $o->initial = $_POST['initial']; $o->accountclass_id = $_POST['accountclass_id']; $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 accountgroup name={$o->accountgroup_name}"); if ($s->check(false, $token, "CREATE_ACG")) { if ($o->insertAccountGroup()) { $latest_id = $o->getLatestAccountGroupID(); redirect_header("accountgroup.php?action=edit&accountgroup_id={$latest_id}", $pausetime, "Your data is saved, the new id={$latest_id}"); } else { $token = $s->createToken($tokenlife, "CREATE_ACG"); $o->orgctrl = $ctrl->selectionOrg($o->createdby, $o->organization_id, 'N', "", 'Y'); $o->accounclassctrl = $ctrl->getAccClass($o->accountclass_id, 'N'); $o->getInputForm("new", -1, $token); $o->showAccountGroupTable("WHERE accountgroup_id>0 and organization_id={$defaultorganization_id}", "ORDER BY initial,defaultlevel,accountgroup_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_ACG"); $o->orgctrl = $ctrl->selectionOrg($o->createdby, $o->organization_id, 'N', "", 'Y');
$cvr->lineeffectivedate = $_POST['lineeffectivedate']; $cvr->linedescription = $_POST['linedescription']; $cvr->lineisactive = $_POST['lineisactive']; $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 currency name={$o->currency_name}"); if ($s->check(false, $token, "CREATE_WDW")) { if ($o->insertCurrency()) { $latest_id = $o->getLatestCurrencyID(); redirect_header("currency.php?action=edit¤cy_id={$latest_id}", $pausetime, "Your data is saved, the new id={$latest_id}"); } else { $token = $s->createToken($tokenlife, "CREATE_WDW"); $o->countryctrl = $ctrl->getSelectCountry($o->country_id, 'N'); // $log->showLog(1,__FILE__ . ",Line:". __LINE__. ",Data cannot be created"); $o->getInputForm("new", -1, $token); $o->showCurrencyTable("WHERE currency_id>0", "ORDER BY cur.defaultlevel,cur.currency_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_WDW"); $o->countryctrl = $ctrl->getSelectCountry($o->country_id, 'N');
$o->isclosed = $_POST['isclosed']; $l->linedel = $_POST['linedel']; $l->lineisclosed = $_POST['lineisclosed']; $l->linefinancialyearline_id = $_POST['linefinancialyearline_id']; $o->periodfrom_id = $_POST['periodfrom_id']; $o->periodto_id = $_POST['periodto_id']; $o->defaultlevel = $_POST['defaultlevel']; $o->isAdmin = $xoopsUser->isAdmin(); //$o->periodqty=$row['periodqty']; $o->createdby = $xoopsUser->getVar('uid'); $o->updatedby = $xoopsUser->getVar('uid'); 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 financialyear name={$o->financialyear_name}"); if ($s->check(true, $token, "CREATE_ACG")) { if ($o->isValid($o->periodfrom_id, $o->periodto_id)) { if ($o->insertFinancialYear()) { $latest_id = $o->getLatestFinancialYearID(); $l->createFinancialYearLine($latest_id, $o->periodfrom_id, $o->periodto_id); $o->periodqty = $l->createdline + $o->periodqty; $o->updateFinancialYear(); redirect_header("financialyear.php?action=edit&financialyear_id={$latest_id}", $pausetime, "Your data is saved, the new id={$latest_id}"); } else { $token = $s->createToken($tokenlife, "CREATE_ACG"); $o->orgctrl = $ctrl->selectionOrg($o->createdby, $o->organization_id, 'N', "", 'Y'); $o->periodfromctrl = $ctrl->getSelectPeriod($o->periodfrom_id, 'N', "", "periodfrom_id"); $o->periodtoctrl = $ctrl->getSelectPeriod($o->periodto_id, 'N', "", "periodto_id"); $o->getInputForm("new", -1, $token); $o->showFinancialYearTable("WHERE financialyear_id>0 and organization_id={$defaultorganization_id}", "ORDER BY f.financialyear_name");