<?php

include_once 'casafari.class.php';

//$client_url = 'https://crmapi.proppydev.com';
//$client_secret = 'ZXh0ZXJuYWxkZXY6Rml0aDVmQmRmZ3NkeEhWTUF4aXpkNW9yNjhn';
$client_url = 'https://crmapi.casafaricrm.com';
$client_secret = 'dGVuIEhvb3BlbiAtIENyZWF0aW9uIE1lZGlhOnRlbkhvb3BlbjIwMjQq';

$casafari_api = new CasafariAPI($client_url, $client_secret);

$params = [
    'PropertyIncludes' => [
        'IncludeFeatures' => true,
        'IncludeBrokers' => true,
        'IncludeAgency' => true,
        'UseHtmlDescription' => false
    ],
    'PropertyId' => ($_GET['id'] ?: null),
    'Reference' => ($_GET['reference'] ?: null),
    'BusinessTypeIds' => [
        'Sale'
    ],
    'PropertyTypeIds' => [],
    //'Featured' => true,
    'VisibleOnWebsite' => true,
    'PriceFrom' => ($_GET['price_from'] ?: null),
    'PriceTo' => ($_GET['price_to'] ?: null),
    'MinBedrooms' => ($_GET['bedrooms'] == 'Studio' ? null : $_GET['bedrooms']),
    'MaxBedrooms' => ($_GET['bedrooms'] != 6 ? ($_GET['bedrooms'] == 'Studio' ? 0 : $_GET['bedrooms']) : null),
    'Lang' => 'nl',
    'PropertyListSorts' => [
        'SortBy' => 'DateDesc'
    ],
    'InnertLocations' => [
        'RegionIds' => [],
        'CityIds' => [],
        'LocalityIds' => [],
        'Zonenames' => []
    ],
    'CorrelationId' => 'string',
    'EchoToken' => 'string',
    'PrimaryLangId' => 0,
    'RetransmissionIndicator' => true,
    'TimeStamp' => 'string',
    'Version' => 0
];

$properties_json = $casafari_api->getProperties($params);

$property = $properties_json->PropertyList[0];

//Prepare Property Vido
$video_id = null;
if ($property->video) $video_id = explode('?v=', $property->video)[1];

//Prepare Property Features
$features_list = $property->features_list;
$floors = 1;
for ($i = 0; $i < count($features_list); $i++) {
    $fl = $features_list[$i];
    if (strtolower(substr($fl, 0, 8)) == 'vloeren:') {
        $floors = trim(explode(':', $fl)[1]);
        unset($features_list[$i]);
        break;
    }
}

$build_year = 0;
for ($i = 0; $i < count($features_list); $i++) {
    $fl = $features_list[$i];
    if (strtolower(substr($fl, 0, 9)) == 'bouwjaar:') {
        $build_year = trim(explode(':', $fl)[1]);
        unset($features_list[$i]);
        break;
    }
}

$proximity_list = [];
for ($i = 0; $i < count($features_list); $i++) {
    $fl = $features_list[$i];
    if (strtolower(substr($fl, 0, 10)) == 'nabijheid:') {
        $proximity_list[] = trim(explode(':', $fl)[1]);
        unset($features_list[$i]);
    }
}
$proximity_list = array_chunk($proximity_list, ceil(count($proximity_list) / 2));
$views_list = [];
for ($i = 0; $i < count($features_list); $i++) {
    $fl = $features_list[$i];
    if (strtolower(substr($fl, 0, 8)) == 'bekeken:') {
        $views_list[] = trim(explode(':', $fl)[1]);
        unset($features_list[$i]);
    }
}
$views_list = array_chunk($views_list, ceil(count($views_list) / 2));
$features_list = array_chunk($features_list, ceil(count($features_list) / 2));

//header('Content-type: application/json; charset=utf-8');
//echo json_encode($property);
//echo '<pre>' . print_r($property, true) . '</pre>';

?>

<div data-elementor-type="wp-page" data-elementor-id="3131" class="elementor elementor-3131" data-elementor-post-type="page">
    <section class="elementor-section elementor-top-section elementor-element elementor-element-4aa74e69 elementor-section-full_width elementor-section-height-default elementor-section-height-default" data-id="4aa74e69" data-element_type="section" data-settings="{&quot;background_background&quot;:&quot;classic&quot;}">
        <div class="elementor-container elementor-column-gap-no">
            <div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-5e3c23cb" data-id="5e3c23cb" data-element_type="column">
                <div class="elementor-widget-wrap elementor-element-populated">
                    <?php if ($video_id) { ?>
                    <div class="elementor-element elementor-element-13d442ce elementor-widget elementor-widget-video" data-id="13d442ce" data-element_type="widget" data-settings="{&quot;youtube_url&quot;:&quot;https:\/\/www.youtube.com\/watch?v=<?php echo $video_id;?>&quot;,&quot;autoplay&quot;:&quot;yes&quot;,&quot;play_on_mobile&quot;:&quot;yes&quot;,&quot;loop&quot;:&quot;yes&quot;,&quot;video_type&quot;:&quot;youtube&quot;}" data-widget_type="video.default">
                        <div class="elementor-widget-container">
                            <div class="elementor-wrapper elementor-open-inline">
                                <iframe class="elementor-video" frameborder="0" allowfullscreen="" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" title="<?php echo $property->locale[0]->title; ?>" width="640" height="360" src="https://www.youtube.com/embed/<?php echo $video_id;?>?controls=0&amp;rel=0&amp;playsinline=1&amp;modestbranding=0&amp;autoplay=1&amp;enablejsapi=1&amp;origin=https%3A%2F%2Fnew.tenhoopenrealty.com&amp;widgetid=1" id="widget2"></iframe>
                            </div>
                        </div>
                    </div>
                    <?php } else { ?>
                    <div class="elementor-element elementor-element-fedc248 elementor-widget elementor-widget-image" data-id="fedc248" data-element_type="widget" data-widget_type="image.default">
                        <div class="elementor-widget-container">
                            <a href="#elementor-action%3Aaction%3Dpopup%3Aopen%26settings%3DeyJpZCI6IjMyMjMiLCJ0b2dnbGUiOmZhbHNlfQ%3D%3D" style="display:inherit;">
                                <img fetchpriority="high" decoding="async" width="2560" height="1440" src="<?php echo $property->photos[0]->Url;?>" class="attachment-full size-full wp-image-3235" alt="" srcset="<?php echo $property->photos[0]->Url;?> 2560w" sizes="(max-width: 2560px) 100vw, 2560px" style="max-height:75vh;height: 100%; width: 100%; object-fit: cover;">
                            </a>
                        </div>
                    </div>
                    <?php } ?>
                    <div class="elementor-element elementor-element-265717dc elementor-widget__width-auto elementor-absolute elementor-widget elementor-widget-button" data-id="265717dc" data-element_type="widget" data-settings="{&quot;_position&quot;:&quot;absolute&quot;}" data-widget_type="button.default">
                        <div class="elementor-widget-container">
                            <div class="elementor-button-wrapper">
                                <a class="elementor-button elementor-button-link elementor-size-sm" href="#elementor-action%3Aaction%3Dpopup%3Aopen%26settings%3DeyJpZCI6IjMyMjMiLCJ0b2dnbGUiOmZhbHNlfQ%3D%3D">
                                    <span class="elementor-button-content-wrapper">
                                        <span class="elementor-button-icon">
                                            <i aria-hidden="true" class="fas fa-search"></i> </span>
                                        <span class="elementor-button-text">PHOTOS</span>
                                    </span>
                                </a>
                                <?php if($property->widepanorama) {?>
                                <a class="elementor-button elementor-button-link elementor-size-sm" href="<?php echo $property->widepanorama;?>" target="_blank">
                                    <span class="elementor-button-content-wrapper">
                                        <span class="elementor-button-icon">
                                            <i aria-hidden="true" class="fas fa-vr-cardboard"></i> </span>
                                        <span class="elementor-button-text">VIRTUAL TOUR</span>
                                    </span>
                                </a>
                                <?php } ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <section class="elementor-section elementor-top-section elementor-element elementor-element-5838ac5b elementor-section-content-middle elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="5838ac5b" data-element_type="section" data-settings="{&quot;background_background&quot;:&quot;classic&quot;}">
        <div class="elementor-container elementor-column-gap-default">
            <div class="elementor-column elementor-col-33 elementor-top-column elementor-element elementor-element-73647656" data-id="73647656" data-element_type="column">
                <div class="elementor-widget-wrap elementor-element-populated">
                    <div class="elementor-element elementor-element-4cae016d elementor-absolute e-transform elementor-hidden-mobile elementor-widget elementor-widget-image" data-id="4cae016d" data-element_type="widget" data-settings="{&quot;_position&quot;:&quot;absolute&quot;,&quot;_transform_rotateZ_effect&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:90,&quot;sizes&quot;:[]},&quot;_transform_rotateZ_effect_tablet&quot;:{&quot;unit&quot;:&quot;deg&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;_transform_rotateZ_effect_mobile&quot;:{&quot;unit&quot;:&quot;deg&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]}}" data-widget_type="image.default">
                        <div class="elementor-widget-container">
                            <img fetchpriority="high" decoding="async" width="408" height="456" src="https://new.tenhoopenrealty.com/wp-content/uploads/2023/08/geometric.svg" class="attachment-full size-full wp-image-91" alt="">
                        </div>
                    </div>
                </div>
            </div>
            <div class="elementor-column elementor-col-33 elementor-top-column elementor-element elementor-element-50ca083e" data-id="50ca083e" data-element_type="column">
                <div class="elementor-widget-wrap elementor-element-populated">
                    <div class="elementor-element elementor-element-3884b2cb elementor-widget elementor-widget-heading animated fadeInUp" data-id="3884b2cb" data-element_type="widget" data-settings="{&quot;_animation&quot;:&quot;fadeInUp&quot;}" data-widget_type="heading.default">
                        <div class="elementor-widget-container">
                            <h2 class="elementor-heading-title elementor-size-default"><?php echo strtoupper($property->location->zone . ', ' . $property->location->City); ?></h2>
                        </div>
                    </div>
                    <div class="elementor-element elementor-element-136deab3 elementor-widget elementor-widget-heading animated fadeInUp" data-id="136deab3" data-element_type="widget" data-settings="{&quot;_animation&quot;:&quot;fadeInUp&quot;}" data-widget_type="heading.default">
                        <div class="elementor-widget-container">
                            <h3 class="elementor-heading-title elementor-size-default"><?php echo $property->price ? number_format($property->price, 0, ',', ' ') . ' ' . $property->currency : 'P. O. A.'; ?></h3>
                        </div>
                    </div>
                </div>
            </div>
            <div class="elementor-column elementor-col-33 elementor-top-column elementor-element elementor-element-276296e7" data-id="276296e7" data-element_type="column">
                <div class="elementor-widget-wrap elementor-element-populated">
                    <div class="elementor-element elementor-element-55d3e485 elementor-icon-list--layout-inline elementor-align-center elementor-list-item-link-full_width elementor-widget elementor-widget-icon-list" data-id="55d3e485" data-element_type="widget" data-widget_type="icon-list.default">
                        <div class="elementor-widget-container">
                            <ul class="elementor-icon-list-items elementor-inline-items">
                                <li class="elementor-icon-list-item elementor-inline-item" id="share-icon" style="cursor: pointer">
                                    <span class="elementor-icon-list-icon">
                                        <svg xmlns="http://www.w3.org/2000/svg" id="Icon_feather-share-2" data-name="Icon feather-share-2" width="23.233" height="25.556" viewBox="0 0 23.233 25.556">
                                            <path id="Path_111" data-name="Path 111" d="M25.647,1.5A4.647,4.647,0,1,1,21,6.147,4.652,4.652,0,0,1,25.647,1.5Zm0,6.97a2.323,2.323,0,1,0-2.323-2.323A2.326,2.326,0,0,0,25.647,8.47Z" transform="translate(-7.06 -1.5)" fill="#d3b37d"></path>
                                            <path id="Path_112" data-name="Path 112" d="M7.647,12A4.647,4.647,0,1,1,3,16.647,4.652,4.652,0,0,1,7.647,12Zm0,6.97a2.323,2.323,0,1,0-2.323-2.323A2.326,2.326,0,0,0,7.647,18.97Z" transform="translate(-3 -3.868)" fill="#d3b37d"></path>
                                            <path id="Path_113" data-name="Path 113" d="M25.647,22.5A4.647,4.647,0,1,1,21,27.147,4.652,4.652,0,0,1,25.647,22.5Zm0,6.97a2.323,2.323,0,1,0-2.323-2.323A2.326,2.326,0,0,0,25.647,29.47Z" transform="translate(-7.06 -6.237)" fill="#d3b37d"></path>
                                            <path id="Path_114" data-name="Path 114" d="M20.48,25.712a1.156,1.156,0,0,1-.584-.158L11.962,20.93a1.162,1.162,0,1,1,1.17-2.007l7.934,4.623a1.162,1.162,0,0,1-.586,2.166Z" transform="translate(-4.891 -5.394)" fill="#d3b37d"></path>
                                            <path id="Path_115" data-name="Path 115" d="M12.548,15.212a1.162,1.162,0,0,1-.587-2.165l7.922-4.623a1.162,1.162,0,1,1,1.171,2.007l-7.922,4.623A1.156,1.156,0,0,1,12.548,15.212Z" transform="translate(-4.891 -3.026)" fill="#d3b37d"></path>
                                        </svg> </span>
                                    <span class="elementor-icon-list-text"></span>
                                </li>
                                <!--
                                <li class="elementor-icon-list-item elementor-inline-item">
                                    <span class="elementor-icon-list-icon">
                                        <svg xmlns="http://www.w3.org/2000/svg" width="20.91" height="25.556" viewBox="0 0 20.91 25.556">
                                            <g id="Icon_feather-share" data-name="Icon feather-share" transform="translate(20.91 25.556) rotate(180)">
                                                <path id="Path_114" data-name="Path 114" d="M21.925,30.44H7.985A3.489,3.489,0,0,1,4.5,26.955V17.662a1.162,1.162,0,0,1,2.323,0v9.293a1.163,1.163,0,0,0,1.162,1.162h13.94a1.163,1.163,0,0,0,1.162-1.162V17.662a1.162,1.162,0,1,1,2.323,0v9.293A3.489,3.489,0,0,1,21.925,30.44Z" transform="translate(-4.5 -4.883)" fill="#d3b37d"></path>
                                                <path id="Path_115" data-name="Path 115" d="M20.955,8.47a1.158,1.158,0,0,1-.821-.34L16.308,4.3,12.483,8.13A1.162,1.162,0,0,1,10.84,6.487L15.487,1.84a1.162,1.162,0,0,1,1.643,0l4.647,4.647a1.162,1.162,0,0,1-.821,1.983Z" transform="translate(-5.853 -1.5)" fill="#d3b37d"></path>
                                                <path id="Path_116" data-name="Path 116" d="M17.662,18.925A1.162,1.162,0,0,1,16.5,17.763V2.662a1.162,1.162,0,0,1,2.323,0v15.1A1.162,1.162,0,0,1,17.662,18.925Z" transform="translate(-7.207 -1.5)" fill="#d3b37d"></path>
                                            </g>
                                        </svg> </span>
                                    <span class="elementor-icon-list-text"></span>
                                </li>
                                -->
                                <li class="elementor-icon-list-item elementor-inline-item">
                                    <a href="https://new.tenhoopenrealty.com/casafari/pdf/?reference=<?php echo $property->reference; ?>&id=<?php echo $property->id; ?>&lang=nl" target="_blank">
                                    <span class="elementor-icon-list-icon">
                                        <svg xmlns="http://www.w3.org/2000/svg" id="Icon_feather-printer" data-name="Icon feather-printer" width="25.556" height="25.556" viewBox="0 0 25.556 25.556">
                                            <path id="Path_111" data-name="Path 111" d="M22.6,11.955a1.162,1.162,0,0,1-1.162-1.162V3.823H9.823v6.97a1.162,1.162,0,0,1-2.323,0V2.662A1.162,1.162,0,0,1,8.662,1.5H22.6a1.162,1.162,0,0,1,1.162,1.162v8.132A1.162,1.162,0,0,1,22.6,11.955Z" transform="translate(-2.853 -1.5)" fill="#d3b37d"></path>
                                            <path id="Path_112" data-name="Path 112" d="M23.571,24.778H21.248a1.162,1.162,0,0,1,0-2.323h2.323a1.163,1.163,0,0,0,1.162-1.162V15.485a1.163,1.163,0,0,0-1.162-1.162H4.985a1.163,1.163,0,0,0-1.162,1.162v5.808a1.163,1.163,0,0,0,1.162,1.162H7.308a1.162,1.162,0,0,1,0,2.323H4.985A3.489,3.489,0,0,1,1.5,21.293V15.485A3.489,3.489,0,0,1,4.985,12H23.571a3.489,3.489,0,0,1,3.485,3.485v5.808A3.489,3.489,0,0,1,23.571,24.778Z" transform="translate(-1.5 -3.868)" fill="#d3b37d"></path>
                                            <path id="Path_113" data-name="Path 113" d="M8.662,19.5H22.6a1.162,1.162,0,0,1,1.162,1.162v9.293A1.162,1.162,0,0,1,22.6,31.117H8.662A1.162,1.162,0,0,1,7.5,29.955V20.662A1.162,1.162,0,0,1,8.662,19.5ZM21.44,21.823H9.823v6.97H21.44Z" transform="translate(-2.853 -5.56)" fill="#d3b37d"></path>
                                        </svg> </span>
                                    <span class="elementor-icon-list-text"></span>
                                    </a>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <section class="elementor-section elementor-top-section elementor-element elementor-element-4417b857 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="4417b857" data-element_type="section">
        <div class="elementor-container elementor-column-gap-default">
            <div class="elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-4dc18116" data-id="4dc18116" data-element_type="column">
                <div class="elementor-widget-wrap elementor-element-populated">
                    <div class="elementor-element elementor-element-7eb12eba elementor-invisible elementor-widget elementor-widget-heading" data-id="7eb12eba" data-element_type="widget" data-settings="{&quot;_animation&quot;:&quot;fadeInUp&quot;}" data-widget_type="heading.default">
                        <div class="elementor-widget-container">
                            <h3 class="elementor-heading-title elementor-size-default">DETAILS</h3>
                        </div>
                    </div>
                </div>
            </div>
            <div class="elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-4207cf97" data-id="4207cf97" data-element_type="column">
                <div class="elementor-widget-wrap elementor-element-populated">
                    <section class="elementor-section elementor-inner-section elementor-element elementor-element-54f2af56 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="54f2af56" data-element_type="section">
                        <div class="elementor-container elementor-column-gap-default">
                            <div class="elementor-column elementor-col-100 elementor-inner-column elementor-element elementor-element-644f4b55" data-id="644f4b55" data-element_type="column">
                                <div class="elementor-widget-wrap elementor-element-populated">
                                    <div class="elementor-element elementor-element-3f706694 details elementor-invisible elementor-widget elementor-widget-text-editor" data-id="3f706694" data-element_type="widget" data-settings="{&quot;_animation&quot;:&quot;fadeInUp&quot;}" data-widget_type="text-editor.default">
                                        <div class="elementor-widget-container">
                                            <table>
                                                <tbody>
                                                    <tr>
                                                        <td>REFERENCE:</td>
                                                        <td><?php echo $property->reference; ?></td>
                                                        <td>FLOORS:</td>
                                                        <td><?php echo $floors; ?></td>
                                                    </tr>
                                                    <tr>

                                                        <td>TYPE:</td>
                                                        <td><?php echo $property->typeLocale; ?></td>
                                                        <td>BUILD AREA:</td>
                                                        <td><?php echo number_format($property->living_area, 2, ',', ' '); ?>m2</td>
                                                    </tr>
                                                    <tr>
                                                        <td>BEDROOMS:</td>
                                                        <td><?php echo $property->bedrooms; ?></td>
                                                        <td>TOTAL AREA:</td>
                                                        <td><?php echo number_format($property->total_area, 2, ',', ' '); ?>m2</td>
                                                    </tr>
                                                    <tr>
                                                        <td>BATHROOMS:</td>
                                                        <td><?php echo $property->bathrooms; ?></td>
                                                        <?php if ($build_year) { ?>
                                                            <td>BOUWJAAR:</td>
                                                            <td><?php echo $build_year; ?></td>
                                                        <?php } ?>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    <?php if ($property->energy_rating && $property->energy_rating != 'InProgress') { ?>
                                        <div class="elementor-element elementor-element-718c5e91 elementor-widget elementor-widget-image" data-id="718c5e91" data-element_type="widget" data-widget_type="image.default">
                                            <div class="elementor-widget-container">
                                                <img decoding="async" width="70" height="86" src="https://new.tenhoopenrealty.com/wp-content/uploads/2024/10/<?php echo $property->energy_rating == 'A+' ? 'A-1' : $property->energy_rating; ?>.png" class="attachment-full size-full wp-image-1658" alt="">
                                            </div>
                                        </div>
                                    <?php } ?>
                                </div>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </div>
    </section>
    <section class="elementor-section elementor-top-section elementor-element elementor-element-261ff4f elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="261ff4f" data-element_type="section">
        <div class="elementor-container elementor-column-gap-default">
            <div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-36776c25" data-id="36776c25" data-element_type="column">
                <div class="elementor-widget-wrap elementor-element-populated">
                    <div class="elementor-element elementor-element-71e4e022 elementor-widget-divider--view-line elementor-widget elementor-widget-divider" data-id="71e4e022" data-element_type="widget" data-widget_type="divider.default">
                        <div class="elementor-widget-container">
                            <div class="elementor-divider">
                                <span class="elementor-divider-separator">
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <section class="elementor-section elementor-top-section elementor-element elementor-element-1831079a elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="1831079a" data-element_type="section">
        <div class="elementor-container elementor-column-gap-default">
            <div class="elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-1cb26040" data-id="1cb26040" data-element_type="column">
                <div class="elementor-widget-wrap elementor-element-populated">
                    <div class="elementor-element elementor-element-3a795bec elementor-invisible elementor-widget elementor-widget-heading" data-id="3a795bec" data-element_type="widget" data-settings="{&quot;_animation&quot;:&quot;fadeInUp&quot;}" data-widget_type="heading.default">
                        <div class="elementor-widget-container">
                            <h3 class="elementor-heading-title elementor-size-default">DESCRIPTION</h3>
                        </div>
                    </div>
                </div>
            </div>
            <div class="elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-5ed42183" data-id="5ed42183" data-element_type="column">
                <div class="elementor-widget-wrap elementor-element-populated">
                    <section class="elementor-section elementor-inner-section elementor-element elementor-element-1b39a72f elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="1b39a72f" data-element_type="section">
                        <div class="elementor-container elementor-column-gap-default">
                            <div class="elementor-column elementor-col-100 elementor-inner-column elementor-element elementor-element-b96363" data-id="b96363" data-element_type="column">
                                <div class="elementor-widget-wrap elementor-element-populated">
                                    <div class="elementor-element elementor-element-7d101065 elementor-invisible elementor-widget elementor-widget-heading" data-id="7d101065" data-element_type="widget" data-settings="{&quot;_animation&quot;:&quot;fadeInUp&quot;}" data-widget_type="heading.default">
                                        <div class="elementor-widget-container">
                                            <h3 class="elementor-heading-title elementor-size-default"><?php echo strtoupper($property->locale[0]->title) ?></h3>
                                        </div>
                                    </div>
                                    <div class="elementor-element elementor-element-15a41460 details elementor-invisible elementor-widget elementor-widget-text-editor" data-id="15a41460" data-element_type="widget" data-settings="{&quot;_animation&quot;:&quot;fadeInUp&quot;}" data-widget_type="text-editor.default">
                                        <div class="elementor-widget-container">
                                            <?php echo nl2br($property->locale[0]->description); ?>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </div>
    </section>
    <section class="elementor-section elementor-top-section elementor-element elementor-element-4757c4d0 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="4757c4d0" data-element_type="section">
        <div class="elementor-container elementor-column-gap-default">
            <div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-3a1c7b72" data-id="3a1c7b72" data-element_type="column">
                <div class="elementor-widget-wrap elementor-element-populated">
                    <div class="elementor-element elementor-element-380f524a elementor-widget-divider--view-line elementor-widget elementor-widget-divider" data-id="380f524a" data-element_type="widget" data-widget_type="divider.default">
                        <div class="elementor-widget-container">
                            <div class="elementor-divider">
                                <span class="elementor-divider-separator">
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <section class="elementor-section elementor-top-section elementor-element elementor-element-6462b982 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="6462b982" data-element_type="section">
        <div class="elementor-container elementor-column-gap-default">
            <div class="elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-ca514fd" data-id="ca514fd" data-element_type="column">
                <div class="elementor-widget-wrap elementor-element-populated">
                    <div class="elementor-element elementor-element-372d8fdd elementor-invisible elementor-widget elementor-widget-heading" data-id="372d8fdd" data-element_type="widget" data-settings="{&quot;_animation&quot;:&quot;fadeInUp&quot;}" data-widget_type="heading.default">
                        <div class="elementor-widget-container">
                            <h3 class="elementor-heading-title elementor-size-default">BEKEKEN</h3>
                        </div>
                    </div>
                </div>
            </div>
            <div class="elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-39b5c0a9" data-id="39b5c0a9" data-element_type="column">
                <div class="elementor-widget-wrap elementor-element-populated">
                    <section class="elementor-section elementor-inner-section elementor-element elementor-element-38c63e48 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="38c63e48" data-element_type="section">
                        <div class="elementor-container elementor-column-gap-default">
                            <div class="elementor-column elementor-col-100 elementor-inner-column elementor-element elementor-element-1b7c89" data-id="1b7c89" data-element_type="column">
                                <div class="elementor-widget-wrap elementor-element-populated">
                                    <div class="elementor-element elementor-element-2ed4b3d1 details elementor-invisible elementor-widget elementor-widget-text-editor" data-id="2ed4b3d1" data-element_type="widget" id="table100" data-settings="{&quot;_animation&quot;:&quot;fadeInUp&quot;}" data-widget_type="text-editor.default">
                                        <div class="elementor-widget-container">
                                            <table>
                                                <tbody>
                                                    <?php for ($i = 0; $i < count($views_list[0]); $i++) echo '<tr><td>' . $views_list[0][$i] . '</td><td>' . (isset($views_list[1][$i]) ? $views_list[1][$i] : '') . '</td></tr>'; ?> </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </div>
    </section>
    <section class="elementor-section elementor-top-section elementor-element elementor-element-4256a5f6 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="4256a5f6" data-element_type="section">
        <div class="elementor-container elementor-column-gap-default">
            <div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-b85cb0c" data-id="b85cb0c" data-element_type="column">
                <div class="elementor-widget-wrap elementor-element-populated">
                    <div class="elementor-element elementor-element-2b990ec6 elementor-widget-divider--view-line elementor-widget elementor-widget-divider" data-id="2b990ec6" data-element_type="widget" data-widget_type="divider.default">
                        <div class="elementor-widget-container">
                            <div class="elementor-divider">
                                <span class="elementor-divider-separator">
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <section class="elementor-section elementor-top-section elementor-element elementor-element-280ea5c1 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="280ea5c1" data-element_type="section">
        <div class="elementor-container elementor-column-gap-default">
            <div class="elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-2a7dedb8" data-id="2a7dedb8" data-element_type="column">
                <div class="elementor-widget-wrap elementor-element-populated">
                    <div class="elementor-element elementor-element-3c198e9d elementor-invisible elementor-widget elementor-widget-heading" data-id="3c198e9d" data-element_type="widget" data-settings="{&quot;_animation&quot;:&quot;fadeInUp&quot;}" data-widget_type="heading.default">
                        <div class="elementor-widget-container">
                            <h3 class="elementor-heading-title elementor-size-default">FEATURES</h3>
                        </div>
                    </div>
                </div>
            </div>
            <div class="elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-56f6492" data-id="56f6492" data-element_type="column">
                <div class="elementor-widget-wrap elementor-element-populated">
                    <section class="elementor-section elementor-inner-section elementor-element elementor-element-4b7b7450 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="4b7b7450" data-element_type="section">
                        <div class="elementor-container elementor-column-gap-default">
                            <div class="elementor-column elementor-col-100 elementor-inner-column elementor-element elementor-element-4833861b" data-id="4833861b" data-element_type="column">
                                <div class="elementor-widget-wrap elementor-element-populated">
                                    <div class="elementor-element elementor-element-16824638 details elementor-invisible elementor-widget elementor-widget-text-editor" data-id="16824638" data-element_type="widget" id="table100" data-settings="{&quot;_animation&quot;:&quot;fadeInUp&quot;}" data-widget_type="text-editor.default">
                                        <div class="elementor-widget-container">
                                            <table>
                                                <tbody>
                                                    <?php for ($i = 0; $i < count($features_list[0]); $i++) echo '<tr><td>' . $features_list[0][$i] . '</td><td>' . (isset($features_list[1][$i]) ? $features_list[1][$i] : '') . '</td></tr>'; ?>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </div>
    </section>
    <section class="elementor-section elementor-top-section elementor-element elementor-element-db9d874 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="db9d874" data-element_type="section">
        <div class="elementor-container elementor-column-gap-default">
            <div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-7b9a2fe1" data-id="7b9a2fe1" data-element_type="column">
                <div class="elementor-widget-wrap elementor-element-populated">
                    <div class="elementor-element elementor-element-558baf63 elementor-widget-divider--view-line elementor-widget elementor-widget-divider" data-id="558baf63" data-element_type="widget" data-widget_type="divider.default">
                        <div class="elementor-widget-container">
                            <div class="elementor-divider">
                                <span class="elementor-divider-separator">
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <section class="elementor-section elementor-top-section elementor-element elementor-element-307a836d elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="307a836d" data-element_type="section">
        <div class="elementor-container elementor-column-gap-default">
            <div class="elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-7d5fa7bf" data-id="7d5fa7bf" data-element_type="column">
                <div class="elementor-widget-wrap elementor-element-populated">
                    <div class="elementor-element elementor-element-7b0109e0 elementor-invisible elementor-widget elementor-widget-heading" data-id="7b0109e0" data-element_type="widget" data-settings="{&quot;_animation&quot;:&quot;fadeInUp&quot;}" data-widget_type="heading.default">
                        <div class="elementor-widget-container">
                            <h3 class="elementor-heading-title elementor-size-default">NABIJHEID</h3>
                        </div>
                    </div>
                </div>
            </div>
            <div class="elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-3f578d45" data-id="3f578d45" data-element_type="column">
                <div class="elementor-widget-wrap elementor-element-populated">
                    <section class="elementor-section elementor-inner-section elementor-element elementor-element-5867c329 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="5867c329" data-element_type="section">
                        <div class="elementor-container elementor-column-gap-default">
                            <div class="elementor-column elementor-col-100 elementor-inner-column elementor-element elementor-element-74f3d882" data-id="74f3d882" data-element_type="column">
                                <div class="elementor-widget-wrap elementor-element-populated">
                                    <div class="elementor-element elementor-element-1a9439c1 details elementor-invisible elementor-widget elementor-widget-text-editor" data-id="1a9439c1" data-element_type="widget" id="table100" data-settings="{&quot;_animation&quot;:&quot;fadeInUp&quot;}" data-widget_type="text-editor.default">
                                        <div class="elementor-widget-container">
                                            <table>
                                                <tbody>
                                                    <?php for ($i = 0; $i < count($proximity_list[0]); $i++) echo '<tr><td>' . $proximity_list[0][$i] . '</td><td>' . (isset($proximity_list[1][$i]) ? $proximity_list[1][$i] : '') . '</td></tr>'; ?> </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </div>
    </section>
    <section class="elementor-section elementor-top-section elementor-element elementor-element-db9d874 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="db9d874" data-element_type="section">
        <div class="elementor-container elementor-column-gap-default">
            <div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-7b9a2fe1" data-id="7b9a2fe1" data-element_type="column">
                <div class="elementor-widget-wrap elementor-element-populated">
                    <div class="elementor-element elementor-element-558baf63 elementor-widget-divider--view-line elementor-widget elementor-widget-divider" data-id="558baf63" data-element_type="widget" data-widget_type="divider.default">
                        <div class="elementor-widget-container">
                            <div class="elementor-divider">
                                <span class="elementor-divider-separator">
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <section class="elementor-section elementor-top-section elementor-element elementor-element-307a836d elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="307a836d" data-element_type="section">
        <div class="elementor-container elementor-column-gap-default">
            <div class="elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-7d5fa7bf" data-id="7d5fa7bf" data-element_type="column">
                <div class="elementor-widget-wrap elementor-element-populated">
                    <div class="elementor-element elementor-element-7b0109e0 elementor-invisible elementor-widget elementor-widget-heading" data-id="7b0109e0" data-element_type="widget" data-settings="{&quot;_animation&quot;:&quot;fadeInUp&quot;}" data-widget_type="heading.default">
                        <div class="elementor-widget-container">
                            <h3 class="elementor-heading-title elementor-size-default">DOWNLOADS</h3>
                        </div>
                    </div>
                </div>
            </div>
            <div class="elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-3f578d45" data-id="3f578d45" data-element_type="column">
                <div class="elementor-widget-wrap elementor-element-populated">
                    <section class="elementor-section elementor-inner-section elementor-element elementor-element-5867c329 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="5867c329" data-element_type="section">
                        <div class="elementor-container elementor-column-gap-default">
                            <div class="elementor-column elementor-col-100 elementor-inner-column elementor-element elementor-element-74f3d882" data-id="74f3d882" data-element_type="column">
                                <div class="elementor-widget-wrap elementor-element-populated">
                                    <div class="elementor-element elementor-element-1a9439c1 details elementor-invisible elementor-widget elementor-widget-text-editor" data-id="1a9439c1" data-element_type="widget" id="table100" data-settings="{&quot;_animation&quot;:&quot;fadeInUp&quot;}" data-widget_type="text-editor.default">
                                        <div class="elementor-widget-container">
                                            <table>
                                                <tbody>
                                                    <?php 
                                                        foreach($property->files as $file) {
                                                            $filebits = explode('/', $file->Filename);
                                                            echo '<tr><td><a href="' . $file->Filename . '" style="color:#192a67;" target="_blank">' . array_pop($filebits) . '</a></td></tr>';
                                                        }
                                                    ?>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </div>
    </section>
     <section class="elementor-section elementor-top-section elementor-element elementor-element-db9d874 elementor-section-boxed elementor-section-height-default elementor-section-height-default" id="custom-form" data-id="db9d874" data-element_type="section">
	<div class="elementor-container elementor-column-gap-default">
		<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-7b9a2fe1" data-id="7b9a2fe1" data-element_type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
				<div class="elementor-element elementor-element-558baf63 elementor-widget-divider--view-line elementor-widget elementor-widget-divider" data-id="558baf63" data-element_type="widget" data-widget_type="divider.default">
					<div class="elementor-widget-container">
						<div class="elementor-divider">
							<span class="elementor-divider-separator">
							</span>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</section>
<section class="elementor-section elementor-top-section elementor-element elementor-element-307a836d elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="7b0109e0" data-element_type="section">
					<div class="elementor-container elementor-column-gap-default">
		<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-7b0109e0" data-id="7b0109e0" data-element_type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
				<div class="elementor-element elementor-element-7b0109e0 elementor-widget elementor-widget-heading animated fadeInUp" data-id="7b0109e0" data-element_type="widget" data-settings="{&quot;_animation&quot;:&quot;fadeInUp&quot;}" data-widget_type="heading.default">
					<div class="elementor-widget-container">
						<h3 class="elementor-heading-title elementor-size-default">CONTACTAR AGORA</h3>
					</div>
						<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-contact-form-column">
							<div class="elementor-widget-wrap elementor-element-populated">
								<?php
								$wp_path = dirname(__FILE__) . '/../'; 
								require_once($wp_path . 'wp-load.php');
								
								if (class_exists('\Elementor\Plugin')) {
									$contact_form_id = 4263; // Your contact form template ID
									echo \Elementor\Plugin::instance()->frontend->get_builder_content_for_display($contact_form_id, true);
								}
								?>
							</div>
						</div>
				</div>
			</div>
		</div>
	</section>
</div>

<a class="floating-button" href="#custom-form">
CONTACTAR AGORA
</a>

<style>
   .floating-button {
    position: fixed;
    top: 45%;
    transform: translateY(-50%) rotate(270deg);
    padding: 10px 20px;
    background-color: #192A67;
    color: white;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 14px;
    border-radius: 0;
    box-shadow: -2px 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    white-space: nowrap;
}
.floating-button:hover{
    color: #fff !important;
}
.floating-button {
    right: -50px;
}
.elementor-heading-title{
    margin-bottom: 20px;
}

@media (max-width: 767px) {
    .floating-button {
        right: -45px;
    }
        .elementor-3131 .elementor-element.elementor-element-265717dc {
        bottom: 0 !important;
         top: 0 !important;
          right: 0 !important;
           left: 0 !important;
           position: relative;
           margin: 0 auto;
}
.elementor-3131 .elementor-element.elementor-element-265717dc a{
margin: 3px;
}
}
</style>