$orgtel2 = $org->tel_2; $orgfax = $org->fax; $periodfrom_id = $_POST['periodfrom_id']; //$periodto_id=$_POST['periodto_id']; $financialyearfrom_id = $_POST['financialyearfrom_id']; $reportlevel = $_POST['reportlevel']; $showzero = $_POST['showzero']; $showaccountcode = $_POST['showaccountcode']; $period = new Period(); if ($period->fetchPeriod($periodfrom_id)) { $header[1] = $period->period_name; } else { $header[1] = "Unknown"; } $financialyear = new FinancialYear(); if ($financialyear->fetchFinancialYear($financialyearfrom_id)) { $header[2] = $financialyear->financialyear_name; } else { $header[2] = "Unknown"; } $periodrange = $financialyear->getPeriodRange($financialyearfrom_id); /* if($period->fetchPeriod($periodto_id)) $header[2]=$period->period_name; else $header[2]="Unknown"; */ if ($showaccountcode == "on") { $orderby = "ORDER BY ac.classtype,a.accountcode_full"; } else { $orderby = "ORDER BY ac.classtype,a.accountcode_full,a.placeholder desc,a.accounts_name";
} } else { // if the token is not valid or the token is expired, it back to previous form with previous inputed data $log->showLog(1, "Error: Record cannot create, due to token expired!"); $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"); } break; //when user request to edit particular organization //when user request to edit particular organization case "edit": if ($o->fetchFinancialYear($o->financialyear_id)) { //create a new token for editing a form $o->periodtable = $l->showFinancialYearLine($o->financialyear_id); $token = $s->createToken($tokenlife, "CREATE_ACG"); $o->orgctrl = $ctrl->selectionOrg($o->createdby, $o->organization_id, 'N', "", 'Y'); $o->periodfromctrl = $simbizctrl->getSelectPeriod(0, 'Y', "", "periodfrom_id"); $o->periodtoctrl = $simbizctrl->getSelectPeriod(0, 'Y', "", "periodto_id"); $o->getInputForm("edit", $o->financialyear, $token); $o->showFinancialYearTable("WHERE f.financialyear_id>0 and f.organization_id={$defaultorganization_id}", "ORDER BY f.financialyear_name,f.defaultlevel"); } else { //if can't find particular organization from database, return error message redirect_header("financialyear.php", 3, "Some error on viewing your financialyear data, probably database corrupted"); } break; //when user press save for change existing organization data //when user press save for change existing organization data