|
|
|
@ -504,6 +504,21 @@ |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
|
|
|
|
|
.otp-input-box { |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
gap: 10px; |
|
|
|
margin: 20px 0; |
|
|
|
} |
|
|
|
|
|
|
|
.otp-input-box .otp-input { |
|
|
|
width: 40px; |
|
|
|
height: 40px; |
|
|
|
text-align: center; |
|
|
|
font-size: 16px; |
|
|
|
border: 1px solid #ccc; |
|
|
|
border-radius: 5px; |
|
|
|
} |
|
|
|
</style> |
|
|
|
|
|
|
|
<body> |
|
|
|
@ -1322,8 +1337,7 @@ |
|
|
|
<embed id="filePreview" src="" width="100%" height="600px"> |
|
|
|
</div> |
|
|
|
<div class="modal-footer"> |
|
|
|
<button type="button" class="btn btn-secondary" |
|
|
|
data-bs-dismiss="modal">Close |
|
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -1342,7 +1356,7 @@ |
|
|
|
<br> |
|
|
|
<div style="margin-bottom: -59px; margin-left: -185px;"> |
|
|
|
<!-- Adding margin-top for separation --> |
|
|
|
<p style="font-size: 14px; color: #6c757d;">Note: Only the Start Date can be |
|
|
|
<p style="font-size: 14px; color: #6c757d;"> the Start Date can be |
|
|
|
changed.</p> |
|
|
|
</div> |
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" |
|
|
|
@ -1430,8 +1444,7 @@ |
|
|
|
</div> |
|
|
|
<!-- Modal Footer --> |
|
|
|
<div class="modal-footer"> |
|
|
|
<button type="button" class="btn btn-secondary" |
|
|
|
data-bs-dismiss="modal">Close |
|
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close |
|
|
|
</button> |
|
|
|
<button type="button" class="btn btn-primary" onclick="Reschedule()">Save |
|
|
|
Changes |
|
|
|
@ -1441,6 +1454,61 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- Reschedule OTP Verification Modal --> |
|
|
|
<div class="modal fade" id="rescheduleOtpModal" tabindex="-1" role="dialog" |
|
|
|
aria-labelledby="rescheduleOtpModalLabel" aria-hidden="true"> |
|
|
|
<div class="modal-dialog" role="document"> |
|
|
|
<div class="modal-content"> |
|
|
|
<div class="modal-header"> |
|
|
|
<h6 class="modal-title m-0" id="rescheduleOtpModalLabel">Reschedule Verification |
|
|
|
</h6> |
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" |
|
|
|
aria-label="Close"></button> |
|
|
|
</div> |
|
|
|
<div class="modal-body"> |
|
|
|
<div class="row"> |
|
|
|
<div class="mb-3 text-center"> |
|
|
|
<img src="media/images/mobileotp.png" width="50%" alt="Mobileotp"> |
|
|
|
</div> |
|
|
|
<div class="mb-0 text-center"> |
|
|
|
<h4>OTP Verification</h4> |
|
|
|
<p class="text-mute">Enter the OTP sent to <b class="text-info" |
|
|
|
id="rescheduleMobileTxt"></b></p> |
|
|
|
<p class="text-danger" id="rescheduleOtpError"></p> |
|
|
|
</div> |
|
|
|
<div class="mb-3 text-center"> |
|
|
|
<div class="otp-input-box"> |
|
|
|
<input type="text" maxlength="1" class="otp-input" id="rescheduleOtp1" |
|
|
|
required /> |
|
|
|
<input type="text" maxlength="1" class="otp-input" id="rescheduleOtp2" |
|
|
|
required /> |
|
|
|
<input type="text" maxlength="1" class="otp-input" id="rescheduleOtp3" |
|
|
|
required /> |
|
|
|
<input type="text" maxlength="1" class="otp-input" id="rescheduleOtp4" |
|
|
|
required /> |
|
|
|
<input type="text" maxlength="1" class="otp-input" id="rescheduleOtp5" |
|
|
|
required /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="mb-3 text-center"> |
|
|
|
<div id="rescheduleResendContainer"> |
|
|
|
<p class="mb-0">Didn't receive OTP?</p> |
|
|
|
<p class="mb-0 text-info" id="rescheduleResendLink">Please wait..<span |
|
|
|
id="rescheduleCountdown">60</span>s</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="modal-footer"> |
|
|
|
<button type="button" class="btn btn-secondary btn-sm" |
|
|
|
data-bs-dismiss="modal">Close</button> |
|
|
|
<button type="button" class="btn btn-primary btn-sm" |
|
|
|
onclick="verifyRescheduleOtp()">Verify OTP</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- Tracking Log Modal --> |
|
|
|
<!-- Tracking Modal --> |
|
|
|
<div class="modal fade" id="trackingModal" tabindex="-1" aria-labelledby="trackingModalLabel" |
|
|
|
@ -1482,8 +1550,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="modal-footer"> |
|
|
|
<button type="button" class="btn btn-secondary" |
|
|
|
data-bs-dismiss="modal">Close |
|
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close |
|
|
|
</button> |
|
|
|
<button type="button" class="btn btn-primary" id="submitNocButton">Submit</button> |
|
|
|
</div> |
|
|
|
@ -1541,8 +1608,7 @@ |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="modal-footer"> |
|
|
|
<button type="button" class="btn btn-secondary" |
|
|
|
data-bs-dismiss="modal">Close |
|
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -1564,6 +1630,16 @@ |
|
|
|
<script src="https://cdn.datatables.net/buttons/2.4.1/js/dataTables.buttons.min.js"></script> |
|
|
|
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script> |
|
|
|
<script type="text/javascript"> |
|
|
|
// Reschedule variables |
|
|
|
var rescheduleBookingId = null; |
|
|
|
var rescheduleStartDate = null; |
|
|
|
var rescheduleEndDate = null; |
|
|
|
var rescheduleMobileNumber = null; |
|
|
|
var rescheduleHallId = null; |
|
|
|
var rescheduleStartingSlot = null; |
|
|
|
var rescheduleEndingSlot = null; |
|
|
|
var rescheduleReason = null; |
|
|
|
|
|
|
|
$(document).ready(function () { |
|
|
|
$('#detailstable').DataTable({ |
|
|
|
responsive: true, |
|
|
|
@ -2177,6 +2253,43 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function resetRescheduleOTPSection() { |
|
|
|
// Hide OTP section |
|
|
|
var otpSection = document.getElementById("otpSection"); |
|
|
|
if (otpSection) { |
|
|
|
otpSection.style.display = "none"; |
|
|
|
} |
|
|
|
|
|
|
|
// Show reschedule button and hide verify button |
|
|
|
var rescheduleBtn = document.getElementById("rescheduleBtn"); |
|
|
|
var verifyOtpBtn = document.getElementById("verifyOtpBtn"); |
|
|
|
|
|
|
|
if (rescheduleBtn) { |
|
|
|
rescheduleBtn.style.display = "inline-block"; |
|
|
|
} |
|
|
|
if (verifyOtpBtn) { |
|
|
|
verifyOtpBtn.style.display = "none"; |
|
|
|
} |
|
|
|
|
|
|
|
// Clear OTP input fields |
|
|
|
for (let i = 1; i <= 6; i++) { |
|
|
|
var otpField = document.getElementById("otp" + i); |
|
|
|
if (otpField) { |
|
|
|
otpField.value = ""; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Reset variables |
|
|
|
rescheduleBookingId = null; |
|
|
|
rescheduleStartDate = null; |
|
|
|
rescheduleEndDate = null; |
|
|
|
rescheduleMobileNumber = null; |
|
|
|
rescheduleHallId = null; |
|
|
|
rescheduleStartingSlot = null; |
|
|
|
rescheduleEndingSlot = null; |
|
|
|
rescheduleReason = null; |
|
|
|
} |
|
|
|
|
|
|
|
function openRescheduleModal(bookingId, startDate, endDate, noOfDays, hallId, startingSlot, endingSlot, reason) { |
|
|
|
// Function to map slot values to their text representation |
|
|
|
function getSlotText(slot) { |
|
|
|
@ -2205,10 +2318,19 @@ |
|
|
|
document.getElementById("startingSlotText").value = getSlotText(startingSlot); |
|
|
|
document.getElementById("endingSlotText").value = getSlotText(endingSlot); |
|
|
|
|
|
|
|
// Store booking details for OTP verification |
|
|
|
rescheduleBookingId = bookingId; |
|
|
|
rescheduleStartDate = startDate; |
|
|
|
rescheduleEndDate = endDate; |
|
|
|
rescheduleHallId = hallId; |
|
|
|
rescheduleStartingSlot = startingSlot; |
|
|
|
rescheduleEndingSlot = endingSlot; |
|
|
|
rescheduleReason = reason; |
|
|
|
|
|
|
|
// Optionally, fetch and update calendar or availability based on hallId |
|
|
|
getBookingCalendar(hallId, reason); |
|
|
|
|
|
|
|
// Show the modal |
|
|
|
// Show the date change modal |
|
|
|
$('#bookingRescheduleModal').modal('show'); |
|
|
|
} |
|
|
|
|
|
|
|
@ -2314,6 +2436,40 @@ |
|
|
|
updateEndDate(selectedDate, noofdays, startingSlot, endingSlot); |
|
|
|
}); |
|
|
|
|
|
|
|
// Handle changes in the start date input |
|
|
|
// $("#startDateInput").on("change", function () { |
|
|
|
// const selectedDate = $(this).val(); |
|
|
|
// const bookingStatus = window.bookingResponse[selectedDate] || {}; |
|
|
|
// const currentHours = new Date().getHours(); |
|
|
|
// const currentDateString = $("#serverDate").val(); |
|
|
|
|
|
|
|
// $("#startPeriodDropdown option").prop("disabled", false); |
|
|
|
// $("#startPeriodDropdown").val(0).prop("disabled", false); |
|
|
|
// $("#endPeriodDropdown").val(0).prop("disabled", false); |
|
|
|
// $("#numDaysCount").val(''); |
|
|
|
// validateForm(); |
|
|
|
|
|
|
|
// // Disable Morning slot for today between 6 AM and 2 PM |
|
|
|
// if (selectedDate === currentDateString && currentHours >= 6 && currentHours < 14) { |
|
|
|
// $("#startPeriodDropdown option[value='1']").prop("disabled", true); |
|
|
|
|
|
|
|
// Swal.fire({ |
|
|
|
// title: 'Morning Slot Not Available', |
|
|
|
// text: 'You can only book Evening Slot for today between 6 AM and 2 PM.', |
|
|
|
// icon: 'warning', |
|
|
|
// confirmButtonText: 'OK' |
|
|
|
// }); |
|
|
|
// } else { |
|
|
|
// if ((selectedDate === currentDateString && currentHours >= 6) || bookingStatus[0]) { |
|
|
|
// $("#startPeriodDropdown option[value='1']").prop("disabled", true); |
|
|
|
// } else if (bookingStatus[1]) { |
|
|
|
// $("#startPeriodDropdown option[value='2']").prop("disabled", true); |
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
// updateEndDate(selectedDate); |
|
|
|
// }); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
function handleBookingStatus(bookingStatus, defaultMessage) { |
|
|
|
@ -2614,72 +2770,282 @@ |
|
|
|
} |
|
|
|
|
|
|
|
function Reschedule() { |
|
|
|
// Retrieve values from modal inputs |
|
|
|
var bookingId = document.getElementById("bookingId").value; |
|
|
|
var startDate = document.getElementById("startDateInput").value; |
|
|
|
var endDate = document.getElementById("endDateInput").value; |
|
|
|
var originalStartDate = document.getElementById("startDatetext").value; |
|
|
|
// Get mobile number and show OTP modal for verification |
|
|
|
$.ajax({ |
|
|
|
type: "GET", |
|
|
|
url: '/communityhall/user/api/viewAllBookingDetails', |
|
|
|
data: { bookingId: rescheduleBookingId }, |
|
|
|
success: function (response) { |
|
|
|
rescheduleMobileNumber = response.users.mobileNo; |
|
|
|
|
|
|
|
// Check if the rescheduled start date is the same as the original booked start date |
|
|
|
if (startDate === originalStartDate) { |
|
|
|
// Show mobile number in OTP modal |
|
|
|
document.getElementById("rescheduleMobileTxt").textContent = rescheduleMobileNumber; |
|
|
|
|
|
|
|
// Clear any previous OTP errors |
|
|
|
document.getElementById("rescheduleOtpError").textContent = ""; |
|
|
|
|
|
|
|
// Clear OTP inputs |
|
|
|
for (let i = 1; i <= 5; i++) { |
|
|
|
document.getElementById("rescheduleOtp" + i).value = ""; |
|
|
|
} |
|
|
|
|
|
|
|
// Close date change modal and show OTP modal |
|
|
|
$('#bookingRescheduleModal').modal('hide'); |
|
|
|
$('#rescheduleOtpModal').modal('show'); |
|
|
|
|
|
|
|
// Send OTP immediately |
|
|
|
sendRescheduleOTP(rescheduleMobileNumber); |
|
|
|
}, |
|
|
|
error: function () { |
|
|
|
Swal.fire({ |
|
|
|
icon: 'warning', |
|
|
|
title: 'Warning', |
|
|
|
text: 'Your Rescheduled Start Date is the same as Your booking Start Date. Please change the date.', |
|
|
|
icon: 'error', |
|
|
|
title: 'Error', |
|
|
|
text: 'Failed to get booking details. Please try again.', |
|
|
|
showConfirmButton: true |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!endDate) { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
function sendRescheduleOTP(mobileNumber) { |
|
|
|
$.ajax({ |
|
|
|
type: "GET", |
|
|
|
url: "/communityhall/user/api/sendOTP", |
|
|
|
data: { |
|
|
|
mobileNo: mobileNumber, |
|
|
|
purpose: "reschedule" |
|
|
|
}, |
|
|
|
success: function (response) { |
|
|
|
// Start countdown timer |
|
|
|
startRescheduleCountdown(); |
|
|
|
}, |
|
|
|
error: function () { |
|
|
|
Swal.fire({ |
|
|
|
icon: 'error', |
|
|
|
title: 'Error', |
|
|
|
text: 'End Date is Empty! Please check your Start Date', // Error message from backend |
|
|
|
text: 'Failed to send OTP. Please try again.', |
|
|
|
showConfirmButton: true |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
function startRescheduleCountdown() { |
|
|
|
var resendTimeout; |
|
|
|
var resendLink = $("#rescheduleResendLink"); |
|
|
|
$("#rescheduleResendLink").html('<a href="#" id="rescheduleResendLink" class="text-info" onclick="return resendRescheduleOTP();">Resend OTP</a>'); |
|
|
|
var countdown = $("#rescheduleCountdown"); |
|
|
|
|
|
|
|
function startCountdown() { |
|
|
|
var timeleft = 60; |
|
|
|
countdown.text(timeleft); |
|
|
|
|
|
|
|
resendTimeout = setInterval(function () { |
|
|
|
timeleft--; |
|
|
|
countdown.text(timeleft); |
|
|
|
|
|
|
|
if (timeleft <= 0) { |
|
|
|
clearInterval(resendTimeout); |
|
|
|
$("#rescheduleResendLink").html('<a href="#" id="rescheduleResendLink" class="text-info" onclick="return sendRescheduleOTP(' + rescheduleMobileNumber + ');">Resend OTP</a>'); |
|
|
|
} |
|
|
|
}, 1000); |
|
|
|
} |
|
|
|
|
|
|
|
startCountdown(); |
|
|
|
} |
|
|
|
|
|
|
|
function resendRescheduleOTP() { |
|
|
|
if (rescheduleMobileNumber) { |
|
|
|
sendRescheduleOTP(rescheduleMobileNumber); |
|
|
|
// Restart countdown timer after resending OTP |
|
|
|
startRescheduleCountdown(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function verifyRescheduleOtp() { |
|
|
|
// Get all the input fields with class `otp-input` |
|
|
|
var otpInputs = $('.otp-input'); |
|
|
|
|
|
|
|
// Get the OTP value as a string |
|
|
|
var otpValue = ''; |
|
|
|
otpInputs.each(function () { |
|
|
|
otpValue += $(this).val(); |
|
|
|
}); |
|
|
|
|
|
|
|
if (otpValue.length !== 5) { |
|
|
|
document.getElementById("rescheduleOtpError").textContent = "Please enter complete OTP"; |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
// Verify OTP |
|
|
|
$.ajax({ |
|
|
|
type: "GET", |
|
|
|
url: "/communityhall/user/api/verifyofficialOTP", |
|
|
|
data: { |
|
|
|
otp: otpValue |
|
|
|
}, |
|
|
|
dataType: 'text', |
|
|
|
success: function (response) { |
|
|
|
if (response.trim() === "Success") { |
|
|
|
// OTP verified successfully, close OTP modal and proceed with reschedule |
|
|
|
$('#rescheduleOtpModal').modal('hide'); |
|
|
|
validateDatesAndReschedule(); |
|
|
|
} else { |
|
|
|
document.getElementById("rescheduleOtpError").textContent = "OTP is Incorrect!!!"; |
|
|
|
// Clear OTP inputs |
|
|
|
for (let i = 1; i <= 5; i++) { |
|
|
|
document.getElementById("rescheduleOtp" + i).value = ""; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
error: function () { |
|
|
|
document.getElementById("rescheduleOtpError").textContent = "Error verifying OTP. Please try again."; |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function proceedWithReschedule() { |
|
|
|
// Debug: Log the data being sent |
|
|
|
console.log('Reschedule data:', { |
|
|
|
bookingId: rescheduleBookingId, |
|
|
|
startDate: rescheduleStartDate, |
|
|
|
endDate: rescheduleEndDate |
|
|
|
}); |
|
|
|
|
|
|
|
// Ajax POST request |
|
|
|
$.ajax({ |
|
|
|
type: "POST", |
|
|
|
url: "/communityhall/user/api/reschedule-dates", |
|
|
|
data: { |
|
|
|
bookingId: bookingId, |
|
|
|
startDate: startDate, |
|
|
|
endDate: endDate |
|
|
|
bookingId: rescheduleBookingId, |
|
|
|
startDate: rescheduleStartDate, |
|
|
|
endDate: rescheduleEndDate |
|
|
|
}, |
|
|
|
success: function (response) { |
|
|
|
// Handle success response |
|
|
|
Swal.fire({ |
|
|
|
icon: 'success', |
|
|
|
title: 'Success', |
|
|
|
text: response, // Success message from backend |
|
|
|
showConfirmButton: false, |
|
|
|
timer: 1500 |
|
|
|
}).then(function () { |
|
|
|
// Optionally reload page or update UI |
|
|
|
location.reload(); // Example: reload the page |
|
|
|
text: 'Booking rescheduled successfully!', |
|
|
|
showConfirmButton: true |
|
|
|
}).then((result) => { |
|
|
|
if (result.isConfirmed) { |
|
|
|
// Close modal and reload page |
|
|
|
$('#bookingRescheduleModal').modal('hide'); |
|
|
|
location.reload(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
error: function (xhr, status, error) { |
|
|
|
if (xhr.responseText.includes("Dates are already occupied")) { |
|
|
|
console.error('Reschedule API Error:', { |
|
|
|
status: xhr.status, |
|
|
|
statusText: xhr.statusText, |
|
|
|
responseText: xhr.responseText, |
|
|
|
error: error |
|
|
|
}); |
|
|
|
|
|
|
|
let errorMessage = 'Failed to reschedule booking. Please try again.'; |
|
|
|
|
|
|
|
if (xhr.responseText) { |
|
|
|
try { |
|
|
|
const errorData = JSON.parse(xhr.responseText); |
|
|
|
errorMessage = errorData.message || errorData.error || errorMessage; |
|
|
|
} catch (e) { |
|
|
|
errorMessage = xhr.responseText || errorMessage; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Swal.fire({ |
|
|
|
icon: 'error', |
|
|
|
title: 'Error', |
|
|
|
text: 'Dates are already occupied. Please select another date.', // Error message from backend |
|
|
|
text: errorMessage, |
|
|
|
showConfirmButton: true |
|
|
|
}); |
|
|
|
} else { |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
function validateDatesAndReschedule() { |
|
|
|
// Retrieve values from modal inputs |
|
|
|
|
|
|
|
var startDate = document.getElementById("startDateInput").value; |
|
|
|
var endDate = document.getElementById("endDateInput").value; |
|
|
|
var originalStartDate = document.getElementById("startDatetext").value; |
|
|
|
|
|
|
|
// Debug: Log the retrieved dates |
|
|
|
console.log('Retrieved dates:', { |
|
|
|
startDate: startDate, |
|
|
|
endDate: endDate, |
|
|
|
originalStartDate: originalStartDate |
|
|
|
}); |
|
|
|
|
|
|
|
// Check if the rescheduled start date is the same as the original booked start date |
|
|
|
if (startDate === originalStartDate) { |
|
|
|
Swal.fire({ |
|
|
|
icon: 'warning', |
|
|
|
title: 'Warning', |
|
|
|
text: 'Your Rescheduled Start Date is the same as Your booking Start Date. Please change the date.', |
|
|
|
showConfirmButton: true |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!endDate) { |
|
|
|
Swal.fire({ |
|
|
|
icon: 'error', |
|
|
|
title: 'Error', |
|
|
|
text: 'An error occurred while rescheduling your booking. Please try again.', // General error message |
|
|
|
text: 'End Date is Empty! Please check your Start Date', |
|
|
|
showConfirmButton: true |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Store the validated dates |
|
|
|
rescheduleStartDate = startDate; |
|
|
|
rescheduleEndDate = endDate; |
|
|
|
|
|
|
|
// Debug: Log the final dates being sent |
|
|
|
console.log('Final reschedule dates:', { |
|
|
|
startDate: rescheduleStartDate, |
|
|
|
endDate: rescheduleEndDate, |
|
|
|
bookingId: rescheduleBookingId |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
// Proceed with reschedule |
|
|
|
proceedWithReschedule(); |
|
|
|
} |
|
|
|
|
|
|
|
$(document).ready(function () { |
|
|
|
@ -2838,6 +3204,23 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// OTP input navigation for reschedule modal |
|
|
|
$('.otp-input').on('keyup', function (e) { |
|
|
|
var $this = $(this); |
|
|
|
if ($this.val().length === 1) { |
|
|
|
$this.next('.otp-input').focus(); |
|
|
|
} |
|
|
|
if ($this.val().length === 0) { |
|
|
|
$this.prev('.otp-input').focus(); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
// Clear OTP inputs when OTP modal is shown |
|
|
|
$('#rescheduleOtpModal').on('shown.bs.modal', function () { |
|
|
|
$('.otp-input').val(''); |
|
|
|
$('#rescheduleOtpError').text(''); |
|
|
|
}); |
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
</div> |
|
|
|
|