
<?php $__env->startSection('title','Role'); ?>
<?php $__env->startSection('content'); ?>
    <!-- Content Header (Page header) -->
    <div class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <h1 class="m-0 text-dark">Manage  Role</h1>
                </div><!-- /.col -->
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-right">
                        <li class="breadcrumb-item"><a href="#">Settings</a></li>
                        <li class="breadcrumb-item active">Manage Role </li>
                    </ol>
                </div><!-- /.col -->
            </div><!-- /.row -->
        </div><!-- /.container-fluid -->
    </div>
    <!-- /.content-header -->


    <!-- Main content -->
    <section class="content">
        <div class="col-lg-12">
            <div class="row">
                
                <div class="col-lg-12">
                    <div class=" bg-light">
                        <div class="card card-info card-outline">
                            <div class="card-header">
                                <h3 class="card-title">Edit Role</h3>
                                <div class="card-tools">
                                    <button type="button" class="btn btn-tool" data-widget="collapse">
                                        <i class="fas fa-plus"></i>
                                    </button>
                                </div>
                            </div> <!-- /.card-header -->

                            <div class="card-body" style="display: block;">
                                <div class="row">
                                    
                                    <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12">
                                        <?php echo e(Form::open(['route'=>['users.role.update',$role->id],'method'=>'post'])); ?>

                                        <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 <?php echo e($errors->has('name') ? 'has-error' : ''); ?>">
                                            <span style="display: block;height: 10px;width: 100%;background: #fff;"></span>
                                            <?php echo e(Form::label('name','Role Name:* ',['class'=>'control-label'])); ?>

                                            <?php echo e(Form::text('name',$role->name,['class'=>'form-control','id'=>'name'])); ?>

                                            <?php if($errors->has('name')): ?>
                                                <span class="help-block"><strong><?php echo e($errors->first('name')); ?></strong></span>
                                            <?php endif; ?>
                                        </div>
                                        <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 <?php echo e($errors->has('permission') ? 'has-error' : ''); ?>">
                                            
												
                                           
                                            <label for="permission"><h4>Permissions</h4></label>
                                            <table id="protable" class="table table-bordered table-striped">
                                                <thead>
                                                    <tr>
                                                        <th>SL</th>
                                                        <th>Name</th>
                                                        <th>Permissions</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    <?php $__empty_1 = true; $__currentLoopData = $permission_groups; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$permissions): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                                    
                                                        <tr>
                                                            <th><h5><?php echo e($key); ?></h5></th>
                                                            <th>
                                                                    <input id="<?php echo e(strtolower($key)); ?>-select-all" onclick="checkAll('<?php echo e(strtolower($key)); ?>')" type="checkbox">
                                                                    <label for="<?php echo e(strtolower($key)); ?>-select-all"> Select all <?php echo e($key); ?></label>
                                                            </th>
                                                            <th>
                                                                <?php $__empty_2 = true; $__currentLoopData = $permissions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $permission): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_2 = false; ?>
                                                                
                                                                    <div class="checkbox">
                                                                        <input  type="checkbox" class="<?php echo e(strtolower($key)); ?>-select" name="asignpermission[]" value="<?php echo e($permission->id); ?>" <?php echo e(hasPermission($role->id,$permission->name) ? 'checked':''); ?>>
                                                                        <label for="demo-form-checkbox"><?php echo e($permission->label); ?></label>
                                                                    </div>
                                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_2): ?>
                                                                <?php endif; ?>
                                                            </th>
                                                        </tr>                                           
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                                    <?php endif; ?>
                                                </tbody>
                                            </table>
                                        </div>



                                        <div class="col-lg-12 col-sm-12 col-xs-12"><span style="display: block;height: 10px;width: 100%;background: #fff;"></span></div>
                                        <div class="col-lg-6 col-sm-6 col-md-6 col-xs-12">
                                            <div class="col-lg-4 col-sm-4 col-xs-12">
                                                <?php echo e(Form::submit('SUBMIT',['class'=>'btn btn-success'])); ?>

                                            </div>
                                        </div>
                                        <?php echo e(Form::close()); ?>

                                    </div>
                                  
                                </div>
                               
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>

    </section><!-- /.content -->
<?php $__env->stopSection(); ?>

<?php $__env->startSection('style'); ?>
    <!-- DataTables -->
    <link rel="stylesheet" href="<?php echo e(asset('plugins/datatables/dataTables.bootstrap4.css')); ?>">
<?php $__env->stopSection(); ?>

<?php $__env->startSection('plugin'); ?>
    <!-- DataTables -->
    <script src="<?php echo e(asset('plugins/datatables/jquery.dataTables.js')); ?>"></script>
    <script src="<?php echo e(asset('plugins/datatables/dataTables.bootstrap4.js')); ?>"></script>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>
    <!-- page script -->
    <script type="text/javascript">
    function checkAll(label_group){
        var consd=$("."+label_group+"-select").attr('checked');
        if(consd){
             $("."+label_group+"-select").attr('checked', false);
             }else{
                $("."+label_group+"-select").attr('checked', true);
             }
               
        }
        

    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.fixed', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/welluugs/purchase.wellgrouperp.com/resources/views/users/edit-roles.blade.php ENDPATH**/ ?>