Delete appointment from calendar
This commit is contained in:
parent
a772b300df
commit
77a4a5987e
|
@ -74,8 +74,11 @@
|
|||
<div id="event-description"/></div>
|
||||
<div id="event-start"/></div>
|
||||
<div id="event-end"/></div>
|
||||
<form method="post" action="appointment_management.php">
|
||||
<input type="hidden" name="event_id" id="event_id">
|
||||
<button class="create_btn" type="submit" name="edit">Editar</button>
|
||||
<button class="del_btn" type="submit" name="delete">Borrar</button>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
|
|
@ -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("<b>DNI/NIE: </b>" + event.patient);
|
||||
$("#event-description").html("<b>Observaciones: </b>" + event.description);
|
||||
$("#event-start").html("<b>Comienzo: </b>" + start);
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue