Merge pull request #1791 from varunkewlani322/gli-3071

Added: Hotel reports module and functions needed for reports in their respective classes
This commit is contained in:
Rohit Jain
2026-09-11 17:14:20 +05:30
committed by GitHub
30 changed files with 6127 additions and 51 deletions

View File

@@ -1370,15 +1370,16 @@ class AdminStatsControllerCore extends AdminStatsTabController
);
}
public static function getTotalRooms($idHotel = null, $active = null)
public static function getTotalRooms($idHotel = null, $active = null, $idProduct = null)
{
$sql = 'SELECT COUNT(hri.`id`)
FROM `'._DB_PREFIX_.'htl_room_information` hri
INNER JOIN `'._DB_PREFIX_.'product` p
ON (p.`id_product` = hri.`id_product`)
WHERE p.`booking_product` = 1 '.
(!is_null($active) ? ' AND p.`active` ='.(int) $active : ' ').
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hri') : '');
(!is_null($active) ? ' AND p.`active` = '.(int) $active : '').
(!is_null($idProduct) ? ' AND hri.`id_product` = '.(int) $idProduct : '').
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hri') : '');
return Db::getInstance()->getValue($sql);
}