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

      <main>
        <!-- Start page-heading -->
        <div class="page-heading">
            <div class="container">
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb mb-0">
                        <li class="breadcrumb-item"><a href="<?php echo e(url(getCurrentLocale().'/')); ?>"><img src="<?php echo e(url('')); ?>/assets/web/images/icons/nav/1.svg" alt="" class="home-icon"/></a></li>
                        <li class="breadcrumb-item active" aria-current="page"><?php echo e(sectionname($section->id)); ?></li>
                    </ol>
                </nav>
                <h3 class="title text-center text-white mb-0"><b><?php echo e(sectionname($section->id)); ?></b></h3>
            </div>
            <img src="<?php echo e(url('')); ?>/assets/web/images/pattern-3.png" alt="" class="pattern"/>
        </div>
        <!-- Start package-det -->
        <section class="package-det">
            <div class="container">
                <form method="get" id="forming" action="<?php echo e(url(getCurrentLocale().'/pay/package')); ?>">
                    <?php if(count($packages)>0): ?>
                    <span class="badge"> <b id="cost"><?php echo e($packages[0]->cost); ?></b> <small><b><?php echo e(__('web.sar')); ?></b></small></span>
                    <?php endif; ?>
                     <?php if(Session::has('error')): ?>
   <div class="col-12">
    <div  class="alert alert-danger">
<p style="color: black;"><?php echo e(Session::get('error')); ?></p>
</div>
</div>
<?php endif; ?>
                    <div class="box_wrapper">
                        <h4 class="label mb-4 text-center"><b> <?php echo e(__('web.chooseLevel')); ?></b></h4>
                        <div class="row justify-content-center mt-4">
                            <?php $__currentLoopData = $packages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <div class="col-lg-4 col-md-6">
                                <div class="custom-control custom-radio">
                                    <input type="radio" id="pkgType<?php echo e($row->id); ?>" onclick="timePeriod(this)" <?php if($key == '0'): ?> checked <?php endif; ?> name="package_id" value="<?php echo e($row->id); ?>" class="custom-control-input">
                                    <label class="custom-control-label w-100" for="pkgType<?php echo e($row->id); ?>">
                                        <div class="pkg_card package-det-card">
                                            <div class="card_t">
                                                <img src="<?php echo e(asset($row->image)); ?>" alt="" class="bg"/>
                                                <div class="content center-vr">
                                                    <h4 class="pkg-name text-center"><?php echo e(packagename($row->id)); ?></h4>
                                                </div>
                                            </div>
                                            <div class="card-body">
                                                <ul class="list">
                                                    <?php $__currentLoopData = items($row->id); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <li class="li"><i class="fas fa-check"></i><?php echo e($item->value); ?></li>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </ul>
                                            </div>
                                        </div>
                                    </label>
                                </div>
                         
                            </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                    </div>
                    <div class="row mt-5 mb-5">
                        <div class=" col-lg-6">
                            <div class="box_wrapper">
                                <h5 class="label mb-4 text-center"><b><?php echo e(__('web.length')); ?></b></h5>
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="custom-control custom-radio">
                                            <input type="radio" id="pkgPeriod1" name="period" onclick="timePeriod(this)" checked value="four" class="custom-control-input">
                                            <label class="custom-control-label w-100" for="pkgPeriod1">
                                                <div class="package-det-card">
                                                    <div class="content">
                                                        <p class="det text-dark mb-0"><i class="far fa-calendar-alt"></i> 4 <?php echo e(__('web.weeks')); ?></p>
                                                    </div>
                                                </div>
                                            </label>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="custom-control custom-radio">
                                            <input type="radio" id="pkgPeriod2" name="period" onclick="timePeriod(this)" value="eight" class="custom-control-input">
                                            <label class="custom-control-label w-100" for="pkgPeriod2">
                                                <div class="package-det-card">
                                                    <div class="content">
                                                        <p class="det text-dark mb-0"><i class="far fa-calendar-alt"></i> 8 <?php echo e(__('web.weeks')); ?> </p>
            
                                                    </div>
                                                </div>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-6">
                            <div class="box_wrapper">
                                <h5 class="label mb-4 text-center"><b>  <?php echo e(__('web.contactway')); ?></b></h5>
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="custom-control custom-radio">
                                            <input type="radio" id="pkgContact1"onclick="timePeriod(this)"  name="contact" checked value="week" class="custom-control-input">
                                            <label class="custom-control-label w-100" for="pkgContact1">
                                                <div class="package-det-card">
                                                    <div class="content">
                                                        <p class="det text-dark mb-0"><i class="fas fa-phone"></i> <?php echo e(__('web.eachweek')); ?></p>
                                                    </div>
                                                </div>
                                            </label>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="custom-control custom-radio">
                                            <input type="radio" id="pkgContact2"onclick="timePeriod(this)"  name="contact" value="month" class="custom-control-input">
                                            <label class="custom-control-label w-100" for="pkgContact2">
                                                <div class="package-det-card">
                                                    <div class="content">
                                                        <p class="det text-dark mb-0"><i class="fas fa-phone"></i> <?php echo e(__('web.eachmonth')); ?></p>
            
                                                    </div>
                                                </div>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        
                        </div>
                    </div>

                    <button class="main-butn dark-butn m-auto"><span><?php echo e(__('web.subscribenow')); ?></span></button>
                </form>
            </div>
        </section>
        <!-- Start newsletter-sec -->
         <section class="newsletter-sec">
            <div class="container">
                <div class="row">
                    <div class="col-lg-3">
                        <img src="<?php echo e(url('')); ?>/assets/web/images/icon.svg" alt="" class="logo wow zoomIn"/>
                    </div>
                    <div class="col-lg-5 col-md-6">
                        <div class="text  center-vr wow text-focus-in">
                           <h2 class="title text-white mb-3"><?php echo e(__('web.subscribe_mail')); ?></h2>
                            <p class="p text-white-50 mb-0"><?php echo e(__('web.enter_email')); ?> </p>
                        </div>
                    </div>
                    <div class="col-lg-4 col-md-6">
                        <div class="form-wrapper center-vr wow text-focus-in">
                            <form onsubmit="formemail(this)" id="formemail" method="post" action="<?php echo e(url(getCurrentLocale().'/subscribe')); ?>" class="row">
                                <?php echo csrf_field(); ?>
                                <input type="email" name="email" class="form-control col-10"  placeholder="<?php echo e(__('web.email')); ?>">
                                <button class="submit-butn col-2"><i class="fab fa-telegram-plane"></i></button>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </section>
         <div class="modal logoutModal fade" id="confirmModal" tabindex="-1" aria-labelledby="confirmModalLabel" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered modal-lg">
                <div class="modal-content">
                    <div class="modal-body">
                        <img src="<?php echo e(url('')); ?>/assets/web/images/confirmed.svg" alt="" class="main-img"/>
                        <h4 class="title text-center mt-3" id="success"><?php echo e(__('web.success')); ?></h4>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="main-butn active-butn" data-dismiss="modal"><span><?php echo e(__('web.ok')); ?></span></button>
                    </div>
                </div>
            </div>
        </div>
        <!-- Canceled Newsletter Modal --> 
        <div class="modal logoutModal fade" id="cancelModal" tabindex="-1" aria-labelledby="cancelModalLabel" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered modal-lg">
                <div class="modal-content">
                    <div class="modal-body">
                        <img src="<?php echo e(url('')); ?>/assets/web/images/cancel.svg" alt="" class="main-img"/>
                        <div  id="error">
                        
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="main-butn active-butn" data-dismiss="modal"><span><?php echo e(__('web.ok')); ?></span></button>
                    </div>
                </div>
            </div>
        </div>
    </main>
    <?php $__env->startPush('js'); ?>
   <script>
   function formemail(elem){
        event.preventDefault(); 
       var action = $('#formemail').attr('action');
       var urls = action;
       var dataform = $('#formemail').serialize();
     
      $.ajax({
          url : urls,
          type: 'POST',              
          data: dataform,
          success:function(data)
          {
           $('#confirmModal').modal('show');
              $('#error').css("display", "none");
              $('#success').css("display", "block");
           
            
             
          }
          ,error:function(data) {
             $('#cancelModal').modal('show');
              $('#success').css("display", "none");
              $('#error').html('');
    $('#error').css("display", "block");
   
   $.each(data.responseJSON.errors, function(key,value) {
       
     $('#error').append('<h4 class="title text-center mt-3">'+value+'</h4>');
     
     
 }); 
 
}
        })
        }
       
   
      function timePeriod(elem){
         
          var dataform = $('#forming').serializeArray();
         console.log(dataform);
         let packages = dataform[0]['value'];
         let period = dataform[1]['value'];
         let contact = dataform[2]['value'];
$.ajax({
          url : <?php echo json_encode(url(getCurrentLocale().'/costPackage')); ?>+'/'+packages+','+period+','+contact,
          type: 'Get',              
          data: 'dataform',        
          dataType: 'json',
          success:function(data)
          {
           
              $('#cost').html(data);
             
          }
          
 

        })

      }
    </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/raied/resources/views/web/pages/packagedetails.blade.php ENDPATH**/ ?>