<?php

$ssllogo = get_option('ssllogo_key', '');
$formlabel = get_option('form_key', '');
$usessl = get_option('usessl_key', 0);
$base_url = get_site_url(null, '', $usessl ? "https" : null);
$language = $GLOBALS['bfi_lang'];
if (defined('ICL_LANGUAGE_CODE') && class_exists('SitePress')) {
    $language = ICL_LANGUAGE_CODE;
    global $sitepress;
    if ($sitepress->get_current_language() != $sitepress->get_default_language()) {
        $base_url .= "/" . ICL_LANGUAGE_CODE;
    }
}
$resource_id = $_SESSION['search.params']['resourceId'];
$modelresource = new BookingForConnectorModelResource();
$resource = $modelresource->getItem($resource_id);
$merchant = $resource->Merchant;
$rateplan_id = $_SESSION['search.params']['pricetype'];
//$currentState = isset($_SESSION['search.params']['state']) ? $_SESSION['search.params']['state'] : "booking";
$currentState = "booking";
$privacy = BFCHelper::GetPrivacy($language);
$additionalPurpose = BFCHelper::GetAdditionalPurpose($language);
$policy = BFCHelper::GetPolicy($resource->ResourceId, $language);
$deposit = 0;
/*----------------------------*/
$currstay = array();
$currstay['resourceId'] = $_SESSION['search.params']['resourceId'];
$currstay['checkin'] = $_SESSION['search.params']['checkin']->format('d/m/Y');
$currstay['checkout'] = $_SESSION['search.params']['checkout']->format('d/m/Y');
$currstay['duration'] = $_SESSION['search.params']['duration'];
Esempio n. 2
0
function accommodationdetails_resource($resource_name)
{
    $args = explode('-', $resource_name);
    $resource_id = $args[0];
    $_SESSION['search.params']['resourceId'] = $resource_id;
    $model = new BookingForConnectorModelResource();
    $resource = $model->getItem($resource_id);
    $merchant_id = $resource->MerchantId;
    $modelmerchant = new BookingForConnectorModelMerchantDetails();
    $merchant = $modelmerchant->getItem($merchant_id);
    $images = array();
    if ($resource->ImageUrl != null && $resource->ImageUrl != '') {
        $images[] = $resource->ImageUrl;
    }
    foreach (explode(',', $resource->ImageData) as $image) {
        if (!empty($images[0]) && basename($image) != basename($images[0]) && $images[0]) {
            $images[] = $image;
        }
    }
    if (!isset($_REQUEST['layout'])) {
        ob_start();
        include 'templates/resource-gallery.php';
        $photos_slider = ob_get_contents();
        ob_end_clean();
        ob_start();
        include 'templates/resource-video.php';
        $video_slider = ob_get_contents();
        ob_end_clean();
        ob_start();
        include 'templates/planimetria.php';
        $planimetria = ob_get_contents();
        ob_end_clean();
        $order_type = 'c';
        ob_start();
        include 'templates/inforequestform.php';
        $inforequest = ob_get_contents();
        ob_end_clean();
        if (!$resource->IsCatalog) {
            ob_start();
            include 'templates/rate-calculator.php';
            $rate_calculator = ob_get_contents();
            ob_end_clean();
        }
        include 'templates/resource.php';
    } else {
        $merchant = $resource->Merchant;
        $resourceLat = 0;
        $resourceLon = 0;
        $htmlmarkerpoint = '';
        if (!empty($resource->XGooglePos) && !empty($resource->YGooglePos)) {
            $resourceLat = $resource->XGooglePos;
            $resourceLon = $resource->YGooglePos;
        }
        if (!empty($resource->XPos)) {
            $resourceLat = $merchant->XPos;
        }
        if (!empty($resource->YPos)) {
            $resourceLon = $merchant->YPos;
        }
        if (BFCHelper::getAddressDataByMerchant($merchant->MainMerchantCategoryId)) {
            if (!empty($merchant->XGooglePos) && !empty($merchant->YGooglePos)) {
                $resourceLat = $merchant->XGooglePos;
                $resourceLon = $merchant->YGooglePos;
            }
            if (!empty($merchant->XPos)) {
                $resourceLat = $merchant->XPos;
            }
            if (!empty($merchant->YPos)) {
                $resourceLon = $merchant->YPos;
            }
        }
        $showResourceMap = !empty($resourceLat) && !empty($resourceLon);
        if ($showResourceMap) {
            $htmlmarkerpoint = "&markers=color:blue%7C" . $resourceLat . "," . $resourceLon;
        }
        ob_start();
        include 'templates/resource-rapidview.php';
        $resource_html = ob_get_contents();
        ob_end_clean();
        wp_send_json(array('mainhtml' => $resource_html, 'htmlmarkerpoint' => $htmlmarkerpoint, 'resourceLon' => $resourceLon, 'title' => $resource->Name));
    }
}
    $count = count($parts);
    $merchant_name = $parts[$count - 1];
    if (in_array('offer-details', $parts)) {
        $merchant_name = $parts[$count - 2];
    }
    $part = explode('-', $merchant_name);
    $merchant_id = $part[0];
    $model = new BookingForConnectorModelMerchantDetails();
    $merchant = $model->getItem($merchant_id);
} else {
    if (in_array('accommodation-details', $parts)) {
        $count = count($parts);
        $resource_name = $parts[$count - 1];
        $part = explode('-', $resource_name);
        $resource_id = $part[0];
        $model = new BookingForConnectorModelResource();
        $resource = $model->getItem($resource_id);
        $merchant_id = $resource->Merchant->MerchantId;
        $model = new BookingForConnectorModelMerchantDetails();
        $merchant = $model->getItem($merchant_id);
    }
}
if (!isset($merchant) || $merchant == null) {
    return;
}
$addressData = $merchant->AddressData;
$contacts = $merchant->ContactData;
$layout = '';
$resourceLat = get_option('posy_key', null);
$resourceLon = get_option('posx_key', null);
$startzoom = get_option('startzoom_key', 14);