<?php $__env->startSection('content'); ?>
<div class="side-title">
    <h3><?php echo e($head ?? ''); ?></h3>
</div>


<div class="border-item">
    <div class="noti_search_box mb-4">
      <input type="text" class="search-input" onkeyup="selectuser(this)" id="search" placeholder=" بحث">
      <button class="search-button" onclick="selectuserclick(this)">
        <i class="fas fa-search"></i>
      </button>
   </div>
    <form class="form-row"   method="post" action="<?php echo e($action); ?>" enctype="multipart/form-data">
       
        <?php echo csrf_field(); ?>
     
    
       <div class="form-group col-lg-12">
            <div class="custom-control custom-checkbox d-block">
                <input type="checkbox" class="custom-control-input checkbox" onclick="selectalldata(this)" id="notifications_check" name="selecctall" >
                <label class="custom-control-label" for="notifications_check"><h5><?php echo e(__('notifications.all')); ?></h5></label>
            </div>
           <div class="companies_checkbox row">
                    <?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="col-3 checkboxes" id="companies<?php echo e($row->id); ?>">
                        <div class="custom-control custom-checkbox">
                            <input type="checkbox" class="custom-control-input checkbox" id="<?php echo e($row->id); ?>"  name="user_id[]" value="<?php echo e($row->id); ?>" >
                            <label class="custom-control-label" for="<?php echo e($row->id); ?>"><?php echo e($row->name); ?></label>
                        </div>
                    </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
       </div>
       <div class="side-title col-lg-12 mt-4">
            <h3>تفاصيل الرسالة</h3>
        </div>
        <?php $__currentLoopData = $languages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <div class="form-group col-lg-6">
            <label><?php echo e(meta('title', $language->local) ?? __('articles.title')); ?> <?php echo e(count($languages) > 1 ? "({$language->name})" : ''); ?> </label>
            <input type="text" class="form-control <?php echo e($errors->has('title_'.$language->local) ? 'is-invalid' : ''); ?>" name="title_<?php echo e($language->local); ?>" placeholder="<?php echo e(meta('title', $language->local) ?? __('articles.title')); ?>" value='<?php echo e(old("title_{$language->local}", $article[$language->local]->title ?? "")); ?>'/>
        </div>

        <div class="form-group col-lg-12">
            <label><?php echo e(meta('description', $language->local) ?? __('articles.description')); ?> <?php echo e(count($languages) > 1 ? "({$language->name})" : ''); ?> </label>
            <textarea name="description_<?php echo e($language->local); ?>" class="form-control my-editor <?php echo e($errors->has('description_'.$language->local) ? 'is-invalid' : ''); ?>" placeholder="<?php echo e(meta('description', $language->local) ?? __('articles.description')); ?>"><?php echo e(old("description_{$language->local}", $article[$language->local]->description ?? "")); ?></textarea>
        </div>

        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

       
    


        <div class="text-center mt-5 col-12">
            <button class="butn"><span><?php echo e(__('dashboard.save')); ?></span></button>
        </div>
    </form>
</div>


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

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

<script>
function selectuser(elem){
    let data = $('#search').val();
    if(data == ''){
        $( ".checkboxes" ).each(function() {
  $( this ).css('display','block');
});
    }
    else{
        
             $('.checkboxes').each(function () { 
  $( this ).css('display','none');
});

    
    $.ajax({
          url : url_lisence+'/'+data,
          type : 'GET',
          data : 'nothing',
          dataType : 'json',
         
          success:function(data)
          {
             
           $.each( data, function( key, value ) {
                let dataval = 'companies'+value;
                
  $( "#"+dataval ).css('display','block');
});
          }
        })
       
    }
}
function selectuserclick(elem){
       let data = $(elem).val();
    if(data == ''){
        $( ".checkboxes" ).each(function() {
  $( this ).css('display','block');
});
    }
    else{
        
             $('.checkboxes').each(function () { 
  $( this ).css('display','none');
});

    
    $.ajax({
          url : url_lisence+'/'+data,
          type : 'GET',
          data : 'nothing',
          dataType : 'json',
         
          success:function(data)
          {
             
           $.each( data, function( key, value ) {
                let dataval = 'companies'+value;
                
  $( "#"+dataval ).css('display','block');
});
          }
        })
       
    }
}
  function selectalldata(elem){
      
        if (elem.checked) {
            $('.checkbox').each(function () { //loop through each checkbox
                $(this).prop('checked', true); //check 
            });
        } else {
            $('.checkbox').each(function () { //loop through each checkbox
                $(this).prop('checked', false); //uncheck              
            });
        }
    
}
    </script>
   <script src="<?php echo e(asset('/assets/admin/js/lib/tinymce.min.js')); ?>"></script>
   
    <script>
        let route_prefix = "<?php echo e(url(config('lfm.prefix'))); ?>",
            url = "<?php echo e(url('/')); ?>/",
            url_lisence = <?php echo json_encode(url(getCurrentLocale().'/admin/usersdata/')); ?>,
            url_type = <?php echo json_encode(url(getCurrentLocale().'/admin/type/')); ?>,
            currentLanguage = "<?php echo e(getCurrentLocale()); ?>",
            imagePath = "<?php echo e(asset('')); ?>";
    </script>
    <script src="<?php echo e(asset('assets/admin/js/editor.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/admin/js/lfm.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/admin/js/articles.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/admin/js/areas.js')); ?>"></script>
<?php $__env->stopSection(); ?>




<?php echo $__env->make('admin.layouts.container', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/omaralyomhost/public_html/nawalgym/resources/views/admin/notifications/form.blade.php ENDPATH**/ ?>