Browse Source

Scheduler refund amount code disabled and right click disabled and coniditon added in 3rd step of hall booking form

master
Praveenkumartvmalai 1 year ago
parent
commit
267e7fe25e
  1. 24
      src/main/java/com/gcc/communityHall/paymentService/scheduler/PaymentStatusScheduler.java
  2. 12
      src/main/java/com/gcc/communityHall/service/Impl/BookingServiceImpl.java
  3. 156
      src/main/resources/templates/user/hallbookingform.html
  4. 463
      src/main/resources/templates/user/viewhistory.html

24
src/main/java/com/gcc/communityHall/paymentService/scheduler/PaymentStatusScheduler.java

@ -328,21 +328,21 @@ public class PaymentStatusScheduler {
}
//need to be commented
@Transactional
public void intiateRefund(int bookingId, int userId) throws Exception {
List<BookingCalendar> bc = calendarService.getCalendarByBookingId(bookingId);
if (bc != null && bc.isEmpty()) {
String s = paymentGatewayServiceImpl.refundTheAmount(bookingId, userId);
if (s.equals("Refunded")) {
bookingService.updateRefundStatus(bookingId, BookingDetails.RefundStatus.COMPLETED);
}
// @Transactional
// public void intiateRefund(int bookingId, int userId) throws Exception {
// List<BookingCalendar> bc = calendarService.getCalendarByBookingId(bookingId);
// if (bc != null && bc.isEmpty()) {
// String s = paymentGatewayServiceImpl.refundTheAmount(bookingId, userId);
// if (s.equals("Refunded")) {
// bookingService.updateRefundStatus(bookingId, BookingDetails.RefundStatus.COMPLETED);
// }
} else {
bookingService.updateRefundStatus(bookingId, BookingDetails.RefundStatus.FAILURE);
}
// } else {
// bookingService.updateRefundStatus(bookingId, BookingDetails.RefundStatus.FAILURE);
// }
}
// }
}

12
src/main/java/com/gcc/communityHall/service/Impl/BookingServiceImpl.java

@ -626,6 +626,7 @@ public class BookingServiceImpl implements BookingService {
@Override
public Map<String, Object> saveBookingDetails(Map<String, Object> formData) {
Map<String, Object> hs = new HashMap<>();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
BookingDetails bookingDetails = null;
Integer userId = userSession.getUserId();
@ -659,6 +660,16 @@ public class BookingServiceImpl implements BookingService {
bookingDetails.setHallDetails(hallDetails);
String startDate = formData.get("startDate").toString();
LocalDate startD = LocalDate.parse(startDate, formatter);
LocalDate today = LocalDate.now();
LocalDate sixMonthsLater = today.plusMonths(6);
if (startD.isBefore(today)) {
return Collections.singletonMap("status", "pastdate");
} else if (startD.isAfter(sixMonthsLater)) {
return Collections.singletonMap("status", "futuredate");
}
String endDate = formData.get("endDate").toString();
String relation = formData.get("relation").toString();
double days = Double.parseDouble(formData.get("days").toString());
@ -852,7 +863,6 @@ public class BookingServiceImpl implements BookingService {
int i = 0;
String startDateStr = bookingDetails.getStartDate();
String endDateStr = bookingDetails.getEndDate();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDate start = LocalDate.parse(startDateStr, formatter);
LocalDate end = LocalDate.parse(endDateStr, formatter);
int hallId = bookingDetails.getHallDetails().getHallId();

156
src/main/resources/templates/user/hallbookingform.html

@ -930,6 +930,7 @@
bottom: 0;
opacity: 0;
}
to {
bottom: 30px;
opacity: 1;
@ -941,6 +942,7 @@
bottom: 30px;
opacity: 1;
}
to {
bottom: 0;
opacity: 0;
@ -957,6 +959,53 @@
color: white;
}
/* css fror toast */
/* Toast styling */
#toast {
visibility: hidden;
min-width: 200px;
margin-left: -100px;
background: #333;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 10px;
position: fixed;
z-index: 9999;
left: 50%;
bottom: 30px;
font-size: 14px;
}
#toast.show {
visibility: visible;
animation: fadein 0.5s, fadeout 0.5s 2s;
}
@keyframes fadein {
from {
bottom: 10px;
opacity: 0;
}
to {
bottom: 30px;
opacity: 1;
}
}
@keyframes fadeout {
from {
bottom: 30px;
opacity: 1;
}
to {
bottom: 10px;
opacity: 0;
}
}
</style>
<body>
@ -1226,7 +1275,8 @@
<button type="button"
class="btn btn-primary btn-square-md"
style="background-color:#008000;"></button>
<p style="margin-left: -7px;">Day(Available)</p>
<p style="margin-left: -7px;">Day(Available)
</p>
</div>
<div class="col col-lg-2 col-sm-2 col-md-2">
<button type="button"
@ -1239,8 +1289,7 @@
<button type="button"
class="btn btn-primary btn-square-md"
style="background-color:#FFEA00;"></button>
<p
style="margin-left: -8px;">
<p style="margin-left: -8px;">
Evening(Available)</p>
</div>
<div class="col col-lg-2 col-sm-2 col-md-2">
@ -1484,18 +1533,21 @@
style="background-color: rgb(21,69,93); position: relative;">
<img src="media/images/logo-sm.png" alt="Logo"
style="position: absolute; left: 10px; top: 7px; height: 30px;">
<h6 style="color: white; text-align: center; line-height: 3.1;">
<h6
style="color: white; text-align: center; line-height: 3.1;">
Payment Details for Confirmation
<span id="timer"
style="display: inline; float:right;margin-right:10px;">
<span class="sand-clock"></span> <!-- Hourglass icon -->
<span class="sand-clock"></span>
<!-- Hourglass icon -->
<span id="timerText">Payment Closes in 15:00</span>
<!-- Timer text -->
</span>
</h6>
</div>
<div class="col-md-12">
<table class="table table-bordered center-table table-align">
<table
class="table table-bordered center-table table-align">
<tbody>
<tr>
<td class="td-align"><strong>Full Name:</strong>
@ -1520,7 +1572,8 @@
<tr>
<td class="td-align"><strong>Hall
Name:</strong></td>
<td class="td-align" style="text-wrap:wrap;">
<td class="td-align"
style="text-wrap:wrap;">
<span id="selecthall_td"></span>
</td>
</tr>
@ -1613,9 +1666,11 @@
</td>
<td><span id="rentamount_td">0</span></td>
</tr>
<tr id="additionalcharges_tr" style="display:none">
<tr id="additionalcharges_tr"
style="display:none">
<td class="td-align">
<strong>Additional charges (Cleaning + P.A.
<strong>Additional charges (Cleaning +
P.A.
System + E.B):</strong>
</td>
<td><span id="additionalcharges_td">0</span>
@ -1975,6 +2030,24 @@
}).then(function () {
location.reload(); // Example: reload the page
});
} else if (response.status === 'pastdate') {
Swal.fire({
icon: 'error',
title: 'Past Date',
text: 'Start date cannot be in the past',
confirmButtonText: 'OK'
}).then(function () {
location.reload();
});
} else if (response.status === 'futuredate') {
Swal.fire({
icon: 'error',
title: 'Future Date',
text: 'Start date cannot be more than 6 months from today',
confirmButtonText: 'OK'
}).then(function () {
location.reload();
});
} else {
userId = response.userId;
bookingId = response.bookingId;
@ -3333,6 +3406,71 @@
}
timerElement.innerHTML = "Timer Stopped"; // Optionally update the message
}
(function () {
function block(e) {
e.preventDefault();
e.stopPropagation();
return false;
}
// Disable right‑click
window.addEventListener('contextmenu', block, true);
// 2) Disable drag (images/text) — optional
// window.addEventListener('dragstart', block, true);
// 3) Disable common DevTools / view‑source shortcuts
window.addEventListener('keydown', function (e) {
// Normalize: e.key is a string like 'F12' or 'I'; keyCode is a number (deprecated but useful for older browsers)
var key = e.key;
var code = e.keyCode || e.which;
// F12 (DevTools)
if (key === 'F12' || code === 123) return block(e);
// Ctrl+Shift+I/J/C (DevTools / Inspect / Console)
if (e.ctrlKey && e.shiftKey && (key === 'I' || key === 'J' || key === 'C' || code === 73 || code === 74 || code === 67)) return block(e);
// Ctrl+U (view source)
if (e.ctrlKey && (key === 'u' || key === 'U' || code === 85)) return block(e);
// Ctrl+S (save page)
if (e.ctrlKey && (key === 's' || key === 'S' || code === 83)) return block(e);
// Firefox specific shortcuts
// Ctrl+Shift+K opens Web Console
if (e.ctrlKey && e.shiftKey && (key === 'K' || code === 75)) return block(e);
// Ctrl+Shift+E opens Network Monitor
if (e.ctrlKey && e.shiftKey && (key === 'E' || code === 69)) return block(e);
}, true);
let threshold = 160;
setInterval(function () {
if (window.outerHeight - window.innerHeight > threshold ||
window.outerWidth - window.innerWidth > threshold) {
document.body.innerHTML = "<h1 style='color:red;text-align:center;margin-top:20%'>DevTools detected. Page disabled.</h1>";
}
}, 500);
})();
function showToast(msg) {
var toast = document.getElementById("toast");
toast.textContent = msg;
toast.className = "show";
setTimeout(function () {
toast.className = toast.className.replace("show", "");
}, 2500);
}
$(document).on("contextmenu",
"#ui-datepicker-div td, #ui-datepicker-div a, #ui-datepicker-div .ui-datepicker-title", function (e) {
e.preventDefault();
showToast("Right-click disabled");
return false;
});
</script>
</body>
</html>

463
src/main/resources/templates/user/viewhistory.html

@ -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>

Loading…
Cancel
Save