diff --git a/src/appointment.php b/src/appointment.php index 9c57e56..ba257f8 100644 --- a/src/appointment.php +++ b/src/appointment.php @@ -23,7 +23,6 @@ $pdo = connectDatabase(); $patients = listPatients($pdo); $calendar_settings = fetchCalendarSettings($pdo, $doctor); - $holidays = listHolidays($pdo); ?>
@@ -57,7 +56,7 @@ diff --git a/src/database.php b/src/database.php index 2c6bdd6..8fa853a 100644 --- a/src/database.php +++ b/src/database.php @@ -346,7 +346,9 @@ function fetchDoctorHolidays($pdo, $doctor) function createAppointment($pdo, $data){ $query = "INSERT INTO cita (fecha, hora, duracion, medico, observaciones, paciente) VALUES (?,?,?,?,?,?)"; - $pdo->prepare($query)->execute([$data["fecha"], $data["hora"], $data["duracion"], - $data["medico"], $data["observaciones"], $data["paciente"]]); + $result = $pdo->prepare($query); + $result->execute([$data["fecha"], $data["hora"], $data["duracion"], + $data["doctor"], $data["observaciones"], $data["paciente"]]); + $result->debugDumpParams(); return "Cita creada con éxito"; }