<?php $__env->startSection('content'); ?>
<?php
//fetch users with pagination
if (!empty($_GET['search'])) {
   $neenoe = request()->query('search');
   //where('title','like','%'.$search.'%')
   $users = DB::table('users')->where('status', 'inactive')->where('name','like','%'.$neenoe.'%')->orWhere('email','like','%'.$neenoe.'%')->orWhere('phone','like','%'.$neenoe.'%')->paginate(10);
}else {
    $users = DB::table('users')->where('status', 'inactive')->paginate(10);
}


?>

    <div class="col-lg-7">
        <div class="page-header-title">
            <div class="d-inline">
                <div class="card-header">
                    <h5>List of Inactive Referred Users</h5>
                </div>
            </div>
        </div>
    </div>

    <div class="col-lg-5">
        <div class="page-header-breadcrumb">
            <div class="col-sm-12">
                <form action="" method="GET">
                    <?php echo csrf_field(); ?>
                    <div class="input-group input-group-success">
                        <input type="text" name="search" class="form-control" placeholder="Enter referer username"
                            value="">
                        <button type="submit" class="input-group-addon">
                            <i class="feather icon-search f-15"></i>
                        </button>
                    </div>
                </form>

            </div>
        </div>
    </div>

    <div class="col-xl-12 col-md-12">
        <!-- DOM/Jquery table start -->
        <div class="card">
            <div class="card-block">
                <div class="table-responsive dt-responsive">
                    <table class="table table-hover table-borderless">
                        <thead>
                            <tr>
                                <th>Join Date</th>
                                <th>User Active</th>
                                <th>Username</th>
                                <th>Phone</th>
                                <th>Referrered by</th>
                                <th>Referer Phone</th>
                                <th>Commision Earned</th>
                            </tr>
                        </thead>
                        <tbody>

                         <?php if($users->count() > 0): ?>
                            <?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td><?php echo e(\Carbon\Carbon::parse($user->created_at)->diffForHumans()); ?>

                                </td>
                                <td>
                                    <label class="label label-warning"><?php echo e($user->status); ?></label>
                                </td>
                                <td><?php echo e($user->username); ?></td>
                                <td><?php echo e($user->phone); ?></td>
                                <td><?php echo e($user->upline); ?></td>
                                <td>
                                    <?php
                                        $up = DB::table('users')->where('username', $user->upline)->first();
                                    ?>
                                    <?php echo e($up->phone ?? 'empty'); ?>

                                </td>
                                <td>
                                    <label><?php echo e($user->wallet); ?></label>
                                </td>
                            </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                        <?php else: ?>

                        <tr>
                            <td colspan="full">
                                <p>No Data found</p>
                            </td>
                        </tr>

                        <?php endif; ?>

                        </tbody>
                    </table>
                </div>
                <div class="card-footer py-4">
                    <div class="row">
                        <?php echo $users->withQueryString()->links('pagination::bootstrap-5'); ?>

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

<?php echo $__env->make('layouts.main', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/deno/Desktop/adminPanel/resources/views/affiliates/dormant.blade.php ENDPATH**/ ?>