|
|
|
@ -52,6 +52,21 @@ |
|
|
|
.hidden { |
|
|
|
display: none; |
|
|
|
} |
|
|
|
|
|
|
|
.modal-fullscreen-custom { |
|
|
|
max-width: 98% !important; |
|
|
|
width: 98%; |
|
|
|
margin: 0 auto; |
|
|
|
} |
|
|
|
|
|
|
|
/* Ensure second modal is on top of the first modal */ |
|
|
|
.modal-backdrop.show:nth-of-type(2) { |
|
|
|
z-index: 1055 !important; /* slightly above the first modal */ |
|
|
|
} |
|
|
|
|
|
|
|
#showBookingDetails.modal { |
|
|
|
z-index: 1060 !important; /* higher than .modal-backdrop */ |
|
|
|
} |
|
|
|
</style> |
|
|
|
|
|
|
|
<body> |
|
|
|
@ -111,8 +126,24 @@ |
|
|
|
<option value="5" th:selected="${request=='5'}">Hall Booking List</option> |
|
|
|
<option value="6" th:selected="${request=='6'}">Refund Details</option> |
|
|
|
<option value="7" th:selected="${request=='7'}">Total Count</option> |
|
|
|
<option value="9" th:selected="${request=='9'}">Counter Details</option> |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="col-sm-3 mb-2" id="bookingcountbasedonDropdown" style="display: none;"> |
|
|
|
<label class="form-label" for="basedon" >Based On: <span |
|
|
|
class="text-danger">*</span></label> |
|
|
|
<select class="form-control text-center" id="basedon" name="basedon" |
|
|
|
th:value="${basedon}"> |
|
|
|
<option value="">Select</option> |
|
|
|
<option value="zone" th:selected="${basedon == 'zone'}">Zone |
|
|
|
</option> |
|
|
|
<option value="division" th:selected="${basedon == 'division'}">Division |
|
|
|
</option> |
|
|
|
</select> |
|
|
|
<span id="basedonError" class="text-danger"></span> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- UsersDropdown2 --> |
|
|
|
<div class="col-sm-3 mb-2" id="userDropdown2" style="display: none;"> |
|
|
|
<label class="form-label" for="usertype">User Type: </label> |
|
|
|
@ -273,18 +304,6 @@ |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="col-sm-3 mb-2" id="bookingcountbasedonDropdown" style="display: none;"> |
|
|
|
<label class="form-label" for="basedon">Based On: </label> |
|
|
|
<select class="form-control text-center" id="basedon" name="basedon" |
|
|
|
th:value="${basedon}"> |
|
|
|
<option value="">Select</option> |
|
|
|
<option value="zone" th:selected="${basedon == 'zone'}">Zone |
|
|
|
</option> |
|
|
|
<option value="division" th:selected="${basedon == 'division'}">Division |
|
|
|
</option> |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="col-sm-3"> |
|
|
|
<br> |
|
|
|
@ -312,7 +331,6 @@ |
|
|
|
<th>Address</th> |
|
|
|
<th>UserType</th> |
|
|
|
<th>UserStatus</th> |
|
|
|
|
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
<tr th:each="user, iterStat : ${users}"> |
|
|
|
@ -600,7 +618,36 @@ |
|
|
|
</tfoot> |
|
|
|
</table> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!--<div class="table-responsive" id="countertable" th:if="${request == '9'}">--> |
|
|
|
<div class="table-responsive" id="countertable" th:if="${request}==9"> |
|
|
|
<table id="requestTable9" class="table table-striped table-bordered table-hover dataTable" |
|
|
|
role="grid" width="99.5%"> |
|
|
|
<thead class="thead-dark"> |
|
|
|
<tr role="row"> |
|
|
|
<th>S.No</th> |
|
|
|
<th>Counter ID</th> |
|
|
|
<th>Total Bookings</th> |
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
<tbody> |
|
|
|
<tr th:each="counterdata, iterstat : ${counterBookingList}"> |
|
|
|
<td th:text="${iterstat.index + 1}"></td> |
|
|
|
<td th:text="${counterdata[0]}"></td> |
|
|
|
<td> |
|
|
|
<button href="#" |
|
|
|
th:attr="data-counter-id=${counterdata[0]}" |
|
|
|
data-bs-toggle="modal" |
|
|
|
data-bs-target="#bookingModal" |
|
|
|
style="background-color: #2a807f; color: white; border: none; padding: 6px 12px; border-radius: 4px;" |
|
|
|
|
|
|
|
onclick="showCounterTable(this)"> |
|
|
|
<span th:text="${counterdata[1]}"></span> |
|
|
|
</button> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
@ -877,7 +924,7 @@ |
|
|
|
|
|
|
|
<!--Newly added for Reschedule Details--> |
|
|
|
|
|
|
|
<div class="row col-md-12 col-lg-12 col-sm-12" |
|
|
|
<!--<div class="row col-md-12 col-lg-12 col-sm-12" |
|
|
|
id="rescheduleDetails" |
|
|
|
style="display:none;margin-left: 0px;margin-top: -10px"> |
|
|
|
<div class="card-body"> |
|
|
|
@ -916,7 +963,7 @@ |
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div>--> |
|
|
|
|
|
|
|
|
|
|
|
<div class="row col-md-12 col-lg-12 col-sm-12" |
|
|
|
@ -1247,7 +1294,91 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- Modal --> |
|
|
|
<div class="modal fade" id="bookingModal" tabindex="-1" aria-labelledby="bookingModalLabel" aria-hidden="true"> |
|
|
|
<div class="modal-dialog modal-xl modal-dialog-scrollable"> |
|
|
|
<div class="modal-content"> |
|
|
|
<div class="modal-header"> |
|
|
|
<h5 class="modal-title">Hall-wise Booking Details</h5> |
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> |
|
|
|
</div> |
|
|
|
<div class="modal-body"> |
|
|
|
<!-- |
|
|
|
<table id="modalBookingTable" class="table table-bordered table-striped dataTable" style="width: 100%;"> |
|
|
|
--> |
|
|
|
<table id="modalBookingTable" class="table table-striped table-bordered table-hover dataTable" |
|
|
|
role="grid" width="99.5%"> |
|
|
|
<input type="hidden" id="hallBookingJsonInput" th:value="${hallBookingJson}"> |
|
|
|
|
|
|
|
<thead> |
|
|
|
<tr> |
|
|
|
<th>S.No</th> |
|
|
|
<th>Zone</th> |
|
|
|
<th>Division</th> |
|
|
|
<th>Hall Name</th> |
|
|
|
<th>Total Bookings</th> |
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
<tbody id="modalBookingDetails"></tbody> |
|
|
|
</table> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="modal fade" id="hallDetailModal" tabindex="-1" aria-hidden="true"> |
|
|
|
<div class="modal-dialog modal-fullscreen-custom modal-dialog-scrollable"> |
|
|
|
<div class="modal-content"> |
|
|
|
<div class="modal-header"> |
|
|
|
<h5 class="modal-title">Booking Details for Hall</h5> |
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal"></button> |
|
|
|
</div> |
|
|
|
<div class="modal-body"> |
|
|
|
<table id="hallDetailsTable" class="table table-bordered table-striped"> |
|
|
|
<input type="hidden" id="hallBookingDetailsJsonInput" th:value="${hallBookingDetailsJson}"> |
|
|
|
|
|
|
|
<thead> |
|
|
|
<tr> |
|
|
|
<th>S.No</th> |
|
|
|
<th>Booking ID</th> |
|
|
|
<th>Hall Name</th> |
|
|
|
<th>Booking Date</th> |
|
|
|
<th>Start Date</th> |
|
|
|
<th>End Date</th> |
|
|
|
<th>Starting Slot</th> |
|
|
|
<th>Ending Slot</th> |
|
|
|
<th>No.of.Days</th> |
|
|
|
<th>Reason for Booking</th> |
|
|
|
<th>Hall Amount</th> |
|
|
|
<th>Deposit Amount</th> |
|
|
|
<th>GSt</th> |
|
|
|
<th>Amount Received</th> |
|
|
|
<th>Booking Status</th> |
|
|
|
<th>Booking Type</th> |
|
|
|
<th>View</th> |
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
<tbody id="hallDetailsTableBody"></tbody> |
|
|
|
</table> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="modal fade" id="bookingInfoModal" tabindex="-1" aria-labelledby="bookingInfoModalLabel" |
|
|
|
aria-hidden="true"> |
|
|
|
<div class="modal-dialog modal-xl"> |
|
|
|
<div class="modal-content"> |
|
|
|
<div class="modal-header bg-dark text-white"> |
|
|
|
<h5 class="modal-title">Booking Information</h5> |
|
|
|
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button> |
|
|
|
</div> |
|
|
|
<div class="modal-body" id="bookingInfoContent"> |
|
|
|
<!-- Filled by JS --> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</main> |
|
|
|
<footer th:replace="~{fragments/footer2 :: footer}"></footer> |
|
|
|
@ -1259,7 +1390,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
$(document).ready(function () { |
|
|
|
/*$(document).ready(function () { |
|
|
|
// Common buttons configuration |
|
|
|
var buttons = [{ |
|
|
|
extend: 'pageLength', |
|
|
|
@ -1288,7 +1419,7 @@ |
|
|
|
}]; |
|
|
|
|
|
|
|
// DataTables initialization |
|
|
|
$('#requestTable1, #requestTable2, #requestTable3, #requestTable8, #requestTable4, #requestTable5, #requestTable6, #requestTable7').DataTable({ |
|
|
|
$('#requestTable1, #requestTable2, #requestTable3, #requestTable8, #requestTable4, #requestTable5, #requestTable6, #requestTable7,#requestTable9,#modalBookingTable,#hallDetailsTable').DataTable({ |
|
|
|
dom: 'Bftip', |
|
|
|
columnDefs: [{ |
|
|
|
targets: 'no-sort', |
|
|
|
@ -1298,7 +1429,7 @@ |
|
|
|
[50, 100, 200, 500, -1], |
|
|
|
['50 rows', '100 rows', '200 rows', '500 rows', 'Show all'] |
|
|
|
], |
|
|
|
scrollY: '50vh', |
|
|
|
// scrollY: '50vh', |
|
|
|
fixedColumns: { |
|
|
|
left: 1, |
|
|
|
right: 1 |
|
|
|
@ -1311,6 +1442,126 @@ |
|
|
|
order: [] // Remove any default sorting |
|
|
|
}); |
|
|
|
|
|
|
|
// Link the search input to DataTable |
|
|
|
$('#searchInput').on('keyup', function () { |
|
|
|
$('#bookinglistdataTable').DataTable().search(this.value).draw(); |
|
|
|
}); |
|
|
|
});*/ |
|
|
|
|
|
|
|
$(document).ready(function () { |
|
|
|
// Common buttons (default for most tables) |
|
|
|
var commonButtons = [{ |
|
|
|
extend: 'pageLength', |
|
|
|
className: 'btn btn-primary' |
|
|
|
}, { |
|
|
|
title: 'Data export', |
|
|
|
extend: 'copyHtml5', |
|
|
|
text: 'Copy', |
|
|
|
className: 'btn btn-primary', |
|
|
|
id: 'copyBtn' |
|
|
|
}, { |
|
|
|
extend: 'excelHtml5', |
|
|
|
text: 'Excel', |
|
|
|
className: 'btn btn-primary', |
|
|
|
id: 'excelBtn' |
|
|
|
}, { |
|
|
|
extend: 'csvHtml5', |
|
|
|
text: 'CSV', |
|
|
|
className: 'btn btn-primary', |
|
|
|
id: 'csvBtn' |
|
|
|
}, { |
|
|
|
extend: 'pdfHtml5', |
|
|
|
text: 'PDF', |
|
|
|
className: 'btn btn-primary', |
|
|
|
id: 'pdfBtn' |
|
|
|
}]; |
|
|
|
|
|
|
|
// Custom PDF buttons for specific tables |
|
|
|
function getCustomButtons(tableId) { |
|
|
|
let orientation = 'portrait'; |
|
|
|
let pageSize = 'A4'; |
|
|
|
|
|
|
|
if (tableId === 'modalBookingTable') { |
|
|
|
orientation = 'landscape'; |
|
|
|
pageSize = 'A4'; |
|
|
|
} else if (tableId === 'hallDetailsTable') { |
|
|
|
orientation = 'landscape'; |
|
|
|
pageSize = 'A3'; |
|
|
|
} |
|
|
|
|
|
|
|
return [{ |
|
|
|
extend: 'pageLength', |
|
|
|
className: 'btn btn-primary' |
|
|
|
}, { |
|
|
|
title: 'Data export', |
|
|
|
extend: 'copyHtml5', |
|
|
|
text: 'Copy', |
|
|
|
className: 'btn btn-primary' |
|
|
|
}, { |
|
|
|
extend: 'excelHtml5', |
|
|
|
text: 'Excel', |
|
|
|
className: 'btn btn-primary' |
|
|
|
}, { |
|
|
|
extend: 'csvHtml5', |
|
|
|
text: 'CSV', |
|
|
|
className: 'btn btn-primary' |
|
|
|
}, { |
|
|
|
extend: 'pdfHtml5', |
|
|
|
text: 'PDF', |
|
|
|
className: 'btn btn-primary', |
|
|
|
orientation: orientation, |
|
|
|
pageSize: pageSize |
|
|
|
}]; |
|
|
|
} |
|
|
|
|
|
|
|
// Tables using default buttons |
|
|
|
$('#requestTable1, #requestTable2, #requestTable3, #requestTable8, #requestTable4, #requestTable5, #requestTable6, #requestTable7').DataTable({ |
|
|
|
dom: 'Bftip', |
|
|
|
columnDefs: [{ |
|
|
|
targets: 'no-sort', |
|
|
|
orderable: false |
|
|
|
}], |
|
|
|
lengthMenu: [ |
|
|
|
[50, 100, 200, 500, -1], |
|
|
|
['50 rows', '100 rows', '200 rows', '500 rows', 'Show all'] |
|
|
|
], |
|
|
|
fixedColumns: { |
|
|
|
left: 1, |
|
|
|
right: 1 |
|
|
|
}, |
|
|
|
buttons: commonButtons, |
|
|
|
responsive: true, |
|
|
|
searching: true, |
|
|
|
select: false, |
|
|
|
processing: false, |
|
|
|
order: [] |
|
|
|
}); |
|
|
|
|
|
|
|
// Tables with custom PDF buttons |
|
|
|
['requestTable9', 'modalBookingTable', 'hallDetailsTable'].forEach(function (tableId) { |
|
|
|
$('#' + tableId).DataTable({ |
|
|
|
dom: 'Bftip', |
|
|
|
columnDefs: [{ |
|
|
|
targets: 'no-sort', |
|
|
|
orderable: false |
|
|
|
}], |
|
|
|
lengthMenu: [ |
|
|
|
[50, 100, 200, 500, -1], |
|
|
|
['50 rows', '100 rows', '200 rows', '500 rows', 'Show all'] |
|
|
|
], |
|
|
|
fixedColumns: { |
|
|
|
left: 1, |
|
|
|
right: 1 |
|
|
|
}, |
|
|
|
buttons: getCustomButtons(tableId), |
|
|
|
responsive: true, |
|
|
|
searching: true, |
|
|
|
select: false, |
|
|
|
processing: false, |
|
|
|
order: [] |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
// Link the search input to DataTable |
|
|
|
$('#searchInput').on('keyup', function () { |
|
|
|
$('#bookinglistdataTable').DataTable().search(this.value).draw(); |
|
|
|
@ -1319,6 +1570,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
function validateme() { |
|
|
|
// checkTodateCon(); |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
@ -1336,6 +1588,7 @@ |
|
|
|
fromdate.onchange = validateDate; |
|
|
|
todate.onchange = validateDate; |
|
|
|
|
|
|
|
|
|
|
|
$(document).ready(function () { |
|
|
|
var today = new Date(); |
|
|
|
$('.datepicker').datepicker({ |
|
|
|
@ -1348,10 +1601,16 @@ |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
document.addEventListener("DOMContentLoaded", function () { |
|
|
|
myRequest(); // Initial call to set dropdowns based on initial value |
|
|
|
}); |
|
|
|
|
|
|
|
document.addEventListener("DOMContentLoaded", function () { |
|
|
|
checkTodateCon(); |
|
|
|
}); |
|
|
|
|
|
|
|
function checkTodateCon(){ |
|
|
|
var today = new Date(); |
|
|
|
var sixMonthsLater = new Date(); |
|
|
|
sixMonthsLater.setMonth(today.getMonth() + 6); |
|
|
|
@ -1360,7 +1619,9 @@ |
|
|
|
var maxDate = sixMonthsLater.toISOString().split('T')[0]; |
|
|
|
let fromDateInput = document.getElementById('fromdate'); |
|
|
|
let toDateInput = document.getElementById('todate'); |
|
|
|
let selectedFromDate = document.getElementById('fromdate').value; |
|
|
|
fromDateInput.setAttribute('max', maxDate); |
|
|
|
toDateInput.setAttribute('min', selectedFromDate); |
|
|
|
toDateInput.setAttribute('max', maxDate); |
|
|
|
fromDateInput.addEventListener('change', function () { |
|
|
|
let selectedFromDate = this.value; |
|
|
|
@ -1368,8 +1629,66 @@ |
|
|
|
toDateInput.setAttribute('min', selectedFromDate); |
|
|
|
toDateInput.value = ''; // Reset the value of toDate |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// document.addEventListener("DOMContentLoaded", function () { |
|
|
|
// const form = document.getElementById('myForm'); // Change selector if needed |
|
|
|
// var requestValue = document.getElementById("request").value; |
|
|
|
// if(requestValue ==="7"){ |
|
|
|
// console.log("inside 7"); |
|
|
|
// const basedonSelect = document.getElementById('basedon'); |
|
|
|
// const errorSpan = document.getElementById('basedonError'); |
|
|
|
// |
|
|
|
// form.addEventListener("submit", function (event) { |
|
|
|
// console.log("basedonSelect.value====="+basedonSelect.value); |
|
|
|
// if (basedonSelect.value === "") { |
|
|
|
// event.preventDefault(); // Stop form submission |
|
|
|
// errorSpan.textContent = "Please select a value."; |
|
|
|
// basedonSelect.classList.add("is-invalid"); // Optional: Bootstrap styling |
|
|
|
// } |
|
|
|
// else { |
|
|
|
// errorSpan.textContent = ""; |
|
|
|
// basedonSelect.classList.remove("is-invalid"); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// } |
|
|
|
// |
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
document.addEventListener("DOMContentLoaded", function () { |
|
|
|
const form = document.getElementById('myForm'); |
|
|
|
const basedonSelect = document.getElementById('basedon'); |
|
|
|
const errorSpan = document.getElementById('basedonError'); |
|
|
|
const request = document.getElementById('request'); |
|
|
|
|
|
|
|
form.addEventListener("submit", function (event) { |
|
|
|
const requestValue = request.value; |
|
|
|
|
|
|
|
if (requestValue === "7") { |
|
|
|
console.log("inside 7"); |
|
|
|
console.log("basedonSelect.value=====" + basedonSelect.value); |
|
|
|
|
|
|
|
if (basedonSelect.value === "") { |
|
|
|
event.preventDefault(); // Stop form submission |
|
|
|
errorSpan.textContent = "Please select a value."; |
|
|
|
basedonSelect.classList.add("is-invalid"); |
|
|
|
} else { |
|
|
|
errorSpan.textContent = ""; |
|
|
|
basedonSelect.classList.remove("is-invalid"); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
document.getElementById("basedon").addEventListener("change", function () { |
|
|
|
this.classList.remove("is-invalid"); |
|
|
|
document.getElementById("basedonError").textContent = ""; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Function to manage the display of dropdowns based on the request type |
|
|
|
function myRequest() { |
|
|
|
var requestValue = document.getElementById("request").value; |
|
|
|
@ -1435,7 +1754,7 @@ |
|
|
|
document.getElementById("divisionContainer").style.display = "block"; |
|
|
|
document.getElementById("hallContainer").style.display = "block"; |
|
|
|
} else if (requestValue === "7") { |
|
|
|
document.getElementById("bookingcountbasedonDropdown").style.display = "block" |
|
|
|
document.getElementById("bookingcountbasedonDropdown").style.display = "block"; |
|
|
|
} else if (requestValue === "8") { |
|
|
|
document.getElementById("zoneDropdown").style.display = "block"; |
|
|
|
document.getElementById("divisionContainer").style.display = "block"; |
|
|
|
@ -1520,6 +1839,8 @@ |
|
|
|
document.getElementById("td_endingSlot").innerHTML = getTimeSlot(response.endingSlot); |
|
|
|
document.getElementById("bookingstatus_td").innerHTML = response.bookingStatus; |
|
|
|
|
|
|
|
console.log("before comments admin..."); |
|
|
|
console.log("Comments..." + response.comments); |
|
|
|
if (response.bookingStatus === 'REJECTED' && response.comments) { |
|
|
|
document.getElementById("rejectionreasondiv").style.display = "block"; |
|
|
|
const rejectionCell = document.getElementById("reasonforrejection"); |
|
|
|
@ -1571,14 +1892,14 @@ |
|
|
|
document.getElementById("refunddetails").style.display = "none"; |
|
|
|
} |
|
|
|
|
|
|
|
if (response.scheduleCount === 1) { |
|
|
|
/*if (response.scheduleCount === 1) { |
|
|
|
document.getElementById("rescheduleDetails").style.display = "block"; |
|
|
|
document.getElementById("td_res_start_date").innerHTML = response.startDate; |
|
|
|
document.getElementById("td_res_end_date").innerHTML = response.endDate; |
|
|
|
document.getElementById("td_res_date").innerHTML = response.updatedDate; |
|
|
|
} else { |
|
|
|
document.getElementById("rescheduleDetails").style.display = "none"; |
|
|
|
} |
|
|
|
}*/ |
|
|
|
|
|
|
|
showDamageDetails(response); |
|
|
|
if (response.bookingStatus === 'CANCELED' && ['WAITING', 'APPROVED', 'INITIATED'].includes(response.refundStatus)) { |
|
|
|
@ -1798,6 +2119,16 @@ |
|
|
|
$('#fileModal').modal('show'); |
|
|
|
} |
|
|
|
|
|
|
|
$('#fileModal').on('shown.bs.modal', function () { |
|
|
|
// boost the last backdrop above everything else |
|
|
|
$('.modal-backdrop').last().css({ |
|
|
|
'z-index': 1095, |
|
|
|
'pointer-events': 'none' |
|
|
|
}); |
|
|
|
// boost this modal |
|
|
|
$(this).css('z-index', 1100); |
|
|
|
}); |
|
|
|
|
|
|
|
function viewbookingDetails(userId) { |
|
|
|
$.ajax({ |
|
|
|
type: "GET", |
|
|
|
@ -2041,6 +2372,107 @@ |
|
|
|
storeSelectedValues(); |
|
|
|
}); |
|
|
|
|
|
|
|
let hallBookingData = []; |
|
|
|
let hallDetailsData = []; |
|
|
|
|
|
|
|
window.addEventListener("DOMContentLoaded", () => { |
|
|
|
try { |
|
|
|
const jsonString1 = document.getElementById("hallBookingJsonInput")?.value; |
|
|
|
if (jsonString1) { |
|
|
|
hallBookingData = JSON.parse(jsonString1); |
|
|
|
console.log("Parsed hallBookingData:", hallBookingData); |
|
|
|
} |
|
|
|
|
|
|
|
const jsonString2 = document.getElementById("hallBookingDetailsJsonInput")?.value; |
|
|
|
if (jsonString2) { |
|
|
|
hallDetailsData = JSON.parse(jsonString2); |
|
|
|
console.log("Parsed hallDetailsData:", hallDetailsData); |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
console.error("Failed to parse JSON inputs", e); |
|
|
|
} |
|
|
|
// Delegate click event for dynamically added booking links |
|
|
|
$(document).on('click', '.hall-detail-link', function (e) { |
|
|
|
e.preventDefault(); |
|
|
|
const hallName = $(this).data('hall-name'); |
|
|
|
showHallBookingDetails(hallName); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
function showCounterTable(elem) { |
|
|
|
const counterId = elem.getAttribute("data-counter-id"); |
|
|
|
const filtered = hallBookingData.filter(row => row[0] == counterId); |
|
|
|
|
|
|
|
const table = $('#modalBookingTable').DataTable(); |
|
|
|
table.clear(); |
|
|
|
|
|
|
|
filtered.forEach((row, index) => { |
|
|
|
table.row.add([ |
|
|
|
index + 1, |
|
|
|
row[1], // Zone |
|
|
|
row[2], // Division |
|
|
|
row[3], // Hall Name |
|
|
|
`<button href="#" class="hall-detail-link" |
|
|
|
style="background-color: #2a807f; color: white; border: none; padding: 6px 12px; border-radius: 4px;" |
|
|
|
data-hall-name="${row[3]}">${row[4]}</button>` |
|
|
|
]); |
|
|
|
}); |
|
|
|
|
|
|
|
table.draw(); |
|
|
|
table.columns.adjust().responsive.recalc(); |
|
|
|
|
|
|
|
// Show modal after data is loaded |
|
|
|
$('#bookingModal').modal('show'); |
|
|
|
} |
|
|
|
|
|
|
|
function formatDateFromTimestamp(timestamp) { |
|
|
|
const date = new Date(parseInt(timestamp)); |
|
|
|
const year = date.getFullYear(); |
|
|
|
const month = String(date.getMonth() + 1).padStart(2, '0'); |
|
|
|
const day = String(date.getDate()).padStart(2, '0'); |
|
|
|
return `${year}-${month}-${day}`; |
|
|
|
} |
|
|
|
|
|
|
|
function getSlotLabel(slot) { |
|
|
|
return slot === 1 ? 'Morning' : (slot === 2 ? 'Evening' : ''); |
|
|
|
} |
|
|
|
|
|
|
|
function showHallBookingDetails(hallName) { |
|
|
|
const filtered = hallDetailsData.filter(row => row[1] === hallName); |
|
|
|
|
|
|
|
const table = $('#hallDetailsTable').DataTable(); |
|
|
|
table.clear(); |
|
|
|
|
|
|
|
filtered.forEach((row, index) => { |
|
|
|
table.row.add([ |
|
|
|
index + 1, |
|
|
|
row[0], |
|
|
|
row[1], |
|
|
|
formatDateFromTimestamp(row[2]), |
|
|
|
row[3], |
|
|
|
row[4], |
|
|
|
getSlotLabel(row[5]), |
|
|
|
getSlotLabel(row[6]), |
|
|
|
row[7], |
|
|
|
row[8], |
|
|
|
row[9], |
|
|
|
row[10], |
|
|
|
row[11], |
|
|
|
row[12], |
|
|
|
row[13], |
|
|
|
row[14], |
|
|
|
` <button class="btn btn-sm btn-primary" onclick="viewDetails('${row[0]}')">View</button>` |
|
|
|
]); |
|
|
|
}); |
|
|
|
table.draw(); |
|
|
|
table.columns.adjust().responsive.recalc(); |
|
|
|
$('#hallDetailModal').modal('show'); |
|
|
|
} |
|
|
|
|
|
|
|
function viewCounterBookingDetails(bookingId) { |
|
|
|
viewDetails(bookingId); |
|
|
|
} |
|
|
|
|
|
|
|
</script> |
|
|
|
</body> |
|
|
|
|