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


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


?>

    <div class="col-lg-7">
        <div class="page-header-title">
            <div class="d-inline">
                <div class="card-header">
                    <h5>Rejected withdrawals</h5>
                </div>
            </div>
        </div>
    </div>
    <div class="col-lg-5">
        <div class="page-header-breadcrumb">
            <div class="col-sm-12">
                <form
                    method="GET">
                    <?php echo csrf_field(); ?>
                    <div class="input-group input-group-success">
                        <input type="text" name="search" class="form-control"
                            placeholder="Enter Amount/Phone">
                        <button class="input-group-addon">
                            <i data-feather="search" class="menuicons 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-header">
            <h5>Rejected withdrawal History </h5>
        </div>
        <div class="card-block">
            <div class="table-responsive dt-responsive">
                <table id="dom-jqry"
                    class="table table-striped table-bordered nowrap">
                    <thead>
                        <tr>
                            <th>Date</th>
                            <th>Code</th>
                            <th>Username</th>
                            <th>Phone</th>
                            <th>Charge</th>
                            <th>Amount</th>
                            <th>Status</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php if($cashouts->count() > 0): ?>

                        <?php $__currentLoopData = $cashouts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $c): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            

                        <tr>
                            <td><?php echo e(\Carbon\Carbon::parse($c->created_at)->diffForHumans()); ?>

                            </td>
                            <td><?php echo e($c->code); ?></td>
                            <td style="text-transform: lowercase">
                                <?php
                                    
                                    $thisguy = DB::table('users')->where('phone', $c->phone)->first();
                                    $iduser = $thisguy->id ?? 1;
                                ?>
                                <a href="<?php echo e(route('viewuser', $iduser)); ?>">
                                    <u>
                                        <?php echo e($thisguy->username ?? "nouser"); ?>

                                    </u>
                                </a>                                              
                            </td>
                            <td>
                                <?php echo e($c->phone); ?></td>
                            <td>KSH <?php echo e($c->Charge); ?></td>
                            <td>KSH <?php echo e($c->amount); ?></td>
                            <td>
                                <button class="btn btn-success  btn-mini feather icon-check-square f-12"  >
                                <?php echo e($c->status); ?>

                                </button>
                             
                            </td>
                        </tr>


                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php else: ?>
                        <tr>
                            <td class="text-center" colspan="100%">
                                No search results found
                            </td>
                        </tr>

                        <?php endif; ?>
                    </tbody>
                </table>
            </div>
            <div class="card-footer py-4">
                <nav aria-label="...">

                </nav>
            </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/withdrawals/rejected.blade.php ENDPATH**/ ?>