From b93df4005bec1abce1b496dc97c5b88edf1f8259 Mon Sep 17 00:00:00 2001 From: coolneng Date: Thu, 25 Jun 2020 21:15:52 +0200 Subject: [PATCH] Move the database logic to appointment_management --- src/appointment.php | 14 ++-------- src/appointment_management.php | 48 ++++++++++++++++++++++++++++++++++ src/calendar.js | 13 ++++----- src/calendar.php | 2 +- src/database.php | 2 +- 5 files changed, 57 insertions(+), 22 deletions(-) create mode 100644 src/appointment_management.php diff --git a/src/appointment.php b/src/appointment.php index 7347858..12fdde6 100644 --- a/src/appointment.php +++ b/src/appointment.php @@ -21,13 +21,8 @@ $pdo = connectDatabase(); ?> - - $user = finduser($pdo, $_SESSION["user"]); - $events = fetchCalendarEvents($pdo, $user[0][4]); - $holidays = fetchDoctorHolidays($pdo, $user[0][4]); - $calendar_settings = fetchCalendarSettings($pdo, $user[0][4]); - -
+ +
-
diff --git a/src/appointment_management.php b/src/appointment_management.php new file mode 100644 index 0000000..43101ff --- /dev/null +++ b/src/appointment_management.php @@ -0,0 +1,48 @@ + diff --git a/src/database.php b/src/database.php index 277913c..bcf7c9d 100644 --- a/src/database.php +++ b/src/database.php @@ -187,7 +187,7 @@ function fetchRegions($pdo) return $data; } -function listHolidays($pdo) +function fetchHolidays($pdo) { $query = "SELECT * FROM festivo"; $result = $pdo->prepare($query);