<?php
    Theme::asset()
        ->usePath()
        ->add('leaflet-css', 'libraries/leaflet/leaflet.css');
    Theme::asset()
        ->container('footer')
        ->usePath()
        ->add('leaflet-js', 'libraries/leaflet/leaflet.js');
    Theme::asset()
        ->usePath()
        ->add('magnific-css', 'libraries/magnific/magnific-popup.css');
    Theme::asset()
        ->container('footer')
        ->usePath()
        ->add('magnific-js', 'libraries/magnific/jquery.magnific-popup.min.js');
    Theme::asset()
        ->container('footer')
        ->usePath()
        ->add('property-js', 'js/property.js');
?>
<main class="detailproject bg-white">
    <div data-property-id="<?php echo e($property->id); ?>"></div>
    <?php echo $__env->make(Theme::getThemeNamespace() . '::views.real-estate.includes.slider', ['object' => $property], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

    <?php echo apply_filters('ads_render', null, 'property_detail_before'); ?>


    <div class="container-fluid w90 padtop20">
        <h1 class="titlehouse"><?php echo e($property->name); ?></h1>
        <?php if(RealEstateHelper::isEnabledReview()): ?>
            <p style="margin-bottom: 5px;"><?php echo $__env->make(Theme::getThemeNamespace('views.real-estate.partials.review-star'), [
                'avgStar' => $property->reviews_avg_star,
                'count' => $property->reviews_count,
            ], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?></p>
        <?php endif; ?>
        <p class="addresshouse">
            <?php if($address = implode(', ', array_filter([$property->city->name, $property->state->name]))): ?>
                <span
                    class="d-inline-block"
                    style="margin-right: 10px"
                >
                    <i class="fas fa-map-marker-alt"></i> <?php echo e($address); ?>

                </span>
            <?php endif; ?>
            <?php if(setting('real_estate_display_views_count_in_detail_page', 0) == 1): ?>
                <span
                    class="d-inline-block"
                    style="margin-right: 10px"
                ><i class="fa fa-eye"></i> <?php echo e(number_format($property->views)); ?> <?php echo e(__('views')); ?></span>
            <?php endif; ?>
            <span class="d-inline-block"><i class="fa fa-calendar-alt"></i>
                <?php echo e($property->created_at->translatedFormat('M d, Y')); ?></span>
        </p>
        <div class="d-none">
            <?php echo Theme::partial('breadcrumb'); ?>

        </div>
        <p class="pricehouse"> <?php echo e($property->price_html); ?> <?php echo $property->status_html; ?></p>
        <div class="row">
            <div class="col-md-8">
                <?php echo apply_filters('before_single_content_detail', null, $property); ?>


                <div class="row pt-3">
                    <div class="col-sm-12">
                        <h5 class="headifhouse"><?php echo e(__('Overview')); ?></h5>
                        <div class="row py-2">
                            <div class="col-sm-12">
                                <table class="table table-striped table-bordered">
                                    <?php if($lastUpdated = $property->getMetaData('last_updated', true)): ?>
                                        <tr>
                                            <td><?php echo e(__('Last Updated')); ?></td>
                                            <td>
                                                <strong>
                                                    <?php echo e(rescue(fn () => Carbon\Carbon::parse($lastUpdated)->translatedFormat('M d, Y'))); ?>

                                                </strong>
                                            </td>
                                        </tr>
                                    <?php endif; ?>

                                    <?php if($property->unique_id): ?>
                                        <tr>
                                            <td><?php echo e(__('Property ID')); ?></td>
                                            <td>
                                                <strong>
                                                    <?php echo e($property->unique_id); ?>

                                                </strong>
                                            </td>
                                        </tr>
                                    <?php endif; ?>
                                    <?php if($property->categories->isNotEmpty()): ?>
                                        <tr>
                                            <td><?php echo e(__('Category')); ?></td>
                                            <td>
                                                <strong>
                                                    <?php $__currentLoopData = $property->categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <a href="<?php echo e($category->url); ?>"><?php echo BaseHelper::clean($category->name); ?></a>
                                                        <?php if(!$loop->last): ?>
                                                            ,&nbsp;
                                                        <?php endif; ?>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </strong>
                                            </td>
                                        </tr>
                                    <?php endif; ?>
                                    <?php if($property->square): ?>
                                        <tr>
                                            <td><?php echo e(__('Square')); ?></td>
                                            <td><strong><?php echo e($property->square_text); ?></strong></td>
                                        </tr>
                                    <?php endif; ?>
                                    <?php if($property->number_bedroom): ?>
                                        <tr>
                                            <td><?php echo e(__('Number of bedrooms')); ?></td>
                                            <td><strong><?php echo e(number_format($property->number_bedroom)); ?></strong></td>
                                        </tr>
                                    <?php endif; ?>
                                    <?php if($property->number_bathroom): ?>
                                        <tr>
                                            <td><?php echo e(__('Number of bathrooms')); ?></td>
                                            <td><strong><?php echo e(number_format($property->number_bathroom)); ?></strong></td>
                                        </tr>
                                    <?php endif; ?>
                                    <?php if($property->number_floor): ?>
                                        <tr>
                                            <td><?php echo e(__('Number of floors')); ?></td>
                                            <td><strong><?php echo e(number_format($property->number_floor)); ?></strong></td>
                                        </tr>
                                    <?php endif; ?>
                                    <tr>
                                        <td><?php echo e(__('Price')); ?></td>
                                        <td><strong><?php echo e($property->price_html); ?></strong></td>
                                    </tr>
                                    <?php $__currentLoopData = $property->customFields; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $customField): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <tr>
                                            <td><?php echo BaseHelper::clean($customField->name); ?></td>
                                            <td><strong><?php echo BaseHelper::clean($customField->value); ?></strong></td>
                                        </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    <?php echo apply_filters('property_details_extra_info', null, $property); ?>

                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <?php if($property->content): ?>
                    <div class="row">
                        <div class="col-sm-12">
                            <h5 class="headifhouse"><?php echo e(__('Description')); ?></h5>
                            <div class="ck-content">
                                <?php echo BaseHelper::clean($property->content); ?>

                            </div>
                        </div>
                    </div>
                <?php endif; ?>
                <?php if($property->features->count()): ?>
                    <br>
                    <div class="row">
                        <div class="col-sm-12">
                            <h5 class="headifhouse"><?php echo e(__('Features')); ?></h5>
                            <div class="row">
                                <?php $property->features->loadMissing('metadata'); ?>
                                <?php $__currentLoopData = $property->features; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $feature): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <div class="col-sm-4">
                                        <?php if($feature->getMetaData('icon_image', true)): ?>
                                            <p><i><img
                                                        src="<?php echo e(RvMedia::getImageUrl($feature->getMetaData('icon_image', true))); ?>"
                                                        alt="<?php echo e($feature->name); ?>"
                                                        style="vertical-align: top; margin-top: 3px;"
                                                        width="18"
                                                        height="18"
                                                    ></i> <?php echo e($feature->name); ?></p>
                                        <?php else: ?>
                                            <p><i
                                                    class="<?php if($feature->icon): ?> <?php echo e($feature->icon); ?> <?php else: ?> fas fa-check <?php endif; ?> text-orange text0i"></i>
                                                <?php echo e($feature->name); ?></p>
                                        <?php endif; ?>
                                    </div>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </div>
                        </div>
                    </div>
                <?php endif; ?>
                <br>
                <?php if($property->facilities->isNotEmpty()): ?>
                    <div class="row">
                        <div class="col-sm-12">
                            <h5 class="headifhouse"><?php echo e(__('Distance key between facilities')); ?></h5>
                            <div class="row">
                                <?php $property->facilities->loadMissing('metadata'); ?>
                                <?php $__currentLoopData = $property->facilities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $facility): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <div class="col-sm-4">
                                        <?php if($facility->getMetaData('icon_image', true)): ?>
                                            <p><i><img
                                                        src="<?php echo e(RvMedia::getImageUrl($facility->getMetaData('icon_image', true))); ?>"
                                                        alt="<?php echo e($facility->name); ?>"
                                                        style="vertical-align: top; margin-top: 3px;"
                                                        width="18"
                                                        height="18"
                                                    ></i> <?php echo e($facility->name); ?> - <?php echo e($facility->pivot->distance); ?></p>
                                        <?php else: ?>
                                            <p><i
                                                    class="<?php if($facility->icon): ?> <?php echo e($facility->icon); ?> <?php else: ?> fas fa-check <?php endif; ?> text-orange text0i"></i>
                                                <?php echo e($facility->name); ?> - <?php echo e($facility->pivot->distance); ?></p>
                                        <?php endif; ?>
                                    </div>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </div>
                        </div>
                    </div>
                    <br>
                <?php endif; ?>
                <?php if(RealEstateHelper::isEnabledProjects() && $property->project_id && ($project = $property->project)): ?>
                    <div class="row pb-3">
                        <div class="col-sm-12">
                            <h5 class="headifhouse"><?php echo e(__("Project's information")); ?></h5>
                        </div>
                        <div class="col-sm-12">
                            <div class="row item">
                                <div class="col-md-4 col-sm-5 pr-sm-0">
                                    <div class="img h-100 bg-light">
                                        <a href="<?php echo e($project->url); ?>">
                                            <img
                                                class="thumb lazy"
                                                data-src="<?php echo e(RvMedia::getImageUrl($project->image, null, false, RvMedia::getDefaultImage())); ?>"
                                                src="<?php echo e(RvMedia::getImageUrl($project->image, null, false, RvMedia::getDefaultImage())); ?>"
                                                alt="<?php echo e($project->name); ?>"
                                            >
                                        </a>
                                    </div>
                                </div>
                                <div class="col-md-8 col-sm-7 pt-2 pr-sm-0 bg-light">
                                    <h5><a
                                            class="font-weight-bold text-dark"
                                            href="<?php echo e($project->url); ?>"
                                        ><?php echo BaseHelper::clean($project->name); ?></a></h5>
                                    <div><?php echo e(Str::limit($project->description, 120)); ?></div>
                                    <p><a href="<?php echo e($project->url); ?>"><?php echo e(__('Read more')); ?></a></p>
                                </div>
                            </div>
                        </div>
                    </div>
                <?php endif; ?>
                <br>
                <?php if($property->latitude && $property->longitude): ?>
                    <?php echo Theme::partial('real-estate.elements.traffic-map-modal', ['location' => $property->location]); ?>


                    <div class="d-none d-print-block">
                        <a
                            class="text-decoration-none"
                            href="https://maps.google.com/?ll=<?php echo e($property->latitude); ?>,<?php echo e($property->longitude); ?>"
                        >
                            <?php echo e($property->location ?: $address); ?>

                        </a>
                    </div>
                <?php else: ?>
                    <?php echo Theme::partial('real-estate.elements.gmap-canvas', ['location' => $property->location]); ?>


                    <div class="d-none d-print-block">
                        <a
                            class="text-decoration-none"
                            href="https://www.google.com/maps/search/<?php echo e(urlencode($property->location)); ?>"
                        >
                            <?php echo e($property->location ?: $address); ?>

                        </a>
                    </div>
                <?php endif; ?>
                <br>
                <?php if($property->video_url): ?>
                    <?php echo Theme::partial('real-estate.elements.video', ['object' => $property, 'title' => __('Property video')]); ?>

                <?php endif; ?>

                <?php echo apply_filters('after_single_content_detail', null, $property); ?>


                <br>
                <?php echo Theme::partial('share', ['title' => __('Share this property'), 'description' => $property->description]); ?>

                <div class="clearfix"></div>
                <?php echo apply_filters(
                    BASE_FILTER_PUBLIC_COMMENT_AREA,
                    theme_option('facebook_comment_enabled_in_property', 'no') == 'yes' ? Theme::partial('comments') : null,
                ); ?>


                <?php echo apply_filters('after_property_detail_content', null, $property); ?>


                <br>
                <?php if(RealEstateHelper::isEnabledReview()): ?>
                    <?php echo $__env->make(Theme::getThemeNamespace('views.real-estate.partials.reviews'), [
                        'model' => $property,
                    ], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                <?php endif; ?>
            </div>
            <div class="col-md-4">
                <?php echo apply_filters('ads_render', null, 'property_detail_sidebar_before'); ?>


                <?php echo apply_filters('property_right_details_info', null, $property); ?>


                <?php if(!RealEstateHelper::hideAgentInfoInPropertyDetailPage() && ($account = $property->author)): ?>
                    <div class="boxright p-3">
                        <div class="head">
                            <?php echo e(__('Contact agency')); ?>

                        </div>

                        <div class="row rowm10 itemagent">
                            <div class="col-lg-4 colm10">
                                <?php if($account->url): ?>
                                    <a href="<?php echo e($account->url); ?>">
                                        <?php if($account->avatar->url): ?>
                                            <img
                                                class="img-thumbnail"
                                                src="<?php echo e(RvMedia::getImageUrl($account->avatar->url, 'thumb')); ?>"
                                                alt="<?php echo e($account->name); ?>"
                                            >
                                        <?php else: ?>
                                            <img
                                                class="img-thumbnail"
                                                src="<?php echo e($account->avatar_url); ?>"
                                                alt="<?php echo e($account->name); ?>"
                                            >
                                        <?php endif; ?>
                                    </a>
                                <?php else: ?>
                                    <?php if($account->avatar->url): ?>
                                        <img
                                            class="img-thumbnail"
                                            src="<?php echo e(RvMedia::getImageUrl($account->avatar->url, 'thumb')); ?>"
                                            alt="<?php echo e($account->name); ?>"
                                        >
                                    <?php else: ?>
                                        <img
                                            class="img-thumbnail"
                                            src="<?php echo e($account->avatar_url); ?>"
                                            alt="<?php echo e($account->name); ?>"
                                        >
                                    <?php endif; ?>
                                <?php endif; ?>
                            </div>
                            <div class="col-lg-8 colm10">
                                <div class="info">
                                    <p>
                                        <strong>
                                            <?php if($account->url): ?>
                                                <a href="<?php echo e($account->url); ?>"><?php echo e($account->name); ?></a>
                                            <?php else: ?>
                                                <?php echo e($account->name); ?>

                                            <?php endif; ?>
                                        </strong>
                                    </p>
                                    <?php if($account->phone && !setting('real_estate_hide_agency_phone', 0)): ?>
                                        <?php
                                            Theme::set('hotlineNumber', $account->phone);
                                        ?>
                                        <p
                                            class="mobile"
                                            dir="ltr"
                                        ><a href="tel:<?php echo e($account->phone); ?>"><?php echo e($account->phone); ?></a></p>
                                    <?php elseif($hotline = theme_option('hotline')): ?>
                                        <p
                                            class="mobile"
                                            dir="ltr"
                                        ><a href="tel:<?php echo e($hotline); ?>"><?php echo e($hotline); ?></a>
                                        </p>
                                    <?php endif; ?>
                                    <?php if($account->email && !setting('real_estate_hide_agency_email', 0)): ?>
                                        <p><a href="mailto:<?php echo e($account->email); ?>"><?php echo e($account->email); ?></a></p>
                                    <?php endif; ?>
                                    <?php if($account->url): ?>
                                        <p><span class="fas fa-arrow-circle-right me-1"></span> <a
                                                href="<?php echo e($account->url); ?>"
                                            ><?php echo e(__('More properties by this agent')); ?></a></p>
                                    <?php endif; ?>
                                </div>
                            </div>
                        </div>
                    </div>
                <?php endif; ?>
                <div class="boxright p-3">
                    <?php echo Theme::partial('consult-form', ['type' => 'property', 'data' => $property]); ?>

                </div>

                <?php echo apply_filters('ads_render', null, 'property_detail_sidebar_after'); ?>

            </div>
        </div>
        <br>
        <div class="projecthome mb-2">
            <?php
                $relatedProperties = app(\Botble\RealEstate\Repositories\Interfaces\PropertyInterface::class)
                    ->getRelatedProperties(
                        $property->id,
                        theme_option('number_of_related_properties', 8),
                        \Botble\RealEstate\Facades\RealEstateHelper::getPropertyRelationsQuery()
                    );
            ?>

            <?php if($relatedProperties->isNotEmpty()): ?>
                <h3 class="headifhouse"><?php echo e(__('Related properties')); ?></h3>
                <div class="row rowm10">
                    <?php $__currentLoopData = $relatedProperties; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $relatedProperty): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="col-sm-6 col-lg-4 col-xl-3 colm10">
                            <?php echo Theme::partial('real-estate.properties.item', ['property' => $relatedProperty]); ?>

                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
            <?php endif; ?>
        </div>
    </div>

    <?php echo apply_filters('ads_render', null, 'property_detail_after'); ?>

</main>

<script id="traffic-popup-map-template" type="text/x-custom-template">
    <?php echo Theme::partial('real-estate.properties.map', ['property' => $property]); ?>

</script>
<?php /**PATH /home/gyannewsoftware/public_html/realestate13_FlexHome/platform/themes/flex-home/views/real-estate/property.blade.php ENDPATH**/ ?>