<div>
    <?php $__env->startComponent('common.breadcrumb', ['addBtn' => false, 'permission_create' => 'Company_register_users_index', 'breadcrumb_show' => $breadcrumb_show]); ?>
        <?php $__env->slot('breadcrumb_title'); ?>
            <h3><?php echo e($componentName); ?> | <?php echo e($pageTitle); ?></h3>
        <?php $__env->endSlot(); ?>
        <li class="breadcrumb-item">Empresa</li>
        <li class="breadcrumb-item active">Contratos</li>

    <?php if (isset($__componentOriginal96f5b8f7cb2e3bbc8f06cfd8ecfbc87428561469)): ?>
<?php $component = $__componentOriginal96f5b8f7cb2e3bbc8f06cfd8ecfbc87428561469; ?>
<?php unset($__componentOriginal96f5b8f7cb2e3bbc8f06cfd8ecfbc87428561469); ?>
<?php endif; ?>
<?php echo $__env->renderComponent(); ?>

    <?php echo $__env->make('common.searchbox', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <div class="container-fluid">
        <div class="row layout-top-spacing">
            <div class="col-sm-12">
                <div class="card">
                    <div class="card-body">
                        <div class="card-header">
                            <h4><?php echo e($company_name); ?> | Plan: <b><?php echo e($company_plan_name); ?></b></h4>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-12">
                <div class="card">
                    <div class="table-responsive">
                        <table class="table">
                            <thead class="bg-primary">
                                <tr>
                                    <th scope="col">NOMBRE <?php echo $__env->make('common.orderby', ['column' => 'name'], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?></th>
                                    <th scope="col" class="text-center">APELLIDO <?php echo $__env->make('common.orderby', ['column' => 'last_name'], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?></th>
                                    <th scope="col" class="text-center">DOCUMENTO <?php echo $__env->make('common.orderby', ['column' => 'document'], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?></th>
                                    <th scope="col" class="text-center">ROL</th>
                                    <th scope="col" class="text-center">ESTADO</th>
                                    <th scope="col" class="text-center">FOTO</th>
                                    <th scope="col" class="text-center">ACCIONES</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td><?php echo e($item->first_name); ?></td>
                                        <td class="text-left"><?php echo e($item->last_name); ?></td>
                                        <td class="text-left"><?php echo e($item->document); ?></td>
                                        <td>
                                            <?php if(!empty($item->getRoleNames())): ?>
                                            <?php $__currentLoopData = $item->getRoleNames(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <strong class="text-secondary"><?php echo e($val); ?></strong>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        <?php endif; ?>
                                        </td>
                                        <td class="text-center">
                                            <?php if($item->status == "ACTIVO"): ?>
                                                <span class="badge badge-success">Activo</span>
                                            <?php else: ?>
                                                <span class="badge badge-danger">Bloqueado</span>
                                            <?php endif; ?>
                                        </td>
                                        <td class="text-center">
                                            <?php if($item->imagen != null): ?>
                                                <img src="<?php echo e(asset('storage/users/' . $item->imagen)); ?>"
                                                    alt="imagen" class="card-img-top img-fluid img-h-50">
                                            <?php endif; ?>
                                        </td>
                                        <td class="text-center">
                                            <?php if(!empty($item->getRoleNames())): ?>
                                                <?php $__currentLoopData = $item->getRoleNames(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <?php if($val == 'Empleado'): ?>
                                                        <?php if($item->status == "ACTIVO"): ?>
                                                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Company_employee_profile_index')): ?>
                                                                <a href="<?php echo e(route('cargo-empleado', $item->id)); ?>"
                                                                    class="btn btn-outline-primary btn-sm" title="Perfil Empleado / Cargo">
                                                                    <i class="fas fa-briefcase"></i>
                                                                </a>
                                                            <?php endif; ?>
                                                        <?php endif; ?>
                                                    <?php endif; ?>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            <?php endif; ?>
                                            <?php if($item->status == "ACTIVO"): ?>
                                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Company_contracts_users_create')): ?>
                                                <a href="<?php echo e(route('contratos-empleados.create', $item->id)); ?>"
                                                    class="btn btn-outline-secondary" title="Contrato Empleado">
                                                    <i class="fa fa-file-contract"></i>
                                                </a>
                                            <?php endif; ?>
                                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Company_contracts_users_history')): ?>
                                                <a href="<?php echo e(route('contratos-empleados.historial', $item->id)); ?>"
                                                    class="btn btn-outline-secondary" title="Historial Empleado">
                                                    <i class="fa fa-history"></i>
                                                </a>
                                            <?php endif; ?>
                                            <?php endif; ?>

                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                        <?php echo e($users->links()); ?>

                    </div>

                </div>
            </div>
        </div>
        <?php echo $__env->make('livewire.company.contracts.form-profile', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    </div>
</div>
<?php echo $__env->make('common.scriptsCompStandar', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<script>
    document.addEventListener('DOMContentLoaded', function() {
        $('#theModalProfile').on('show.bs.modal', function() {
            $('.modal-body:first *:input[type!=hidden]:first').trigger('focus');
        });
        window.livewire.on('hide-modal-profile', msg => {
            $('#theModalProfile').modal('hide')
        });
        window.livewire.on('show-modal-profile', msg => {
            $('#theModalProfile').modal('show')
        });

    });

</script>
<?php /**PATH /var/www/html/resources/views/livewire/company/contracts/component.blade.php ENDPATH**/ ?>