addStyleSheet(VCM_ADMIN_URI.'assets/css/vikchannelmanager.css'); $document->addStyleSheet(VCM_ADMIN_URI.'assets/css/vcm-channels.css'); if (method_exists('VikChannelManager', 'loadAppearancePreferenceAssets')) { VikChannelManager::loadAppearancePreferenceAssets(); } } $ptmpl = VikRequest::getString('tmpl', '', 'request'); $q = "SELECT * FROM `#__vikbooking_orders` WHERE `id`=".(int)$id." AND `status`='confirmed';"; $dbo->setQuery($q); $dbo->execute(); if ($dbo->getNumRows() < 1) { $mainframe->redirect('index.php'); exit; } $row = $dbo->loadAssoc(); $rooms = VikBooking::loadOrdersRoomsData($row['id']); if (!is_array($rooms) || !(count($rooms) > 0)) { $mainframe->redirect('index.php'); exit; } $customer = array(); $q = "SELECT `c`.*,`co`.`idorder`,`co`.`signature`,`co`.`pax_data`,`co`.`comments`,`co`.`checkindoc` FROM `#__vikbooking_customers` AS `c` LEFT JOIN `#__vikbooking_customers_orders` `co` ON `c`.`id`=`co`.`idcustomer` WHERE `co`.`idorder`=".$row['id'].";"; $dbo->setQuery($q); $dbo->execute(); if ($dbo->getNumRows() > 0) { $customer = $dbo->loadAssoc(); if (!empty($customer['country'])) { if (file_exists(VBO_ADMIN_PATH.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'countries'.DIRECTORY_SEPARATOR.$customer['country'].'.png')) { $customer['country_img'] = ''; } } } if (!(count($customer) > 0)) { VikError::raiseWarning('', JText::translate('VBOCHECKINERRNOCUSTOMER')); $mainframe->redirect('index.php?option=com_vikbooking&task=newcustomer&checkin=1&bid='.$row['id'].($ptmpl == 'component' ? '&tmpl=component' : '')); exit; } $this->row = $row; $this->rooms = $rooms; $this->customer = $customer; // Display the template parent::display($tpl); } }