| @@ -24,10 +24,10 @@ | ||
| 24 | 24 | $session = JFactory::getSession(); |
| 25 | 25 | $cookie = JFactory::getApplication()->input->cookie; |
| 26 | 26 | $roomids = VikRequest::getVar('roomids', array(), 'request', 'int'); |
| 27 | 27 | $month = VikRequest::getInt('month', 0, 'request'); |
| 28 | - $fromdate = VikRequest::getString('fromdate', '', 'request'); | |
| 29 | - $todate = VikRequest::getString('todate', '', 'request'); | |
| 28 | + $fromdate = VikRequest::getString('tbxfromdate', '', 'request'); | |
| 29 | + $todate = VikRequest::getString('tbxtodate', '', 'request'); | |
| 30 | 30 | $sessfromts = $session->get('vbTbxFrom', ''); |
| 31 | 31 | $sesstots = $session->get('vbTbxTo', ''); |
| 32 | 32 | // view mode (classic or tag, taken from overv View) |
| 33 | 33 | $cbmode = $cookie->get('vbTagsMode', $session->get('vbTagsMode', ''), 'string'); |
| @@ -177,31 +177,15 @@ | ||
| 177 | 177 | $rooms = array(); |
| 178 | 178 | $q = "SELECT `id`,`name`,`units`,`params` FROM `#__vikbooking_rooms`".($roomids ? " WHERE `id` IN (".implode(', ', $roomids).")" : "")." ORDER BY `name` ASC;"; |
| 179 | 179 | $dbo->setQuery($q); |
| 180 | 180 | $all = $dbo->loadAssocList(); |
| 181 | - if ($all) { | |
| 182 | - foreach ($all as $r) { | |
| 183 | - $rooms[$r['id']] = $r; | |
| 184 | - } | |
| 181 | + foreach ($all as $r) { | |
| 182 | + $rooms[$r['id']] = $r; | |
| 185 | 183 | } |
| 186 | 184 | if (!$rooms) { |
| 187 | 185 | JFactory::getApplication()->redirect('index.php?option=com_vikbooking'); |
| 188 | 186 | exit; |
| 189 | 187 | } |
| 190 | - // all rooms must always be taken to compose the drop down | |
| 191 | - $allrooms = array(); | |
| 192 | - if (!$roomids) { | |
| 193 | - $allrooms = $rooms; | |
| 194 | - } else { | |
| 195 | - $q = "SELECT `id`,`name`,`units` FROM `#__vikbooking_rooms` ORDER BY `name` ASC;"; | |
| 196 | - $dbo->setQuery($q); | |
| 197 | - $all = $dbo->loadAssocList(); | |
| 198 | - if ($all) { | |
| 199 | - foreach ($all as $r) { | |
| 200 | - $allrooms[$r['id']] = $r; | |
| 201 | - } | |
| 202 | - } | |
| 203 | - } | |
| 204 | 188 | |
| 205 | 189 | // get all occupied dates for these rooms |
| 206 | 190 | $rooms_busy = array(); |
| 207 | 191 | $q = "SELECT `b`.*,`ob`.`idorder`,`o`.`custdata`,`o`.`status`,`o`.`totpaid`,`o`.`roomsnum`,`o`.`total`,`o`.`idorderota`,`o`.`channel`,`o`.`country`,`o`.`colortag`,`oc`.`idcustomer`,`c`.`first_name`,`c`.`last_name`,`c`.`pic`, |
| @@ -241,24 +225,11 @@ | ||
| 241 | 225 | * |
| 242 | 226 | * @since 1.13.5 |
| 243 | 227 | */ |
| 244 | 228 | $rdaynotes = VikBooking::getCriticalDatesInstance()->loadRoomDayNotes(date('Y-m-d', $fromts), date('Y-m-d', $tots)); |
| 245 | - // | |
| 246 | - | |
| 247 | - /** | |
| 248 | - * Load categories to be used for group filter. | |
| 249 | - * | |
| 250 | - * @since 1.13.5 | |
| 251 | - */ | |
| 252 | - $q = "SELECT `id`,`name` FROM `#__vikbooking_categories` ORDER BY `#__vikbooking_categories`.`name` ASC;"; | |
| 253 | - $dbo->setQuery($q); | |
| 254 | - $categories = $dbo->loadAssocList(); | |
| 255 | - $categories = $categories ? $categories : []; | |
| 256 | 229 | |
| 257 | 230 | $this->roomids = $roomids; |
| 258 | 231 | $this->rooms = $rooms; |
| 259 | - $this->allrooms = $allrooms; | |
| 260 | - $this->categories = $categories; | |
| 261 | 232 | $this->reqcats = $reqcats; |
| 262 | 233 | $this->mindate = $mindate; |
| 263 | 234 | $this->maxdate = $maxdate; |
| 264 | 235 | $this->rooms_busy = $rooms_busy; |