$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'); $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"); } break; //when user request to edit particular organization //when user request to edit particular organization case "edit": if ($o->fetchAccountGroup($o->accountgroup_id)) { //create a new token for editing a form $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("edit", $o->accountgroup, $token); $o->showAccountGroupTable("WHERE accountgroup_id>0 and organization_id={$defaultorganization_id}", "ORDER BY initial,defaultlevel,accountgroup_name"); } else { //if can't find particular organization from database, return error message redirect_header("accountgroup.php", 3, "Some error on viewing your accountgroup 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(false, $token, "CREATE_ACG")) {