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

    <div class="card">
        <div class="card-body">
            <form action="" id="search" class="resellerRechargeLog">
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>Select Manager</label>
                            <select name="reseller" id="reseller" class="select2 form-control">
                                <option value="">Select One</option>
                                <?php $__currentLoopData = $reseller; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $r): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($r->id); ?>"><?php echo e($r->name); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <label class='block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2'>Select POP
                        </label>
                        <select name="pop" id="pop" class="form-control select2">
                            <option value="">Select One</option>
                        </select>
                    </div>
                    <div class="col-md-12">
                        <div class="form-group float-right mt-2">
                            <button @click="search" class="btn btn-primary" type="submit" id="searchBtn"><i
                                    class="fa fa-search"></i> Search</button>
                            <button class="btn btn-info" type="reset" id="reset">Reset</button>
                        </div>
                    </div>
                </div>

            </form>


        </div>
    </div>



    <div class="card">
        <div class="card-body" id="leftClientResult">

            <div class="mb-4">
                <span class="bg-success p-2" style="border-radius: 5px;">
                    <?php
                        $total = $deactiveCount + $deleteCount;
                    ?>
                    Total Client: <?php echo e($total); ?>

                </span>
            </div>


            <table id="dataTable" class="table table-bordered">

                <thead>
                    <tr>
                        <th scope="col" class="no-wrap">
                            ID
                        </th>
                        <th scope="col" class="no-wrap">
                            User name
                        </th>
                        <th scope="col" class="no-wrap">
                            Status
                        </th>
                        <th scope="col" class="no-wrap">
                            Expire
                        </th>
                        <th scope="col" class="no-wrap">
                            Bill Info
                        </th>
                        <th scope="col" class="no-wrap">
                            Package
                        </th>
                        <th scope="col" class="no-wrap">
                            POP
                        </th>
                        <th>
                            Name
                        </th>
                        <th>
                            Contact
                        </th>
                        <th scope="col" style="width:350px">
                            User Info
                        </th>
                        <th>
                            Remarks
                        </th>
                        <th scope="col" class="noprin">
                        </th>
                    </tr>
                </thead>
                <tbody>



                    <?php $__currentLoopData = $deactive; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $r): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr <?php if($r->clients_status == 'deactive'): ?> class="deactive" <?php endif; ?>>

                            <td class="text-center">
                                <a class="btn btn-info btn-block btn-xs text-nowrap"
                                    href="<?php echo e(route('getPaymentHistory', $r->id)); ?>">CID: <?php echo e($r->id); ?></a>
                                <?php if(checkAPI() == false): ?>
                                    <a href="<?php echo e(route('getCustomerLogHistory', $r->userid)); ?>"
                                        class="noprint btn btn-primary btn-xs btn-block">Log</a>
                                <?php endif; ?>

                                <a href="<?php echo e(route('clients.show', $r->id)); ?>"
                                    class="noprint btn btn-primary btn-xs btn-block">Details</a>

                            </td>
                            <td class="no-wrap">
                                <?php echo e($r->userid); ?>

                                <br>
                                


                            </td>

                            <td
                                class="
                                <?php if($r->deleted_at != null || $r->clients_status == 'expired'): ?> deactive bg-danger
                                <?php elseif($r->clients_status == 'deactive'): ?>
                                    bg-secondary
                                    <?php elseif($r->clients_status == 'disable'): ?>
                                    bg-warning
                                <?php elseif($r->clients_status == 'active'): ?>
                                bg-success <?php endif; ?>
                                ">
                                <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.Custom.Status','data' => ['status' => ''.e($r->clients_status).'']]); ?>
<?php $component->withName('Custom.Status'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes(['status' => ''.e($r->clients_status).'']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
                            </td>
                            <td class=" <?php if($r->deleted_at != null || $r->clients_status == 'expired'): ?> deactive bg-danger
                                            <?php elseif($r->clients_status == 'deactive'): ?> bg-secondary
                                            <?php elseif($r->clients_status == 'disable'): ?> bg-warning
                                            <?php elseif($r->clients_status == 'active'): ?>  bg-success <?php endif; ?> "
                                style="min-width:140px;text-align:left">
                                BD: <?php echo e(date('d-M-Y', strtotime($r->expire_date))); ?><br>
                                PD:
                                <?php echo e(\Carbon\Carbon::parse($r->expire_date)->addDay($r->payment_dadeline)->format('d-M-Y')); ?>

                            </td>


                            <td style="min-width:130px">
                                <p style="font-size:14px;">
                                    B Cycle: <?php echo e($r->billing_cycle); ?> <br>
                                    <?php if(isset($r->pop->bill_generate) && $r->pop->bill_generate == 'yes'): ?>
                                        B Amount: <?php if(auth()->check() && auth()->user()->hasRole('Sub Reseller')): ?>
                                            <?php if($r->pop->subreseller == 'yes'): ?>
                                                <?php echo e($r->subpack->rate ?? 0); ?>

                                            <?php else: ?>
                                                <?php echo e($r->packages->package_rate); ?>

                                            <?php endif; ?>
                                        <?php else: ?>
                                            <?php echo e($r->packages->package_rate); ?>

                                        <?php endif; ?> <br>
                                        OTC : <?php echo e($r->clientsinfo->otc ?? 0); ?> <br>
                                        <?php if(isset($r->clientsinfo->otc_due)): ?>
                                            <?php if($r->clientsinfo->otc_due > 0): ?>
                                                <span class="bg-danger pl-1 pr-1"> OTC Due:
                                                    <?php echo e($r->clientsinfo->otc_due ?? 0); ?></span>
                                            <?php endif; ?>
                                        <?php endif; ?>
                                    <?php endif; ?>
                                </p>

                                <?php if($r->pop->bill_generate == 'yes'): ?>
                                    <p class="text-danger">Due: <?php echo e($r->customerAccount->dueAmount ?? 0); ?></p>
                                <?php endif; ?>
                            </td>


                            <td>

                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('show-sub-package')): ?>
                                    <span class="d-block mb-1 badge badge-info"><?php echo e($r->subpack->name ?? ''); ?></span>
                                <?php endif; ?>

                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('show-mother-package')): ?>
                                    <span class="d-block badge badge-info">
                                        <?php echo e($r->packages->package_name ?? ''); ?></span>
                                <?php endif; ?>




                            </td>

                            <td class="no-wrap">
                                <?php echo e($r->pop->popname ?? ''); ?>

                            </td>

                            <td>

                                <?php echo e($r->clientsinfo->clients_name ?? ''); ?>

                            </td>
                            <td>
                                <?php echo e($r->clientsinfo->contact_no ?? ''); ?>

                            </td>



                            <td style="width:350px;">
                                <p style="font-size:14px;">
                                    <?php if($r->clientsinfo->flat_no): ?>
                                        Flat No: <?php echo e($r->clientsinfo->flat_no ?? ''); ?>,
                                    <?php endif; ?>
                                    <?php if($r->clientsinfo->building_name): ?>
                                        Building Name: <?php echo e($r->clientsinfo->building_name ?? ''); ?>,<br>
                                    <?php endif; ?>
                                    <?php if($r->clientsinfo->road_no): ?>
                                        Road No: <?php echo e($r->clientsinfo->road_no ?? ''); ?>,<br>
                                    <?php endif; ?>
                                    <?php if($r->clientsinfo->block_sector): ?>
                                        Block/Sector: <?php echo e($r->clientsinfo->block_sector ?? ''); ?>,
                                    <?php endif; ?>
                                    <?php if($r->clientsinfo->area): ?>
                                        Area : <?php echo e($r->clientsinfo->area ?? ''); ?>, <br>
                                    <?php endif; ?>
                                    <?php if($r->clientsinfo->box): ?>
                                        Box : <?php echo e($r->clientsinfo->box ?? ''); ?>,<br>
                                    <?php endif; ?>
                                    <?php if($r->clientsinfo->client_latitude): ?>
                                        Latitude : <?php echo e($r->clientsinfo->client_latitude ?? ''); ?>,<br>
                                    <?php endif; ?>
                                    <?php if($r->clientsinfo->client_longitude): ?>
                                        Longitude : <?php echo e($r->clientsinfo->client_longitude ?? ''); ?>

                                    <?php endif; ?>
                                </p>
                            </td>

                            <td>
                                <?php echo e($r->clientsinfo->remarks ?? ''); ?>

                            </td>


                            <td class="text-center noprint" style="width:160px;">

                                <?php if($r->deleted_at != null): ?>
                                    <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">


                                            <a href="<?php echo e(route('clients.show', $r->id)); ?>" class="dropdown-item">Details</a>


                                            <div class="mb-1"></div>

                                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('can-open')): ?>
                                                <a href="<?php echo e(route('open', $r->id)); ?>"
                                                    onclick="return confirm('Are you sure you want to Open the ID?');"
                                                    class="confirmDisable dropdown-item bg-danger">Restore Account</a>
                                            <?php endif; ?>

                                        </div>
                                    </div>
                                <?php else: ?>
                                    <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('add-otc')): ?>
                                                <?php if(isset($r->clientsinfo->otc_due)): ?>
                                                    <?php if($r->clientsinfo->otc < 1): ?>
                                                        <button type="button" class="dropdown-item addOtc"
                                                            data-toggle="modal" data-id="<?php echo e($r->id); ?>"
                                                            data-target="#addOtc">
                                                            Add Otc
                                                        </button>
                                                    <?php endif; ?>
                                                <?php endif; ?>
                                            <?php endif; ?>


                                            <a href="<?php echo e(route('clients.show', $r->id)); ?>"
                                                class="dropdown-item">Details</a>

                                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('mac-customer_edit')): ?>
                                                <a href="<?php echo e(route('clients.edit', $r->id)); ?>" class="dropdown-item">Edit</a>
                                            <?php endif; ?>

                                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('changeBillCycle')): ?>
                                                <button type="button" class="dropdown-item clientBillCycleChange"
                                                    data-toggle="modal" data-id="<?php echo e($r->id); ?>"
                                                    data-curdate=<?php echo e($r->billing_cycle); ?> data-target="#billCycleChange">
                                                    Bill Cycle Change
                                                </button>
                                            <?php endif; ?>


                                            <div class="mb-1"></div>


                                            <?php if($r->client_approval == 'pending'): ?>
                                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('new-customer-approve')): ?>
                                                    <form method="POST" action="<?php echo e(route('clinetApprove', $r->id)); ?>">
                                                        <?php echo method_field('post'); ?>
                                                        <?php echo csrf_field(); ?>
                                                        <input type="hidden" name="user_approve"
                                                            value="<?php echo e($r->id); ?>">
                                                        <button
                                                            onclick="return confirm('Are you sure you want to Approved this user ?');"
                                                            type="submit" class="dropdown-item">Approve</button>
                                                    </form>
                                                <?php endif; ?>
                                            <?php endif; ?>

                                            <?php if($r->clients_status == 'disable'): ?>
                                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('id-enable')): ?>
                                                    <a href="<?php echo e(route('idEnable', $r->id)); ?>"
                                                        onclick="return confirm('Are you sure you want to Enable the ID?');"
                                                        class="dropdown-item">Enable</a>
                                                <?php endif; ?>
                                            <?php endif; ?>

                                            <?php if($r->clients_status == 'active'): ?>
                                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('id-disable')): ?>
                                                    <a href="<?php echo e(route('idDisable', $r->id)); ?>"
                                                        onclick="return confirm('Are you sure you want to Disable the ID?');"
                                                        class="confirmDisable dropdown-item">Disable</a>
                                                <?php endif; ?>
                                            <?php endif; ?>

                                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('can-close')): ?>
                                                <a href="<?php echo e(route('close', $r->id)); ?>"
                                                    onclick="return confirm('Are you sure you want to Close the ID?');"
                                                    class="confirmDisable dropdown-item">Close</a>
                                            <?php endif; ?>

                                            
                                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('mac-customer_destroy')): ?>
                                                <form method="POST" action="<?php echo e(route('clients.destroy', $r->id)); ?>">
                                                    <?php echo method_field('DELETE'); ?>
                                                    <?php echo csrf_field(); ?>
                                                    <button
                                                        onclick="return confirm('Are you sure you want to Delete this user ?');"
                                                        type="submit" class="dropdown-item">Delete</button>
                                                </form>
                                            <?php endif; ?>





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

                            </td>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php $__currentLoopData = $delete; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $r): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr <?php if($r->clients_status == 'deactive'): ?> class="deactive" <?php endif; ?>>

                            <td class="text-center">
                                <a class="btn btn-info btn-block btn-xs text-nowrap"
                                    href="<?php echo e(route('getPaymentHistory', $r->id)); ?>">CID: <?php echo e($r->id); ?></a>
                                <?php if(checkAPI() == false): ?>
                                    <a href="<?php echo e(route('getCustomerLogHistory', $r->userid)); ?>"
                                        class="noprint btn btn-primary btn-xs btn-block">Log</a>
                                <?php endif; ?>

                                <a href="<?php echo e(route('clients.show', $r->id)); ?>"
                                    class="noprint btn btn-primary btn-xs btn-block">Details</a>

                            </td>
                            <td class="no-wrap">
                                <?php echo e($r->userid); ?>

                                <br>
                                


                            </td>

                            <td
                                class="
                                <?php if($r->deleted_at != null || $r->clients_status == 'expired'): ?> deactive bg-danger
                                <?php elseif($r->clients_status == 'deactive'): ?>
                                    bg-secondary
                                    <?php elseif($r->clients_status == 'disable'): ?>
                                    bg-warning
                                <?php elseif($r->clients_status == 'active'): ?>
                                bg-success <?php endif; ?>
                                ">
                                <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.Custom.Status','data' => ['status' => ''.e($r->clients_status).'']]); ?>
<?php $component->withName('Custom.Status'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes(['status' => ''.e($r->clients_status).'']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
                            </td>
                            <td class=" <?php if($r->deleted_at != null || $r->clients_status == 'expired'): ?> deactive bg-danger
                                            <?php elseif($r->clients_status == 'deactive'): ?> bg-secondary
                                            <?php elseif($r->clients_status == 'disable'): ?> bg-warning
                                            <?php elseif($r->clients_status == 'active'): ?>  bg-success <?php endif; ?> "
                                style="min-width:140px;text-align:left">
                                BD: <?php echo e(date('d-M-Y', strtotime($r->expire_date))); ?><br>
                                PD:
                                <?php echo e(\Carbon\Carbon::parse($r->expire_date)->addDay($r->payment_dadeline)->format('d-M-Y')); ?>

                            </td>


                            <td style="min-width:130px">
                                <p style="font-size:14px;">
                                    B Cycle: <?php echo e($r->billing_cycle); ?> <br>
                                    <?php if(isset($r->pop->bill_generate) && $r->pop->bill_generate == 'yes'): ?>
                                        B Amount: <?php if(auth()->check() && auth()->user()->hasRole('Sub Reseller')): ?>
                                            <?php if($r->pop->subreseller == 'yes'): ?>
                                                <?php echo e($r->subpack->rate ?? 0); ?>

                                            <?php else: ?>
                                                <?php echo e($r->packages->package_rate); ?>

                                            <?php endif; ?>
                                        <?php else: ?>
                                            <?php echo e($r->packages->package_rate); ?>

                                        <?php endif; ?> <br>
                                        OTC : <?php echo e($r->clientsinfo->otc ?? 0); ?> <br>
                                        <?php if(isset($r->clientsinfo->otc_due)): ?>
                                            <?php if($r->clientsinfo->otc_due > 0): ?>
                                                <span class="bg-danger pl-1 pr-1"> OTC Due:
                                                    <?php echo e($r->clientsinfo->otc_due ?? 0); ?></span>
                                            <?php endif; ?>
                                        <?php endif; ?>
                                    <?php endif; ?>
                                </p>

                                <?php if($r->pop->bill_generate == 'yes'): ?>
                                    <p class="text-danger">Due: <?php echo e($r->customerAccount->dueAmount ?? 0); ?></p>
                                <?php endif; ?>
                            </td>


                            <td>

                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('show-sub-package')): ?>
                                    <span class="d-block mb-1 badge badge-info"><?php echo e($r->subpack->name ?? ''); ?></span>
                                <?php endif; ?>

                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('show-mother-package')): ?>
                                    <span class="d-block badge badge-info">
                                        <?php echo e($r->packages->package_name ?? ''); ?></span>
                                <?php endif; ?>




                            </td>

                            <td class="no-wrap">
                                <?php echo e($r->pop->popname ?? ''); ?>

                            </td>

                            <td>

                                <?php echo e($r->clientsinfo->clients_name ?? ''); ?>

                            </td>
                            <td>
                                <?php echo e($r->clientsinfo->contact_no ?? ''); ?>

                            </td>



                            <td style="width:350px;">
                                <p style="font-size:14px;">
                                    <?php if($r->clientsinfo->flat_no): ?>
                                        Flat No: <?php echo e($r->clientsinfo->flat_no ?? ''); ?>,
                                    <?php endif; ?>
                                    <?php if($r->clientsinfo->building_name): ?>
                                        Building Name: <?php echo e($r->clientsinfo->building_name ?? ''); ?>,<br>
                                    <?php endif; ?>
                                    <?php if($r->clientsinfo->road_no): ?>
                                        Road No: <?php echo e($r->clientsinfo->road_no ?? ''); ?>,<br>
                                    <?php endif; ?>
                                    <?php if($r->clientsinfo->block_sector): ?>
                                        Block/Sector: <?php echo e($r->clientsinfo->block_sector ?? ''); ?>,
                                    <?php endif; ?>
                                    <?php if($r->clientsinfo->area): ?>
                                        Area : <?php echo e($r->clientsinfo->area ?? ''); ?>, <br>
                                    <?php endif; ?>
                                    <?php if($r->clientsinfo->box): ?>
                                        Box : <?php echo e($r->clientsinfo->box ?? ''); ?>,<br>
                                    <?php endif; ?>
                                    <?php if($r->clientsinfo->client_latitude): ?>
                                        Latitude : <?php echo e($r->clientsinfo->client_latitude ?? ''); ?>,<br>
                                    <?php endif; ?>
                                    <?php if($r->clientsinfo->client_longitude): ?>
                                        Longitude : <?php echo e($r->clientsinfo->client_longitude ?? ''); ?>

                                    <?php endif; ?>
                                </p>
                            </td>

                            <td>
                                <?php echo e($r->clientsinfo->remarks ?? ''); ?>

                            </td>

                            
                            <td class="text-center noprint" style="width:160px;">

                                <?php if($r->deleted_at != null): ?>
                                    <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">


                                            <a href="<?php echo e(route('clients.show', $r->id)); ?>"
                                                class="dropdown-item">Details</a>


                                            <div class="mb-1"></div>

                                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('can-open')): ?>
                                                <a href="<?php echo e(route('open', $r->id)); ?>"
                                                    onclick="return confirm('Are you sure you want to Open the ID?');"
                                                    class="confirmDisable dropdown-item bg-danger">Restore Account</a>
                                            <?php endif; ?>

                                        </div>
                                    </div>
                                <?php else: ?>
                                    <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('add-otc')): ?>
                                                <?php if(isset($r->clientsinfo->otc_due)): ?>
                                                    <?php if($r->clientsinfo->otc < 1): ?>
                                                        <button type="button" class="dropdown-item addOtc"
                                                            data-toggle="modal" data-id="<?php echo e($r->id); ?>"
                                                            data-target="#addOtc">
                                                            Add Otc
                                                        </button>
                                                    <?php endif; ?>
                                                <?php endif; ?>
                                            <?php endif; ?>


                                            <a href="<?php echo e(route('clients.show', $r->id)); ?>"
                                                class="dropdown-item">Details</a>

                                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('mac-customer_edit')): ?>
                                                <a href="<?php echo e(route('clients.edit', $r->id)); ?>" class="dropdown-item">Edit</a>
                                            <?php endif; ?>

                                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('changeBillCycle')): ?>
                                                <button type="button" class="dropdown-item clientBillCycleChange"
                                                    data-toggle="modal" data-id="<?php echo e($r->id); ?>"
                                                    data-curdate=<?php echo e($r->billing_cycle); ?> data-target="#billCycleChange">
                                                    Bill Cycle Change
                                                </button>
                                            <?php endif; ?>


                                            <div class="mb-1"></div>





                                            <?php if($r->client_approval == 'pending'): ?>
                                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('new-customer-approve')): ?>
                                                    <form method="POST" action="<?php echo e(route('clinetApprove', $r->id)); ?>">
                                                        <?php echo method_field('post'); ?>
                                                        <?php echo csrf_field(); ?>
                                                        <input type="hidden" name="user_approve"
                                                            value="<?php echo e($r->id); ?>">
                                                        <button
                                                            onclick="return confirm('Are you sure you want to Approved this user ?');"
                                                            type="submit" class="dropdown-item">Approve</button>
                                                    </form>
                                                <?php endif; ?>
                                            <?php endif; ?>

                                            <?php if($r->clients_status == 'disable'): ?>
                                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('id-enable')): ?>
                                                    <a href="<?php echo e(route('idEnable', $r->id)); ?>"
                                                        onclick="return confirm('Are you sure you want to Enable the ID?');"
                                                        class="dropdown-item">Enable</a>
                                                <?php endif; ?>
                                            <?php endif; ?>

                                            <?php if($r->clients_status == 'active'): ?>
                                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('id-disable')): ?>
                                                    <a href="<?php echo e(route('idDisable', $r->id)); ?>"
                                                        onclick="return confirm('Are you sure you want to Disable the ID?');"
                                                        class="confirmDisable dropdown-item">Disable</a>
                                                <?php endif; ?>
                                            <?php endif; ?>

                                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('can-close')): ?>
                                                <a href="<?php echo e(route('close', $r->id)); ?>"
                                                    onclick="return confirm('Are you sure you want to Close the ID?');"
                                                    class="confirmDisable dropdown-item">Close</a>
                                            <?php endif; ?>

                                            
                                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('mac-customer_destroy')): ?>
                                                <form method="POST" action="<?php echo e(route('clients.destroy', $r->id)); ?>">
                                                    <?php echo method_field('DELETE'); ?>
                                                    <?php echo csrf_field(); ?>
                                                    <button
                                                        onclick="return confirm('Are you sure you want to Delete this user ?');"
                                                        type="submit" class="dropdown-item">Delete</button>
                                                </form>
                                            <?php endif; ?>





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

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

                    

                </tbody>

            </table>

        </div>
    </div>

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



<?php $__env->startSection('ajax'); ?>
    <script type="text/javascript">
        $(function() {
            // $('#reset').click(function() {
            //     $('#deactiveResult').html('');
            //     $('#pop').html('<option value="all">Select One</option>');
            // });

            $('#searchBtn').on('click', function(e) {
                e.preventDefault();
                $('body').append('<div id="processing">processing.....</div>');
                $.ajax({
                    type: 'get',
                    url: '<?php echo e(route('leftClientSearch')); ?>',
                    data: $('#search').serialize(),
                    success: function(result) {
                        // console.log(result);
                        $('#leftClientResult').html(result);
                        $('#processing').remove();

                    }
                });
            });


            $('#reseller').on('change', function(e) {
                e.preventDefault();
                $('body').append('<div class="hidden" id="processing">processing.....</div>');

                $.ajax({
                    type: 'get',
                    url: '<?php echo e(route('getResellerPopList')); ?>',
                    data: {
                        id: $(this).val()
                    },
                    success: function(result) {
                        $('#pop').html(result);
                        $('#processing').remove();
                    }
                });
            });

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

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