if ($s->check(true, $token, "CREATE_RCE")) { $o->updatedby = $xoopsUser->getVar('uid'); //get current uid if ($o->updateRaces()) { //if data save successfully redirect_header("races.php?action=edit&races_id={$o->races_id}", $pausetime, "Your data is saved."); } else { redirect_header("races.php?action=edit&races_id={$o->races_id}", $pausetime, "<b style='color:red'>Warning! Can't save '{$o->races_name}', please make sure all value is insert properly.</b>"); } } else { redirect_header("races.php?action=edit&races_id={$o->races_id}", $pausetime, "<b style='color:red'>Warning! Can't save the data '{$o->races_name}' due to token expired, please reenter data after form refresh.</b>"); } break; case "delete": if ($s->check(true, $token, "CREATE_RCE")) { if ($o->deleteRaces($o->races_id)) { redirect_header("races.php", $pausetime, "Data removed successfully."); } else { redirect_header("races.php?action=edit&races_id={$o->races_id}", $pausetime, "<b style='color:red'>Warning! Can't delete \n\t\t\t\t\tdata from database due to dependency issue.</b>"); } } else { redirect_header("races.php?action=edit&races_id={$o->races_id}", $pausetime, "<b style='color:red'>Warning! Can't delete data from database due to token expired.</b>"); } break; default: $token = $s->createToken($tokenlife, "CREATE_RCE"); $o->getInputForm("new", 0, $token); $o->showRacesTable(); break; } echo '</td>';