<?php $__env->startSection('content'); ?>
    <?php Fun::lang()?>
    <div class="page">
        <div class=container-fluid>
            <div class="top-content">
                <div class="row">
                    <div class="col-sm-12 col-xs-12" style="margin-bottom: 30px">
                    <h3><?php echo e(__('administrator.create_role')); ?></h3>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <div class="form-wrapper">
                        <?php echo Form::open(array('route' => 'roles.store','method'=>'POST','id'=>'form_validate')); ?>

                        <div class="form-group col-lg-6 col-xl-6">
                            <div class="col-lg-2 col-xl-2">
                                <label class="required"><?php echo e(__('administrator.title')); ?></label>
                            </div>
                            <div class="col-lg-8 col-xl-8">
                                <?php echo Form::text('name', null, array('placeholder' => 'Title','class' => 'form-control')); ?>

                            </div>
                        </div>
                        <div class="col-sm-12">
                            <div class="vertical-tabs">
                                <ul class="nav nav-tabs" role="tablist" style="overflow: scroll;height: 70vh">
                                    <?php $__currentLoopData = $group_permission; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <li class="nav-item">
                                            <a class="nav-link active" data-toggle="tab" href="#page<?php echo e($key); ?>" role="tab"
                                               aria-controls="home"><?php echo e(__('administrator.'.strtolower(str_replace(' ','_',$row->group_name)))); ?></a>
                                        </li>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    <li class=" hr-dashboard">
                                        <?php echo e(__('administrator.hrm')); ?>

                                    </li>
                                    <?php $__currentLoopData = $group_app_name; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <li class="nav-item">
                                            <a class="nav-link active" data-toggle="tab" href="#pag<?php echo e($key); ?>" role="tab"
                                               aria-controls="home"><?php echo e(__('administrator.'.strtolower(str_replace(' ','_',$row->group_name)))); ?></a>
                                        </li>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </ul>
                                <div class="tab-content">
                                    <?php $__currentLoopData = $group_permission; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <div class="tab-pane <?php echo e($key==0?'active':''); ?>" id="page<?php echo e($key); ?>" role="tabpanel">
                                            <div class="sv-tab-panel app-height"  style="overflow-y: scroll;height: 70vh">
                                                <?php
                                                    $items = \Spatie\Permission\Models\Permission::where(['group_name'=>$row->group_name,'app_name'=>$row->app_name])->get();
                                                    $string = preg_replace('/\s+/', '', $row->group_name);
                                                ?>
                                                <div class="col-lg-12" style="margin-bottom: 10px;"><?php echo e(Form::checkbox('check_all_area1[]',  $string, false, array('class' =>'check_all' ))); ?>

                                                    <?php echo e(__('administrator.check_all')); ?>

                                                </div>
                                                <?php
                                                    $permission = \Spatie\Permission\Models\Permission::where(['group_name'=>$row->group_name,'app_name'=>$row->app_name])->get();
                                                ?>
                                                <?php $__currentLoopData = $permission; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <div class="col-lg-3" style="margin-top: 5px">
                                                        <label>
                                                            <?php echo e(Form::checkbox('permission[]', $value->id, false, array('class' =>$string))); ?>

                                                            <?php echo e(__("administrator.$value->name")); ?>

                                                        </label>
                                                    </div>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </div>
                                        </div>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    <?php $__currentLoopData = $group_app_name; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <div class="tab-pane" id="pag<?php echo e($key); ?>" role="tabpanel">
                                            <div class="sv-tab-panel"  style="overflow-y: scroll;height: 70vh">
                                                <?php
                                                    $items = \Spatie\Permission\Models\Permission::where(['group_name'=>$row->group_name,'app_name'=>$row->app_name])->get();
                                                    $string = preg_replace('/\s+/', '', $row->group_name);
                                                ?>
                                                <div class="col-lg-12" style="margin-bottom: 10px;"><?php echo e(Form::checkbox('check_all_area1[]',  $string, false, array('class' =>'check_all' ))); ?>

                                                    <?php echo e(__('administrator.check_all')); ?>

                                                </div>
                                                <?php
                                                    $permission = \Spatie\Permission\Models\Permission::where('group_name',$row->group_name)->get();
                                                ?>
                                                <?php $__currentLoopData = $permission; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <div class="col-lg-3" style="margin-top: 5px">
                                                        <label>
                                                            <?php echo e(Form::checkbox('permission[]', $value->id, false, array('class' =>$string))); ?>

                                                            <?php echo e(__("administrator.$value->name")); ?>

                                                        </label>
                                                    </div>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </div>
                                        </div>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12 col-xs-12">
                        <div class="form-group">
                            <button type="submit" class=" button_primary pull-right"><span
                                        class="fa fa-save"></span> <?php echo e(__('administrator.save')); ?></button>
                            <button type="button" onClick="history.go(-1)" class=" button_warning pull-right">
                                <span class=" fa fa-arrow-circle-left"></span> <?php echo e(__('administrator.back')); ?></button>
                        </div>
                    </div>
                    <?php echo Form::close(); ?>

                </div>
            </div>

        </div>
    </div>

<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
    <script>
        $(".check_all").change(function () {
            let this_ = $(this);
            let check = $(this).prop("checked");
            let val = '.' + this_.val();
            $(val + `:checkbox`).prop('checked', check);
        });

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


<?php echo $__env->make(branchMenu(), \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/nsowos/public_html/shr-brand/resources/views/administrator/roles/create.blade.php ENDPATH**/ ?>