Пример #1
0
function drawPropertyDetail()
{
    global $detailHeaderText;
    global $detailImage1;
    global $detailReference;
    global $detailPrice;
    global $detailPrice2;
    global $detailLocation;
    global $detailType;
    global $detailROLType;
    global $detailROLSubType;
    global $detailBeds;
    global $detailBaths;
    global $detailPlot;
    global $detailArea;
    global $detailTerrace;
    global $detailEnergy;
    global $detailDescription;
    global $photoArray;
    global $featuresArray;
    global $builds;
    global $dimension;
    global $agencyRef;
    global $currencyIcon;
    global $dir;
    global $languageArr;
    global $showMap;
    global $bookingPage;
    global $showBookingCalendar;
    global $datePickerLanguages;
    global $language;
    $currencyIcon = array('EUR' => '€', 'GBP' => '£', 'USD' => '$');
    $bookingDataJSon = '';
    $bookingLink = '';
    $showPlot = false;
    $showGarden = false;
    $searchLink = $dir;
    if ($searchLink == '') {
        $searchLink = '/';
    }
    if (($detailROLType == 'Plot' || $detailROLType == 'Commercial') && $detailPlot != '' && $detailPlot != '0') {
        $showPlot = true;
    } else {
        if ($detailROLType == 'House' && $detailROLSubType != 'Terraced Townhouse' && $detailPlot != '' && $detailPlot != '0') {
            $showPlot = true;
        }
    }
    if (!$showPlot) {
        if ($detailROLType == 'Apartment' && $detailROLSubType == 'Ground Floor' && $detailPlot != '' && $detailPlot != '0') {
            $showGarden = true;
        } else {
            if ($detailROLType == 'House' && $detailROLSubType == 'Terraced Townhouse' && $detailPlot != '' && $detailPlot != '0') {
                $showGarden = true;
            }
        }
    }
    if (isset($_SESSION["SearchType"]) && in_array($_SESSION["SearchType"], array('RentalLT', 'RentalST')) && $showBookingCalendar) {
        $rag = createRangeDate();
        $bookingData = rentalBooking(array('start' => $rag[0][0], 'end' => $rag[sizeof($rag) - 1][1]));
        $bookingDataJSon = json_encode($bookingData);
        $bookingLink = createUrl($dir . '/', array($bookingPage), '', '') . "?P_RefId=" . getPropertyRef();
    }
    $price = '';
    switch ($_SESSION["SearchType"]) {
        case "RentalST":
            if ($detailPrice != '') {
                $price .= formatPrice($detailPrice, isset($_SESSION["currency"]) ? $currencyIcon[$_SESSION["currency"]] : '€');
            }
            if ($detailPrice2 != '' && $detailPrice2 != $detailPrice) {
                if ($price != '') {
                    $price .= ' - ';
                }
                $price .= formatPrice($detailPrice2, isset($_SESSION["currency"]) ? $currencyIcon[$_SESSION["currency"]] : '€');
            }
            if ($price != '') {
                $price .= ' /' . $languageArr['detail_Headings']['week'];
            }
            break;
        case "RentalLT":
            if ($detailPrice != '') {
                $price .= formatPrice($detailPrice, isset($_SESSION["currency"]) ? $currencyIcon[$_SESSION["currency"]] : '€');
                $price .= ' /' . $languageArr['detail_Headings']['month'];
            }
            break;
        default:
            if ($detailPrice != '') {
                $price .= formatPrice($detailPrice, isset($_SESSION["currency"]) ? $currencyIcon[$_SESSION["currency"]] : '€');
            }
    }
    $propertyDetail = TemplateHelper::render('templates/propertyDetail.html', array('Property.Price' => $price, 'Property.LocationRef' => ' - ' . $detailReference, 'Property.NewSearchUrl' => $searchLink, 'Property.NewSearchText' => $languageArr['results_Headings']['new_Search'], 'Property.LastResult.Link' => $_SERVER['HTTP_REFERER'], 'Property.LastResult.Text' => $languageArr['detail_Headings']['last_Result'], 'Property.HeaderText' => $detailHeaderText, 'Property.PhotoText' => $languageArr['detail_Headings']['photos'], 'Property.Map.Title' => $languageArr['detail_Headings']['map'], 'Property.DetailImages' => $detailImage1, 'Property.PhotoList' => $photoArray, 'Property.DetailLocation' => $detailLocation, 'Property.StartRentalDate' => isset($_SESSION["startRentalDate"]) ? $_SESSION["startRentalDate"] : '', 'Property.EndRentalDate' => isset($_SESSION["endRentalDate"]) ? $_SESSION["endRentalDate"] : '', 'Property.LanguageCode' => $datePickerLanguages[$language], 'Property.Booking.Data' => $bookingDataJSon, 'Property.Booking.Url' => $bookingLink, 'Property.Booking.TextHover' => $languageArr['detail_Headings']['not_Available'], 'Property.Booking.LinkText' => $languageArr['detail_Headings']['calendar'], 'Property.Description' => preg_replace("/\r\n|\r|\n/", '<br />', $detailDescription), 'Property.DetailText' => $languageArr['detail_Headings']['property_Details'], 'Property.DetailBed' => $languageArr['field_Headings']['bedrooms']['header'] . ": " . $detailBeds, 'Property.DetailBath' => $languageArr['field_Headings']['bathrooms']['header'] . ": " . $detailBaths, 'Property.DetailPlot' => $languageArr['field_Headings']['plot_Size'] . ": " . formatArea($detailPlot, "m&sup2;"), 'Property.DetailBuild' => $languageArr['field_Headings']['built_Size'] . ": " . formatArea($builds, "m&sup2;"), 'Property.DetailTerrace' => $languageArr['field_Headings']['terrace_Size'] . ": " . formatArea($detailTerrace, "m&sup2;"), 'Property.DetailGarden' => $languageArr['field_Headings']['garden'] . ": " . formatArea($detailPlot, "m&sup2;"), 'Property.DetailEnergy' => $languageArr['field_Headings']['energyRating']['header'] . ": " . $detailEnergy, 'Property.Features' => $featuresArray), array('showLastResultLink' => !isFeatureSearch(), 'showMap' => $showMap, 'showBookingCalendar' => isset($_SESSION["SearchType"]) && in_array($_SESSION["SearchType"], array('RentalLT', 'RentalST')) && $showBookingCalendar, 'showPlot' => $showPlot, 'showBuild' => $builds != '', 'showTerrace' => $detailTerrace != '' && $detailTerrace != '0', 'showGarden' => $showGarden, 'showEnergy' => $detailEnergy != ''));
    return $propertyDetail;
}
Пример #2
0
function contactForm()
{
    global $languageArr;
    global $country;
    global $detailArea;
    global $detailReference;
    global $detailLocation;
    global $detailType;
    global $detailBeds;
    global $detailBaths;
    global $contactId;
    global $hashKey;
    global $language;
    global $registerLeadUrl;
    $result = TemplateHelper::render('templates/contactForm.html', array('Property.ContactForm.Action' => RegisterLeadWebkitAPI, 'Property.ContactForm.Title' => $languageArr['contact_Form']['header'], 'Property.ContactForm.FirstName' => $languageArr['contact_Form']['firstName'], 'Property.ContactForm.M1' => isset($_SESSION['M1']) ? $_SESSION['M1'] : '', 'Property.ContactForm.LastName' => $languageArr['contact_Form']['lastName'], 'Property.ContactForm.M2' => isset($_SESSION['M2']) ? $_SESSION['M2'] : '', 'Property.ContactForm.Email' => $languageArr['contact_Form']['email'], 'Property.ContactForm.M5' => isset($_SESSION['M5']) ? $_SESSION['M5'] : '', 'Property.ContactForm.Message' => $languageArr['contact_Form']['message'], 'Property.ContactForm.Submit' => $languageArr['contact_Form']['submit'], 'Property.ContactForm.DetailReference' => $detailReference, 'Property.ContactForm.DetailCountry' => $country, 'Property.ContactForm.DetailArea' => $detailArea, 'Property.ContactForm.DetailLocation' => $detailLocation, 'Property.ContactForm.DetailType' => $detailType, 'Property.ContactForm.DetailBeds' => $detailBeds, 'Property.ContactForm.DetailBaths' => $detailBaths, 'Property.ContactForm.SearchType' => getSearchTypeInt(), 'Property.ContactForm.ContactId' => $contactId, 'Property.ContactForm.HashKey' => HashKey, 'Property.ContactForm.Language' => $language, 'Property.ContactForm.ErrFirstName' => $languageArr['contact_Form']['valid_firstName'], 'Property.ContactForm.ErrLastName' => $languageArr['contact_Form']['valid_lastName'], 'Property.ContactForm.ErrEmail' => $languageArr['contact_Form']['valid_email']));
    return $result;
}
Пример #3
0
function outputFeatureResults($propertyResults)
{
    global $resultType;
    global $resultImage;
    global $resultPrice;
    global $resultPrice2;
    global $resultLocation;
    global $resultReference;
    global $resultDescription;
    global $resultBeds;
    global $resultBaths;
    global $resultTerrace;
    global $urlRewrite;
    global $searchResultType;
    global $rewritePatternUrl;
    global $queryInfo;
    global $built;
    global $languageArr;
    global $fRow;
    global $fCol;
    global $fDefaultArea;
    global $fShowFullWidth;
    global $colClass;
    $_SESSION['isFSearch'] = 1;
    $tmpText = '';
    $count = 0;
    $colClass = 'col-xs-12 col-sm-6 col-md-2';
    if (12 / $fCol > 0) {
        $colClass = 'col-xs-12 col-sm-6 col-md-' . 12 / $fCol;
    }
    if ($propertyResults !== NULL) {
        for ($i = 0; $i < $fRow; $i++) {
            $tmpText .= '<div class="row">';
            for ($j = 0; $j < $fCol; $j++) {
                if ($count < count($propertyResults)) {
                    $property = $propertyResults[$count];
                    $count++;
                    if ($_SESSION["SearchType"] == 'Resale') {
                        $resultPrice = $property['Price'];
                        $resultPrice2 = '';
                    } else {
                        $resultPrice = $property['RentalPrice1'];
                        $resultPrice2 = $property['RentalPrice2'];
                    }
                    $resultType = $property['Type'];
                    $resultImage = $property['MainImage'];
                    $resultLocation = $property['Location'];
                    $resultReference = $property['Reference'];
                    $resultDescription = $property['Description'];
                    $resultBeds = $property['Bedrooms'];
                    $resultBaths = $property['Bathrooms'];
                    $resultTerrace = $property['Terrace'];
                    $built = $property['Built'];
                    //Rewrite url with pattern config from webkitConfig
                    //option: beds, baths, type, location, refid, area, search_type, subtype
                    $sTypes = array('Resale' => $languageArr['search_Types']['for_Sale'], 'RentalLT' => $languageArr['search_Types']['longTerm_Rent'], 'RentalST' => $languageArr['search_Types']['shortTerm_Rent']);
                    $sType = $sTypes['Resale'];
                    if (isset($_SESSION["SearchType"])) {
                        $sType = $_SESSION["SearchType"];
                    }
                    $pType = 'All';
                    if (isset($_SESSION["Type"])) {
                        $pType = $_SESSION["Type"];
                    }
                    $arrayTmp = array('beds' => $resultBeds, 'baths' => $resultBaths, 'type' => $pType, 'location' => $resultLocation, 'refid' => $resultReference, 'search_type' => $sType, 'area' => $fDefaultArea, 'subtype' => 'All');
                    $data = array();
                    $patterns = explode("-", $rewritePatternUrl);
                    foreach ($patterns as $item) {
                        if ($item == 'type') {
                            if ($arrayTmp[$item] != '') {
                                $data[] = str_replace('-', ' ', $arrayTmp[$item]);
                            }
                        } else {
                            if ($arrayTmp[$item] != '' && !in_array($item, array('refid', 'location', 'type', 'search_type', 'area', 'subtype'))) {
                                $data[] = $arrayTmp[$item] . $item;
                            } else {
                                $data[] = $arrayTmp[$item];
                            }
                        }
                    }
                    $data[] = 'Feature';
                    $urlRewrite = implode('-', $data);
                    $align = '';
                    $tmpText .= featureResult();
                } else {
                    $tmpText .= '<div>&nbsp;</div>';
                }
            }
            $tmpText .= '</div>';
        }
    } else {
        $tmpText .= "<div class='row'><div class='col-md-12'>" . $languageArr['results_Headings']['no_Result'] . '</div></div>';
    }
    $resultText = TemplateHelper::render('templates/featuredProperty.html', array('Feature.TableWidth' => $fShowFullWidth ? 'width="100%"' : '', 'Feature.ListItem' => $tmpText));
    echo $resultText;
}