diff --git a/src/appointment.php b/src/appointment.php index 47dc623..f691b4d 100644 --- a/src/appointment.php +++ b/src/appointment.php @@ -74,8 +74,11 @@
- - +
+ + + +
diff --git a/src/appointment_management.php b/src/appointment_management.php index 141df14..30965e2 100644 --- a/src/appointment_management.php +++ b/src/appointment_management.php @@ -45,9 +45,9 @@ function appointmentModification(){ function appointmentDeletion(){ - $id = $_POST["id"]; + $id = $_POST["event_id"]; $pdo = connectDatabase(); - editAppointment($pdo, $id); + deleteAppointment($pdo, $id); closeDatabase($pdo); header('location: appointment.php'); } diff --git a/src/calendar.js b/src/calendar.js index 9c996ba..8e65f5f 100644 --- a/src/calendar.js +++ b/src/calendar.js @@ -24,6 +24,7 @@ eventClick: function(event) { var start = $.fullCalendar.formatDate(event.start, 'HH:mm'); var end = $.fullCalendar.formatDate(event.end, 'HH:mm'); + $("#event_id").val(event.id); $("#event-patient").html("DNI/NIE: " + event.patient); $("#event-description").html("Observaciones: " + event.description); $("#event-start").html("Comienzo: " + start); diff --git a/src/database.php b/src/database.php index 2cd40f0..9757d23 100644 --- a/src/database.php +++ b/src/database.php @@ -420,7 +420,7 @@ function editAppointment($pdo, $data){ function deleteAppointment($pdo, $id){ - $statement = "DELETE FROM cita where id=?"; + $statement = "DELETE FROM cita WHERE id=?"; $pdo->prepare($statement)->execute([$id]); return "Cita borrada con éxito"; }