<?php if (isset($component)) { $__componentOriginal8e2ce59650f81721f93fef32250174d77c3531da = $component; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\AppLayout::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
    <div class="col-md-12">
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb">
              <li class="breadcrumb-item"><a href="/">Dasboard</a></li>
              <li class="breadcrumb-item active" aria-current="page">Usuarios</li>
            </ol>
          </nav>
    </div>
    <div class="col-md-12 text-end mb-4">
        <a class="btn btn-success" href="<?php echo e(route('users.create')); ?>"> <i class="fas fa-user-plus"></i> </a>
    </div>
    <div class="col-md-12">

        <div class="card">
            <div class="card-body">
                <table class="table" id="datatable-responsive">
                    <thead>
                        <tr>
                            <th width="40" scope="col">#</th>
                            <th scope="col">Nombre</th>
                            <th scope="col">Roles</th>
                            <th scope="col">Correo</th>
                            <th width="40" class="text-center" scope="col">Deshabilitado</th>
                            <th width="40" class="text-center" scope="col"><i class="fas fa-edit"></i></th>
                            <th width="40" class="text-center" scope="col"><i class="fas fa-user-slash"></i></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr class="  <?php if($item->disabled): ?> table-danger <?php endif; ?>">
                                <th scope="row"><?php echo e($key + 1); ?></th>
                                <td><?php echo e($item->name); ?> </td>
                                <td>
                                    <?php if(count($item->getRoleNames()) > 0): ?>
                                        <?php $__currentLoopData = $item->getRoleNames(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $r): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php echo e($r); ?> <br>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    <?php else: ?>
                                        <span class="badge bg-danger">Sin roles</span>
                                    <?php endif; ?>

                                </td>
                                <td><?php echo e($item->email); ?></td>
                                <td class="text-center">
                                    <?php if($item->disabled): ?>
                                        <h4> <span class="badge bg-danger"><i class="fas fa-frown"></i></span></h4>
                                    <?php else: ?>
                                        <h4> <span class="badge bg-success"><i class="fas fa-smile"></i></span></h4>
                                    <?php endif; ?>
                                </td>
                                <td> <a href="<?php echo e(route('users.edit', $item->id)); ?>" class="btn btn-warning"><i
                                            class="fas fa-edit"></i></a> </td>
                                <td>
                                    <?php
                                        $title = '¿Desea habilitar al usuario?';
                                        if (!$item->disabled) {
                                            $title = '¿Desea deshabilitar al usuario?';
                                        }
                                    ?>



                                    <form id="form<?php echo e($item->id); ?>" action="<?php echo e(route('users.disableUser', $item->id)); ?>"
                                        method="get">
                                        <button class="btn btn-danger" onclick="confirm('form<?php echo e($item->id); ?>', '<?php echo e($title); ?>')"
                                            type="button"><i class="fas fa-trash"></i></button>
                                    </form>


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


                    </tbody>
                </table>
            </div>
        </div>

    </div>

 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal8e2ce59650f81721f93fef32250174d77c3531da)): ?>
<?php $component = $__componentOriginal8e2ce59650f81721f93fef32250174d77c3531da; ?>
<?php unset($__componentOriginal8e2ce59650f81721f93fef32250174d77c3531da); ?>
<?php endif; ?>
<?php /**PATH C:\laragon\www\sistema-contable-laravel\resources\views/users/index.blade.php ENDPATH**/ ?>