diff --git a/resources/views/appointment.blade.php b/resources/views/appointment.blade.php index a23570f..c0fae13 100644 --- a/resources/views/appointment.blade.php +++ b/resources/views/appointment.blade.php @@ -61,28 +61,29 @@ @@ -92,7 +93,7 @@ - - + --> @@ -218,9 +218,11 @@ e.preventDefault(); var appointmentId = $(this).data("appointment-id"); - $("#modal").attr("id", "modal-" + appointmentId); + // $("#modal").attr("id", "modal-" + appointmentId); $('#appointment-form input[name="appointment_id"]').val(appointmentId); - $("#modal-" + appointmentId).modal("show"); + // $("#modal-" + appointmentId).modal("show"); + $("#modal").modal("show"); + // showAppointmentForm(appointmentId); }); @@ -235,7 +237,7 @@ function showAppointmentForm(appointmentId){ // $("#appointmentModal").modal(); - //show Appointment booking form + // show Appointment booking form // Reset the form // $('#appointment-form')[0].reset(); @@ -250,15 +252,16 @@ function submitAppointment(event){ event.preventDefault(); $.ajax({ - url: "/appointment_submit", - type: "post", - data: $("form").serialize(), - success: function(response) { - console.log(response.appointment_detail); - // Handle the success response - // e.g. close the modal, show a success message, etc. - } - }); + url: "/appointment_submit", + type: "post", + data: $("form").serialize(), + success: function(response) { + $("#modal").modal("hide"); + alert('Appointment successfuuly booked'); + // Handle the success response + // e.g. close the modal, show a success message, etc. + } + }); }