
<?php $__env->startSection('title'); ?> <?php if( ! empty($title)): ?> <?php echo e($title); ?> | <?php endif; ?> ##parent-placeholder-3c6de1b7dd91465d437ef415f94f36afc1fbc8a8## <?php $__env->stopSection(); ?>

<?php $__env->startSection('social-meta'); ?>
<meta property="og:title" content="<?php echo e($ad->title); ?>">
<meta property="og:description"
    content="<?php echo e(substr(trim(preg_replace('/\s\s+/', ' ',strip_tags($ad->description) )),0,160)); ?>">
<?php if($ad->media_img->first()): ?>
<meta property="og:image" content="<?php echo e(media_url($ad->media_img->first(), true)); ?>">
<?php else: ?>
<meta property="og:image" content="<?php echo e(asset('uploads/placeholder.png')); ?>">
<?php endif; ?>
<meta property="og:url" content="<?php echo e(route('single_ad', $ad->slug)); ?>">
<meta name="twitter:card" content="summary_large_image">
<!--  Non-Essential, But Recommended -->
<meta name="og:site_name" content="<?php echo e(get_option('site_name')); ?>">
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page-css'); ?>
<link rel="stylesheet" href="<?php echo e(asset('assets/plugins/fotorama-4.6.4/fotorama.css')); ?>">
<link rel="stylesheet" href="<?php echo e(asset('assets/plugins/owl.carousel/assets/owl.carousel.css')); ?>">
<style>
    /* The Modal (background) */
    .modals {
        display: none;
        /* Hidden by default */
        position: fixed;
        /* Stay in place */
        z-index: 1;
        /* Sit on top */
        padding-top: 20px;
        /* Location of the box */
        left: 0;
        top: 0;
        /* Full width */
        width: 100%;
        /* Full width */
        height: 100%;
        /* Full height */
        overflow: auto;
        /* Enable scroll if needed */
        background-color: rgb(0, 0, 0);
        /* Fallback color */
        background-color: rgba(0, 0, 0, 0.4);
        /* Black w/ opacity */
    }

    /* Modal Content */
    .modals-content {
        position: relative;
        background-color: #fefefe;
        margin: auto;
        padding: 0;
        border: 1px solid #888;
        max-width: 600px;
        ;
        width: 80%;
        box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
        -webkit-animation-name: animatetop;
        -webkit-animation-duration: 0.4s;
        animation-name: animatetop;
        animation-duration: 0.4s
    }

    /* Add Animation */
    @-webkit-keyframes animatetop {
        from {
            top: -300px;
            opacity: 0
        }

        to {
            top: 0;
            opacity: 1
        }
    }

    @keyframes  animatetop {
        from {
            top: -300px;
            opacity: 0
        }

        to {
            top: 0;
            opacity: 1
        }
    }

    /* The Close Button */
    .closed {
        color: white;
        float: right;
        font-size: 28px;
        padding: 20px 10px;
        font-weight: bold;
    }

    .closed:hover,
    .closed:focus {
        color: #000;
        text-decoration: none;
        cursor: pointer;
    }

    .modals-header {
        padding: 2px 16px;
        background-color: #6a148e;
        //font-size: 3.2vw;

        color: white;
    }

    .modals-body {
        padding: 20px 16px 10px 0px;
    }

    .modals-footer {
        padding: 2px 16px;
        background-color: #5cb85c;
        color: white;
    }

    .jg {
        border: none;
        position: relative;
        border-collapse: collapse;
        margin: 0;
        padding: 0;
        width: 100%;
        table-layout: fixed;
    }

    .jg caption {
        font-size: 1.5em;
        margin: .5em 0 .75em;
    }

    .jg tr {
        background-color: #fff;
        border: none;
        padding: .35em;
    }

    .jg th,
    .jg td {
        padding: .625em;
        text-align: center;
    }

    .jg th {
        font-size: .85em;
        letter-spacing: .1em;
        text-transform: uppercase;
    }

    @media  screen and (max-width: 2200px) {
        .jg {
            border: 0;
        }

        .jg caption {
            font-size: 1.3em;
        }

        .jg thead {
            border: none;
            clip: rect(0 0 0 0);
            height: 1px;
            margin: -1px;
            overflow: hidden;
            padding: 0;
            position: absolute;
            width: 1px;
        }

        .jg tr {

            display: block;
            margin-bottom: .625em;
        }

        .jg td {
            border-bottom: none;
            display: block;
            font-size: 1.0em;
            text-align: right;
        }

        .jg td::before {
            /*
    * aria-label has no advantage, it won't be read inside a table
    content: attr(aria-label);
    */
            content: attr(data-label);
            float: left;
            font-weight: bold;
            text-transform: uppercase;
        }

        .jg td:last-child {
            border-bottom: 0;
        }
    }

    .svg3 {
        position: absolute;
        right: -1.42em;
        top: -0.22em;
    }

    .svg2 {
        position: absolute;
        left: -0.42em;
        top: 0.72em;
    }

    .cover {
        position: relative;

    }
</style>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('main'); ?>

<div class="modern-single-ad-top-description-wrap">

    <div class="container">
        <div class="row">
            <div class="col-sm-12">
                <div class="modern-single-ad-breadcrumb">
                    <ol class="breadcrumb">
                        <li><a href="<?php echo e(route('home')); ?>"><?php echo app('translator')->getFromJson('app.home'); ?></a></li>
                        <?php if($ad->category): ?>
                        <li><a href="<?php echo e(route('listing', ['category' => $ad->category->id])); ?>">
                                <?php echo e($ad->category->category_name); ?> </a> </li>
                        <?php endif; ?>
                        <li><?php echo e($ad->title); ?></li>
                    </ol><!-- breadcrumb -->
                    <h2 class="modern-single-ad-top-title">Report Ad</h2>
                </div>

                <?php if($enable_monetize): ?>
                <?php echo get_option('monetize_code_below_ad_title'); ?>

                <?php endif; ?>

            </div>
        </div>
    </div>

    <div class="container">
        <div class="row">
            <div class="modern-single-ad-top-description">

                <div class="col-sm-7 col-xs-12">
                    <?php if( ! $ad->is_published()): ?>
                    <div class="alert alert-warning"> <i class="fa fa-warning"></i>
                        <?php echo app('translator')->getFromJson('app.ad_not_published_warning'); ?></div>
                    <?php endif; ?>

                    <?php if( ! empty($ad->video_url)): ?>
                    <?php
                            $video_url = $ad->video_url;
                            if (strpos($video_url, 'youtube') > 0) {
                                preg_match("/^(?:http(?:s)?:\/\/)?(?:www\.)?(?:m\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)\/))([^\?&\"'>]+)/", $video_url, $matches);
                                if ( ! empty($matches[1])){
                                    echo '<div class="embed-responsive embed-responsive-16by9"><iframe class="embed-responsive-item" src="https://www.youtube.com/embed/'.$matches[1].'" frameborder="0" allowfullscreen></iframe></div>';
                                }

                            } elseif (strpos($video_url, 'vimeo') > 0) {
                                if (preg_match('%^https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)(?:[?]?.*)$%im', $video_url, $regs)) {
                                    if (!empty($regs[3])){
                                        echo '<div class="embed-responsive embed-responsive-16by9"><iframe class="embed-responsive-item" src="https://player.vimeo.com/video/'.$regs[3].'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>';
                                    }
                                }
                            }
                            ?>

                    <?php else: ?>

                    <div class="ads-gallery">
                        <div class="fotorama" data-nav="thumbs" data-allowfullscreen="true" data-width="100%">
                            <?php $__currentLoopData = $ad->media_img; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $img): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <img src="<?php echo e(media_url($img, true)); ?>" alt="<?php echo e($ad->title); ?>">
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                    </div>

                    <?php endif; ?>


                </div>

                <div class="col-sm-5 col-xs-12">
                    <h2 class="ad-title"><a href="<?php echo e(route('single_ad', $ad->slug)); ?>"><?php echo e($ad->title); ?></a> </h2>
                    <h2 class="modern-single-ad-price"><?php echo e(themeqx_price_ng($ad)); ?></h2>

                    <h3><?php echo app('translator')->getFromJson('app.general_info'); ?></h3>
                    <p><strong><i class="fa fa-money"></i> <?php echo app('translator')->getFromJson('app.price'); ?></strong> <?php echo e(themeqx_price_ng($ad)); ?> </p>
                    <p><strong><i class="fa fa-map-marker"></i> <?php echo app('translator')->getFromJson('app.location'); ?> </strong> <?php echo $ad->full_address(); ?> </p>
                    <p><strong><i class="fas fa-check-circle"></i> <?php echo app('translator')->getFromJson('app.condition'); ?></strong>
                        <?php echo e($ad->ad_condition); ?> </p>



                    <?php if($enable_monetize): ?>
                    <?php echo get_option('monetize_code_below_general_info'); ?>

                    <?php endif; ?>

                </div>
                <div class="clearfix"></div>
            </div>
        </div>

    </div>
</div>


<div class="container">
    <div class="row">
        <div class="col-sm-8 col-xs-12">
            <div class="ads-detail bg-white">
                <div class="modal-body">

                    <p><?php echo app('translator')->getFromJson('app.report_ad_description'); ?></p>

                    <form action="<?php echo e(route('report_ads_pos')); ?>" method="post">

                        <div class="form-group">
                            <label class="control-label"><?php echo app('translator')->getFromJson('app.reason'); ?>:</label>
                            <select class="form-control" name="reason">
                                <option value=""><?php echo app('translator')->getFromJson('app.select_a_reason'); ?></option>
                                <option value="unavailable"><?php echo app('translator')->getFromJson('app.item_sold_unavailable'); ?></option>
                                <option value="fraud"><?php echo app('translator')->getFromJson('app.fraud'); ?></option>
                                <option value="duplicate"><?php echo app('translator')->getFromJson('app.duplicate'); ?></option>
                                <option value="spam"><?php echo app('translator')->getFromJson('app.spam'); ?></option>
                                <option value="wrong_category"><?php echo app('translator')->getFromJson('app.wrong_category'); ?></option>
                                <option value="offensive"><?php echo app('translator')->getFromJson('app.offensive'); ?></option>
                                <option value="other"><?php echo app('translator')->getFromJson('app.other'); ?></option>
                            </select>

                            <div id="reason_info"></div>
                        </div>

                        <div class="form-group">
                            <label for="email" class="control-label"><?php echo app('translator')->getFromJson('app.email'); ?>:</label>
                            <input type="text" class="form-control" id="email" name="email">
                            <div id="email_info"></div>

                        </div>
                        <div class="form-group">
                            <label for="message-text" class="control-label"><?php echo app('translator')->getFromJson('app.message'); ?>:</label>
                            <textarea class="form-control" id="message" name="message"></textarea>
                            <div id="message_info"></div>
                        </div>
                        <button type="submit" class="btn btn-primary" id="report_ad"><?php echo app('translator')->getFromJson('app.report_ad'); ?></button>
                    </form>
                </div>









            </div>














        </div>

        <div class="col-sm-4 col-xs-12">
            <div class="sidebar-widget">

                <h3><?php echo app('translator')->getFromJson('app.seller_info'); ?></h3>
                <div class="sidebar-user-info">
                    <div class="row">
                        <div class="col-xs-3">
                            <img src="<?php echo e($ad->user->get_gravatar()); ?>" class="img-circle img-responsive" />
                        </div>
                        <div class="col-xs-9">
                            <h5><?php echo e($ad->user->name); ?></h5>
                            <p class="text-muted"><i class="fa fa-map-marker"></i> <?php echo e($ad->user->get_address()); ?></p>
                        </div>
                    </div>
                </div>

                <div class="sidebar-user-link">
                    <button class="btn btn-block" id="onClickShowPhone">
                        <strong> <span id="ShowPhoneWrap"></span> </strong> <br />
                        <span class="text-muted"><?php echo app('translator')->getFromJson('app.click_to_show_phone_number'); ?></span>
                    </button>
                </div>

            </div>


        </div>
    </div>
</div>














<?php $__env->stopSection(); ?>

<?php $__env->startSection('page-js'); ?>

<script
    src="https://maps.googleapis.com/maps/api/js?key=<?php echo e(get_option('google_map_api_key')); ?>&libraries=places&callback=initMap"
    async defer></script>
<script type="text/javascript">
    function initMap() {
            var myLatLng = {lat: <?php echo e($ad->latitude); ?>, lng: <?php echo e($ad->longitude); ?> };

            var map = new google.maps.Map(document.getElementById('dvMap'), {
                center: myLatLng,
                zoom: 15
            });
            var marker = new google.maps.Marker({
                position: myLatLng,
                map: map,
                title: '<?php echo e($ad->title); ?>'
            });
            marker.setMap(map);
        }

</script>

<script src="<?php echo e(asset('assets/plugins/fotorama-4.6.4/fotorama.js')); ?>"></script>
<script src="<?php echo e(asset('assets/plugins/SocialShare/SocialShare.js')); ?>"></script>
<script src="<?php echo e(asset('assets/plugins/owl.carousel/owl.carousel.min.js')); ?>"></script>
<script src="<?php echo e(asset('assets/plugins/form-validator/form-validator.min.js')); ?>"></script>

<script>
    $('.share').ShareLink({
            title: '<?php echo e($ad->title); ?>', // title for share message
            text: '<?php echo e(substr(trim(preg_replace('/\s\s+/', ' ',strip_tags($ad->description) )),0,160)); ?>', // text for share message

            <?php if($ad->media_img->first()): ?>
            image: '<?php echo e(media_url($ad->media_img->first(), true)); ?>', // optional image for share message (not for all networks)
            <?php else: ?>
            image: '<?php echo e(asset('uploads/placeholder.png')); ?>', // optional image for share message (not for all networks)
            <?php endif; ?>
            url: '<?php echo e(route('single_ad', $ad->slug)); ?>', // link on shared page
            class_prefix: 's_', // optional class prefix for share elements (buttons or links or everything), default: 's_'
            width: 640, // optional popup initial width
            height: 480 // optional popup initial height
        })
</script>
<script>
    $.validate();
</script>
<script>
    $(document).ready(function(){
            $(".themeqx_new_regular_ads_wrap").owlCarousel({
                loop:true,
                margin:10,
                responsiveClass:true,
                responsive:{
                    0:{
                        items:1,
                        nav:true
                    },
                    600:{
                        items:3,
                        nav:false
                    },
                    1000:{
                        items:4,
                        nav:true,
                        loop:false
                    }
                },
                navText : ['<i class="fas fa-arrow-circle-left dir-btn"></i>','<i class="fas fa-arrow-circle-right dir-btn"></i>']
            });
        });
</script>
<script>
    $(function(){
            $('#onClickShowPhone').click(function(){
                $('#ShowPhoneWrap').html('<i class="fa fa-phone"></i> <?php echo e($ad->seller_phone); ?>');
            });

            $('#save_as_favorite').click(function(){
                var selector = $(this);
                var slug = selector.data('slug');

                $.ajax({
                    type : 'POST',
                    url : '<?php echo e(route('save_ad_as_favorite')); ?>',
                    data : { slug : slug, action: 'add',  _token : '<?php echo e(csrf_token()); ?>' },
                    success : function (data) {
                        if (data.status == 1){
                            selector.html(data.msg);
                        }else {
                            if (data.redirect_url){
                                location.href= data.redirect_url;
                            }
                        }
                    }
                });
            });

            $('button#report_ad').click(function(){
                var reason = $('[name="reason"]').val();
                var email = $('[name="email"]').val();
                var message = $('[name="message"]').val();
                var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;

                var error = 0;
                if(reason.length < 1){
                    $('#reason_info').html('<p class="text-danger">Reason required</p>');
                    error++;
                }else {
                    $('#reason_info').html('');
                }
                if(email.length < 1){
                    $('#email_info').html('<p class="text-danger">Email required</p>');
                    error++;
                }else {
                    if ( ! regex.test(email)){
                        $('#email_info').html('<p class="text-danger">Valid email required</p>');
                        error++;
                    }else {
                        $('#email_info').html('');
                    }
                }
                if(message.length < 1){
                    $('#message_info').html('<p class="text-danger">Message required</p>');
                    error++;
                }else {
                    $('#message_info').html('');
                }

                if (error < 1){
                    $('#loadingOverlay').show();
                    $.ajax({
                        type : 'POST',
                        url : '<?php echo e(route('report_ads_pos')); ?>',
                        data : { reason : reason, email: email,message:message, slug:'<?php echo e($ad->slug); ?>',  _token : '<?php echo e(csrf_token()); ?>' },
                        success : function (data) {
                            if (data.status == 1){
                                toastr.success(data.msg, '<?php echo app('translator')->getFromJson('app.success'); ?>', toastr_options);
                            }else {
                                toastr.error(data.msg, '<?php echo app('translator')->getFromJson('app.error'); ?>', toastr_options);
                            }
                            $('#reportAdModal').modal('hide');
                            $('#loadingOverlay').hide();
                        }
                    });
                }
            });

            $('#replyByEmailForm').submit(function(e){
                e.preventDefault();
                var reply_email_form_data = $(this).serialize();

                $('#loadingOverlay').show();
                $.ajax({
                    type : 'POST',
                    url : '<?php echo e(route('reply_by_email_post')); ?>',
                    data : reply_email_form_data,
                    success : function (data) {
                        if (data.status == 1){
                            toastr.success(data.msg, '<?php echo app('translator')->getFromJson('app.success'); ?>', toastr_options);
                        }else {
                            toastr.error(data.msg, '<?php echo app('translator')->getFromJson('app.error'); ?>', toastr_options);
                        }
                        $('#replyByEmail').modal('hide');
                        $('#loadingOverlay').hide();
                    }
                });
            });

            $(document).on('change past keyup', '#embedded_width', function(){
                var width = $(this).val();
                var height = $('#embedded_height').val();
                $('iframe').css('width', width+'px');

                var iframe_code = '<iframe src="http://localhost/real-estate/source/embedded/2-beds-nice-apertment-in-ny-united-states" style="border:0;width:'+width+'px;height:'+height+'px;"></iframe> ';

                $('#embedded_code').val(iframe_code);
            });
            $(document).on('change past keyup', '#embedded_height', function(){
                var height = $(this).val();
                var width = $('#embedded_width').val();
                $('iframe').css('height', height+'px');

                var iframe_code = '<iframe src="http://localhost/real-estate/source/embedded/2-beds-nice-apertment-in-ny-united-states" style="border:0;width:'+width+'px;height:'+height+'px;"></iframe> ';

                $('#embedded_code').val(iframe_code);
            });

        });
</script>


<?php $__env->stopSection(); ?>
<?php echo $__env->make('layout.main', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>