} // retrieve courses data only user type is tutor if ($curUser->isTutor()) { $teachingCourses = TutorFetcher::retrieveCurrTermTeachingCourses($curUser->getId()); $allCourses = CourseFetcher::retrieveAll(); $majors = MajorFetcher::retrieveMajors(); $terms = TermFetcher::retrieveCurrTerm(); } if ($curUser->isActive()) { if (isBtnAddTeachingCoursesPrsd()) { Tutor::addCourse($staffId, $_POST['teachingCourses'], $_POST['termId']); header('Location: ' . BASE_URL . 'staff/edit/' . $staffId . '/success'); exit; } else { if (isBtnSubmitReplaceCourse()) { Tutor::updateTeachingCourse($curUser->getId(), $_POST['teachingCourse'], $_POST['hiddenUpdateCourseOldId'], $_POST['termId']); header('Location: ' . BASE_URL . 'staff/edit/' . $staffId . '/success'); exit; } } } if (isSaveBttnProfilePressed()) { $newDataAdded = false; $newFirstName = $_POST['firstName']; $newLastName = $_POST['lastName']; $newEmail = $_POST['email']; $oldFirstName = $curUser->getFirstName(); $oldLastName = $curUser->getLastName(); $oldEmail = $curUser->getEmail(); if (strcmp($newFirstName, $oldFirstName) !== 0) { $user->validateName($newFirstName);