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

    <div class="card">
        <div class="card-body">
            <div class="table-responsive" style="min-height:500px;">
                <table id="dataTable" class="table" >
                    <thead class="bg-gray-50">
                        <tr>
                            <th>ID</th>
                            <th>User's name</th>
                            <th>Email</th>
                            <th>Company</th>
                            <th>Role</th>
                            <th>Active State</th>
                            <th>Accounting</th>
                            <th>Last Edit By</th>
                            <th> </th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $r): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            
                            <?php if($r->email =="support@yetfix.com" || $r->email =="soiket@outlook.com"): ?>

                            <?php else: ?>
                            <tr>
                                <td><?php echo e($r->id); ?></td>
                                <td><?php echo e($r->name); ?></td>

                                <td><?php echo e($r->email); ?></td>

                                <td><?php echo e($r->userdetails->company ?? ''); ?></td>

                                <td>
                                    <?php $__currentLoopData = $r->role; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $role): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <span class="btn btn-info btn-xs"><?php echo e($role->name); ?></span>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </td>

                                <td class="text-center">
                                    <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.Custom.Status','data' => ['status' => ''.e($r->userdetails->user_status ?? '').'']]); ?>
<?php $component->withName('Custom.Status'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes(['status' => ''.e($r->userdetails->user_status ?? '').'']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
                                </td>

                                <td class="text-center">
                                    <?php echo e($r->user_accounting_status); ?>

                                </td>

                                <td>
                                    <?php if(isset($r->userdetails->last_edit_by) &&  $r->userdetails->last_edit_by!= 1): ?>

                                            <?php echo e($all_user[$r->userdetails->last_edit_by] ?? ''); ?>

                                    <?php endif; ?>

                                    

                                </td>

                                <td class="px-6 text-left text-sm font-medium" style="max-width:300px">

                                    <div class="dropdown">
                                        <button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenuButton"
                                            data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                            Action
                                        </button>
                                        <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
                                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('user_edit')): ?>
                                            <a class="dropdown-item" href="<?php echo e(route('user.edit', $r->id)); ?>">Edit</a>
                                            <?php endif; ?>
                                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin-password-reset')): ?>
                                                <a class="dropdown-item" href="<?php echo e(route('passwordReset', $r->email)); ?>">Reset
                                                    Password</a>
                                            <?php endif; ?>
                                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('assign-user-pop')): ?>
                                                <a class="dropdown-item" href="<?php echo e(route('assignPop', $r->id)); ?>">Assign
                                                    POP</a>
                                            <?php endif; ?>
                                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('assign-role')): ?>
                                                <a class="dropdown-item" href="<?php echo e(route('userRole', $r->email)); ?>">Assign
                                                    Role</a>
                                            <?php endif; ?>
                                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('assign-user-reseller')): ?>
                                                <a class="dropdown-item" href="<?php echo e(route('assignReseller', $r->id)); ?>">Assign
                                                    Reseller</a>
                                            <?php endif; ?>
                                            <?php if(!auth()->check() || ! auth()->user()->hasRole('Reseller Admin|Reseller|Sub Reseller')): ?>
                                                <a class="dropdown-item"
                                                    href="<?php echo e(route('view_user_account_history', $r->id)); ?>">Account
                                                    History</a>
                                            <?php endif; ?>
                                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('user-balance-recharge')): ?>
                                            <?php if($r->user_balance_check == 'yes'): ?>

                                                <a class="dropdown-item" href="<?php echo e(route('user-recharge', $r->id)); ?>">Balance Recharge</a>

                                            <?php endif; ?>

                                            <?php endif; ?>
                                            <a class="dropdown-item" href="<?php echo e(route('userLogInfo',$r->id)); ?>">User
                                                LogInfo</a>

                                            <a href="<?php echo e(route('editLog-history', ['id' => $r->id, 'type' => 'AdminUser'])); ?>"
                                                class="dropdown-item">Update History</a>
                                            <a href="<?php echo e(route('editLog-history', ['id' => $r->id, 'type' => 'UserRole'])); ?>"
                                                class="dropdown-item">Role History</a>
                                            <a href="<?php echo e(route('userCustomerSummary', $r->id)); ?>"
                                                class="dropdown-item">Customer Summary</a>

                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <?php endif; ?>

                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                </table>
            </div>
        </div>

    </div>
    </div>




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

<?php echo $__env->make('layout.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/netlink/radius-circle/resources/views/user/index.blade.php ENDPATH**/ ?>