/** * Handles what happens when user moves to URL/ */ public function addSchedule() { if (isset($_POST['selectExamType']) and isset($_POST['selectSemester'])) { $schedule_model = $this->loadModel('Schedule'); $exam = new Exam(); $exam->setExamType($_POST['selectExamType']); $exam->setLocation($_POST['textLocation']); $exam->setDate($_POST['textDate']); $exam->setTime($_POST['textTime']); $exam->setSemester($_POST['selectSemester']); $exam->setYear($_POST['selectYear']); $schedule_model->createExam($exam); } header('location: ' . URL . 'schedule/index'); }