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

        <div class="container-fluid">
          <div class="animated fadeIn">
            <div class="row">
              <div class="col-sm-12 col-md-12 col-lg-12 col-xl-12">
                <div class="card">
                    <div class="card-header">
                      <i class="fa fa-align-justify"></i><?php echo e(__('Users')); ?></div>
                    <div class="card-body">
                    <?php if(Session::has('message')): ?>
                    <div class="alert alert-success" role="alert"><?php echo e(Session::get('message')); ?></div>
                    <?php endif; ?>
                    <div class="row">
                        <a class="btn btn-lg btn-primary ml-3" href="<?php echo e(route('users.create')); ?>">Add New User</a>
                    </div>
                    <br>
                        <table class="table table-responsive-sm table-striped datatable">
                        <thead>
                          <tr>
                            <th>#</th>
                            <th>Name</th>
                            <th>E-mail</th>
                            <th>Roles</th>
                            <th></th>
                            <th></th>
                            <th></th>
                          </tr>
                        </thead>
                        <tbody>
                          <?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                              <td class="text-center"><?php echo e($loop->iteration); ?></td>
                              <td><?php echo e($user->fname.' '.$user->lname); ?></td>
                              <td><?php echo e($user->email); ?></td>
                              <td><?php echo e($user->menuroles); ?></td>
                              <td>
                                <a href="<?php echo e(url('/users/' . $user->id)); ?>" class="btn btn-block btn-primary">View</a>
                              </td>
                              <td>
                                <a href="<?php echo e(url('/users/' . $user->id . '/edit')); ?>" class="btn btn-block btn-primary">Edit</a>
                              </td>
                              <td>
                                <?php if( $you->id !== $user->id ): ?>
                                <form action="<?php echo e(route('users.destroy', $user->id )); ?>" method="POST">
                                    <?php echo method_field('DELETE'); ?>
                                    <?php echo csrf_field(); ?>
                                    <button class="btn btn-block btn-danger delete-bt">Delete</button>
                                </form>
                                <?php endif; ?>
                              </td>
                            </tr>
                          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                      </table>
                    </div>
                </div>
              </div>
            </div>
          </div>
        </div>

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


<?php $__env->startSection('javascript'); ?>
        <script>
            $(document).ready( function () {
                $('.datatable').DataTable();
            } );
        </script>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('dashboard.base', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\pec_portal\resources\views/dashboard/admin/usersList.blade.php ENDPATH**/ ?>