<?php $__env->startSection('title','List of Users | '); ?>
<?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">All Users</h1>
            </div><!-- /.col -->
            <div class="col-sm-6">
                <ol class="breadcrumb float-sm-right">
                    <li class="breadcrumb-item"><a href="#">Home</a></li>
                    <li class="breadcrumb-item active">All Users</li>
                </ol>
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.container-fluid -->
</div>
<!-- /.content-header -->
<!-- Main content -->
<section class="content">
    <div class="container-fluid">
        <div class="card">
            <div class="card-header">
                <h3 class="card-title">List of all users</h3>
            </div>
            <!-- /.card-header -->
            <div class="card-body">
            <?php if(session('success')): ?>
                    <div class="alert alert-success alert-dismissible fade show" role="alert">
                        <strong><?php echo e(session('success')); ?></strong>
                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                <?php endif; ?>
                <?php if(session('error')): ?>
                    <div class="alert alert-danger alert-dismissible fade show" role="alert">
                        <strong><?php echo e(session('error')); ?></strong>
                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                <?php endif; ?>
                <?php if(session('warning')): ?>
                    <div class="alert alert-warning alert-dismissible fade show" role="alert">
                        <strong><?php echo e(session('warning')); ?></strong>
                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                <?php endif; ?>
            <?php if(Auth::user()->user_role == 1 || Auth::user()->user_role == 2 || Auth::user()->user_role == 3): ?>
                <table id="EmployeeList" class="table table-bordered table-striped">
                    <thead>
                        <tr>
                            <th>Sr No.</th>
                            <th>Full Name</th>
                            <th>Email</th>
                            <th>Mobile</th>
                            <th>User Role</th>
                            <th>District</th>
                            <th>Emp Status</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                    <?php if($users->count() > 0): ?>
                            <?php
                                $count = 1;
                            ?>
                            <?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr class="<?php echo e(($user->emp_status == 0) ? 'bg-danger' :''); ?>">
                                    <td><?php echo e($count); ?></td>
                                    <td><?php echo e($user->full_name); ?></td>
                                    <td><?php echo e($user->email); ?></td>
                                    <td><?php echo e($user->mobile_number); ?></td>
                                    <td>
                                        <?php if($user->user_role == 1): ?>
                                            <?php echo e(__('Super Admin')); ?>

                                        <?php elseif($user->user_role == 2): ?>
                                            <?php echo e(__('Admin/HR')); ?>

                                        <?php elseif($user->user_role == 3): ?>
                                            <?php echo e(__('Team Lead')); ?>

                                        <?php elseif($user->user_role == 4): ?>
                                            <?php echo e(__('Employee')); ?>

                                        <?php endif; ?>
                                    </td>
                                    <td>
                                        <?php echo e($user->district_name); ?>

                                    </td>
                                    <td>
                                        <?php if($user->emp_status == 1): ?>
                                            <?php echo e(__('Active')); ?>

                                        <?php elseif($user->emp_status == 0): ?>
                                            <?php echo e(__('Inactive')); ?>

                                        <?php endif; ?>
                                    </td>
                                    <td>
                                        <a href="<?php echo e(route('edit.employee',$user->id)); ?>" class="p-1 mr-2 "><i class="fa fa-edit  text-warning"></i></a>
                                        <?php if($user->emp_status == 1): ?>
                                        <a href="#" class="p-1 deactivate-employee mr-1" data-id="<?php echo e(route('deactivate.employee', $user->id)); ?>"><i class="fa fa-trash  text-danger"></i></a>
                                        <?php endif; ?>
                                        <a href="#" data-id="<?php echo e($user->id); ?>" class="btn btn-sm btn-success reset-user-password">Reset Password</a>
                                    </td>
                                </tr>
                                <?php
                                $count++; 
                                ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <?php endif; ?>
                    </tbody>
                </table>
            <?php else: ?> 
                <p class="text-info">Permission denied: You don't have access permission to access this page</p>
            <?php endif; ?>
            </div>
            <!-- /.card-body -->
        </div>
        <!-- /.card -->
    </div>
    <!--/. container-fluid -->
</section>
<!-- /.content -->
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/data/public_html/legal/resources/views/pages/employees/listAllEmployee.blade.php ENDPATH**/ ?>