本文整理匯總了PHP中Term::updateName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Term::updateName方法的具體用法?PHP Term::updateName怎麽用?PHP Term::updateName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Term
的用法示例。
在下文中一共展示了Term::updateName方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: header
$general->loggedOutProtect();
// redirect if user elevation is not that of secretary or admin
if ($user->isTutor()) {
header('Location: ' . BASE_URL . "error-403");
exit;
}
try {
$terms = TermFetcher::retrieveAll();
if (isBtnUpdatePrsd()) {
$updateDone = false;
$termId = $_POST['updateTermIdModal'];
$termName = $_POST['nameUpdate'];
if (($course = getTerm($termId, $terms)) === false) {
throw new Exception("Data tempering detected. Aborting.");
}
$updateDone = $updateDone || Term::updateName($termId, $_POST['nameUpdate'], $course[TermFetcher::DB_COLUMN_NAME]);
$updateDone = $updateDone || Term::updateStartingDate($termId, $_POST['dateStartUpdate'], $course[TermFetcher::DB_COLUMN_START_DATE]);
$updateDone = $updateDone || Term::updateEndingDate($termId, $_POST['dateEndUpdate'], $course[TermFetcher::DB_COLUMN_END_DATE]);
if (!$updateDone) {
throw new Exception("No new data inputted. Process aborted.");
}
header('Location: ' . BASE_URL . 'academia/terms/success');
exit;
} else {
if (isBtnCreatePrsd()) {
Term::create($_POST['termName'], $_POST['dateTimePickerStart'], $_POST['dateTimePickerEnd']);
header('Location: ' . BASE_URL . 'academia/terms/success');
exit;
} else {
if (isBtnDeletePrsd()) {
Term::delete($_POST['delTermIdModal']);