function display($tpl = null, $preparecontent = false)
 {
     BookingForConnectorViewOnSellUnitBase::basedisplay($tpl);
     $item = $this->get('Item');
     $document = JFactory::getDocument();
     $language = $document->getLanguage();
     $config = JComponentHelper::getParams('com_bookingforconnector');
     BFCHelper::setState($item, 'onsellunit', 'onsellunit');
     //		$document->addStyleSheet('components/com_bookingforconnector/assets/css/resource.css');
     // add stylesheet
     JHTML::stylesheet('components/com_bookingforconnector/assets/css/bookingfor.css');
     JHTML::stylesheet('components/com_bookingforconnector/assets/css/bookingfor-responsive.css');
     $document->addScript('components/com_bookingforconnector/assets/js/jquery.form.js');
     $document->addScript('components/com_bookingforconnector/assets/js/jquery.blockUI.js');
     $document->addScript('components/com_bookingforconnector/assets/js/bf.js');
     if ($this->checkAnalytics("Sales Resources Page") && $config->get('eecenabled', 0) == 1) {
         $obj = new stdClass();
         $obj->id = "" . $item->ResourceId . " - Sales Resource";
         $obj->name = $item->Name;
         $obj->category = $item->MerchantCategoryName;
         $obj->brand = $item->MerchantName;
         $obj->variant = 'NS';
         $document->addScriptDeclaration('callAnalyticsEEc("addProduct", [' . json_encode($obj) . '], "item");');
     }
     $this->assignRef('document', $document);
     $this->assignRef('language', $language);
     $this->assignRef('item', $item);
     $this->assignRef('config', $config);
     //		$item		= $this->get('Item');
     //$item->Name = $item->nome;
     //$this->setBreadcrumb($item, 'resources');
     $this->setBreadcrumb($item, 'onsellunits', $language);
     parent::display($tpl, true);
 }
 public function __construct($config, $order, $language, $urlBack, $url, $suffixOrder, $overrideAmount = 0, $debug = FALSE)
 {
     $paymentData = explode('|', $config);
     /*ShopID|Separator|SecretKey|PaymentUrl */
     $this->shopID = $paymentData[0];
     $this->separator = $paymentData[1];
     $this->SecretKey = $paymentData[2];
     $this->paymentUrl = $paymentData[3];
     $this->numord = sprintf('B%s%s%s%s', rand(1, 9999) . $this->separator, $order->ExternalId, $this->separator, $order->OrderId);
     $this->importo = number_format($order->DepositAmount * COM_BOOKINGFORCONNECTOR_CONVERSIONCURRENCY, 2, ',', '');
     $this->importoForMac = intval($order->DepositAmount * 100 * COM_BOOKINGFORCONNECTOR_CONVERSIONCURRENCY);
     if (isset($suffixOrder) && $suffixOrder != "" && $overrideAmount > 0) {
         $this->numord .= $this->separator . "R" . $suffixOrder;
         $this->importo = number_format($overrideAmount * COM_BOOKINGFORCONNECTOR_CONVERSIONCURRENCY, 2, ',', '');
         $this->importoForMac = intval($overrideAmount * 100 * COM_BOOKINGFORCONNECTOR_CONVERSIONCURRENCY);
     }
     $this->email = BFCHelper::getItem($order->CustomerData, 'email') . "";
     $this->languageId = $this->getLanguage($language);
     $this->url = $url;
     $this->urlBack = $urlBack;
     if ($debug) {
         $this->shopID = 'MYSHOP';
         $this->numord = 78;
         $this->importo = '17,00';
         $this->importoForMac = '1700';
         $this->SecretKey = '3DfEO2B5Jjm4VC1Q3vEh';
     }
     //$this->mac = $this->getMac();
     $this->redirectUrl = getUrl();
 }
 public function __construct($config, $order, $language, $urlok, $urlko, $suffixOrder, $overrideAmount = 0, $debug = FALSE)
 {
     $paymentData = explode('|', $config);
     /*MerchantID|ShopID|UserID|Password|Separator|SecretString */
     $this->merchantID = $paymentData[0];
     $this->shopID = $paymentData[1];
     $this->userID = $paymentData[2];
     $this->password = $paymentData[3];
     $this->separator = $paymentData[4];
     $this->SecretKey = $paymentData[5];
     //$this->paymentUrl = $paymentData[3];
     $this->numeroOrdine = sprintf('B%s%s%s%s', rand(1, 9999) . $this->separator, $order->ExternalId, $this->separator, $order->OrderId);
     $this->totaleOrdine = intval($order->DepositAmount * 100);
     if (isset($suffixOrder) && $suffixOrder != "" && $overrideAmount > 0) {
         $this->numord .= $this->separator . "R" . $suffixOrder;
         $this->totaleOrdine = intval($overrideAmount * 100);
     }
     $this->email = BFCHelper::getItem($order->CustomerData, 'email') . "";
     $this->languageId = $this->getLanguage($language);
     $this->urlOk = $urlok;
     $this->urlKo = $urlko;
     if ($debug) {
         $this->merchantID = '9999888';
         $this->shopID = '99888';
         $this->userID = '9999888_IPERTRD';
         $this->numeroOrdine = 'VERXORDXPROD196';
         $this->totaleOrdine = '1';
         $this->password = '******';
         $this->SecretKey = 'b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1';
         $this->tipoRispostaApv = 'click';
         $this->urlOk = "http://www.dominio.it/ok.html";
         $this->urlKo = "http://www.dominio.it/ko.html";
     }
     //		$this->paymentUrl .= $this->getUrl();
 }
 public function __construct($config, $order, $language, $urlBack, $url, $debug = false, $donation = false)
 {
     $paymentData = explode('|', $config);
     /*Username|Password|Signature|Separator */
     $this->Username = $paymentData[0];
     $this->Password = $paymentData[1];
     $this->Signature = $paymentData[2];
     $this->separator = $paymentData[3];
     $this->divisa = 'EUR';
     $this->numord = sprintf('B%s%s%s%s', rand(1, 9999) . $this->separator, $order->ExternalId, $this->separator, $order->OrderId);
     $this->email = BFCHelper::getItem($order->CustomerData, 'email') . "";
     $this->languageId = $this->getLanguage($language);
     $this->importo = intval($order->DepositAmount);
     $this->paymentUrl = 'https://www.paypal.com/cgi-bin/webscr';
     $this->paymentUrlAPI = 'https://api-3t.paypal.com/nvp';
     $this->returnurl = $url;
     $this->urlBack = $urlBack;
     $this->method = "SetExpressCheckout";
     $this->version = "109.0";
     $this->paymentaction = "Sale";
     if ($debug) {
         $this->paymentUrl = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
         $this->paymentUrlAPI = 'https://api-3t.sandbox.paypal.com/nvp';
     }
     //$this->requestUrl = $this->getUrl();
 }
    function display($tpl = null, $preparecontent = false)
    {
        $document = JFactory::getDocument();
        $language = $document->getLanguage();
        $config = JComponentHelper::getParams('com_bookingforconnector');
        $app = JFactory::getApplication();
        // add stylesheet
        $document->addStyleSheet('components/com_bookingforconnector/assets/css/bookingfor.css');
        $document->addStyleSheet('components/com_bookingforconnector/assets/css/bookingfor-responsive.css');
        $document->addStyleSheet('//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css');
        // load scripts
        $document->addScript('//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js');
        $document->addScript('components/com_bookingforconnector/assets/js/bf.js');
        $document->addScript('components/com_bookingforconnector/assets/js/jquery.xml2json.js');
        $document->addScript('components/com_bookingforconnector/assets/js/jquery.shorten.js');
        // Initialise variables
        $state = $this->get('State');
        $params = $state->params;
        $items = $this->get('Items');
        $pagination = $this->get('Pagination');
        $sortColumn = $state->get('list.ordering');
        $sortDirection = $state->get('list.direction');
        $startswith = $params['startswith'];
        $searchseed = $params['searchseed'];
        // Check for errors.
        if (count($errors = $this->get('Errors'))) {
            JError::raiseWarning(500, implode("\n", $errors));
            return false;
        }
        $merchantsCriteo = isset($items) && !empty($items) ? array_unique(array_map(function ($a) {
            return $a->MerchantId;
        }, $items)) : array();
        $criteoConfig = BFCHelper::getCriteoConfiguration(1, $merchantsCriteo);
        if (isset($criteoConfig) && isset($criteoConfig->enabled) && $criteoConfig->enabled && count($criteoConfig->merchants) > 0) {
            $document->addScript('//static.criteo.net/js/ld/ld.js');
            $document->addScriptDeclaration('window.criteo_q = window.criteo_q || []; 
			window.criteo_q.push( 
				{ event: "setAccount", account: ' . $criteoConfig->campaignid . '}, 
				{ event: "setSiteType", type: "d" }, 
				{ event: "setEmail", email: "" }, 
				{ event: "viewList", item: ' . json_encode($criteoConfig->merchants) . ' }
			);');
        }
        $analyticsEnabled = count($items) > 0 && $this->checkAnalytics("Merchants List") && $config->get('eecenabled', 0) == 1;
        $pagination->setAdditionalUrlParam("filter_order", $sortColumn);
        $pagination->setAdditionalUrlParam("filter_order_Dir", $sortDirection);
        $pagination->setAdditionalUrlParam("startswith", $startswith);
        $pagination->setAdditionalUrlParam("searchseed", $searchseed);
        $this->assignRef('state', $state);
        $this->assignRef('params', $params);
        $this->assignRef('items', $items);
        $this->assignRef('pagination', $pagination);
        $this->assignRef('language', $language);
        $this->assignRef('config', $config);
        $this->assignRef('analyticsEnabled', $analyticsEnabled);
        // Display the view
        parent::display($tpl);
    }
 function setBreadcrumb($merchant, $layout = '')
 {
     $mainframe = JFactory::getApplication();
     $pathway = $mainframe->getPathway();
     $pathway->addItem($merchant->Name, JRoute::_('index.php?option=com_bookingforconnector&view=merchantdetails&merchantId=' . $merchant->MerchantId . ':' . BFCHelper::getSlug($merchant->Name)));
     if ($layout != '') {
         $pathway->addItem(JTEXT::_('COM_BOOKINGFORCONNECTOR_VIEWS_MERCHANTDETAILS_LAYOUT_' . strtoupper($layout)), JRoute::_('index.php?layout=' . $layout . '&option=com_bookingforconnector&view=merchantdetails&merchantId=' . $merchant->MerchantId . ':' . BFCHelper::getSlug($merchant->Name)));
     }
 }
Example #7
0
 function setBreadcrumb($resource, $layout = '')
 {
     $mainframe = JFactory::getApplication();
     $pathway = $mainframe->getPathway();
     $pathway->addItem($resource->Merchant->Name, JRoute::_('index.php?option=com_bookingforconnector&view=merchantdetails&merchantId=' . $resource->Merchant->MerchantId . ':' . BFCHelper::getSlug($resource->Merchant->Name)));
     $pathway->addItem(JTEXT::_('COM_BOOKINGFORCONNECTOR_VIEWS_MERCHANTDETAILS_LAYOUT_' . strtoupper($layout)), JRoute::_('index.php?option=com_bookingforconnector&view=merchantdetails&layout=' . $layout . '&merchantId=' . $resource->Merchant->MerchantId . ':' . BFCHelper::getSlug($resource->Merchant->Name)));
     //		$resourceName = BFCHelper::getLanguage($resource->Name, $this->Language);
     $resourceName = BFCHelper::getLanguage($resource->Name, $this->language, null, array('ln2br' => 'ln2br', 'striptags' => 'striptags'));
     $pathway->addItem($resourceName, JRoute::_('index.php?option=com_bookingforconnector&view=resource&resourceId=' . $resource->ResourceId . ':' . BFCHelper::getSlug($resourceName)));
 }
 /**
  * Method to get a list of options for a list input.
  *
  * @return	array		An array of JHtml options.
  */
 protected function getOptions()
 {
     $merchantTypes = BFCHelper::getMerchantTypes();
     $options = array();
     if ($merchantTypes) {
         foreach ($merchantTypes as $merchantType) {
             $options[] = JHtml::_('select.option', $merchantType->MerchantTypeId, $merchantType->RefName);
         }
     }
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
Example #9
0
 /**
  * Method to get a list of options for a list input.
  *
  * @return	array		An array of JHtml options.
  */
 protected function getOptions()
 {
     $tags = BFCHelper::getTags();
     $options = array();
     if ($tags) {
         foreach ($tags as $tag) {
             $options[] = JHtml::_('select.option', $tag->TagId, $tag->Name);
         }
     }
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
Example #10
0
 /**
  * Method to get a list of options for a list input.
  *
  * @return	array		An array of JHtml options.
  */
 protected function getOptions()
 {
     $locationZones = BFCHelper::getLocations();
     $options = array();
     if ($locationZones) {
         foreach ($locationZones as $lz) {
             $options[] = JHtml::_('select.option', $lz->CityId, $lz->Name);
         }
     }
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
 function setBreadcrumb($resource, $layout = '', $language)
 {
     if (!empty($resource)) {
         $mainframe = JFactory::getApplication();
         $pathway = $mainframe->getPathway();
         // resetto il pathway
         $pathway->setPathway(null);
         //				$resourceName = BFCHelper::getLanguage($resource->Name, $language);
         $resourceName = BFCHelper::getLanguage($resource->Name, $this->language, null, array('ln2br' => 'ln2br', 'striptags' => 'striptags'));
         $pathway->addItem($resource->MerchantName, JRoute::_('index.php?option=com_bookingforconnector&view=merchantdetails&merchantId=' . $resource->MerchantId . ':' . BFCHelper::getSlug($resource->MerchantName)));
         $pathway->addItem($resourceName, JRoute::_('index.php?option=com_bookingforconnector&view=onsellunit&resourceId=' . $resource->ResourceId . ':' . BFCHelper::getSlug($resourceName)));
     }
 }
 /**
  * Method to get a list of options for a list input.
  *
  * @return	array		An array of JHtml options.
  */
 protected function getOptions()
 {
     $document = JFactory::getDocument();
     $language = $document->getLanguage();
     $masterTypologies = BFCHelper::getMasterTypologies();
     $options = array();
     if ($masterTypologies) {
         foreach ($masterTypologies as $masterTypology) {
             $options[] = JHtml::_('select.option', $masterTypology->MasterTypologyId, BFCHelper::getLanguage($masterTypology->Name, $language));
         }
     }
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
 public function __construct($config, $order, $language, $urlBack, $url, $suffixOrder, $overrideAmount = 0, $debug = FALSE)
 {
     //	echo "<pre>order";
     //	echo print_r($order);
     //	echo "</pre>";
     //$this->helper = new wsQueryHelper(COM_BOOKINGFORCONNECTOR_WSURL, COM_BOOKINGFORCONNECTOR_APIKEY);
     $paymentData = explode('|', $config);
     /* MerchantId|Abi|MacKey|Separator|PaymentUrl */
     $this->merchant_id = $paymentData[0];
     $this->abi = $paymentData[1];
     $this->SecretKey = $paymentData[2];
     $this->separator = $paymentData[3];
     $this->paymentUrl = $paymentData[4];
     $this->order_id = sprintf('B%s%s%s%s', $this->separator, $order->ExternalId, $this->separator, $order->OrderId);
     $this->email = BFCHelper::getItem($order->CustomerData, 'email') . "";
     $this->lingua = $this->getLanguage($language);
     $this->importo = number_format($order->DepositAmount, 2, ',', '');
     //$this->order_id = $order->OrderId;
     if (isset($suffixOrder) && $suffixOrder != "" && $overrideAmount > 0) {
         $this->order_id .= $this->separator . "R" . $suffixOrder;
         //$this->orderId .= $this->separator . "R" . $suffixOrder;
         $this->importo = $overrideAmount;
         $this->suffixOrder = $suffixOrder;
     }
     if (empty($order->ExternalId)) {
         $order->ExternalId = $this->abi;
     }
     $this->urlok = $url;
     $this->urlko = $urlBack;
     $paymentDescr = "payment";
     if (isset($order->donationNotes) && !empty($order->donationNotes)) {
         $paymentDescr = $order->donationNotes;
     }
     $paymentDescr = preg_replace('/[^A-Za-z0-9\\- ]/', '', $paymentDescr);
     if (strlen($paymentDescr > 120)) {
         $paymentDescr = substr($paymentDescr, 0, 120);
     }
     $ExternalId = $order->ExternalId;
     if (strlen($ExternalId > 32)) {
         $ExternalId = substr($ExternalId, 0, 32);
     }
     $this->items = $ExternalId . $this->FieldSeparator . $paymentDescr . $this->FieldSeparator . "1" . $this->FieldSeparator . $this->importo . $this->FieldSeparator . $this->divisa . $this->macSeparator;
     /*if ($debug){
     			$this->merchant_id = 'NCHTEST';
     			$this->abi = '03599';
     			$this->SecretKey = 'CAE5859549B7F54834040AA110A533A1';
     		}*/
     $this->mac = $this->getMac();
 }
 public function __construct($config, $order, $language, $urlBack, $url, $suffixOrder, $overrideAmount = 0, $debug = FALSE)
 {
     //	echo "<pre>order";
     //	echo print_r($order);
     //	echo "</pre>";
     //$this->helper = new wsQueryHelper(COM_BOOKINGFORCONNECTOR_WSURL, COM_BOOKINGFORCONNECTOR_APIKEY);
     $paymentData = explode('|', $config);
     /* storename|ksig|Separator|PaymentUrl */
     $this->storename = $paymentData[0];
     $this->ksig = $paymentData[1];
     $this->separator = $paymentData[2];
     $this->paymentUrl = $paymentData[3];
     $this->order_id = sprintf('B%s%s%s%s', $this->separator, $order->ExternalId, $this->separator, $order->OrderId);
     $this->email = BFCHelper::getItem($order->CustomerData, 'email') . "";
     $this->language = $this->getLanguage($language);
     $this->importo = number_format($order->DepositAmount, 2, '.', '');
     $this->currentDateTime = date("Y:m:d-H:i:s");
     //$this->order_id = $order->OrderId;
     if (isset($suffixOrder) && $suffixOrder != "" && $overrideAmount > 0) {
         $this->order_id .= $this->separator . "R" . $suffixOrder;
         //$this->orderId .= $this->separator . "R" . $suffixOrder;
         $this->importo = number_format($overrideAmount, 2, '.', '');
         $this->suffixOrder = $suffixOrder;
     }
     $this->responseSuccessURL = $url;
     $this->responseFailURL = $urlBack;
     $paymentDescr = "payment";
     if (isset($order->donationNotes) && !empty($order->donationNotes)) {
         $paymentDescr = $order->donationNotes;
     }
     $paymentDescr = preg_replace('/[^A-Za-z0-9\\- ]/', '', $paymentDescr);
     if (strlen($paymentDescr > 120)) {
         $paymentDescr = substr($paymentDescr, 0, 120);
     }
     if (empty($order->ExternalId)) {
         $this->invoicenumber = $order->ExternalId;
     }
     if (strlen($this->invoicenumber > 32)) {
         $this->invoicenumber = substr($this->invoicenumber, 0, 32);
     }
     $this->info = $this->invoicenumber . $this->FieldSeparator . $paymentDescr . $this->FieldSeparator . "1" . $this->FieldSeparator . $this->importo . $this->FieldSeparator . $this->divisa;
     /*if ($debug){
     			$this->merchant_id = 'NCHTEST';
     			$this->abi = '03599';
     			$this->SecretKey = 'CAE5859549B7F54834040AA110A533A1';
     		}*/
     $this->hash = $this->getHash();
 }
 /**
  * Method to get a list of options for a list input.
  *
  * @return	array		An array of JHtml options.
  */
 protected function getOptions()
 {
     $document = JFactory::getDocument();
     $language = $document->getLanguage();
     $merchantCategories = BFCHelper::getMerchantCategories();
     $options = array();
     if ($merchantCategories) {
         foreach ($merchantCategories as $merchantCategory) {
             $currOpt = JHtml::_('select.option', $merchantCategory->MerchantCategoryId, BFCHelper::getLanguage($merchantCategory->Name, $language));
             $currOpt->checked = null;
             $options[] = $currOpt;
         }
     }
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
 public function setInfoRequest($customerData = NULL, $suggestedStay = NULL, $creditCardData = NULL, $otherNoteData = NULL, $merchantId = 0, $type = NULL, $userNotes = NULL, $label = NULL, $cultureCode = NULL, $processInfoRequest = NULL, $mailFrom = NULL)
 {
     $options = array('path' => $this->urlCreateInfoRequest, 'data' => array('customerData' => BFCHelper::getQuotedString(BFCHelper::getJsonEncodeString($customerData)), 'suggestedStay' => BFCHelper::getQuotedString(BFCHelper::getJsonEncodeString($suggestedStay)), 'otherNoteData' => BFCHelper::getQuotedString($otherNoteData), 'infoRequestType' => BFCHelper::getQuotedString($type), 'userNotes' => BFCHelper::getQuotedString($userNotes), 'label' => BFCHelper::getQuotedString($label), 'cultureCode' => BFCHelper::getQuotedString($cultureCode), 'processInfoRequest' => $processInfoRequest, 'mailFrom' => $mailFrom, '$format' => 'json'));
     if (!empty($merchantId) && intval($merchantId) > 0) {
         $options['data']['merchantId'] = $merchantId;
     }
     $url = $this->helper->getQuery($options);
     $order = null;
     //$r = $this->helper->executeQuery($url);
     $r = $this->helper->executeQuery($url, "POST");
     if (isset($r)) {
         $res = json_decode($r);
         $order = $res->d->results ?: $res->d;
     }
     return $order;
 }
Example #17
0
 public function getPrivacyFromService($language = '')
 {
     $options = array('path' => $this->urlGetPrivacy, 'data' => array('cultureCode' => BFCHelper::getQuotedString($language), '$format' => 'json'));
     $url = $this->helper->getQuery($options);
     $return = null;
     $r = $this->helper->executeQuery($url);
     if (isset($r)) {
         $res = json_decode($r);
         if (!empty($res->d->results)) {
             $return = $res->d->results->GetPrivacy;
         } elseif (!empty($res->d)) {
             $return = $res->d->GetPrivacy;
         }
     }
     return $return;
 }
 function display($tpl = NULL, $preparecontent = false)
 {
     $document = JFactory::getDocument();
     $language = $document->getLanguage();
     $config = JComponentHelper::getParams('com_bookingforconnector');
     $app = JFactory::getApplication();
     // Initialise variables
     $state = $this->get('State');
     $items = $this->get('Items');
     $pagination = $this->get('Pagination');
     $sortColumn = $state->get('list.ordering');
     $sortDirection = $state->get('list.direction');
     $params = $state->params;
     $typologies = $this->getModel()->getMasterTypologies(true, $language);
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseWarning(500, implode("\n", $errors));
         return false;
     }
     $pagination->setAdditionalUrlParam("filter_order", $sortColumn);
     $pagination->setAdditionalUrlParam("filter_order_Dir", $sortDirection);
     $pagination->setAdditionalUrlParam("searchid", $params['searchid']);
     $filters = BFCHelper::getFilterSearchParamsSession();
     if (!empty($filters)) {
         foreach ($filters as $key => $value) {
             $pagination->setAdditionalUrlParam("filters[" . $key . "]", $value);
         }
     }
     $hidesort = false;
     $this->assignRef('state', $state);
     $this->assignRef('params', $params);
     $this->assignRef('items', $items);
     $this->assignRef('pagination', $pagination);
     $this->assignRef('language', $language);
     $this->assignRef('typologies', $typologies);
     $this->assignRef('config', $config);
     $this->assignRef('hidesort', $hidesort);
     $maxItemsView = 3;
     $this->assignRef('maxItemsView', $maxItemsView);
     $analyticsEnabled = $this->checkAnalytics("");
     $this->assignRef('analyticsEnabled', $analyticsEnabled);
     // Display the view
     parent::display($tpl, true);
 }
Example #19
0
 public function setRating($name = NULL, $city = NULL, $typologyid = NULL, $email = NULL, $nation = NULL, $merchantId = NULL, $value1 = NULL, $value2 = NULL, $value3 = NULL, $value4 = NULL, $value5 = NULL, $totale = NULL, $pregi = NULL, $difetti = NULL, $userId = NULL, $cultureCode = NULL, $checkin = NULL, $resourceId = NULL, $orderId = NULL, $label = NULL)
 {
     $options = array('path' => $this->urlCreateRating, 'data' => array('name' => BFCHelper::getQuotedString($name), 'city' => BFCHelper::getQuotedString($city), 'typologyid' => $typologyid, 'email' => BFCHelper::getQuotedString($email), 'nation' => BFCHelper::getQuotedString($nation), 'merchantId' => $merchantId, 'value1' => $value1, 'value2' => $value2, 'value3' => $value3, 'value4' => $value4, 'value5' => $value5, 'total' => $totale, 'notesData' => BFCHelper::getQuotedString($pregi), 'notesData1' => BFCHelper::getQuotedString($difetti), 'userId' => $userId, 'orderId' => $orderId, 'resourceId' => $resourceId, 'checkin' => BFCHelper::getQuotedString($checkin), 'label' => BFCHelper::getQuotedString($label), 'cultureCode' => BFCHelper::getQuotedString($cultureCode), 'processRating' => 1, '$format' => 'json'));
     $url = $this->helper->getQuery($options);
     $ratingId = 0;
     //$r = $this->helper->executeQuery($url);
     $r = $this->helper->executeQuery($url, "POST");
     if (isset($r)) {
         $res = json_decode($r);
         //$ratingId = $res->d->results ?: $res->d;
         //			$resRating = $res->d->results ?: $res->d;
         if (!empty($res->d->results)) {
             $ratingId = $res->d->results->CreateRating;
         } elseif (!empty($res->d)) {
             $ratingId = $res->d->CreateRating;
         }
         //			$ratingId = $resRating->CreateRating;
     }
     return $ratingId;
 }
 public function getCriteoConfiguration($pagetype = 0, $merchantsList = array(), $orderId = null)
 {
     $language = JFactory::getLanguage()->getTag();
     $options = array('path' => $this->GetCriteoConfiguration, 'data' => array('cultureCode' => BFCHelper::getQuotedString($language), '$format' => 'json', 'pagetype' => $pagetype, 'callerUrl' => BFCHelper::getQuotedString(JURI::current()), 'merchantsList' => BFCHelper::getQuotedString(join(',', $merchantsList))));
     if (isset($orderId) && !empty($orderId)) {
         $options["data"]["orderId"] = $orderId;
     }
     $url = $this->helper->getQuery($options);
     $return = null;
     $r = $this->helper->executeQuery($url);
     if (isset($r)) {
         $res = json_decode($r);
         if (!empty($res->d->results)) {
             $return = $res->d->results;
         } elseif (!empty($res->d)) {
             $return = json_decode($res->d->GetCriteoConfiguration);
         }
     }
     return $return;
 }
Example #21
0
 public function setCrew($customerData = NULL, $merchantId = NULL, $orderId = NULL)
 {
     $params = $this->getState('params');
     if ($customerData == null) {
         $customerData = $params['customerData'];
     }
     if (COM_BOOKINGFORCONNECTOR_USEEXTERNALUPDATEORDER) {
         $this->urlCreateCrew = '/CreateCrewFrom' . COM_BOOKINGFORCONNECTOR_USEEXTERNALUPDATEORDERSYSTEM;
     }
     $options = array('path' => $this->urlCreateCrew, 'data' => array('crewData' => BFCHelper::getQuotedString(BFCHelper::getJsonEncodeString($customerData)), 'merchantId' => $merchantId, 'orderId' => $orderId, '$format' => 'json', '$expand' => 'ChildCrews'));
     $url = $this->helper->getQuery($options);
     $crew = null;
     //$r = $this->helper->executeQuery($url);
     $r = $this->helper->executeQuery($url, "POST");
     if (isset($r)) {
         $res = json_decode($r);
         $crew = $res->d->results ?: $res->d;
     }
     return $crew[0];
 }
Example #22
0
 function display($tpl = null)
 {
     BookingForConnectorViewCondominiumBase::basedisplay($tpl);
     $state = $this->get('State');
     $item = $this->get('Item');
     $document = JFactory::getDocument();
     $language = $document->getLanguage();
     $isFromSearch = false;
     BFCHelper::setState($item, 'condominium', 'condominium');
     if (JRequest::getString('layout') == 'resourcesajax') {
         $items = $this->get('ItemsResourcesAjax');
     } else {
         //if (JRequest::getString('layout') == 'resources') {
         if (JRequest::getString('search') == '1') {
             $isFromSearch = true;
             $items = $this->get('ItemsSearch');
             $pagination = $this->get('Pagination');
         } else {
             $items = $this->get('Items');
             $pagination = $this->get('Pagination');
         }
     }
     //		$document->addStyleSheet(COM_BOOKINGFORCONNECTOR_SCRIPT_PATH.'assets/css/resource.css');
     // add stylesheet
     $document->addStylesheet(COM_BOOKINGFORCONNECTOR_SCRIPT_PATH . 'assets/css/bookingfor.css');
     $document->addStylesheet(COM_BOOKINGFORCONNECTOR_SCRIPT_PATH . 'assets/css/bookingfor-responsive.css');
     $document->addScript(COM_BOOKINGFORCONNECTOR_SCRIPT_PATH . 'assets/js/jquery.form.js');
     $document->addScript(COM_BOOKINGFORCONNECTOR_SCRIPT_PATH . 'assets/js/jquery.blockUI.js');
     $document->addScript(COM_BOOKINGFORCONNECTOR_SCRIPT_PATH . 'assets/js/bf.js');
     $this->assignRef('document', $document);
     $this->assignRef('language', $language);
     $this->assignRef('item', $item);
     $this->assignRef('items', $items);
     $this->assignRef('pagination', $pagination);
     $this->assignRef('isFromSearch', $isFromSearch);
     //		$item		= $this->get('Item');
     //$item->Name = $item->nome;
     //$this->setBreadcrumb($item, 'resources');
     $this->setBreadcrumb($item, 'condominiums', $language);
     parent::display($tpl);
 }
Example #23
0
 public function getTotal()
 {
     $userId = '';
     $user = JFactory::getUser();
     if ($user->id != 0) {
         $userId = $user->id . "|" . $user->username . "|" . $_SERVER["SERVER_NAME"];
     } else {
         return 0;
     }
     $language = JFactory::getLanguage()->getTag();
     $options = array('path' => $this->urlGetOrdersCount, 'data' => array('userid' => BFCHelper::getQuotedString($userId), 'cultureCode' => BFCHelper::getQuotedString($language), '$format' => 'json'));
     //		$this->applyDefaultFilter($options);
     $url = $this->helper->getQuery($options);
     $count = null;
     $r = $this->helper->executeQuery($url);
     if (isset($r)) {
         $count = (int) $r;
         //			$res = json_decode($r);
         //			$count = $res->d->GetOffersCount;
     }
     return $count;
 }
 function setBreadcrumb($resource, $layout = '', $language)
 {
     if (!empty($resource)) {
         $mainframe = JFactory::getApplication();
         $pathway = $mainframe->getPathway();
         // resetto il pathway
         //				$pathway->setPathway(null);
         $count = count($pathway);
         $newPathway = array();
         if ($count > 1) {
             $newPathway = array_pop($pathway);
         }
         $pathway->setPathway($newPathway);
         //				$resourceName = BFCHelper::getLanguage($resource->Name, $language);
         $resourceName = BFCHelper::getLanguage($resource->Name, $this->language, null, array('ln2br' => 'ln2br', 'striptags' => 'striptags'));
         //				$pathway->addItem(
         //					$resource->Merchant->Name,
         //					JRoute::_('index.php?option=com_bookingforconnector&view=merchantdetails&merchantId=' . $resource->MerchantId . ':' . BFCHelper::getSlug($resource->Merchant->Name))
         //				);
         $pathway->addItem($resourceName, JRoute::_('index.php?option=com_bookingforconnector&view=condominium&resourceId=' . $resource->CondominiumId . ':' . BFCHelper::getSlug($resourceName)));
     }
 }
 public function __construct($config, $order, $language, $urlBack, $url, $debug = FALSE)
 {
     $paymentData = explode('|', $config);
     /*ShopID|Separator|StartSecretKey|PaymentUrl */
     $this->alias = $paymentData[0];
     $this->separator = $paymentData[1];
     $this->startSecretKey = $paymentData[2];
     $this->paymentUrl = $paymentData[3];
     $this->divisa = 'EUR';
     $this->numord = sprintf('B%s%s%s%s', rand(1, 9999) . $this->separator, $order->ExternalId, $this->separator, $order->OrderId);
     $this->email = BFCHelper::getItem($order->CustomerData, 'email') . "";
     $this->languageId = $this->getLanguage($language);
     $this->importo = intval($order->DepositAmount * 100);
     $this->url = $url;
     $this->urlBack = $urlBack;
     if ($debug) {
         $this->numord = 'testCILME534';
         $this->importo = 1;
         $this->alias = 'payment_testm_urlmac';
         $this->startSecretKey = 'esempiodicalcolomac';
     }
     $this->mac = $this->getMac();
 }
Example #26
0
 function display($tpl = null, $preparecontent = false)
 {
     BookingForConnectorViewOnSellUnitBase::basedisplay($tpl);
     $item = $this->get('Item');
     $document = JFactory::getDocument();
     $language = $document->getLanguage();
     BFCHelper::setState($item, 'onsellunit', 'onsellunit');
     //		$document->addStyleSheet('components/com_bookingforconnector/assets/css/resource.css');
     // add stylesheet
     JHTML::stylesheet('components/com_bookingforconnector/assets/css/bookingfor.css');
     JHTML::stylesheet('components/com_bookingforconnector/assets/css/bookingfor-responsive.css');
     $document->addScript('components/com_bookingforconnector/assets/js/jquery.form.js');
     $document->addScript('components/com_bookingforconnector/assets/js/jquery.blockUI.js');
     $document->addScript('components/com_bookingforconnector/assets/js/bf.js');
     $this->assignRef('document', $document);
     $this->assignRef('language', $language);
     $this->assignRef('item', $item);
     //		$item		= $this->get('Item');
     //$item->Name = $item->nome;
     //$this->setBreadcrumb($item, 'resources');
     $this->setBreadcrumb($item, 'onsellunits', $language);
     parent::display($tpl, true);
 }
	</div>
	<?php 
}
?>
	<div >
		<a name="reqform" ></a>
		<div class="borderform">
			<div class="borderformtitle">
				<h4><?php 
_e('Ask for more information', 'bfi');
?>
</h4>
			</div>
			<div class="borderformtitle">
<?php 
$isMerchantAnonymous = BFCHelper::isMerchantAnonymous($merchant->MerchantTypeId);
$indirizzo = "";
$cap = "";
$comune = "";
$provincia = "";
$phone = "";
$fax = "";
if (empty($merchant->AddressData)) {
    $indirizzo = $merchant->Address;
    $cap = $merchant->ZipCode;
    $comune = $merchant->CityName;
    $provincia = $merchant->RegionName;
    $phone = $merchant->Phone;
    $fax = $merchant->Fax;
} else {
    $addressData = $merchant->AddressData;
    // suppressing any errors
}
?>

<?php 
if (count($images) > 0) {
    ?>
<div class="royalSlider rsUni" id="resourcePlanimetrygallery">
	<?php 
    foreach ($images as $image) {
        ?>
	<a class="rsImg" href="<?php 
        echo BFCHelper::getImageUrl('onsellunits', $image);
        ?>
"><img class="rsTmb" src="<?php 
        echo BFCHelper::getImageUrl('onsellunits', $image, 'onsellunit_gallery_thumb');
        ?>
"></a>		
	<?php 
    }
    ?>
</div>

<script type="text/javascript">
<!--
jQuery(document).ready(function() {
  jQuery('#resourcePlanimetrygallery').royalSlider({
    fullscreen: {
      enabled: true,
      nativeFS: true
    },
Example #29
0
    ?>
</h4>
		<?php 
    $count = 0;
    ?>
		<?php 
    foreach ($services as $service) {
        ?>
			<?php 
        if ($count > 0) {
            echo ',';
        }
        ?>
			
			<span class="com_bookingforconnector_resource-services-service"><?php 
        echo BFCHelper::getLanguage($service->Name, $language);
        ?>
</span>
			<?php 
        $count += 1;
        ?>
		<?php 
    }
    ?>
	</div>
	<?php 
}
?>
	<?php 
if ($merchantRules != null && $merchantRules != '' || $resourceRules != null && $resourceRules != '') {
    ?>
            echo $condominium->CondominiumId;
            ?>
" style="display:none;" class="<?php 
            echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_COL;
            ?>
12">
				<?php 
        }
        ?>
					<div class="com_bookingforconnector-search-resource-details com_bookingforconnector-item-secondary <?php 
        echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_ROW;
        ?>
" style="padding-top: 10px !important;padding-bottom: 10px !important;">
					<?php 
        $resourceName = BFCHelper::getLanguage($resource->ResName, $this->language, null, array('ln2br' => 'ln2br', 'striptags' => 'striptags'));
        $currUriresource = $uriresource . '&resourceId=' . $resource->ResourceId . ':' . BFCHelper::getSlug($resourceName);
        if ($itemIdresource != 0) {
            $currUriresource .= '&Itemid=' . $itemIdresource;
        }
        $resourceRoute = JRoute::_($currUriresource);
        $bookingType = $resource->BookingType;
        $IsBookable = $resource->IsBookable;
        $btnText = JText::_('COM_BOOKINGFORCONNECTOR_MERCHANTS_VIEW_MERCHANTDETAILS_RESOURCE_BUTTON');
        $btnClass = "";
        if ($IsBookable) {
            $btnText = JText::_('COM_BOOKINGFORCONNECTOR_MERCHANTS_VIEW_MERCHANTDETAILS_RESOURCE_BUTTON_HTTPS');
            $btnClass = "com_bookingforconnector-bookable";
        }
        $classofferdisplay = "";
        if ($resource->Price < $resource->TotalPrice || $resource->IsOffer) {
            $classofferdisplay = "com_bookingforconnector_highlight";