<?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.filter')); ?></span>
            </div>
            <h2><?php echo e(__('web.filter')); ?></h2>
        </div>
    </section>
    <main>
      
        <!---------- new ---------->
        <section class="sections_tabs bg-gray pt-5 pb-5">
            <div class="container">
                <div class="section-head wow fadeInUp mb-0">
                    <h2><?php echo e(__('web.categories')); ?></h2>
                </div>
                <div class="content">
                    <div class="nav nav-pills swiper_sections" id="pills-tab" role="tablist">
                        <div class="swiper-wrapper">
                             <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <div class="nav-item swiper-slide">
                                <a id="pills-tab<?php echo e($row->id); ?>-tab" data-toggle="pill" href="#pills-tabs<?php echo e($row->id); ?>" role="tab" aria-controls="pills-tab<?php echo e($row->id); ?>" aria-selected="true">
                                    <div class="cont_head">
                                        <img src="<?php echo e(asset($row->image)); ?>" alt="">
                                        <span><?php echo e(categoryname($row->id)); ?></span>
                                    </div>
                                </a>
                            </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                        <div class="swiper_arrows">
                            <span class="slide_next"><i class="fas fa-chevron-right"></i></span>
                            <span class="slide_prev"><i class="fas fa-chevron-left"></i></span>
                        </div>
                    </div>
                    <div class="tab-content" id="pills-tabContent">
                        <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="tab-pane fade" id="pills-tabs<?php echo e($row->id); ?>" role="tabpanel" aria-labelledby="pills-tab<?php echo e($row->id); ?>-tab">
                            <div class="tab_cont">
                                <?php $__currentLoopData = mainmodels($row->id); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $model): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <a onclick="fitermodel(this)" style="cursor: pointer;"  model-id="<?php echo e($model->id); ?>" category-id="<?php echo e($row->id); ?>" action-id="<?php echo e(url(getCurrentLocale().'/filtercategoryauction')); ?>"  class="items">
                                    <div class="ico">
                                        <img  src="<?php echo e(asset($model->image)); ?>" alt="">
                                    </div>
                                    <h6>
                                        <?php echo e(modelname($model->id)); ?>

                                    </h6>
                                </a>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </div>
                        </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
                </div>
            </div>
        </section>
        <!-- -------------- products --------------- -->
        <div class="mazad_next_content section-padding">
            <div class="container">
                <div class="row no-gutters" id="filter">
                    <div class="col-lg-9">
                        <section class="products">
                            <div class="prod_cont" id="ads">
                                 <?php $__currentLoopData = $auctions; $__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="">
                           
                            <span class="status bg-info text-light">
                                 <?php echo e(date('F j, Y',strtotime($row->date))); ?>

                            </span>
                        </a>
                        <div class="info">
                            <h6>
                                <?php echo e(productname($row->id)); ?>

                            </h6>
                            <p>
                                <i class="fas fa-map-marker-alt"></i> <?php echo e(cityname($row->city_id)); ?>

                            </p>
                        </div>
                        <div class="mazad_bottom_info">
                            <div class="mazad_price">
                                <p><?php echo e(__('web.start_cost')); ?></p>
                                <div class="price">
                                    <h6 class="sub_color">
                                        <span><?php echo e($row->start_cost); ?></span>
                                        <small><?php echo e(__('web.sar')); ?></small>
                                    </h6>
                                </div>
                            </div>
                            <div class="mazad_count">
                                <p><?php echo e(__('web.timetillstart')); ?></p>
                                <div class="countdown show" data-Date='<?php echo e($row->date); ?> <?php echo e($row->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>
                        </div>
                    </div>
                   <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </div>
                        </section>
                    </div>
                    <div class="col-lg-3">
                        <div class="mazad_filter">
                            <div class="head">
                                <h5><?php echo e(__('web.searchselect')); ?></h5>
                            </div>
                            <div class="content">
                                <form id="formfilter" action="<?php echo e(url(getCurrentLocale().'/formfilterauction')); ?>" class="form-row">
                                    <?php echo csrf_field(); ?>
                                    
                                     
                                            
                                            
                                       
                                        
                                    
                                    <div class="form-group col-12">
                                        <input type="text" onchange="counterdata(this)" name="search" placeholder="<?php echo e(__('web.search')); ?>" class="form-control">
                                    </div>
                                    <?php if(isset($request->model)): ?>
                                    <input type="hidden" name="model" value="<?php echo e($request->model); ?>">
                                    <?php if(count(modelsub($request->model )) >0 ): ?>
                                    <div class="form-group col-12">
                                        <select name="model_id" class="form-control">
                                            <option selected value=""><?php echo e(__('web.category')); ?></option>
                                            <?php $__currentLoopData = modelsub($request->model ); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $model): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($model->id); ?>"><?php echo e(modelname($model->id)); ?></option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                    </div>
                                    <?php endif; ?>
                                    <?php endif; ?>
                                    
                                    <div class="form-group col-12 mb-0">
                                        <label><?php echo e(__('web.date')); ?> </label>
                                    </div>
                                    <div class="form-group col-6">
                                        <input type="time" name="start_time" placeholder="<?php echo e(__('web.start_time')); ?>" class="form-control pr-4">
                                        
                                    </div>
                                    <div class="form-group col-6">
                                        <input type="time" name="end_time" placeholder="<?php echo e(__('web.end_time')); ?>" class="form-control pr-4">
                                       
                                    </div>
                                    <div class="form-group col-12">
                                        <p><?php echo e(__('web.cost')); ?> </p>
                                        <div id="rangeSlider" class="range-slider col-12">
                                            <div class="range-group">
                                                <input class="range-input" onchange="counterdata(this)" name="start" value="1" min="1" max="<?php echo e($max); ?>" step="1" type="range">
                                                <input class="range-input" onchange="counterdata(this)" name="end" value="<?php echo e($max); ?>" min="1" max="<?php echo e($max); ?>" step="1" type="range">
                                            </div>
                                            <div class="number-group">
                                                <span>
                                                    <small><?php echo e(__('web.sar')); ?></small>
                                                <input class="number-input" type="number" name="start" value="1" min="0" max="<?php echo e($max); ?>"> 
                                               </span> -
                                                <span>
                                                    <small><?php echo e(__('web.sar')); ?></small>
                                                    <input class="number-input" type="number" name="end" value="<?php echo e($max); ?>" min="0" max="<?php echo e($max); ?>"> 
                                                </span>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                                <div class="search_results">
                                    <a onclick="formfilter(this)" style="cursor: pointer;" class="butn main_bg"><span id="counter"> <i class="fas fa-search ml-1"></i> <?php echo e(count($auctions)); ?> <?php echo e(__('web.searchresult')); ?> </span></a>
                                    <a onclick="clearsearch(this)" style="cursor: pointer;" class="butn sub_bg"><span> <?php echo e(__('web.clearseach')); ?> </span></a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- -------------- inner_subscribe --------------- -->
        <section class="inner_subscribe">
            <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="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 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="mailerrors" class="alert alert-danger">
                             <a href="<?php echo e(url(getCurrentLocale().'/login')); ?>"><?php echo e(__('web.loginfirst')); ?></a>
                        </div>
                       
                        
                    </div>
                </div>
            </div>
        </div>
        </section>


    </main>

<?php $__env->startPush('js'); ?>
<script>
    function counterdata(elem){
        event.preventDefault();
         let dataform = new FormData( $('#formfilter')[0]);
         
         $.ajax({
          url : <?php echo json_encode(url(getCurrentLocale().'/counterdataauction')); ?>,
          type: 'POST',              
          data: dataform,           
          dataType: 'json',
          contentType: false, 
          processData: false, 
          success:function(data)
          {
            //alert(data);
            $("#counter").html('<i class="fas fa-search ml-1"></i> '+data+' نتيجة بحث ');
               }
          
        })
        
    }
    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');
 
}
        })


}

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',
          success:function(data)
          {
              
              
                  
             
          }

        })


        }
        function loginft(elem){
            $("#loginfailed").modal('show');
        }
        function clearsearch(elem){
            $('.form-row').find("input:not([name='_token'], [name='category'], [name='model'])").val("");
            $(".form-row input").prop('checked', false); 
            $(".form-row select").val('');
        }
        
        function fitermodel(elem){
            let category = $(elem).attr('category-id');
            let model = $(elem).attr('model-id');
            let action = $(elem).attr('action-id');
            let urls = action+'/'+category+','+model;

             $.ajax({
          url : urls,
          type : 'GET',
          data : 'nothing',
          success:function(data)
          {
              $('#filter').html(data);
              
                  
             
          }
        })
            
        }
        function formfilter(elem){
            
            event.preventDefault();
   
         let action = $('#formfilter').attr('action');
       
       let urls = action;
       
       let dataform = new FormData( $('#formfilter')[0]);
        
     
      $.ajax({
          url : urls,
          type: 'POST',              
          data: dataform,
          contentType: false, 
          processData: false, 
          success:function(data)
          {
            
            $("#ads").html(data);
               
          }
          })
               
        }
        function modelselect(elem){
            event.preventDefault();
         let dataform = new FormData( $('#formfilter')[0]);
         
         $.ajax({
          url : <?php echo json_encode(url(getCurrentLocale().'/counterdataauction')); ?>,
          type: 'POST',              
          data: dataform,           
          dataType: 'json',
          contentType: false, 
          processData: false, 
          success:function(data)
          {
            //alert(data);
            $("#counter").html('<i class="fas fa-search ml-1"></i> '+data+' نتيجة بحث ');
               }
          
        })
        let row = $(elem).val();
        $.ajax({
          url : <?php echo json_encode(url(getCurrentLocale().'/selectmodelform')); ?>+'/'+row,
          type: 'GET',              
          data: 'dataform',
          success:function(data)
          {
            
            $("#submodel").html(data);
               }
          
        })
            
        }
</script>

    <!-- ------------- new scripts -------------- -->

    <script>
        $(".sections_tabs .nav .nav-item").on("click", function() {
            $(this).siblings(".nav-item").find("a").removeClass("active");
        })
    </script>

    <script>
        var swiper = new Swiper('.swiper_sections', {
            spaceBetween: 0,
            observer: true,
            observeParents: true,
            loop: false,
            navigation: {
                 nextEl: '.slide_prev',
                prevEl: '.slide_next',
            },
            breakpoints: {
                575: {
                    slidesPerView: 1,
                    spaceBetween: 0,
                },
                767: {
                    slidesPerView: 3,
                },
                991: {
                    slidesPerView: 5,
                }
            }
        });
    </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/auctions.blade.php ENDPATH**/ ?>