diff --git a/src/appointment.php b/src/appointment.php index e1324de..7347858 100644 --- a/src/appointment.php +++ b/src/appointment.php @@ -20,14 +20,31 @@ include 'database.php'; $pdo = connectDatabase(); - $events = fetchCalendarEvents($pdo); - if($_SESSION["user_type"] == 2){ - $user = finduser($pdo, $_SESSION["user"]); - } - $holidays = fetchDoctorHolidays($pdo, $user[0][4]); - $calendar_settings = fetchCalendarSettings($pdo, $user[0][4]); - closeDatabase($pdo); ?> + + $user = finduser($pdo, $_SESSION["user"]); + $events = fetchCalendarEvents($pdo, $user[0][4]); + $holidays = fetchDoctorHolidays($pdo, $user[0][4]); + $calendar_settings = fetchCalendarSettings($pdo, $user[0][4]); + +