From 637e49f574c1090170a17bdcc3a9ed026f4d09f0 Mon Sep 17 00:00:00 2001 From: Mahesh Sharma Date: Wed, 8 Feb 2023 18:04:14 +0545 Subject: [PATCH] appointment-booked --- resources/views/appointment.blade.php | 49 ++++++++++++++------------- 1 file changed, 26 insertions(+), 23 deletions(-) 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. + } + }); }