Reply To: Calendar Cell Classes

Edit to the above post

I found the calendar was being built within easyreservations > lib > functions > both.php

Starting on line 573 I changed the code to this, which adds a price class to the calendar cell.

$final_price = ''.$formated_price.'';
$price_class = ' bg-' . $res->price;
} else $final_price = '';

if(date("d.m.Y", $dateofeachday) == date("d.m.Y", time())) $todayClass=" today";
else $todayClass="";

$avail = $res->checkAvailability(3);
if(floor($avail) >= $room_count) $backgroundtd=" calendar-cell-full";
elseif(floor($avail) > 0) $backgroundtd=" calendar-cell-occupied";
else $backgroundtd=" calendar-cell-empty" . $price_class;

if(round($avail) >= $room_count) $backgroundtd.=" calendar-cell-full2";
elseif(round($avail) > 0) $backgroundtd.=" calendar-cell-occupied2";
else $backgroundtd.=" calendar-cell-empty2" . $price_class;

This works for the intended use for my client. He only has a single resource being booked at one time, so the calendar is either booked or it’s available. This type of application probably wouldn’t work for people with multiple resources to reserve at once. Just a neat customization you may look into adding to a future release!