예제 #1
0
 $tripAdvisorPosition = strpos($theContent, '</div>', $tripAdvisorPosition) + 6;
 $theContent = str_insert($tripAdvisor, $theContent, $tripAdvisorPosition);
 $pageToBeDeployed = str_replace("#content#", $theContent, $pageToBeDeployed);
 // Detail pages already have their destination filtered
 $pageToBeDeployed = str_replace("#dest-region#", "", $pageToBeDeployed);
 // Add the remote path where the installation is located
 $pageToBeDeployed = str_replace("#remote-install-path#", REMOTE_INSTALL_PATH, $pageToBeDeployed);
 //Adding pricing display
 $priceDisplayHTML = "<div id='price-display'>\n\t\t\t\t\t\t\t<div class='left'>\n\t\t\t\t\t\t\t\t3 Nights\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class='right'>\n\t\t\t\t\t\t\t\t7 Nights\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\t<div class='left price'>\n\t\t\t\t\t\t\t\t#three-day-price-output#\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class='right price'>\n\t\t\t\t\t\t\t\t#seven-day-price-output#\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class='style01 clearFix'>\n\t\t\t\t\t\t\t\tSample prices per person double cccupancy and departure of #trip-start#.\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>";
 $tripStart = date("m/d/y", mktime(0, 0, 0, date("m"), date("d") + 43, date("y")));
 $sevenDayPrice = get_hotel_price($datarow[CSV_COUNTRY_CODE_INDEX], $datarow[CSV_HOTEL_CODE_INDEX], 7, $datarow[CSV_DISCOUNT_INDEX], false);
 $totalTripWithAirPrice = "";
 $threeDayPrice = "";
 if (!empty($sevenDayPrice)) {
     try {
         $totalTripWithAirPrice = get_air_price_build(DEFAULT_AIR_GATEWAY, $datarow[CSV_COUNTRY_CODE_INDEX], 7, AIR_DISCOUNT, false);
         if (!empty($totalTripWithAirPrice)) {
             $totalTripWithAirPrice = floatval($totalTripWithAirPrice) + floatval($sevenDayPrice);
             $totalTripWithAirPrice = money_format('%n', $totalTripWithAirPrice);
         } else {
             $totalTripWithAirPrice = "";
             $threeDayPrice = get_hotel_price($datarow[CSV_COUNTRY_CODE_INDEX], $datarow[CSV_HOTEL_CODE_INDEX], 3, $datarow[CSV_DISCOUNT_INDEX]);
         }
     } catch (Exception $e) {
         error_log("errored getting air price in detail pages for country : " . $datarow[CSV_COUNTRY_CODE_INDEX] . " with exceptiom: {$e}");
         $totalTripWithAirPrice = "";
         $threeDayPrice = get_hotel_price($datarow[CSV_COUNTRY_CODE_INDEX], $datarow[CSV_HOTEL_CODE_INDEX], 3, $datarow[CSV_DISCOUNT_INDEX]);
     }
     $sevenDayPrice = money_format('%n', $sevenDayPrice);
 }
 if (!empty($sevenDayPrice)) {
예제 #2
0
파일: helpers.php 프로젝트: tchalvak/airl
 function ListHotelObject($countryCode_, $hotelCode_, $hotelName_, $hotelShortDescription_, $includePrices_ = true)
 {
     $countryCode_ = convertLongCountryCodes($countryCode_);
     $this->countryCode = $countryCode_;
     $this->hotelCode = $hotelCode_;
     $this->hotelName = ucwords(strtolower($hotelName_));
     $this->hotelShortDescription = $hotelShortDescription_;
     //if(!file_exists("/var/www/vhosts/airtravel.com/httpdocs/atcref/atcimage2/".strtolower($this->countryCode.$hotelCode_)."_01lg.jpg")) {
     //$this->hotelImage = "<img src='http://www.airtravel.com/atcref/atcimage2/image-not-available.jpg' alt='.$hotelName_.' width='260' height='180' border='0'>";
     //} else {
     $this->hotelImage = "<img src='http://www.airtravel.com/atcref/atcimage2/" . strtolower(convertLongCountryCodes($this->countryCode) . $hotelCode_) . "_01lg.jpg' alt='" . $this->hotelName . "' width='260' height='180' border='0'>";
     //}
     if ($includePrices_) {
         //$this->hotelPriceForThreeDays = get_hotel_price($this->countryCode, $hotelCode_, 3, getHotelDiscount($this->countryCode, $hotelCode_));
         //if(empty($this->hotelPriceForThreeDays)) {
         //	$this->hotelPriceForSevenDays = "";
         //} else {
         $this->hotelPriceForSevenDays = get_hotel_price($this->countryCode, $hotelCode_, 7, getHotelDiscount($this->countryCode, $hotelCode_), false);
         try {
             $this->airPriceForTrip = get_air_price_build(DEFAULT_AIR_GATEWAY, $this->countryCode, 7, AIR_DISCOUNT, false);
             if (!empty($this->airPriceForTrip)) {
                 $this->airAndHotel = floatval($this->airPriceForTrip) + floatval($this->hotelPriceForSevenDays);
                 $this->airAndHotel = money_format('%n', $this->airAndHotel);
             } else {
                 $this->airAndHotel = "";
                 $this->hotelPriceForThreeDays = get_hotel_price($this->countryCode, $hotelCode_, 3, getHotelDiscount($this->countryCode, $hotelCode_));
             }
         } catch (Exception $e) {
             error_log("errored getting air price for: {$this->countryCode} with exceptiom: {$e}");
             $this->airPriceForTrip = "";
             $this->hotelPriceForThreeDays = get_hotel_price($this->countryCode, $hotelCode_, 3, getHotelDiscount($this->countryCode, $hotelCode_));
         }
         if (!empty($this->hotelPriceForSevenDays)) {
             $this->hotelPriceForSevenDays = money_format('%n', $this->hotelPriceForSevenDays);
         }
         //}
     }
     $this->hotelUrl = "http://" . SITE_DOMAIN . "/" . getHotelUrl($this->countryCode, $hotelCode_);
 }