<?php echo $__env->make('forms.fbncheader', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->make('forms.fdatatables', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

<div class="col-lg-10 col-lg-offset-1">
    <h1><i class="fa fa-roles"></i>Administration des Rôles</h1>
 
         <div class="card-header">
                <a href="./roles_tableau" class="btn btn-info pull-left" style="margin-right: 3px;">
                    Tableau croisé
                </a>
        </div>
        
    <div class="">
            <table id="_table" width="100%" class="table table-striped table-bordered">
                <thead>
                    <tr>
                        <th width=20%'>Nom</th>
                        <th >Utilisateurs</th>
                        <th width='1px'>
                            <?php if($user->hasRole("ADMINISTRATEUR") || $user->can("ROL_AJO")): ?>
                            <a href="<?php echo url('acces/roles/create'); ?>" class="btn btn-success">
                                Ajouter</a> 
                            <?php endif; ?>
                        </th>
                    </tr>
                </thead>

                <tbody>
                    <?php $__currentLoopData = $roles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $role): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td>
                            <a href="<?php echo url('/acces/roles/'.$role->id); ?>" ><?php echo $role->name; ?></a>
                        </td>
                        <td style=''><?php echo $role->NomUsers; ?></td>
                         
                        <td nowrap>
                            <?php if(($user->hasRole("ADMINISTRATEUR") || $user->can("ROL_SUP"))&&($role->NomUsers=="")&&($role->NbPermissions==0)): ?>
                                <?php echo Form::open(['url' => url('roles/' . $role->id), 'method' => 'DELETE']); ?>

                            <?php endif; ?>

                                <?php if($user->hasRole("ADMINISTRATEUR")|| $user->can("ROL_MAJ")): ?>
                                <a href="./roles/<?php echo $role->id; ?>/edit" class="btn btn-info pull-left" style="margin-right: 3px;">
                                    Modifier
                                </a>
                                <?php endif; ?>

                            <?php if(($user->hasRole("ADMINISTRATEUR")|| $user->can("ROL_SUP"))&&($role->NomUsers=="")&&($role->NbPermissions==0)): ?>
                                <?php echo e(csrf_field()); ?>

                                <button class="btn btn-danger">Supprimer</button>
                            <?php echo Form::close(); ?>

                            <?php endif; ?>

                        </td>
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
    </div>
 
 <?php if($user->can("ROL_AJO")|| $user->hasrole("ADMINISTRATEUR")): ?>
     <div>
        <h4><a href="./roles/create" class="btn btn-success">Ajouter un Rôle</a></h4>
    </div> 
<?php endif; ?>


    
 
</div>

</body></html>



<script>
$(document).ready(function() {
   $.fn.dataTable.moment('D/M/YYYY');
} );
</script>
 <?php echo $__env->make('forms.fdatatables_script_2', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\SYSINFO\cpswf\sipre\resources\views/acces/roles/index.blade.php ENDPATH**/ ?>