<div class="card">
    <div class="card-body">
         <button id="downloadCsv" class=" btn btn-primary" >
            Download CSV
       </button>
        <h4>Total Offline: <?php echo e(checkAPI() ? sizeof($list) : count($list)); ?></h4>
        <?php if(checkAPI()): ?>
            <table id="dataTable" class="table table-bordered">
                <thead style=" background-color: #78716c; color: #ffffff;">
                    <tr>
                        <th>Id</th>
                        <th>UserName </th>
                        <th>Client Status</th>
                        <th>Billing Date</th>
                        <th>Bill Info</th>
                        <th>Package</th>
                        <th>POP</th>
                        <th style="width:300px">User Info</th>
                        <th>Expire Date</th>
                        <th>Last Logout Time</th>

                    </tr>
                </thead>
                <tbody class="bg-white divide-y divide-gray-200">

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

                        <tr>
                            <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>
                            </td>
                            <td><?php echo e($r['userid']); ?> <br>
                                <?php if(in_array('view-client-password', userPermissions())): ?>
                                    <i class="fa fa-key" aria-hidden="true"></i> <?php echo e($r->password); ?> <br>
                                <?php endif; ?>

                                Name: <?php echo e($r->clientsinfo->clients_name ?? ''); ?> <br>
                                <?php echo e($r->clientsinfo->contact_no ?? ''); ?>

                            </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 style="width:300px;">
                                <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 ?? ''); ?>

                                    <?php endif; ?>
                                </p>
                            </td>
                            <td><?php echo e(date('d-M-Y', strtotime($r['expire_date']))); ?></td>
                            <td>
                                <?php if(isset($all_customer[$r->userid]['last-logged-out'])): ?>
                                    <?php echo e($all_customer[$r->userid]['last-logged-out']); ?>

                                <?php endif; ?>
                                <br>
                                <?php if(isset($all_customer[$r->userid]['last-disconnect-reason'])): ?>
                                    <span
                                        class="btn btn-danger btn-xs"><?php echo e($all_customer[$r->userid]['last-disconnect-reason']); ?></span>
                                <?php endif; ?>
                            </td>


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

                </tbody>
            </table>
        <?php else: ?>
            <table id="dataTable" class="table table-bordered">
                <thead class="bg-gray-50">
                    <tr>
                        <th scope="col">UserName</th>
                        <th>Nas IP</th>
                        <th>Assigned IP</th>
                        <th>Logout Reason</th>
                        <th>Last Update Time</th>
                        <th>Logout Time</th>
                    </tr>
                </thead>
                <tbody class="bg-white divide-y divide-gray-200">

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

                        <tr>
                            <td><?php echo e($r->username); ?></td>
                            <td><?php echo e($r->nasipaddress); ?></td>
                            <td><?php echo e($r->framedipaddress); ?></td>
                            <td><?php echo e($r->acctterminatecause); ?></td>
                            <td><?php echo e($r->acctupdatetime); ?></td>
                            <td><?php echo e($r->acctstoptime); ?></td>

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


                </tbody>
            </table>
        <?php endif; ?>

    </div>
</div>
<?php /**PATH /var/www/html/sajib/radius-circle/resources/views/clients/onlineofline/oflineResult.blade.php ENDPATH**/ ?>