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

 <section class="inner_header">
        <div class="container">
            <div class="top">
                <a href="<?php echo e(url(getCurrentLocale().'/')); ?>"><?php echo e(__('web.home')); ?> </a>
                
                <span><?php echo e(__('web.details')); ?></span>
            </div>
            <h2><?php echo e(__('web.details')); ?></h2>
        </div>
    </section>
    <main>
        <!-- -------------- mazad_show --------------- -->
        <section class="mazad_show bg-gray section-padding">
            <div class="container">
                <div class="row">
                    <div class="col-lg-8">
                        <div class="r_side">
                            <div class="mazad_show_slider w_items mb-5">
                                <h3><?php echo e(__('web.product')); ?> <span> <?php echo e(productname($ad->id)); ?> (<?php echo e($ad->id); ?>)  </span></h3>
                                <p><?php echo e(categoryname($ad->category_id)); ?> <span> <?php echo e(modelname($ad->main_model_id)); ?> </span></p>
                                <small> <i class="fas fa-map-marker-alt"></i> <?php echo e($ad->address); ?></small>
                                <div class="slider">
                                    <!--<div class="ribbon ribbon-top-right"><span>عرض محدود</span></div>-->
                                    <div class="swiper-container gallery-top">
                                        <div class="swiper-wrapper">
                                            
                                            <div class="swiper-slide">
                                                <div class="img">
                                                    <img src="<?php echo e(asset($ad->image)); ?>" alt="">
                                                </div>
                                            </div>
                                            <?php $__currentLoopData = $photos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <div class="swiper-slide">
                                                <div class="img">
                                                    <img src="<?php echo e(asset($row->image)); ?>" alt="">
                                                </div>
                                            </div>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            
                                        </div>
                                        <!-- Add Pagination -->
                                        <div class="swiper-pagination"></div>
                                    </div>
                                    <div class="swiper-container gallery-thumbs">
                                        <div class="swiper-wrapper">
                                           
                                            <div class="swiper-slide">
                                                <div class="img">
                                                    <img src="<?php echo e(asset($ad->image)); ?>" alt="">
                                                </div>
                                            </div>
                                            <?php $__currentLoopData = $photos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <div class="swiper-slide">
                                                <div class="img">
                                                    <img src="<?php echo e(asset($row->image)); ?>" alt="">
                                                </div>
                                            </div>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!-- ------- more_details ------ -->
                            <div class="more_details w_items">
                                <div class="head">
                                    <h6><?php echo e(__('web.moredetails')); ?></h6>
                                    <div class="edit">
                                        <div class="share_btn">
                                            <nav class="menu">
                                                <input type="checkbox" href="#" class="menu-open" name="menu-open" id="menu-open" />
                                                <label class="menu-open-button" onclick="social(this)" for="menu-open">
                                                    <i class="fas fa-share-alt"></i>
                                              </label>
                                                <a href="#" class="menu-item addthis_inline_share_toolbox_uoxf"> </a>
                                                <a href="#" class="menu-item addthis_inline_share_toolbox_km26">  </a>
                                                <a href="#" class="menu-item addthis_inline_share_toolbox_j3mc">  </a>
                                                
                <!-- Go to www.addthis.com/dashboard to customize your tools -->
                
            
                                            </nav>
                                            <!-- Go to www.addthis.com/dashboard to customize your tools -->
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5fd089b2799fc48d"></script>

                                            <!-- filters -->
                                            <svg xmlns="http://www.w3.org/2000/svg" version="1.1">
                                                <defs>
                                                  <filter id="shadowed-goo">
                                                      
                                                      <feGaussianBlur in="SourceGraphic" result="blur" stdDeviation="10" />
                                                      <feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 18 -7" result="goo" />
                                                      <feGaussianBlur in="goo" stdDeviation="3" result="shadow" />
                                                      <feColorMatrix in="shadow" mode="matrix" values="0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 1 -0.2" result="shadow" />
                                                      <feOffset in="shadow" dx="1" dy="1" result="shadow" />
                                                      <feComposite in2="shadow" in="goo" result="goo" />
                                                      <feComposite in2="goo" in="SourceGraphic" result="mix" />
                                                  </filter>
                                                  <filter id="goo">
                                                      <feGaussianBlur in="SourceGraphic" result="blur" stdDeviation="10" />
                                                      <feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 18 -7" result="goo" />
                                                      <feComposite in2="goo" in="SourceGraphic" result="mix" />
                                                  </filter>
                                                </defs>
                                            </svg>
                                        </div>
                                        <a  class="text-light bg-danger" <?php if(\Auth::user()): ?>  data-toggle="modal" data-target="#modal_report" <?php else: ?> data-toggle="modal" data-target="#modal_login" <?php endif; ?>><i class="fas fa-exclamation-triangle"></i></a>
                                        <?php if($ad->auction =='0'): ?>
                                        <a style="cursor:pointer"  data-id="<?php echo e($ad->id); ?>" action-id="<?php echo e(url(getCurrentLocale().'/togglefav')); ?>"  <?php if(\Auth::user()): ?>  onclick="favoritetoggle(this)" <?php else: ?> data-toggle="modal" data-target="#modal_login"  <?php endif; ?>    class="text-light <?php if(\Auth::user()): ?> <?php if(favorited($ad->id)): ?> bg-primary <?php else: ?> bg-danger <?php endif; ?> <?php else: ?> bg-danger <?php endif; ?> "><i class="fas fa-heart"></i></a>
                                        <a style="cursor:pointer" data-id="<?php echo e($ad->id); ?>" action-id="<?php echo e(url(getCurrentLocale().'/togglelike')); ?>"  <?php if(\Auth::user()): ?> onclick="liketoggle(this)" <?php else: ?> data-toggle="modal" data-target="#modal_login"  <?php endif; ?>   class=" <?php if(\Auth::user()): ?>  <?php if(liked($ad->id)): ?> text-light bg-primary <?php else: ?> text-dark bg-muted <?php endif; ?> text-dark bg-muted  <?php else: ?> <?php endif; ?>"><i class="fas fa-thumbs-up"></i></a>
                                        <?php endif; ?>
                                        <!---------- new ----------->
                             <!--           <a href="#" class="text-light bg-danger" data-toggle="modal" data-target="#modal_login" ><i class="fas fa-exclamation-triangle"></i></a>-->
                                    </div>
                                </div>
                                <div class="det_content">
                                    <div class="items">
                                        <div class="icon">
                                            <i class="far fa-calendar-alt"></i>
                                        </div>
                                        <?php if($ad->auction == '0'): ?>
                                        <div class="inf">
                                            <p> <?php echo e(__('web.ad_history')); ?> </p>
                                            <strong class="sub_color"><?php echo e(date('F j, Y',strtotime($ad->created_at))); ?></strong>
                                        </div>
                                        <?php else: ?>
                                        <div class="inf">
                                            <p> <?php echo e(__('web.auction_history')); ?>  </p>
                                            <strong class="sub_color"><?php echo e(date('F j, Y',strtotime($ad->date))); ?></strong>
                                        </div>
                                        <?php endif; ?>
                                    </div>
                                     <?php if($ad->auction == '0'): ?>
                                    <div class="items">
                                        <div class="icon">
                                            <i class="far fa-user"></i>
                                        </div>
                                        <div class="inf">
                                            <p> <?php echo e(__('web.ad_owner')); ?> </p>
                                            <a href="<?php echo e(url(getCurrentLocale().'/profile/'.$ad->user->hanqr)); ?>"><strong class="sub_color"><?php echo e($ad->user->name); ?> </strong></a>
                                        </div>
                                    </div>
                                    <?php endif; ?>
                                    <div class="items">
                                        <div class="icon">
                                            <i class="far fa-eye"></i>
                                        </div>
                                        <div class="inf">
                                            <p> <?php echo e(__('web.views')); ?></p>
                                            <strong class="sub_color"><?php echo e($ad->visit_counts); ?></strong>
                                        </div>
                                    </div>
                                    <?php if($ad->auction == '0'): ?>
                                    <div class="items">
                                        <div class="icon">
                                            <i class="fas fa-dollar-sign"></i>
                                        </div>
                                        
                                        <div class="inf">
                                            <p> <?php echo e(__('web.cost')); ?>   </p>
                                            <strong class="sub_color"><?php echo e($ad->start_cost); ?> <?php echo e(__('web.sar')); ?></strong>
                                        </div>
                                        
                                    </div>
                                    <?php else: ?>
                                       <div class="items">
                                        <div class="icon">
                                            <i class="fas fa-dollar-sign"></i>
                                        </div>
                                        
                                        <div class="inf">
                                            <p> <?php echo e(__('web.start_cost')); ?>   </p>
                                            <strong class="sub_color"><?php echo e($ad->start_cost); ?> <?php echo e(__('web.sar')); ?></strong>
                                        </div>
                                        
                                    </div>
                                    <div class="items">
                                        <div class="icon">
                                            <i class="fas fa-dollar-sign"></i>
                                        </div>
                                        
                                        <div class="inf">
                                            <p> <?php echo e(__('web.end_cost')); ?>   </p>
                                            <strong class="sub_color"><?php echo e($ad->end_cost); ?> <?php echo e(__('web.sar')); ?></strong>
                                        </div>
                                        
                                    </div>
                                    <div class="items">
                                        <div class="icon">
                                           <i class="far fa-calendar-alt"></i>
                                        </div>
                                        
                                        <div class="inf">
                                            <p> <?php echo e(__('web.start_time')); ?>   </p>
                                            <strong class="sub_color"><?php echo e($ad->start_time); ?> </strong>
                                        </div>
                                        
                                    </div>
                                    <div class="items">
                                        <div class="icon">
                                             <i class="far fa-calendar-alt"></i>
                                        </div>
                                        
                                        <div class="inf">
                                            <p> <?php echo e(__('web.end_time')); ?>   </p>
                                            <strong class="sub_color"><?php echo e($ad->end_time); ?> </strong>
                                        </div>
                                        
                                    </div>
                                        <?php endif; ?>
                                    <div class="items">
                                        <div class="icon">
                                            <i class="fas fa-question"></i>
                                        </div>
                                        <div class="inf">
                                            <p> <?php echo e(__('web.type_ad')); ?> </p>
                                            <?php if(is_null($ad->sold_id)): ?><strong class="sub_color"><?php echo e(__('web.available')); ?></strong><?php else: ?> <strong class="sub_color"><?php echo e(__('web.paid')); ?></strong> <?php endif; ?>
                                        </div>
                                    </div>
                                     <?php if($ad->auction == '0'): ?>
                                    <div class="items">
                                        <div class="icon">
                                            <i class="fas fa-thumbs-up"></i>
                                        </div>
                                        <div class="inf">
                                            <p>  <?php echo e(__('web.likes')); ?> </p>
                                            <strong class="sub_color" id="likescount"><?php echo e($likes); ?></strong>
                                        </div>
                                    </div>
                                    <?php endif; ?>
                                </div>
                            </div>
                            <!-- ------- about_mazad ------ -->
                            <div class="about_mazad">
                                <div class="w_items mt-5 p-0">
                                    <ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
                                        <li class="nav-item">
                                            <a class="active" id="pills-home-tab" data-toggle="pill" href="#pills-home" role="tab" aria-controls="pills-home" aria-selected="true"><?php echo e(__('web.details')); ?></a>
                                        </li>
                                        <li class="nav-item">
                                            <a id="pills-propert-tab" data-toggle="pill" href="#pills-propert" role="tab" aria-controls="pills-propert" aria-selected="true"><?php echo e(__('web.proprties')); ?></a>
                                        </li>
                                    </ul>
                                    <div class="tab-content" id="pills-tabContent">
                                        <div class="tab-pane fade show active" id="pills-home" role="tabpanel" aria-labelledby="pills-home-tab">
                                            <?php echo productdescription($ad->id); ?>

                                        </div>
                                        <div class="tab-pane fade" id="pills-propert" role="tabpanel" aria-labelledby="pills-propert-tab">
                                            <ul>
                                                <?php $__currentLoopData = $attributes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <li><strong><?php echo e(attributename($row->attribute_id)); ?> : </strong> <?php echo e(choisename($row->choise_id)); ?> </li>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!-- ------- about_car ------ -->
                            <?php if($ad->category_id == '1'): ?>
                            <div class="about_car w_items mt-5">
                                <div class="head mb-3">
                                    <h6><?php echo e(__('web.car_images')); ?></h6>
                                </div>
                                <div>
                                    <p><?php echo e(__('web.press_circle')); ?> <span class="sub_color"><?php echo e(__('web.red')); ?></span><?php echo e(__('web.see_clear')); ?></p>
                                    <div class="car_parts mt-5">
                                        <img src="<?php echo e(url('')); ?>/assets/web/images/car_draw.png" alt="">
                                        <div class="dots">
                                            <a href="<?php echo e(asset($ad->image_1)); ?>" data-fancybox=""></a>
                                            <a href="<?php echo e(asset($ad->image_2)); ?>" data-fancybox=""></a>
                                            <a href="<?php echo e(asset($ad->image_3)); ?>" data-fancybox=""></a>
                                            <a href="<?php echo e(asset($ad->image_4)); ?>" data-fancybox=""></a>
                                            <a href="<?php echo e(asset($ad->image_5)); ?>" data-fancybox=""></a>
                                            <a href="<?php echo e(asset($ad->image_6)); ?>" data-fancybox=""></a>
                                            <a href="<?php echo e(asset($ad->image_7)); ?>" data-fancybox=""></a>
                                        </div>
                                    </div>
                                    <div class="items">
                                        <div class="icon">
                                            <i class="far fa-calendar-alt"></i>
                                        </div>
                                        <div class="inf">
                                            <p> <?php echo e(__('web.check_date')); ?> </p>
                                            <strong class="sub_color"><?php echo e(date('F j, Y',strtotime($ad->check))); ?></strong>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <?php endif; ?>
                            <!-- --------- vid ---------- -->
                            <?php if(is_null($ad->sold_id)): ?>
                            <?php if(!is_null($ad->video)): ?>
                            <?php if(lastsubscribe($ad->user_id) == 3): ?>
                            <div class="about_car w_items mt-5">
                                <div class="head mb-3">
                                    <h6><?php echo e(__('web.video')); ?> </h6>
                                </div>
                                <video src="<?php echo e(asset($ad->video)); ?>" controls width="100%" height="450px"></video>
                            </div>
                            <?php endif; ?>
                            <?php endif; ?>
                            <?php endif; ?>
                            <!-- --------- 360 ---------- -->
                          <!--  <div class="about_car w_items mt-5">
                                <div class="head mb-3">
                                    <h6>صوره 360 </h6>
                                </div>
                                <iframe width="100%" height="400px" src="https://momento360.com/e/u/2267c6c87886446abcab262bc72f4d49?utm_campaign=embed&utm_source=other&heading=0&pitch=0&field-of-view=75&size=medium" frameborder="0"></iframe>
                            </div>-->
                            <!-- ------- simillar_cars ------ -->
                            <?php if($ad->auction == '0'): ?>
                            <div class="simillar_cars w_items mt-5">
                                <div class="head mb-3">
                                    <h6><?php echo e(__('web.similar')); ?></h6>
                                </div>
                                <div class="products">
                                    <div class="prod_cont">
                                        <?php $__currentLoopData = $same; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <div class="prod_items">
                                            <a href="<?php echo e(url(getCurrentLocale().'/item/'.$row->id)); ?>" class="img">
                                                <img src="<?php echo e(asset($row->image)); ?>" alt="">
                                                <div class="fav-btn">
                                                    <input data-id="<?php echo e($row->id); ?>" action-id="<?php echo e(url(getCurrentLocale().'/togglefav')); ?>" <?php if(\Auth::user()): ?> onclick="favtoggle(this)" <?php else: ?>   <?php endif; ?> <?php if(\Auth::user()): ?> <?php if(favorited($row->id)): ?> checked <?php endif; ?> <?php endif; ?> type="checkbox" />
                                                </div>
                                            </a>
                                            <div class="info">
                                                <h6>
                                                    <?php echo e(productname($row->id)); ?>

                                                    <span>
                                                            <?php echo e($row->start_cost); ?> <small><?php echo e(__('web.sar')); ?></small>
                                                        </span>
                                                </h6>
                                                <p>
                                                    <i class="fas fa-map-marker-alt"></i> <?php echo e(cityname($row->city_id)); ?>

                                                </p>
                                                <div class="by d-flex">
                                                    <a href="<?php echo e(url(getCurrentLocale().'/profile/'.$row->user->hanqr)); ?>">
                                                    <div class="imgg">
                                                        <img src="<?php echo e(asset($row->user->photo)); ?>" alt="">
                                                    </div>
                                                    </a>
                                                    <a href="<?php echo e(url(getCurrentLocale().'/profile/'.$row->user->hanqr)); ?>">
                                                    <span>
                                                            <?php echo e(__('web.by')); ?> : <?php echo e($row->user->name); ?> 
                                                        </span>
                                                    </a>
                                                </div>
                                            </div>
                                        </div>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </div>
                                </div>
                            </div>
                            <?php endif; ?>
                        </div>
                    </div>
                    <div class="col-lg-4">
                        <div class="l_side">
                            <?php if($ad->auction == '1' && is_null($ad->sold_id)): ?>
                            <?php if(date('Y-m-d') == $ad->dating): ?>
                            <div class="w_items">
                                <div class="head mb-3">
                                    <h6><?php echo e(__('web.timetillstart')); ?></h6>
                                </div>
                                <div class="countdown show" data-Date='<?php echo e($ad->date); ?> <?php echo e($ad->start_time); ?>'>
                                    <div class="running">
                                        <timer>
                                            <div class="col">
                                                <span class="days"></span>
                                                <small><?php echo e(__('web.day')); ?></small>
                                            </div>
                                            <div class="col">
                                                <span class="hours"></span>
                                                <small><?php echo e(__('web.hour')); ?></small>
                                            </div>
                                            <div class="col">
                                                <span class="minutes"></span>
                                                <small><?php echo e(__('web.minute')); ?></small>
                                            </div>
                                            <div class="col">
                                                <span class="seconds"></span>
                                                <small><?php echo e(__('web.second')); ?></small>
                                            </div>
                                        </timer>
                                    </div>
                                </div>
                                
                            </div>
                            <?php else: ?>
                            <div class="w_items">
                                <div class="head mb-3">
                                    <h6><?php echo e(__('web.timetillend')); ?></h6>
                                </div>
                                <div class="countdown show" data-Date='<?php echo e($ad->date); ?> <?php echo e($ad->end_time); ?>'>
                                    <div class="running">
                                        <timer>
                                            <div class="col">
                                                <span class="days"></span>
                                                <small><?php echo e(__('web.day')); ?></small>
                                            </div>
                                            <div class="col">
                                                <span class="hours"></span>
                                                <small><?php echo e(__('web.hour')); ?></small>
                                            </div>
                                            <div class="col">
                                                <span class="minutes"></span>
                                                <small><?php echo e(__('web.minute')); ?></small>
                                            </div>
                                            <div class="col">
                                                <span class="seconds"></span>
                                                <small><?php echo e(__('web.second')); ?></small>
                                            </div>
                                        </timer>
                                    </div>
                                </div>
                            </div>
                            <?php endif; ?>
                            <div class="w_items mt-4">
                                <?php if(is_null($ad->sold_id)): ?>
                                <div class="head mb-3">
                                    <h6><?php echo e(__('web.subscribe_auction')); ?> </h6>
                                </div>
                                <h6 class="text-center mt-2"><?php echo e(__('web.inc_val')); ?><strong class="sub_color mr-3"> <?php echo e($increase); ?> <?php echo e(__('web.sar')); ?> </strong></h6>
                                <div class="text-center mt-3 mb-2">
                                    <!-- Button trigger modal to login -->
                                    <?php if(!\Auth::user()): ?>
                                    <a href="#" class="butn main_bg" data-toggle="modal" data-target="#modal_login"><span><?php echo e(__('web.loginfs')); ?>  </span></a>
                                    <?php elseif( \Auth::user()->id == $ad->user_id): ?>
                                    <a href="<?php echo e(url(getCurrentLocale().'/auction/'.$ad->id)); ?>"  class="butn main_bg" ><span><?php echo e(__('web.enter')); ?>  </span></a>
                                    <?php else: ?>
                                    <?php if(!taxpaid($ad->id) ): ?>
                                    <a  class="butn main_bg" <?php if(lastsubscribe(\Auth::user()->id) != '3'): ?> data-toggle="modal" data-target="#exampleModal1" <?php else: ?> href="<?php echo e(url(getCurrentLocale().'/subscribedirect/'.$ad->id)); ?>" <?php endif; ?>><span><?php echo e(__('web.subscribe')); ?> </span></a>
                                    <?php else: ?>
                                    
                                    <?php endif; ?>
                                    <?php if((date('Y-m-d') == $ad->date)): ?>
                                    <a href="<?php echo e(url(getCurrentLocale().'/auction/'.$ad->id)); ?>" class="butn main_bg" ><span><?php echo e(__('web.enter')); ?> </span></a>
                                    
                                    <?php endif; ?>
                                     <?php endif; ?>
                                </div>
                                <small class="text-danger text-center d-block"><?php echo e(__('web.notmoney')); ?></small>
                                <?php else: ?>
                                <h6 class="text-center mt-2"> <?php echo e(__('web.paid')); ?></h6>
                                
                                <?php endif; ?>
                            </div>
                            <?php endif; ?>
                            <!-- <div class="w_items adv_owner mt-4">
                                <div class="head mb-3">
                                    <h6>صاحب الإعلان</h6>
                                </div>
                                <div class="top text-center">
                                    <div class="img">
                                        <img src="<?php echo e(url('')); ?>/assets/web/images/user.png" alt="">
                                    </div>
                                    <div class="info">
                                        <h6>محمد على </h6>
                                        <p>مدير معرض سيارات</p>
                                        <a href="#">جميع الإعلانات</a>
                                    </div>
                                </div>
                                <div class="bottom">
                                    <div class="btns text-center">
                                        <a href="#" class="bg-dark text-light"><i class="fas fa-heart"></i></a>
                                        <a href="#" class="main_bg text-dark"><i class="fas fa-user-plus"></i></a>
                                    </div>
                                    <ul>
                                        <li>
                                            <i class="far fa-envelope"></i> John.Doe2021@gmail.com
                                        </li>
                                        <li>
                                            <i class="fas fa-phone"></i> +966-48521456
                                        </li>
                                        <li>
                                            <i class="fas fa-map-marker-alt"></i> Jeddah, 1315 king fahd avenue
                                        </li>
                                    </ul>
                                </div>
                            </div> -->
                            <div class="w_items semantics">
                                <div class="head mb-3">
                                    <h6><?php echo e(__('web.tags')); ?></h6>
                                </div>
                                <div class="cntt">
                                    <?php $__currentLoopData = $tags; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <a href="<?php echo e(url(getCurrentLocale().'/search?type=hashtags&search='.$row->name)); ?>"><?php echo e($row->name); ?></a>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </div>
                            </div>
                            <?php if(!is_null($ad->latlng)): ?>
                            <div class="w_items map mt-4">
                                <div class="head mb-3">
                                    <h6><?php echo e(__('web.maps')); ?></h6>
                                </div>
                                <iframe src="https://maps.google.com/maps?q=<?php echo e($ad->latlng); ?>&hl=es&z=14&amp;output=embed"
                                    width="100%" height="300" frameborder="0" style="border:0;" allowfullscreen="" aria-hidden="false" tabindex="0"></iframe>
                                
 
                            </div>
                            <?php endif; ?>
                            <div class="w_items simillar mt-4">
                                <div class="head mb-3">
                                  <h6><?php if($ad->auction =='0'): ?> <?php echo e(__('web.last_ad')); ?> <?php else: ?> <?php echo e(__('web.last_auctions')); ?> <?php endif; ?></h6>
                                </div>
                                <?php $__currentLoopData = $last; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="items">
                                    
                                    <div class="img">
                                     <a href="<?php echo e(url(getCurrentLocale().'/item/'.$row->id)); ?>" >   <img src="<?php echo e(asset($row->image)); ?>" alt=""> </a>
                                    </div>
                                   
                                    <div class="info">
                                        <h6><?php echo e(productname($row->id)); ?></h6>
                                        <div class="rate">
                                            <?php for($i=0;$i< ratings($ad->user_id) ; $i++): ?>
                                            <i class="fas fa-star"></i>
                                            <?php endfor; ?>
                                            
                                        </div>
                                        <div class="price">
                                            <span><?php echo e($row->start_cost); ?> <small><?php echo e(__('web.sar')); ?></small></span> 
                                           
                                        </div>
                                    </div>
                                </div>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- Modal reson -->
        <div class="modal fade" id="modal_report" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title" id="exampleModalLongTitle"><?php echo e(__('web.reason')); ?> </h5>
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
                    </div>
                    <form action="<?php echo e(url(getCurrentLocale().'/report')); ?>" method="post" onsubmit="reportad(this)" data-id="<?php echo e($ad->id); ?>">
                        <?php echo csrf_field(); ?>
                         <input type="hidden" name="product_id" value="<?php echo e($ad->id); ?>">
                        <div class="modal-body">
                             <div id="successreport" style="display : none" class="alert alert-success">
                               
                            </div>
                            <div id="errorreport" style="display : none" class="alert alert-danger">
                               
                            </div>
                        </div>
                    <div class="modal-body">
                        <div class="form-group">
                            <select name="reason_id" class="form-control custom-select">
                                <?php $__currentLoopData = $reasons; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($row->id); ?>"><?php echo e(reasonname($row->id)); ?> </option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                
                            </select>
                        </div>
                        <div class="form-group">
                            <textarea class="form-control"name="msg" rows="6" placeholder="<?php echo e(__('web.msg')); ?> "></textarea>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="text-light bg-danger butn" data-dismiss="modal"><?php echo e(__('web.close')); ?></button>
                        <button type="submit" class="butn main_bg"><?php echo e(__('web.send')); ?></button>
                    </div>
                    </form>
                </div>
            </div>
        </div>

        <!-- -------------- inner_subscribe --------------- -->
               <section class="inner_subscribe payment">
            <div class="container">
                <div class="row">
                    <div class="col-lg-6">
                        <div class="r_side">
                            <div class="icons">
                                <i class="fas fa-location-arrow"></i>
                            </div>
                            <div class="info">
                                <h6><?php echo e(__('web.sub_mail')); ?></h6>
                                <p><?php echo e(__('web.sub_mail_desc')); ?></p>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-6">
                        <div class="l_side">
                            <form onsubmit="subscribedata(this)" method="post" action="<?php echo e(url(getCurrentLocale().'/subcribe')); ?>" class="form-row">
                                <?php echo csrf_field(); ?>
                                <div class="form-group col-12">
                                    <input type="email" name="email"  placeholder="<?php echo e(__('web.email')); ?>">
                                    <button><?php echo e(__('web.subscribe')); ?></button>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal fade modal_login" id="loginfailed" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered" role="document">
                <div class="modal-content">
                    <div class="modal-body text-center">
                        <div class="icon">
                            <img src="<?php echo e(url('')); ?>/assets/web/images/icons/alert.svg" alt="">
                        </div>
                        <div id="loginerror" class="alert alert-danger">
                             <a href="<?php echo e(url(getCurrentLocale().'/login')); ?>"><?php echo e(__('web.loginfirst')); ?></a>
                        </div>
                       
                        
                    </div>
                </div>
            </div>
        </div>
                <div class="modal fade modal_login" id="mailsuccess" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered" role="document">
                <div class="modal-content">
                    <div class="modal-body text-center">
                        <div class="icon">
                            <img src="<?php echo e(url('')); ?>/assets/web/images/icons/checked.svg" alt="">
                        </div>
                        <h4><?php echo e(__('web.success')); ?></h4>
                    </div>
                </div>
            </div>
        </div>
        
         <div class="modal fade modal_login" id="mailfailed" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered" role="document">
                <div class="modal-content">
                    <div class="modal-body text-center">
                        <div class="icon">
                            <img src="<?php echo e(url('')); ?>/assets/web/images/icons/alert.svg" alt="">
                        </div>
                        <div id="mailerrors" class="alert alert-danger">
                             
                        </div>
                       
                        
                    </div>
                </div>
            </div>
        </div>
        <div class="modal modal_pay fade" id="exampleModal1" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered modal-xl">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title" id="exampleModalLabel"><?php echo e(__('web.pay')); ?></h5>
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                    </div>
                     <form onsubmit="paypackage(this)" data-id="2" action="<?php echo e(url(getCurrentLocale().'/paymenttax')); ?>" method="post">
                                            <?php echo csrf_field(); ?>
                           <input type="hidden" name="product_id" value="<?php echo e($ad->id); ?>">
                    <div class="modal-body">
                             <div class="pay-selection">
                                 <?php $__currentLoopData = $ways; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                      <label>
                                <input type="radio" name="pay_type" onclick="showdata(this)"  value="<?php echo e($row['PaymentMethodId']); ?>" class="time-input-element" />
                                  <div class="panel panel-default time-input">
                                    <div class="panel-heading">
                                        <img src="<?php echo e($row['ImageUrl']); ?>">
                                    </div>
                                  </div>
                            </label>
                                       
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<label>
                                <input type="radio" name="pay_type" onclick="hidedata(this)" value="wallet" class="time-input-element" />
                                  <div class="panel panel-default time-input">
                                    <div class="panel-heading">
                                        <img src="<?php echo e(url('')); ?>/assets/web/images/pay/wallet.png">
                                    </div>
                                  </div>
                            </label>
                            </div>
                       <!--    <div class="credit_info">
                                <div class="credit-card">
                                    <div class="checkout">
                                            <div id="successpay2" style="display : none" class="alert alert-success">

                        </div>
                        <div id="errorpay2" style="display : none" class="alert alert-danger">

                        </div>

                                        <div class="row">
                                            <div class="col-lg-6">
                                                <div class="credit-card-box">
                                                    <div class="flip">
                                                        <div class="front">
                                                            <div class="chip"></div>
                                                            <div class="number"></div>
                                                            <div class="card-holder">
                                                                <label>Card holder</label>
                                                                <div></div>
                                                            </div>
                                                            <div class="card-expiration-date">
                                                                <label>Expires</label>
                                                                <div></div>
                                                            </div>
                                                        </div>
                                                        <div class="back">
                                                            <div class="strip"></div>
                                                            <div class="ccv">
                                                                <label>CCV</label>
                                                                <div></div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-lg-6">
                                                <div class="form" autocomplete="off" novalidate>
                                                    <fieldset>
                                                        <label for="card-number"><?php echo e(__('web.credit')); ?> </label>
                                                        <input type="text" name="credit" id="card-holder" />
                                                    </fieldset>
                                                    
                                                    <fieldset>
                                                        <label for="card-holder"><?php echo e(__('web.name')); ?></label>
                                                        <input type="text" name="fullname" id="card-holder" />
                                                    </fieldset>
                                                    <fieldset class="card-expire">
                                                        <label for="expire-month"><?php echo e(__('web.end')); ?> </label>
                                                        <div  class="select">
                                                            <select name="month" id="expire-month">
                                                                <option></option>
                                                                <option>01</option>
                                                                <option>02</option>
                                                                <option>03</option>
                                                                <option>04</option>
                                                                <option>05</option>
                                                                <option>06</option>
                                                                <option>07</option>
                                                                <option>08</option>
                                                                <option>09</option>
                                                                <option>10</option>
                                                                <option>11</option>
                                                                <option>12</option>
                                                            </select>
                                                        </div>
                                                        <div class="select">
                                                            <select name="year" id="expire-year">
                                                                <option></option>
                                                                <option value="16">2016</option>
                                                                <option value="17">2017</option>
                                                                <option value="18">2018</option>
                                                                <option value="19">2019</option>
                                                                <option value="20">2020</option>
                                                                <option value="21">2021</option>
                                                                <option value="22">2022</option>
                                                                <option value="23">2023</option>
                                                                <option value="24">2024</option>
                                                                <option value="25">2025</option>
                                                            </select>
                                                        </div>
                                                    </fieldset>
                                                    <fieldset class="fieldset-ccv">
                                                        <label for="card-ccv"><?php echo e(__('web.cvv')); ?></label>
                                                        <input name="cvv" type="text" id="card-ccv" maxlength="3" />
                                                    </fieldset>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>-->
                       <div class="credit_info">
                       
                        <!------------- new ------------>
                        <div class="pay_check">
                                    <div class="copon">
                                         <div id="successpay2" style="display : none" class="alert alert-success">

                        </div>
                        <div id="errorpay2" style="display : none" class="alert alert-danger">

                        </div>

                                        <!-- <h5>تفاصيل الكارت </h5> -->
                                        <div id="showcredit">
                                        <div class="row">
                                            <div class="col-lg-6">
                                                <div class="form-group">
                                                    <label> <?php echo e(__('web.credit')); ?>  </label>
                                                    <input type="text"  name="credit" placeholder="<?php echo e(__('web.credit')); ?> ">
                                                </div>
                                            </div>
                                            <div class="col-lg-6">
                                                <div class="form-group">
                                                    <label> <?php echo e(__('web.cvv')); ?>  </label>
                                                    <input type="text"  name="cvv" placeholder="<?php echo e(__('web.cvv')); ?>  ">
                                                </div>
                                            </div>
                                              <div class="col-lg-6">
                                                <div class="form-group">
                                                    <label> <?php echo e(__('web.name')); ?>  </label>
                                                    <input type="text" name="fullname" placeholder="<?php echo e(__('web.name')); ?>  ">
                                                </div>
                                            </div>
                                           
                                            <div class="col-lg-6">
                                                <div class="form-group">
                                                    <label> <?php echo e(__('web.month')); ?>   </label>
                                                    <input type="number"  name="month" placeholder=" <?php echo e(__('web.month')); ?> ">
                                                </div>
                                            </div>
                                            <div class="col-lg-6">
                                                <div class="form-group">
                                                    <label> <?php echo e(__('web.year')); ?>  </label>
                                                    <input type="number"  name="year" placeholder=" <?php echo e(__('web.year')); ?> ">
                                                </div>
                                            </div>
                                        </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        
                        </div>
                        <div class="modal-footer justify-content-center">
                            <button type="submit" class="butn main_bg"><span><?php echo e(__('web.pay')); ?></span> </button>
                        </div>
                        </form>
                    </div>
                   
                </div>
            </div>
     

        
        </section>


<?php if($ad->auction == '0'): ?>
<?php if($ad->type == '0'): ?>
<?php if($ad->show == '1'): ?>
    <a href="tel:<?php echo e($ad->user->phone); ?>" class="call_btn" data-toggle="tooltip" data-placement="right" title="<?php echo e($ad->user->phone); ?>">
        <i class="fas fa-phone"></i>
    </a>
    <?php endif; ?>
<?php else: ?>
     <a  style="cursor:pointer" <?php if(\Auth::user()): ?> onclick="sharechat(this)" action="<?php echo e(url(getCurrentLocale().'/sharechat/'.$ad->user_id)); ?>"  <?php else: ?> data-toggle="modal" data-target="#modal_login"<?php endif; ?> class="call_btn" data-toggle="tooltip" data-placement="right" title="Chat">
        <i class="fas fa-comments"></i>
    </a> 
    <?php endif; ?>
    <?php endif; ?>
    </main>
    
        <!-- Modal login -->
        <div class="modal fade modal_login" id="modal_login" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered" role="document">
                <div class="modal-content">
                    <div class="modal-body text-center">
                        <div class="icon">
                            <img src="<?php echo e(url('')); ?>/assets/web/images/icons/alert.svg" alt="">
                        </div>
                        <h4><?php echo e(__('web.loginfs')); ?> </h4>
                        <a href="#" class="butn bg-danger text-white m-1" data-dismiss="modal"><span><?php echo e(__('web.close')); ?> </span></a>
                        <a href="<?php echo e(url(getCurrentLocale().'/login')); ?>" class="butn main_bg m-1"><span><?php echo e(__('web.login')); ?> </span></a>
                    </div>
                </div>
            </div>
        </div>
<?php $__env->startPush('js'); ?>
<script>
<?php if(\Auth::user()): ?>
 function sharechat(elem) {
     var sender_id = <?php echo json_encode(\Auth::user()->id); ?>;
     var reciever_id = <?php echo json_encode($ad->user_id); ?>;
     var urls = $(elem).attr('action'); 
     $.ajax({
          url : <?php echo json_encode(url(getCurrentLocale().'/checkchat/')); ?>+'/'+sender_id+','+ reciever_id,
          type : 'GET',
          data : 'nothing',
          dataType : 'json',
          success:function(data)
          {
    
     let dbCon = firebase.database().ref(data);
dbCon.orderByChild('reciever').equalTo(sender_id).once("value", function(snapshot) {
  snapshot.forEach(function(child) {
    child.ref.update({
      seen: true
    });
  });
});

    firebase.database().ref(data).push().set({
      "sender":sender_id,
      "reciever":reciever_id,
      "message":<?php echo json_encode('this message for Product :'. productname($ad->id).' id : '. $ad->id); ?>,
      "type":'TXT',
      "image_msg":'null',
      "image":<?php echo json_encode(asset(\Auth::user()->photo)); ?>,
      "date":<?php echo json_encode(date("Y-m-d g:i a")); ?>,
      "seen":"false",
    }); 
     document.getElementById('message').value = '';
    $('#messages_scroll').scrollTop($('#messages_scroll')[0].scrollHeight);
          }
        })
        window.location.href = urls;

 }
 <?php endif; ?>
 function subscribedata(elem) {
    event.preventDefault();
   
         let action = $(elem).attr('action');
       
       let urls = action;
       
       let dataform = new FormData( $(elem)[0]);
        
     
      $.ajax({
          url : urls,
          type: 'POST',              
          data: dataform,
          contentType: false, 
          processData: false, 
          success:function(data)
          {
            
            $("#mailsuccess").modal('show');
               }
          ,error: function (data) {
              
              $('#mailerrors').html('');
   $.each(data.responseJSON.errors, function(key,value) {
      
     $('#mailerrors').append('<h4 >'+value+'</h4>');
     
 }); 
 
  $("#mailfailed").modal('show');
 
}
        })


}

<?php if(\Auth::user()): ?>
function liketoggle(elem){
           
              let data = $(elem).attr('data-id');
            let action = $(elem).attr('action-id');
            let urls = action+'/'+data;

            $.ajax({
          url : urls,
          type : 'GET',
          data : 'nothing',
          dataType:'json',
          success:function(data)
          {
              
              if(data.type == 'saved'){
                  $(elem).removeClass();
                  $(elem).addClass('text-light  bg-primary');
                  $('#likescount').html(data.num);
                       var channel_auc = 'auction'+<?php echo $ad->user_id; ?>

            var message_auc = {
      
      
      "user_id":<?php echo json_encode(\Auth::user()->id); ?>,
      "product_id":<?php echo $ad->id; ?>,
      "date":<?php echo json_encode(date("Y-m-d")); ?>,
      "time":<?php echo json_encode(date("g:i a")); ?>,
    }
       
      var snapshot_auc=  firebase.database().ref(channel_auc).push().set(message_auc).then(function(snapshot_auc) {
  if (snapshot_auc && snapshot_auc.exists()) {
    //console.log(snapshot.val());
  }
  else {
    console.log("No data available");
  }
              });
              }
              else{
                  $(elem).removeClass();
                  $(elem).addClass('text-dark  bg-muted');
                  $('#likescount').html(data.num);
              }
              
                  
             
          }

        })

    
}
    function favoritetoggle(elem){
               
              let data = $(elem).attr('data-id');
            let action = $(elem).attr('action-id');
            let urls = action+'/'+data;

            $.ajax({
          url : urls,
          type : 'GET',
          data : 'nothing',
          dataType:'json',
          success:function(data)
          {
              
              if(data == 'saved'){
                  $(elem).removeClass();
                  $(elem).addClass('text-light  bg-primary');
              }
              else{
                  $(elem).removeClass();
                  $(elem).addClass('text-light  bg-danger');
              }
              
                  
             
          }

        })


        }
        function favtoggle(elem){
               
              let data = $(elem).attr('data-id');
            let action = $(elem).attr('action-id');
            let urls = action+'/'+data;

            $.ajax({
          url : urls,
          type : 'GET',
          data : 'nothing',
          dataType:'json',
          success:function(data)
          {
              
              
                  
             
          }

        })


        }
        
        function reportad(elem){
                event.preventDefault();
       var action = $(elem).attr('action');
       var urls = action;
        
       var dataform = new FormData( $(elem)[0]);
      $.ajax({
          url : urls,
          type: 'POST',              
          data: dataform,
          contentType: false, 
          processData: false, 
          success:function(data)
          {
         
              $('#errorreport').css("display", "none");
              $('#successreport').css("display", "block");
            $('#successreport').html(<?php echo json_encode(__('web.success')); ?>);
         
            setTimeout(
  function() 
  {
      $(elem).closest('.modal').modal('hide');
  }, 1000);
  $(elem).closest('form').find("textarea").val("");
  
            
            
          }
          ,error: function (data) {
           
              $('#successreport').css("display", "none");
              $('#errorreport').html('');
    $('#errorreport').css("display", "block");
   
   $.each(data.responseJSON.errors, function(key,value) {
       
     $('#errorreport').append('<div class="col-12">'+value+'</div');
     
     
 }); 
 
}
        })
        }
        <?php endif; ?>
  function social(elem){
        
    $('span.at-icon-wrapper').css('margin-top','-10px');
    
    }
    function loginft(elem){
            $("#loginfailed").modal('show');
        }
        
        function paypackage(elem){
   event.preventDefault();
         let action = $(elem).attr('action');
       
       let urls = action;
       let target = $(elem).attr('data-id');
       let dataform = new FormData( $(elem)[0]);
        
     
      $.ajax({
          url : urls,
          type: 'POST',              
          data: dataform,
          contentType: false, 
          processData: false, 
          success:function(data)
          {
            if(data != 'error'){
            $('#errorpay'+target).css("display", "none");
              $('#successpay'+target).css("display", "block");
            $('#successpay'+target).html(<?php echo json_encode(__('web.success')); ?>);
              setTimeout(
  function() 
  {
      location.reload();
  }, 1000);
           
}
else{
     $('#successpay'+target).css("display", "none");
              $('#errorpay'+target).html(<?php echo json_encode(__('web.try_again')); ?>);
    $('#errorpay'+target).css("display", "block");
}
           
  
               }
          ,error: function (data) {
              
               $('#successpay'+target).css("display", "none");
              $('#errorpay'+target).html('');
    $('#errorpay'+target).css("display", "block");

   $.each(data.responseJSON.errors, function(key,value) {

     $('#errorpay'+target).append('<div class="col-12">'+value+'</div');


 });

}
        })

}
function hidedata(elem){
    $('#showcredit').css('display','none');
}

function showdata(elem){
    $('#showcredit').css('display','block');
}
</script>

<?php $__env->stopPush(); ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('web.layouts.main', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/omaralyomhost/public_html/hanqr/resources/views/web/pages/ads/ad.blade.php ENDPATH**/ ?>