updated upcoming bookings panel in admin room type page

This commit is contained in:
Shreesh Arora
2023-12-01 19:10:06 +05:30
parent 35911b597f
commit 051b4ebe6d
2 changed files with 1 additions and 41 deletions

View File

@@ -233,10 +233,9 @@
<button type="button" class="close margin-right-10" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title"><i class="icon-calendar"></i>&nbsp; {l s='Room Insights'}</h4>
<h4 class="modal-title"><i class="icon-calendar"></i>&nbsp; {l s='Upcoming bookings'}</h4>
</div>
<div class="room-booked-dates-table modal-body">
<h4>{l s='Room Booked Dates'}</h4>
<div class="table-responsive">
<table class="table">
<thead>
@@ -250,27 +249,6 @@
</table>
</div>
</div>
<div class="room-disable-dates-table modal-body">
<h4>{l s='Room Disabled Dates'}</h4>
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>
<span>{l s='Date From'}</span>
</th>
<th>
<span>{l s='Date To'}</span>
</th>
<th>
<span>{l s='Reason'}</span>
</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" aria-label="Close">{l s='Done'}</button>
</div>
@@ -459,7 +437,6 @@
const triggerRoom = $(e.relatedTarget);
$('#room-dates-modal tbody').html('');
var bookedDates = JSON.parse($(triggerRoom).closest('tr').find('.booked-dates').val());
console.log(bookedDates.length);
if (bookedDates.length) {
if (bookedDates.length) {
$('#room-dates-modal .room-booked-dates-table').show();
@@ -476,19 +453,6 @@
<td colspan="3" class="center">{/literal}{l s='No Booking for this room'}{literal}</td>
</tr>`);
}
if ($(triggerRoom).closest('tr').find('.disable_dates_json').val().length) {
$('.room-disable-dates-table').show();
var disableDates = JSON.parse($(triggerRoom).closest('tr').find('.disable_dates_json').val());
$(disableDates).each(function() {
$('#room-dates-modal .room-disable-dates-table tbody').append(`<tr>
<td>${this.date_from_formatted}</td>
<td>${this.date_to_formatted}</td>
<td>${this.reason ? this.reason : '--' }</td>
</tr>`);
});
} else {
$('.room-disable-dates-table').hide();
}
});
{/literal}

View File

@@ -2772,10 +2772,6 @@ class AdminProductsControllerCore extends AdminController
if ($room['id_status'] == HotelRoomInformation::STATUS_TEMPORARY_INACTIVE) {
$disabledDates = $objRoomDisableDates->getRoomDisableDates($room['id']);
foreach($disabledDates as &$disabledDate) {
$disabledDate['date_from_formatted'] = Tools::displayDate($disabledDate['date_from']);
$disabledDate['date_to_formatted'] = Tools::displayDate($disabledDate['date_to']);
}
$room['disable_dates_json'] = json_encode($disabledDates);
}
}