<?php
    use Carbon\Carbon;
?>
<?php $__env->startSection('content'); ?>
    
    <?php $__currentLoopData = $list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $r): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <div class="row">
            <div class="col-md-3">
                <div class="card ml-1">
                    <div class="card-body">
                        <?php if(checkSettings('profilePicture') == 'enable'): ?>
                            <div class="form-group col-sm-3">
                                <?php if($r->profilePicture != null): ?>
                                    <?php if(checkSettings('store_image_to_s3') == 'enable'): ?>
                                        <?php
                                            $s3Url = Storage::disk('s3')->url(
                                                'customer_profile_picture/' . $r->customer_profile_picture,
                                            );
                                        ?>

                                        <img width="150" height="150" style="border-radius: 50%" src="<?php echo e($s3Url); ?>"
                                            alt="No Image">
                                    <?php else: ?>
                                        <img width="150" height="150" style="border-radius: 50%"
                                            src="<?php echo e(asset('storage/customer_profile_picture/' . $r->customer_profile_picture)); ?>"
                                            alt="No Image">
                                    <?php endif; ?>
                                <?php else: ?>
                                    <div
                                        style="background: #f0ede1;
                                    width: 200px;
                                    height: 200px;
                                    border-radius: 1%;">
                                    </div>
                                <?php endif; ?>
                            </div>
                            <label for="profilePicture" class="block pt-2">
                                Name : <?php echo e($r->clients_name); ?>

                            </label>
                        <?php endif; ?>

                        <div class="card-header p-0 pt-1">
                            <ul class="nav nav-tabs" id="custom-tabs-one-tab" role="tablist">
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('show-service-information')): ?>
                                    <li class="nav-item">
                                        <a class="nav-link active" id="custom-tabs-one-auto-wellcome-sms-tab" data-toggle="pill"
                                            href="#custom-tabs-one-auto-wellcome-sms" role="tab"
                                            aria-controls="custom-tabs-one-auto-wellcome-sms" aria-selected="true">Service</a>
                                    </li>
                                <?php endif; ?>
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('show-personal-information')): ?>
                                    <li class="nav-item">
                                        <a class="nav-link" id="custom-tabs-one-bill-payment-tab" data-toggle="pill"
                                            href="#custom-tabs-one-bill-payment" role="tab"
                                            aria-controls="custom-tabs-one-bill-payment" aria-selected="false">Personal</a>
                                    </li>
                                <?php endif; ?>
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('show-address-information')): ?>
                                    <li class="nav-item">
                                        <a class="nav-link" id="custom-tabs-one-bill-address-tab" data-toggle="pill"
                                            href="#custom-tabs-one-bill-address" role="tab"
                                            aria-controls="custom-tabs-one-bill-address" aria-selected="false">Address</a>
                                    </li>
                                <?php endif; ?>
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('show-connection-information')): ?>
                                    <li class="nav-item">
                                        <a class="nav-link" id="custom-tabs-one-bill-connection-tab" data-toggle="pill"
                                            href="#custom-tabs-one-bill-connection" role="tab"
                                            aria-controls="custom-tabs-one-bill-connection" aria-selected="false">Connection</a>
                                    </li>
                                <?php endif; ?>
                            </ul>
                        </div>
                        <div class="row mt-2 ml-1">
                            <div class="mr-2 mt-1">
                                <a href="<?php echo e(route('clients.index')); ?>" class="btn btn-default"><i
                                        class="fa fa-arrow-left"></i> Back</a>
                            </div>
                            <div class="mr-2 mt-1">
                                <?php if(checkSettings('show-traffice') == 'enable' && $r->client_approval != 'pending'): ?>
                                    <a class="btn btn-primary" id="speedshow">Show Speed</a>
                                <?php endif; ?>
                            </div>
                            
                            <div class="mt-1">
                                <?php if($customer_account > 0): ?>
                                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('mac-customer_destroy')): ?>
                                        <form method="POST" action="<?php echo e(route('clients.destroy', $r->client_id)); ?>">
                                            <?php echo method_field('DELETE'); ?>
                                            <?php echo csrf_field(); ?>
                                            <button style=""
                                                onclick="return confirm('Are you sure you want to Perform the Action?');"
                                                type="submit"class="btn btn-danger ">Delete</button>
                                        </form>
                                    <?php endif; ?>
                                <?php endif; ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="col-md-9">
                <div class="card ml-2">
                    <div class="card-body pl-2 ">
                        <div class="tab-content" id="custom-tabs-one-tabContent">
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('show-service-information')): ?>
                                <div class="tab-pane fade show active" id="custom-tabs-one-auto-wellcome-sms" role="tabpanel"
                                    aria-labelledby="custom-tabs-one-auto-wellcome-sms-tab">
                                    <div class="container col-md-12">
                                        <div class="card-body">

                                            <div class="bg-primary">
                                                <h4 style="text-align: center;">Service Information</h4>
                                            </div>
                                            <div class="table-responsive">
                                                <table class="table table-borderd table-condensed">
                                                    <tr>
                                                        <td>Pop Name</td>
                                                        <td><?php echo e($r->popname); ?></td>
                                                        <td>Billing Cycle</td>
                                                        <td><?php echo e($r->billing_cycle); ?></td>
                                                    </tr>
                                                    <tr>
                                                        <?php if(!$r->isStatic): ?>
                                                            <td>User Name</td>
                                                            <td><?php echo e($r->userid); ?></td>
                                                        <?php else: ?>
                                                            <td>
                                                                IP Address
                                                            </td>
                                                            <td>
                                                                <?php echo e($r->ip_address); ?>

                                                            </td>
                                                        <?php endif; ?>

                                                        <?php if(!$r->isStatic): ?>
                                                            <td>Password</td>
                                                            <td><?php echo e($r->password); ?></td>
                                                        <?php endif; ?>

                                                    </tr>
                                                    <tr>
                                                        <td>Package Name</td>
                                                        <?php if($r->sub_package_name != null && $r->subreseller == 'yes'): ?>
                                                            <td>
                                                                <?php echo e($r->sub_package_name); ?>

                                                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('show-mother-package')): ?>
                                                                    <br>
                                                                    <?php echo e($r->package_name); ?>

                                                                <?php endif; ?>
                                                            </td>
                                                        <?php else: ?>
                                                            <td><?php echo e($r->package_name); ?></td>
                                                        <?php endif; ?>
                                                        <td>Expired Date</td>
                                                        <td> <?php echo e($r->expire_date ?? ''); ?></td>
                                                    </tr>
                                                    <tr>
                                                        <td> Enable MAC</td>
                                                        <td> <?php echo e($r->mac ?? ''); ?></td>
                                                        <td>Slug</td>
                                                        <td> <?php echo e($r->slug ?? ''); ?></td>
                                                    </tr>

                                                </table>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            <?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('show-personal-information')): ?>
                                <div class="tab-pane fade" id="custom-tabs-one-bill-payment" role="tabpanel"
                                    aria-labelledby="custom-tabs-one-bill-payment-tab">
                                    <div class="container col-md-12">
                                        <div class="card-body">
                                            <?php if(checkSettings('profilePicture') == 'enable'): ?>
                                                <label for="">Customer Agrement : </label>
                                                <?php if(checkSettings('store_image_to_s3') == 'enable'): ?>
                                                    <?php
                                                        $s3Url = Storage::disk('s3')->url(
                                                            'customer_agrement/' . $r->customer_agrement,
                                                        );
                                                    ?>

                                                    <img width="150" height="150" style="border-radius: 50%"
                                                        src="<?php echo e($s3Url); ?>" alt="No Image">
                                                <?php else: ?>
                                                    <img width="150" height="150" style="border-radius: 50%"
                                                        src="<?php echo e(asset('storage/customer_agrement/' . $r->customer_agrement)); ?>"
                                                        alt="No Image">
                                                <?php endif; ?>

                                                <label for="">Circle Form : </label>
                                                <?php if(checkSettings('store_image_to_s3') == 'enable'): ?>
                                                    <?php
                                                        $s3Url = Storage::disk('s3')->url(
                                                            'profilePicture/' . $r->profilePicture,
                                                        );
                                                    ?>

                                                    <img width="150" height="150" style="border-radius: 50%"
                                                        src="<?php echo e($s3Url); ?>" alt="No Image">
                                                <?php else: ?>
                                                    <img width="150" height="150" style="border-radius: 50%"
                                                        src="<?php echo e(asset('storage/profilePicture/' . $r->profilePicture)); ?>"
                                                        alt="No Image">
                                                <?php endif; ?>
                                            <?php endif; ?>
                                            <div class="bg-primary">
                                                <h4 style="text-align: center;">Personal Information</h4>
                                            </div>
                                            <div class="table-responsive">
                                                <table class="table table-borderd table-condensed">
                                                    <tr>
                                                        <td> Client Name</td>
                                                        <td><?php echo e($r->clients_name); ?></td>
                                                        <td>Date Of Birth</td>
                                                        <td>
                                                            <?php if($r->dob): ?>
                                                                <?php echo e(date('d-M-Y', strtotime($r->dob))); ?>

                                                            <?php endif; ?>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>Contact No</td>
                                                        <td><?php echo e($r->contact_no ?? ''); ?></td>
                                                        <td>Email</td>
                                                        <td> <?php echo e($r->email ?? ''); ?></td>
                                                    </tr>
                                                    <tr>
                                                        <td>Occupation</td>
                                                        <td><?php echo e($r->occupation ?? ''); ?></td>
                                                        <td>Company Name</td>
                                                        <td><?php echo e($r->company_name ?? ''); ?></td>
                                                    </tr>
                                                    <tr>
                                                        <td>Designation</td>
                                                        <td><?php echo e($r->designation ?? ''); ?></td>
                                                        <td></td>
                                                        <td></td>
                                                    </tr>
                                                    <tr>
                                                        <td>Father Name</td>
                                                        <td><?php echo e($r->father_name ?? ''); ?></td>
                                                        <td>Mother Name</td>
                                                        <td> <?php echo e($r->mother_name ?? ''); ?></td>
                                                    </tr>
                                                    <tr>
                                                        <td>National ID</td>
                                                        <td><?php echo e($r->national_id ?? ''); ?></td>
                                                        <td> Passport No</td>
                                                        <td><?php echo e($r->passport_no ?? ''); ?></td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            <?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('show-address-information')): ?>
                                <div class="tab-pane fade" id="custom-tabs-one-bill-address" role="tabpanel"
                                    aria-labelledby="custom-tabs-one-bill-address-tab">
                                    <div class="container col-md-12">
                                        <div class="card-body">
                                            <?php if(checkSettings('profilePicture') == 'enable'): ?>
                                                <label for="">Building Photo : </label>
                                                <?php if(checkSettings('store_image_to_s3') == 'enable'): ?>
                                                    <?php
                                                        $s3Url = Storage::disk('s3')->url('picture/' . $r->picture);
                                                    ?>

                                                    <img width="150" height="150" style="border-radius: 50%"
                                                        src="<?php echo e($s3Url); ?>" alt="No Image">
                                                <?php else: ?>
                                                    <img width="150" height="150" style="border-radius: 50%"
                                                        src="<?php echo e(asset('storage/picture/' . $r->picture)); ?>" alt="No Image">
                                                <?php endif; ?>


                                                <label for="">Client Flat Door Picture : </label>
                                                <?php if(checkSettings('store_image_to_s3') == 'enable'): ?>
                                                    <?php
                                                        $s3Url = Storage::disk('s3')->url(
                                                            'client_door/' . $r->client_door,
                                                        );
                                                    ?>

                                                    <img width="150" height="150" style="border-radius: 50%"
                                                        src="<?php echo e($s3Url); ?>" alt="No Image">
                                                <?php else: ?>
                                                    <img width="150" height="150" style="border-radius: 50%"
                                                        src="<?php echo e(asset('storage/client_door/' . $r->client_door)); ?>"
                                                        alt="No Image">
                                                <?php endif; ?>
                                            <?php endif; ?>
                                            <div class="bg-primary">
                                                <h4 style="text-align: center;">Address</h4>
                                            </div>
                                            <div class="table-responsive">
                                                <table class="table table-borderd table-condensed">
                                                    <tr>
                                                        <td>Road No</td>
                                                        <td><?php echo e($r->road_no ?? ''); ?></td>
                                                        <td> Road Name</td>
                                                        <td><?php echo e($r->road_name ?? ''); ?></td>
                                                    </tr>
                                                    <tr>
                                                        <td> Flat/Level No</td>
                                                        <td><?php echo e($r->flat_no ?? ''); ?></td>
                                                        <td>Building No</td>
                                                        <td><?php echo e($r->building_no ?? ''); ?></td>
                                                    </tr>
                                                    <tr>
                                                        <td>Building Name</td>
                                                        <td><?php echo e($r->building_name ?? ''); ?></td>
                                                        <td>Block/Sector</td>
                                                        <td><?php echo e($r->block_sector ?? ''); ?></td>
                                                    </tr>
                                                    <tr>
                                                        <td>Latitude</td>
                                                        <td><?php echo e($r->client_latitude ?? ''); ?></td>
                                                        <td>Longitude</td>
                                                        <td><?php echo e($r->client_longitude ?? ''); ?></td>
                                                    </tr>
                                                    <tr>
                                                        <td> Area</td>
                                                        <td><?php echo e($r->area ?? ''); ?></td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            <?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('show-connection-information')): ?>
                                <div class="tab-pane fade" id="custom-tabs-one-bill-connection" role="tabpanel"
                                    aria-labelledby="custom-tabs-one-bill-connection-tab">
                                    <div class="container col-md-12">
                                        <div class="card-body">
                                            <div class="bg-primary">
                                                <h4 style="text-align: center;">Connection Info</h4>
                                            </div>
                                            <div class="table-responsive">
                                                <table class="table table-borderd table-condensed">
                                                    <?php if($r->bill_generate == 'yes'): ?>
                                                        <tr>
                                                            <td>Cable type</td>
                                                            <td><?php echo e($r->cable_type ?? ''); ?></td>
                                                            <td>Cable Length(Meter)</td>
                                                            <td><?php echo e($r->required_cable ?? ''); ?></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Cable ID</td>
                                                            <td><?php echo e($r->cable_id ?? ''); ?></td>
                                                            <td>Cable Type(CAT5/CAT6)</td>
                                                            <td><?php echo e($r->cat_type ?? ''); ?></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Cable(CAT-5/CAT-6) Length(Meter)</td>
                                                            <td><?php echo e($r->cat_length ?? ''); ?></td>
                                                            <td>ONU MAC/Pon No/Serial No</td>
                                                            <td><?php echo e($r->onu_serial ?? ''); ?></td>
                                                        </tr>
                                                        <tr>
                                                            <td>OLT No</td>
                                                            <td><?php echo e($r->olt_pon); ?></td>
                                                            <td>OLT Card Slot Number </td>
                                                            <td><?php echo e($r->olt_no); ?></td>
                                                        </tr>
                                                        <tr>
                                                            <td>PON Module Port No</td>
                                                            <td><?php echo e($r->pon_port); ?></td>
                                                            <td>Box</td>
                                                            <td><?php echo e($r->box); ?></td>
                                                        </tr>
                                                    <?php endif; ?>
                                                    <tr>
                                                        <td>Remote Access : <?php echo e($r->remote_access == 'Yes' ? 'Yes' : 'No'); ?>

                                                        </td>
                                                        <td>Remote Access Username : <?php echo e($r->remote_access_username ?? ''); ?>

                                                        </td>
                                                        <td>Remote Access Password : <?php echo e($r->remote_access_password ?? ''); ?>

                                                        </td>
                                                        <td>Remote Access Port : <?php echo e($r->remote_access_port ?? ''); ?></td>
                                                    </tr>
                                                    <tr>
                                                        <td>Connection Date :</td>
                                                        <td>
                                                            <strong>CD:</strong>
                                                            <?php echo e(date('d-M-Y h:i:sa', strtotime($r->created_at))); ?><br>
                                                            <?php if($r->joinDate): ?>
                                                                <strong>JD:</strong>
                                                                <?php echo e(date('d-M-Y', strtotime($r->joinDate))); ?>

                                                            <?php endif; ?>
                                                        </td>
                                                        <td>Created By :</td>
                                                        <td>
                                                            <?php
                                                                $user = App\Models\User::where(
                                                                    'id',
                                                                    $r->created_by,
                                                                )->first();
                                                            ?>
                                                            <?php echo e($user->name ?? ''); ?> -- <?php echo e($user->mobile_number ?? ''); ?>

                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>Source Name :</td>
                                                        <td>
                                                            <?php
                                                                $source = App\Models\ClientSource::where(
                                                                    'id',
                                                                    $r->source_name,
                                                                )->first();
                                                            ?>
                                                            <?php echo e($source->name ?? ''); ?> <?php echo e($previousClientReferenceText ? ' - ' . $previousClientReferenceText : ''); ?>

                                                        </td>
                                                        <?php if(auth()->user()->hasRole('Reseller Admin')): ?>
                                                        <?php elseif(auth()->user()->hasRole(['Sub Reseller', 'Sub Reseller Technician'])): ?>
                                                        <?php else: ?>
                                                            <td>Marketed By</td>
                                                            <?php if($r->marketed_by == 0): ?>
                                                                <td>No Marketing</td>
                                                            <?php else: ?>
                                                                <?php
                                                                    $m = App\Models\ClientReferer::where(
                                                                        'id',
                                                                        $r->marketed_by,
                                                                    )->first();
                                                                ?>
                                                                <td><?php echo e($m->firstname ?? ''); ?> <?php echo e($m->lastname ?? ''); ?></td>
                                                                
                                                            <?php endif; ?>
                                                        <?php endif; ?>
                                                    </tr>
                                                    <?php if(globalPermission('manage-line-man')): ?>
                                                        <tr>
                                                            <td>Line Man :
                                                                <?php echo e($r->line_man_id ? App\Models\Employee::where('id', $r->line_man_id)->first()->name : 'No Line Man'); ?>

                                                            </td>
                                                            <td></td>
                                                            <td></td>
                                                            <td></td>
                                                        </tr>
                                                    <?php endif; ?>
                                                    <tr>
                                                        <td>Remarks</td>
                                                        <td><?php echo e($r->remarks ?? ''); ?></td>

                                                        <td style="">
                                                            
                                                            <?php ($permissions = userPermissions()); ?>
                                                            <?php if(checkSettings('local-user-first-approve') == 'enable'): ?>
                                                                <?php if(in_array('local-user-first-approve', $permissions)): ?>
                                                                    <?php if($r->first_approval == 'Pending'): ?>
                                                                        <form action="<?php echo e(route('firstApproveAllPending')); ?>"
                                                                            method="post" id="firstAllPendingApproveForm">
                                                                            <?php echo csrf_field(); ?>
                                                                            <?php echo method_field('post'); ?>
                                                                            <input type="hidden" name="first_client_ids[]"
                                                                                id="first_client_ids"
                                                                                value="<?php echo e($r->client_id); ?>">

                                                                            <button class="btn btn-primary"
                                                                                id="firstAllApprove"><i
                                                                                    class="fa fa-check"></i>Final
                                                                                Approve</button>
                                                                        </form>
                                                                    <?php endif; ?>
                                                                <?php elseif(in_array('new-customer-approve', $permissions)): ?>
                                                                    <?php if($r->client_approval == 'pending'): ?>
                                                                        <form action="<?php echo e(route('approveAllPending')); ?>"
                                                                            method="post" id="allPendingApproveForm">
                                                                            <?php echo csrf_field(); ?>
                                                                            <?php echo method_field('post'); ?>
                                                                            <input type="hidden" name="client_ids[]"
                                                                                id="client_ids" value="<?php echo e($r->client_id); ?>">

                                                                            <button class="btn btn-success float-right"
                                                                                id="allApprove"><i class="fa fa-check"></i>
                                                                                Approve</button>
                                                                        </form>
                                                                    <?php endif; ?>
                                                                <?php endif; ?>
                                                            <?php else: ?>
                                                                <?php if(in_array('new-customer-approve', $permissions)): ?>
                                                                    <?php if($r->client_approval == 'pending'): ?>
                                                                        <form action="<?php echo e(route('approveAllPending')); ?>"
                                                                            method="post" id="allPendingApproveForm">
                                                                            <?php echo csrf_field(); ?>
                                                                            <?php echo method_field('post'); ?>
                                                                            <input type="hidden" name="client_ids[]"
                                                                                id="client_ids" value="<?php echo e($r->client_id); ?>">

                                                                            <button class="btn btn-success float-right"
                                                                                id="allApprove"><i class="fa fa-check"></i>
                                                                                Approve</button>
                                                                        </form>
                                                                    <?php endif; ?>
                                                                <?php endif; ?>
                                                            <?php endif; ?>
                                                        </td>
                                                        <td>
                                                            
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="card shadow-sm border-0" style="border-radius: 12px; overflow: hidden;">
            <div class="card-body p-3">
                <?php if(checkSettings('show-traffice') == 'enable' && $r->client_approval != 'pending'): ?>
                    <input type="hidden" id="user_Id" name="user_id" value="<?php echo e($r->id); ?>">
                    <input type="hidden" id="admin_user_Id" name="admin_user_Id" value="<?php echo e($user_id); ?>">
                    <div class='row'>
                        <div class="col-md-6 mb-3 mb-md-0" id="addcsnvaus">
                            <div class="bg-white rounded-lg p-3" style="box-shadow: 0 2px 8px rgba(0,0,0,0.08);">
                                <canvas id="myChart" style="max-height: 1000px;"></canvas>
                            </div>


                        </div>
                        <div class="col-md-6">
                            <div class="d-flex align-items-center mb-3">
                                <div class="bg-primary text-white rounded-circle d-flex align-items-center justify-content-center"
                                    style="width: 38px; height: 38px; margin-right: 10px;">
                                    <i class="fas fa-network-wired" style="font-size: 1rem;"></i>
                                </div>
                                <h5 class="font-weight-bold mb-0" style="color: #2c3e50; font-size: 1.2rem;">Session
                                    Details</h5>
                            </div>

                            <div class="session-info-container">
                                <div class="info-item mb-2 bg-light rounded"
                                    style="border-left: 3px solid #3498db; transition: all 0.3s ease; padding: 0.75rem;">
                                    <div class="d-flex align-items-center mb-1">
                                        <i class="fas fa-clock text-primary mr-2" style="font-size: 0.9rem;"></i>
                                        <span class="text-muted small font-weight-bold text-uppercase"
                                            style="font-size: 0.72rem; letter-spacing: 0.3px;">Last Link Up Time</span>
                                    </div>
                                    <div class="mt-1">
                                        <span class="text-dark font-weight-semibold" style="font-size: 0.95rem;">
                                            <?php echo e($bandwidthUsage ? parseDate($bandwidthUsage['last-link-up-time']) : '-1'); ?>

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

                                <div class="info-item mb-2 bg-light rounded"
                                    style="border-left: 3px solid #e74c3c; transition: all 0.3s ease; padding: 0.75rem;">
                                    <div class="d-flex align-items-center mb-1">
                                        <i class="fas fa-sign-out-alt text-danger mr-2" style="font-size: 0.9rem;"></i>
                                        <span class="text-muted small font-weight-bold text-uppercase"
                                            style="font-size: 0.72rem; letter-spacing: 0.3px;">Last Logout Time</span>
                                    </div>
                                    <div class="mt-1">
                                        <span class="text-dark font-weight-semibold" style="font-size: 0.95rem;">
                                            <?php echo e($lastLogoutTime ? parseDate($lastLogoutTime) : '-1'); ?>

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

                                <div class="info-item mb-2 bg-light rounded"
                                    style="border-left: 3px solid #9b59b6; transition: all 0.3s ease; padding: 0.75rem;">
                                    <div class="d-flex align-items-center mb-1">
                                        <i class="fas fa-fingerprint mr-2" style="color: #9b59b6; font-size: 0.9rem;"></i>
                                        <span class="text-muted small font-weight-bold text-uppercase"
                                            style="font-size: 0.72rem; letter-spacing: 0.3px;">Client Mac Address</span>
                                    </div>
                                    <div class="mt-1">
                                        <span class="text-dark font-weight-semibold font-monospace"
                                            style="font-size: 0.95rem;">
                                            <?php echo e($activeClientInfo ? $activeClientInfo['caller-id'] : '-1'); ?>

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

                                <div class="info-item mb-2 bg-light rounded"
                                    style="border-left: 3px solid #27ae60; transition: all 0.3s ease; padding: 0.75rem;">
                                    <div class="d-flex align-items-center mb-1">
                                        <i class="fas fa-industry text-success mr-2" style="font-size: 0.9rem;"></i>
                                        <span class="text-muted small font-weight-bold text-uppercase"
                                            style="font-size: 0.72rem; letter-spacing: 0.3px;">Vendor Name</span>
                                    </div>
                                    <div class="mt-1">
                                        <span class="text-dark font-weight-semibold" style="font-size: 0.95rem;">
                                            <?php echo e($vendorName ?? '-1'); ?>

                                        </span>
                                    </div>
                                </div>
                            </div>
                            <div class="row mt-3 mb-2">
                                <div class="col-6 pr-2">
                                    <div class="stat-card p-3 rounded text-center"
                                        style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);">
                                        <div class="d-flex align-items-center justify-content-center mb-2">
                                            <i class="fas fa-download text-white mr-2" style="font-size: 0.9rem;"></i>
                                            <span class="text-white-50 small font-weight-bold text-uppercase"
                                                style="font-size: 0.7rem;">Download</span>
                                        </div>
                                        <div class="text-white" style="font-size: 1.4rem; font-weight: 700;">
                                            <?php echo e(number_format(($bandwidthUsage ? $bandwidthUsage['tx-byte'] : 0) / 1073741824, 2, '.', '')); ?>

                                            <span class="text-white-50"
                                                style="font-size: 0.85rem; font-weight: 500;">GB</span>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-6 pl-2">
                                    <div class="stat-card p-3 rounded text-center"
                                        style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); box-shadow: 0 4px 12px rgba(245, 87, 108, 0.3);">
                                        <div class="d-flex align-items-center justify-content-center mb-2">
                                            <i class="fas fa-upload text-white mr-2" style="font-size: 0.9rem;"></i>
                                            <span class="text-white-50 small font-weight-bold text-uppercase"
                                                style="font-size: 0.7rem;">Upload</span>
                                        </div>
                                        <div class="text-white" style="font-size: 1.4rem; font-weight: 700;">
                                            <?php echo e(number_format(($bandwidthUsage ? $bandwidthUsage['rx-byte'] : 0) / 1073741824, 2, '.', '')); ?>

                                            <span class="text-white-50"
                                                style="font-size: 0.85rem; font-weight: 500;">GB</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                        </div>
                    </div>
                <?php endif; ?>
            </div>
        </div>
        <?php if(globalPermission('onu_information_laser')): ?>
            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('onu_information_laser')): ?>
                <?php if(isset($onuInfo->laser)): ?>
                    <div class="container-fluid mt-2">
                        <div class="row">
                            <div class="col-md-6">
                                <div class="card p-3">
                                    <h5 class="text-center">ONU Information</h5>
                                    <table class="table table-bordered table-sm">
                                        <tr>
                                            <td><strong>OLT:</strong></td>
                                            <td><?php echo e($onuInfo->oltaddress ?? '-'); ?> - <?php echo e($onuInfo->oltName ?? '-'); ?></td>
                                            <td><strong>ONU Id:</strong></td>
                                            <td><?php echo e($onuInfo->onuid ?? '-'); ?></td>

                                        </tr>
                                        <tr>
                                            <td><strong>Power(Laser):</strong></td>
                                            <td><span class="text-bold text-green"><?php echo e($onuInfo->laser ?? '-'); ?></span></td>
                                            <td><strong>Update:</strong></td>
                                            <td><?php echo e(isset($onuInfo->updated_at) ? Carbon::parse($onuInfo->updated_at)->format('d-m-Y h:i A') : '-'); ?>

                                            </td>

                                        </tr>
                                        <tr>
                                            <td><strong>PON ID, Vlan:</strong></td>
                                            <td><?php echo e($onuInfo->interface ?? '-'); ?>, <?php echo e($onuInfo->Vlan ?? '-'); ?></td>
                                            <td><strong>Device Mac:</strong></td>
                                            <td><?php echo e(strtoupper(implode(':', str_split($onuInfo->mac ?? null, 2))) ?? '-'); ?></td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                <?php endif; ?>
            <?php endif; ?>
        <?php endif; ?>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('ajax'); ?>
    <style>
        .info-item {
            transition: all 0.3s ease;
        }

        .info-item:hover {
            transform: translateX(5px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
            background-color: #f8f9fa !important;
        }

        .stat-card {
            transition: all 0.3s ease;
        }

        .stat-card:hover {
            transform: translateY(-5px);
        }

        .session-info-container .info-item {
            background-color: #f8f9fa;
        }
    </style>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <script src="https://js.pusher.com/7.0/pusher.min.js"></script>
    <script>
        function create_UUID() {
            var dt = new Date().getTime();
            var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
                var r = (dt + Math.random() * 16) % 16 | 0;
                dt = Math.floor(dt / 16);
                return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
            });
            return uuid;
        }

        const data = {
            labels: [],
            datasets: [{
                label: 'Downloads',
                backgroundColor: '#333C83',
                borderColor: '#333C83',
                data: [],
                tension: 0.3,


            }, {
                label: 'Uploads',
                backgroundColor: 'rgb(255, 99, 132)',
                borderColor: 'rgb(255, 99, 132)',
                data: [],
                tension: 0.3,


            }]
        };


        const config = {
            type: 'line',
            data: data,
            options: {
                scales: {
                    y: {
                        ticks: {
                            callback: function(value, index, ticks) {
                                return value > 1 ? value + 'Mb' : (value * 1024) + "Kb";
                            }
                        }
                    }
                },
                plugins: {
                    title: {
                        display: true,
                        text: 'Real-Time Speed',
                        padding: {
                            top: 10,
                            bottom: 10
                        },
                        font: {
                            size: 15,

                        }
                    },
                    legend: {
                        labels: {
                            // This more specific font property overrides the global property
                            font: {
                                size: 12
                            }
                        }
                    }
                }
            }
        };

        const myChart = new Chart(
            document.getElementById('myChart'),
            config
        );

        let usageData = [1, 1];
        if (!('<?php echo e($error); ?>'.length > 0)) {
            usageData = [
                (<?php echo e(($bandwidthUsage ? $bandwidthUsage['tx-byte'] : 1) / 1048576); ?>).toFixed(3),
                (<?php echo e(($bandwidthUsage ? $bandwidthUsage['rx-byte'] : 1) / 1048576); ?>).toFixed(3),
            ]
        }

        const pieChartData = {
            labels: [
                'Downloads',
                'Uploads',
            ],
            datasets: [{
                label: 'My First Dataset',
                data: usageData,
                backgroundColor: [
                    '#333C83',
                    'rgb(255, 99, 132)',
                ],
                hoverOffset: 4
            }]

        };

        const pieChartConfig = {
            type: 'doughnut',
            data: pieChartData,
        }

        const pieChart = new Chart(
            document.getElementById('pieChart'),
            pieChartConfig
        );

        $('#speedshow').click(function() {
            $('#speedshow').hide();
            const uuid = create_UUID();


            const currentTime = () => {
                const today = new Date();
                const time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
                return time;
            }

            const addData = (chart, download, upload) => {
                const time = currentTime();

                chart.data.datasets[0].label = download > 1 ? `Download ${download.toFixed(3)} Mbps` :
                    `Download ${(download *1024).toFixed(3)} Kbps`
                chart.data.datasets[1].label = upload > 1 ? `Upload ${upload.toFixed(3)} Mbps` :
                    `Upload ${(upload *1024).toFixed(3)} Kbps`

                chart.data.labels.push(time)
                chart.data.datasets[0].data.push(download);
                chart.data.datasets[1].data.push(upload)
                chart.update();

            }

            function removeData(chart) {
                chart.data.labels.shift();
                chart.data.datasets.forEach((dataset) => {
                    dataset.data.shift();
                });
                chart.update();
            }
            const pusher = new Pusher('<?php echo e(config('broadcasting.connections.pusher.key')); ?>', {
                cluster: '<?php echo e(config('broadcasting.connections.pusher.options.cluster')); ?>'
            });
            const user_id = $('#user_Id').val();
            const admin_user_id = $('#admin_user_Id').val();

            const channel = pusher.subscribe(uuid);

            channel.bind('my-event', function(data) {
                const speed = JSON.parse(JSON.parse(JSON.stringify(data)).message)[0];
                const upload = speed["rx-bits-per-second"] / 1048576;
                const download = speed["tx-bits-per-second"] / 1048576;

                if (myChart.data.datasets[0].data.length > 15) {
                    removeData(myChart);
                }
                addData(myChart, download, upload)

            });

            $(document).ready(function() {
                const user_id = $('#user_Id').val();
                const admin_user_id = $('#admin_user_Id').val();
                $.ajax({
                    type: 'GET',
                    url: '<?php echo e(route('getSpeed')); ?>',
                    data: {
                        id: user_id,
                        uuid: uuid,

                    },
                    success: function(data) {
                        $('#speedshow').show();

                    },
                    error: function(request, error) {
                        toastr.error(request.responseText);
                        $('#speedshow').show();
                    }
                });
            });
        });
    </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/netlink/radius-circle/resources/views/clients/details.blade.php ENDPATH**/ ?>