<?php require __DIR__ . '/../app/init.php'; $general->loggedOutProtect(); $section = "appointments"; /** * @param $studentsAppointmentData * * @return bool */ function reportsHaveBeenCrtd($studentsAppointmentData) { return $studentsAppointmentData[0][AppointmentHasStudentFetcher::DB_COLUMN_REPORT_ID] !== null; } try { if (!isUrlValid() || $user->isTutor() && !Tutor::hasAppointmentWithId($user->getId(), $_GET['appointmentId'])) { header('Location: ' . BASE_URL . "error-403"); exit; } date_default_timezone_set('Europe/Athens'); $pageTitle = "Single Appointment"; $appointmentId = $_GET['appointmentId']; $studentsAppointmentData = Appointment::getAllStudentsWithAppointment($appointmentId); $terms = TermFetcher::retrieveCurrTerm(); $students = StudentFetcher::retrieveAll(); $courses = CourseFetcher::retrieveForTerm($studentsAppointmentData[0][AppointmentFetcher::DB_COLUMN_TERM_ID]); $instructors = InstructorFetcher::retrieveAll(); $tutors = TutorFetcher::retrieveAll(); $startDateTime = new DateTime($studentsAppointmentData[0][AppointmentFetcher::DB_COLUMN_START_TIME]); $endDateTime = new DateTime($studentsAppointmentData[0][AppointmentFetcher::DB_COLUMN_END_TIME]); $nowDateTime = new DateTime();