current date and search bar result design updated

This commit is contained in:
azhar bhat
2026-07-03 17:45:10 +05:30
parent eecfb2b081
commit 1d14eb75ad
3 changed files with 49 additions and 30 deletions

View File

@@ -557,21 +557,10 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
}
$eventData['date_format'] = Tools::displayDate($cal_date_from);
$stats = $eventData['stats'];
if ($stats['num_avail'] > 0) {
$cellBgColor = '#D9EFD8';
} elseif ($stats['num_part_avai'] > 0) {
$cellBgColor = '#FFF3CD';
} elseif ($stats['num_booked'] == $stats['total_rooms'] && $stats['total_rooms'] != 0) {
$cellBgColor = '#C3E1FB';
} else {
$cellBgColor = '#FFC4C4';
}
$events[strtotime($bookingParams['date_from'])] = array(
'is_notification' => 1,
'start' => date('Y-m-d', strtotime($bookingParams['date_from'])),
'display' => 'background',
'backgroundColor' => $cellBgColor,
'title' => $this->l('icon'),
'start' => date('Y-m-d H:i:s', strtotime($bookingParams['date_from'])),
'data' => $eventData
);
@@ -582,25 +571,23 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
if ($bookingData = $objBookingDetail->getBookingData($bookingParams)) {
if ($bookingData['stats']['num_avail']) {
$eventColor = '#7EC77B';
$title = sprintf($this->l('%s Available Rooms'), $bookingData['stats']['num_avail']);
$title = sprintf($this->l('Available Rooms : %s'), $bookingData['stats']['num_avail']);
} elseif ($bookingData['stats']['num_part_avai']) {
$eventColor = '#FFC224';
$title = sprintf($this->l('%s Partially Available Rooms'), $bookingData['stats']['num_part_avai']);
} elseif ($bookingData['stats']['num_booked'] == $bookingData['stats']['total_rooms'] && $bookingData['stats']['total_rooms'] != 0 && $bookingData['stats']['num_unavail'] == 0) {
$eventColor = '#00AFF0';
$title = sprintf($this->l('%s Available Rooms'), $bookingData['stats']['num_avail']);
$title = sprintf($this->l('Partially Available Rooms : %s'), $bookingData['stats']['num_part_avai']);
} else {
$eventColor = '#FF3838';
$title = sprintf($this->l('%s Available Rooms'), $bookingData['stats']['num_avail']);
$title = sprintf($this->l('Available Rooms : %s'), $bookingData['stats']['num_avail']);
}
$bookingData['date_from_format'] = Tools::displayDate($searchDateFrom);
$bookingData['date_to_format'] = Tools::displayDate($searchDateTo);
$bookingData['eventColor'] = $eventColor;
$events[] = array(
'title' => $title,
'start' => date('Y-m-d', strtotime($searchDateFrom)),
'end' => date('Y-m-d', strtotime($searchDateTo)),
'classNames' => array('search-result-event'),
'backgroundColor' => $eventColor,
'color' => $eventColor,
'textColor' => '#FFF',
'data' => $bookingData
);
}

View File

@@ -550,7 +550,7 @@ p.room_cat_data
/* book now full calender */
.fc .fc-daygrid-day.fc-day-today {
background-color: unset;
background-color: #E3E7F3 !important;
}
.fc-daygrid-day-top {
justify-content: space-between;}
@@ -558,13 +558,6 @@ p.room_cat_data
color: #333;
font-size: 14px;
text-decoration: none;}
.fc .fc-daygrid-day.fc-day-today a.fc-daygrid-day-number {
background-color: #FC3D39;
color: #FFFFFF;
line-height: 1;
border-radius: 50%;
padding: 5px 8px;
}
.fc-daygrid-day-top .day-info {
font-size: 15px;
@@ -628,6 +621,9 @@ body.adminhotelroomsbooking .ui-tooltip {
align-items: center;
overflow: hidden;
}
#fullcalendar .fc-event.search-result-event .fc-event-main {
overflow: hidden;
}
#fullcalendar .fc-event.search-result-event .fc-event-title {
font-size: 14px;
font-weight: 400;
@@ -635,7 +631,6 @@ body.adminhotelroomsbooking .ui-tooltip {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding: 1px;
}
#fullcalendar .fc-event.search-result-event:not(.fc-event-start) {
border-left: none;

View File

@@ -68,6 +68,11 @@ $(document).ready(function() {
},
items: "td",
trigger : 'hover',
position: {
my: "left top",
at: "left+50% bottom-50%",
collision: "flipfit"
},
show: {
delay: 100,
},
@@ -132,6 +137,7 @@ $(document).ready(function() {
},
items: "div",
trigger : 'hover',
track: true,
show: {
delay: 100,
},
@@ -171,6 +177,7 @@ $(document).ready(function() {
}
});
info.el.style.borderLeftColor = info.event.extendedProps.data.eventColor;
resizeSearchResultEventBar($(info.el));
}
},
datesSet: function(arg) {
@@ -180,6 +187,36 @@ $(document).ready(function() {
}
});
calendar.render();
var searchResultResizeTimer;
$(window).on('resize', function() {
clearTimeout(searchResultResizeTimer);
searchResultResizeTimer = setTimeout(function() {
$('#fullcalendar .fc-event.search-result-event').each(function() {
resizeSearchResultEventBar($(this));
});
}, 150);
});
}
function resizeSearchResultEventBar($bar) {
requestAnimationFrame(function() {
var $td = $bar.closest('td');
if (!$td.length) {
return;
}
var cellHeight = $td.outerHeight();
if (!cellHeight) {
return;
}
$bar.css('transform', '');
$bar.css('height', (cellHeight * 0.35) + 'px');
var cellRect = $td.get(0).getBoundingClientRect();
var barRect = $bar.get(0).getBoundingClientRect();
var desiredTop = cellRect.top + (cellRect.height - barRect.height) / 2;
var delta = desiredTop - barRect.top;
$bar.css('transform', 'translateY(' + delta + 'px)');
});
}
function removeInitializedTooltips() {