Skip to content

Commit

Permalink
Merge pull request #198 from sumitwebkul/gli-528_529
Browse files Browse the repository at this point in the history
Hooks added:  actionAvailRoomSearchSqlModifier, displayInteriorExtraContent, displayRoomTypeImageAfter
  • Loading branch information
rohit053 committed Feb 4, 2021
2 parents 7795050 + db59812 commit bfabf70
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
37 changes: 34 additions & 3 deletions modules/hotelreservationsystem/classes/HotelBookingDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,40 @@ public function getBookingData($params)
INNER JOIN `'._DB_PREFIX_.'htl_room_disable_dates` AS hrdd ON (hrdd.`id_room_type` = hri.`id_product` AND hrdd.`id_room` = hri.`id`)
WHERE hri.`id_hotel`='.(int)$hotel_id.' AND hri.`id_product` ='.(int)$room_type['id_product'].' AND hri.`id_status` = 3 AND (hrdd.`date_from` <= \''.pSql($date_to).'\' AND hrdd.`date_to` >= \''.pSql($date_from).'\')';

$sql = 'SELECT ri.`id` AS `id_room`, ri.`id_product`, ri.`id_hotel`, ri.`room_num`, ri.`comment` AS `room_comment`
FROM `'._DB_PREFIX_.'htl_room_information` AS ri
WHERE ri.`id_hotel`='.(int)$hotel_id.' AND ri.`id_product`='.(int)$room_type['id_product'].' AND ri.`id_status` != 2 AND ri.`id` NOT IN ('.$exclude_ids.')';
$selectAvailRoomSearch = 'SELECT ri.`id` AS `id_room`, ri.`id_product`, ri.`id_hotel`, ri.`room_num`, ri.`comment` AS `room_comment`';

$joinAvailRoomSearch = '';

$whereAvailRoomSearch = 'WHERE ri.`id_hotel`='.(int)$hotel_id.' AND ri.`id_product`='.(int)$room_type['id_product'].' AND ri.`id_status` != 2 AND ri.`id` NOT IN ('.$exclude_ids.')';

$groupByAvailRoomSearch = '';
$orderByAvailRoomSearch = '';
$orderWayAvailRoomSearch = '';

Hook::exec('actionAvailRoomSearchSqlModifier',
array(
'select' => &$selectAvailRoomSearch,
'join' => &$joinAvailRoomSearch,
'where' => &$whereAvailRoomSearch,
'group_by' => &$groupByAvailRoomSearch,
'order_by' => &$orderByAvailRoomSearch,
'order_way' => &$orderWayAvailRoomSearch,
'params' => array(
'id_hotel' => $hotel_id,
'id_product' => $room_type['id_product'],
'date_from' => $date_from,
'date_to' => $date_to
)
)
);

$sql = $selectAvailRoomSearch;
$sql .= ' FROM `'._DB_PREFIX_.'htl_room_information` AS ri';
$sql .= ' '.$joinAvailRoomSearch;
$sql .= ' '.$whereAvailRoomSearch;
$sql .= ' '.$groupByAvailRoomSearch;
$sql .= ' '.$orderByAvailRoomSearch;
$sql .= ' '.$orderWayAvailRoomSearch;

$avai_rooms = Db::getInstance()->executeS($sql);
$num_avail += count($avai_rooms);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<div class="col-md-offset-1 col-md-10 col-lg-offset-2 col-lg-8">
<p class="home_block_heading">{$HOTEL_INTERIOR_HEADING|escape:'htmlall':'UTF-8'}</p>
<p class="home_block_description">{$HOTEL_INTERIOR_DESCRIPTION|escape:'htmlall':'UTF-8'}</p>
{hook h="displayInteriorExtraContent"}
<hr class="home_block_desc_line"/>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions themes/hotel-reservation-theme/product.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
{/if}
</span>
{/if}
{hook h="displayRoomTypeImageAfter"}
</div> <!-- end image-block -->
</div>
<div class="col-xs-12 col-sm-3 col-sm-pull-9 col-md-2 col-md-pull-10">
Expand Down

0 comments on commit bfabf70

Please sign in to comment.