if ($s->check(false, $token, "CREATE_RCE")) { $o->updatedby = $xoopsUser->getVar('uid'); //get current uid if ($o->updateYear()) { //if data save successfully redirect_header("year.php?action=edit&year_id={$o->year_id}", $pausetime, "Your data is saved."); } else { redirect_header("year.php?action=edit&year_id={$o->year_id}", $pausetime, "<b style='color:red'>Warning! Can't save '{$o->year_name}', please make sure all value is insert properly.</b>"); } } else { redirect_header("year.php?action=edit&year_id={$o->year_id}", $pausetime, "<b style='color:red'>Warning! Can't save the data '{$o->year_name}' due to token expired, please reenter data after form refresh.</b>"); } break; case "delete": if ($s->check(false, $token, "CREATE_RCE")) { if ($o->deleteYear($o->year_id)) { redirect_header("year.php", $pausetime, "Data removed successfully."); } else { redirect_header("year.php?action=edit&year_id={$o->year_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("year.php?action=edit&year_id={$o->year_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->showYearTable(); break; } echo '</td>';