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


  <section class="inner_header">
        <img src="<?php echo e(url('')); ?>/assets/web/images/icons/inner.svg" alt="" class="inner_shap">
        <div class="container">
            <ul class="links">
                <li>
                    <a href="<?php echo e(url(getCurrentLocale().'/')); ?>"><i class="bi bi-house"></i></a>
                </li>
                <li>
                    <a href="<?php echo e(url(getCurrentLocale().'/stores/'.$store->id)); ?>"> <?php echo e(storedescription($store->id,'name')); ?> </a>
                </li>
            </ul>
            <h4><?php echo e(storedescription($store->id,'name')); ?></h4>
        </div>
    </section>
    <!--End-inner_header-->
    <!--Contents-->
    <main>
        <!-- -------------- shop_details --------------- -->
        <section class="shop_banner" style="background-image:url(<?php echo e(asset($store->banner)); ?>)">
            <div class="container">
                <div class="row">
                    <div class="col-lg-6">
                        <div class="info">
                            <div class="row">
                                <div class="col-lg-3">
                                    <div class="img">
                                        <img src="<?php echo e(asset($store->image)); ?>" alt="">
                                    </div>
                                </div>
                                <div class="col-lg-9">
                                    <div class="cont">
                                        <h3><?php echo e(storedescription($store->id,'name')); ?></h3>
                                        <h6><?php echo e(categorydescription($store->category_id,'name')); ?></h6>
                                        <p><img class="icon" src="<?php echo e(url('')); ?>/assets/web/images/icons/sh_plc.svg" alt=""><?php echo e(storedescription($store->id,'address')); ?></p>
                                        <p>
                                            (<?php echo e(count($rates)); ?> <?php echo e(__('web.rate')); ?>)
                                            <span class="rat">
                                                <?php for($i=0;$i<$total;$i++): ?>
                                                <i class="bi bi-star-fill"></i>
                                                <?php endfor; ?>
                                            </span>
                                            <?php if(\Auth::user()): ?>
                                            <?php if(subscribed()): ?>
                                            <?php if(rated($store->id)): ?>
                                            <a href="#"  data-toggle="modal" data-target="#rate_modal" class="butn sub_color py-1 px-3"> <span><?php echo e(__('web.rate')); ?></span> </a>
                                            <?php endif; ?>
                                            <?php endif; ?>
                                            <?php endif; ?>
                                        </p>
                                        <div class="share">
                                            <span class="icon">
                                                <i class="bi bi-share"></i>
                                            </span>
                                            <?php if(!is_null($store->youtube)): ?>
                                            <a target="_blank" href="<?php echo e($store->youtube); ?>">
                                                <i class="bi bi-youtube"></i>
                                            </a>
                                            <?php endif; ?>
                                            <?php if(!is_null($store->twitter)): ?>
                                            <a target="_blank" href="<?php echo e($store->twitter); ?>">
                                                <i class="bi bi-twitter"></i>
                                            </a>
                                            <?php endif; ?>
                                            <?php if(!is_null($store->instagram)): ?>
                                            <a target="_blank" href="<?php echo e($store->instagram); ?>">
                                                <i class="bi bi-instagram"></i>
                                            </a>
                                            <?php endif; ?>
                                            <?php if(!is_null($store->facebook)): ?>
                                            <a target="_blank" href="<?php echo e($store->facebook); ?>">
                                                <i class="bi bi-facebook"></i>
                                            </a>
                                            <?php endif; ?>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <section class="shop_details section_padding bg_gray">
            <div class="container">
                <div class="shop_coupons mb-5">
                    <div class="section_head">
                        <h2><?php echo e(__('web.cobons')); ?></h2>
                        <!--<h6><?php echo e(__('web.cobons_desc')); ?></h6>-->
                    </div>
                    <div class="prod_content_slider swiper-container pt-5">
                        <div class="swiper-wrapper">
                            <?php $__currentLoopData = $cobons; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php if(is_null($row->count)): ?>
                            <div class="swiper-slide">
                                <div class="coupon_box">
                                    
                                    <div class="cop_label">
                                       
                                        <span> <?php echo e(__('web.reuse')); ?> </span>
                                      
                                       
                                    </div>
                                    
                                    <div class="info">
                                        <div class="cont">
                                            <div class="cop_icon">
                                                <img src="<?php echo e(asset($row->image)); ?>" alt="">
                                            </div>
                                            <div class="">
                                                <h6> <?php echo e(__('web.sale')); ?> <strong> <?php echo e($row->discount_amount); ?> <?php if($row->discount_type == '1'): ?> <?php echo e(__('web.sar')); ?> <?php else: ?> % <?php endif; ?> </strong></h6>
                                                <p><?php echo e(categorydescription($row->store->category_id,'name')); ?></p>
                                            </div>
                                        </div>
                                        <div class="text">
                                            <?php echo cobondescription($row->id,'description'); ?>

                                        </div>
                                        <a href="#" class="butn sub_color">
                                            <span><?php echo e(__('web.downloadapp')); ?></span>
                                        </a>
                                    </div>
                                </div>
                            </div>
                            <?php else: ?>
                            <?php for($i=0;$i< $row->count; $i++): ?>
                            <div class="swiper-slide">
                                <div class="coupon_box">
                                  
                                    <div class="info">
                                        <div class="cont">
                                            <div class="cop_icon">
                                                <img src="<?php echo e(asset($row->image)); ?>" alt="">
                                            </div>
                                            <div class="">
                                                <h6> <?php echo e(__('web.sale')); ?> <strong> <?php echo e($row->discount_amount); ?> <?php if($row->discount_type == '1'): ?> <?php echo e(__('web.sar')); ?> <?php else: ?> % <?php endif; ?> </strong></h6>
                                                <p><?php echo e(categorydescription($row->store->category_id,'name')); ?></p>
                                            </div>
                                        </div>
                                        <div class="text">
                                            <?php echo cobondescription($row->id,'description'); ?>

                                        </div>
                                        <a href="#" class="butn sub_color">
                                            <span><?php echo e(__('web.downloadapp')); ?></span>
                                        </a>
                                    </div>
                                </div>
                            </div>
                            <?php endfor; ?>
                            <?php endif; ?>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                        <div class="swiper-button-next"></div>
                        <div class="swiper-button-prev"></div>
                    </div>
                </div>
                <div class="section_head">
                    <h2><?php echo e(__('web.services')); ?></h2>
                    <!--<h6><?php echo e(__('web.services_desc')); ?></h6>-->
                </div>
                <div class="shop_services swiper-container">
                    <div class="swiper-wrapper">
                        <?php $__currentLoopData = $services; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="swiper-slide">
                            <a href="" class="d-block serv_items">
                                <div class="icon">
                                    <img src="<?php echo e(asset($row->image)); ?>" alt="">
                                </div>
                                <h5><?php echo servicedescription($row->id,'name'); ?></h5>
                            </a>
                        </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
                    <div class="swiper-button-next"></div>
                    <div class="swiper-button-prev"></div>
                </div>
            </div>
        </section>
        <section class="shop_branches section_padding bg_gray">
            <div class="container">
                <div class="section_head">
                    <h2><?php echo e(__('web.branches')); ?></h2>
                    <!--<h6><?php echo e(__('web.branches_desc')); ?></h6>-->
                </div>
                <div class="content">
                    <div class="row">
                        <?php $__currentLoopData = $branches; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="col-lg-6">
                            <div class="brnch_box">
                                <h4><?php echo branchdescription($row->id,'name'); ?></h4>
                                <div class="info">
                                    <h6><?php echo e(__('web.address')); ?> : </h6>
                                    <div class="text">
                                        <?php echo branchdescription($row->id,'address'); ?>

                                    </div>
                                    <a href="#0" data-toggle="modal" data-target="#map_modal<?php echo e($row->id); ?>"><?php echo e(__('web.on_map')); ?></a>
                                </div>
                            </div>
                        </div>
                        
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
                </div>
            </div>
        </section>
        <section class="reviews section_padding bg-white">
            <div class="container">
                <div class="section_head">
                    <h2><?php echo e(__('web.rates')); ?></h2>
                    <!--<h6><?php echo e(__('web.rates_desc')); ?></h6>-->
                </div>
                <div class="content">
                    <div class="rev_slider swiper-container">
                        <div class="swiper-wrapper">
                            <?php $__currentLoopData = $rates; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <div class="swiper-slide">
                                <div class="rev_box bg_gray ">
                                    <div class="img">
                                        <img src="<?php echo e(asset($row->user->photo)); ?>" alt="">
                                    </div>
                                    <div class="info">
                                        <div class="top_inf">
                                            <h4><?php echo e($row->user->name); ?></h4>
                                            <small class="rate">
                                                <i class="bi bi-star me-1"></i>
                                                <span><?php echo e($row->rate); ?></span>
                                            </small>
                                        </div>
                                        <div class="text">
                                            <?php echo e($row->comment); ?>

                                        </div>
                                    </div>
                                </div>
                            </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                        <!-- <div class="swiper-pagination"></div> -->
                    </div>
                    <?php if(\Auth::user()): ?>
                    <?php if(subscribed()): ?>
                    <?php if(rated($store->id)): ?>
                    <div class="text-center mt-5">
                        <a href="#0" class="butn main_color" data-toggle="modal" data-target="#rate_modal">
                            <span><?php echo e(__('web.add_rate')); ?></span>
                        </a>
                    </div>
                    <?php endif; ?>
                    <?php endif; ?>
                    <?php endif; ?>
                </div>
            </div>
        </section>
    </main>
     <div class="modal fade" id="rate_modal" tabindex="-1" role="dialog" aria-labelledby="map_modalLabel"
        aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel"> <?php echo e(__('web.rate')); ?> </h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                  <div class="col-12"id="error_rate" style="display:none">
    <div  class="alert alert-danger" id="error_rates">

</div>
</div>
  <div class="col-12" id="success_rate" style="display:none">
    <div  class="alert alert-success">
<p style="color: black;"><?php echo e(__('web.success')); ?></p>
</div>
</div>
                <form method="post" onsubmit="rating(this)" id="rating" action="<?php echo e(url(getCurrentLocale().'/rate')); ?>">
                    <?php echo csrf_field(); ?>
                    <input type="hidden" name="store_id" value="<?php echo e($store->id); ?>">
                <div class="modal-body p-4">
                    <div class="bod_top text-center py-4">
                        <div class="stars">
                            <input type="radio" name="rate" value="5">
                            <input type="radio" name="rate" value="4">
                            <input type="radio" name="rate" value="3">
                            <input type="radio" name="rate" value="2">
                            <input type="radio" name="rate" value="1">
                        </div>
                    </div>
                    <div class="form">
                        <div class="form-group my-3">
                            <label class="mb-2 text" for=""><?php echo e(__('web.rate_here')); ?> </label>
                            <textarea class="form-control" name="comment" rows="6" placeholder="...">
    
                            </textarea>
                        </div>
                        <div class="text-center">
                            <button class="butn sub_color w-50">
                                <span><?php echo e(__('web.send')); ?></span>
                            </button>
                        </div>
                    </div>
                </div>
                </form>
            </div>
        </div>
    </div>
     <?php $__currentLoopData = $branches; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="modal fade" id="map_modal<?php echo e($row->id); ?>" tabindex="-1" role="dialog" aria-labelledby="map_modalLabel"
        aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
            <div class="modal-content rounded-0">
                <!-- <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel"> المكان على الخريطة </h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div> -->
                <div class="modal-body">
                    <iframe
                        src="https://maps.google.com/maps?q=<?php echo e($row->latlng); ?>&hl=en-US&amp;z=14&amp;ie=UTF8&amp;iwloc=B&amp;output=embed"
                        width="100%" height="400" style="border:0;" allowfullscreen="" loading="lazy"></iframe>
                </div>
            </div>
        </div>
    </div>

                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    
    <?php $__env->startPush('js'); ?>
    
    <script>
        
        function rating(elem){
        event.preventDefault(); 
       var action = $('#rating').attr('action');
       var urls = action;
       var dataform = $('#rating').serialize();
     
      $.ajax({
          url : urls,
          type: 'POST',              
          data: dataform,
          success:function(data)
          {
           $('#success_rate').css('display','block');
           $('#error_rate').css('display','none');
              
                 setTimeout(
  function()
  {
      location.reload();
  }, 1000);
             
          }
          ,error:function(data) {
             $('#error_rate').css('display','block');
             $('#success_rate').css('display','none');
              $('#error_rates').html('');
   
   $.each(data.responseJSON.errors, function(key,value) {
       console.log(key);
     $('#error_rates').append('<p style="color:black">'+value+'</p>');
     
     
 }); 
 
}
        })
        }
    </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/4u/resources/views/web/pages/store/store.blade.php ENDPATH**/ ?>