From d6619aa5ee6f7a380a6804edc76a60244723affb Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Tue, 28 Jun 2016 13:36:22 +1000 Subject: [PATCH] update --- booking.rooms.inc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/booking.rooms.inc b/booking.rooms.inc index 14a9fdd..cf1d3ce 100644 --- a/booking.rooms.inc +++ b/booking.rooms.inc @@ -411,6 +411,7 @@ function booking_rooms_view_form($node, &$form_state, $location_id) { global $event; $rows = array(); $form = array(); + $prefix = t("

Room Allocations for !room

", array('!room' => $location_description->booking_roomlocation_descrip)); //verify that $location_id is a number if (! preg_match('/^[0-9]+$/', $location_id)) { @@ -419,15 +420,15 @@ function booking_rooms_view_form($node, &$form_state, $location_id) { drupal_goto('admin/booking/rooms'); return ""; } + + //@todo reduce the number of queries by using some joins $location_description = db_query("SELECT booking_roomlocation_descrip FROM {booking_room_locations} where lid = :id", array(':id' => $location_id)) ->fetchObject(); - $prefix = t("

Room Allocations for !room

", array('!room' => $location_description->booking_roomlocation_descrip)); - //query for room definitions - $room_query = db_query("SELECT * FROM {booking_room_definition} WHERE booking_room_location_id = :lid", + $room_query = db_query("SELECT * FROM {booking_room_definition} WHERE booking_room_location_id = :lid ORDER BY booking_room_number", array(':lid' => $location_id)); //query for existing room allocations