$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)) { if (!empty($totalTripWithAirPrice)) { $priceDisplayHTML = str_replace("#three-day-price-output#", $sevenDayPrice, $priceDisplayHTML); $priceDisplayHTML = str_replace("#seven-day-price-output#", $totalTripWithAirPrice, $priceDisplayHTML); $priceDisplayHTML = str_replace("#trip-start#", $tripStart, $priceDisplayHTML); $pageToBeDeployed = str_replace("<!--#price-info#-->", $priceDisplayHTML, $pageToBeDeployed); } else { if (!empty($threeDayPrice)) { //Valid prices were returned and should be displayed $priceDisplayHTML = str_replace("#three-day-price-output#", $threeDayPrice, $priceDisplayHTML); $priceDisplayHTML = str_replace("#seven-day-price-output#", $sevenDayPrice, $priceDisplayHTML); $priceDisplayHTML = str_replace("#trip-start#", $tripStart, $priceDisplayHTML);
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_); }