loadSelect2(); $config = VBOFactory::getConfig(); JText::script('VBO_CREATE_LISTING_ON_OTA'); JText::script('VBOCHECKINSTATUSUPDATED'); JText::script('VBO_OTA_ACCOUNT_ID'); JText::script('VBO_OTA_LISTING_ID'); JText::script('VBANNULLA'); JText::script('VBSAVE'); JText::script('VBOCATEGORYFILTER'); $rows = $this->rows; $lim0 = $this->lim0; $navbut = $this->navbut; $orderby = $this->orderby; $ordersort = $this->ordersort; $prname = $app->getUserStateFromRequest("vbo.rooms.rname", 'rname', '', 'string'); $pidcat = $app->getUserStateFromRequest("vbo.rooms.idcat", 'idcat', 0, 'int'); ?>

0) { $cat = explode(";", $row['idcat']); $catsfound = false; $q = "SELECT `name` FROM `#__vikbooking_categories` WHERE "; foreach ($cat as $k => $cc) { if (!empty($cc)) { $q .= "`id`=".$dbo->quote($cc)." "; if ($cc != end($cat) && !empty($cat[($k + 1)])) { $q .= "OR "; } $catsfound = true; } } $q .= ";"; if ($catsfound) { $dbo->setQuery($q); $lines = $dbo->loadAssocList(); foreach ($lines as $ll) { $categories[] = $ll['name']; } } } $caratteristiche = '0'; if (!empty($row['idcarat'])) { $tmpcarat = explode(";", $row['idcarat']); $caratteristiche = '' . VikBooking::totElements($tmpcarat) . ''; } $optionals = '0'; if (!empty($row['idopt'])) { $tmpopt = explode(";", $row['idopt']); $optionals = '' . VikBooking::totElements($tmpopt) . ''; } if ($row['fromadult'] == $row['toadult']) { $stradult = $row['fromadult']; } else { $stradult = $row['fromadult'].' - '.$row['toadult']; } if ($row['fromchild'] == $row['tochild']) { $strchild = $row['fromchild']; } else { $strchild = $row['fromchild'].' - '.$row['tochild']; } // shared calendar icon $sharedcal = ''; if (!empty($row['sharedcals'])) { $sharedcal = ' '; } // VCM room's channels mapped $website_source_lbl_short = substr($website_source_lbl, 0, 1); if (function_exists('mb_substr')) { $website_source_lbl_short = mb_substr($website_source_lbl, 0, 1, 'UTF-8'); } $roomchannels = array($website_source_lbl => strtoupper($website_source_lbl_short)); $otachannels = is_object($vcm_logos) && method_exists($vcm_logos, 'getVboRoomLogosMapped') ? $vcm_logos->getVboRoomLogosMapped($row['id']) : array(); $roomchannels = count($otachannels) ? array() : $roomchannels; $roomchannels = array_merge($roomchannels, $otachannels); // VCM room onboardable OTAs $onboardable_otas = []; $room_ota_accounts = []; if (is_object($vcm_logos) && method_exists($vcm_logos, 'getRoomOnboardableChannels')) { $onboardable_otas = $vcm_logos->getRoomOnboardableChannels($row['id']); $room_ota_accounts = $vcm_logos->getRoomOtaAccounts(); $room_ota_accounts = $room_ota_accounts[$row['id']] ?? []; } // room upgrade option $room_upgrade_options = $config->getArray('room_upgrade_options_' . $row['id'], []); $room_upgrade_enabled = (!empty($room_upgrade_options['rooms']) && $room_upgrade_options['rooms']); ?>
" class=""> ' : ($orderby == "name" ? '' : '')); ?> " class=""> ' : ($orderby == "toadult" ? '' : '')); ?> " class=""> ' : ($orderby == "tochild" ? '' : '')); ?> " class=""> ' : ($orderby == "totpeople" ? '' : '')); ?> " class=""> ' : ($orderby == "units" ? '' : '')); ?> " class=""> ' : ($orderby == "avail" ? '' : '')); ?>
$churi) { if (in_array(preg_replace("/api$/", '', $source), $onboardable_otas)) { // the room is mapped with the current channel, but we have a pending onboarding $ch_counter++; continue; } $is_img = (strpos($churi, 'http') !== false); // build readable channel name $raw_ch_name = $source; $lower_name = strtolower($raw_ch_name); $lower_name = preg_replace("/(hotel|vr)$/", ' $1', $lower_name); $channel_name = ucwords(preg_replace("/api$/", '', $lower_name)); // build OTA account attributes $ota_account_attributes = []; if (!strcasecmp(($room_ota_accounts[$ch_counter]['channel'] ?? ''), $source)) { $ota_account_attributes = [ 'data-ota-name="' . $this->escape($channel_name) . '"', 'data-ota-idroom="' . $this->escape(($room_ota_accounts[$ch_counter]['idroomota'] ?? '')) . '"', 'data-ota-account-name="' . $this->escape(($room_ota_accounts[$ch_counter]['account_name'] ?? '')) . '"', 'data-ota-account-id="' . $this->escape(($room_ota_accounts[$ch_counter]['host_main_id'] ?? '')) . '"', ]; } ?>
> <?php echo $source; ?>
$ch_name) { $ch_logo_url = $vcm_logos ? $vcm_logos->setProvenience($ch_name, $ch_name)->getTinyLogoURL() : ''; if (!$ch_logo_url || strpos($ch_logo_url, 'http') === false) { continue; } ?>
<?php echo $ch_name; ?>
' . $row['units'] . ''; ?> " : ""); ?>