Ejemplo n.º 1
0
         // 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
 case "update":
     if ($s->check(true, $token, "CREATE_ACG")) {