@foreach ($list as $r)
    <div class="row mb-2">
        <div class="mr-2 mt-1 mb-1">
            @if (checkSettings('show-traffice') == 'enable' && $r->client_approval != 'pending')
                <a class="btn btn-primary speedshow" id="speedshow">Show Speed</a>
            @endif
        </div>
    </div>


    <div class="card">
        <div class="card-body">
            @if (checkSettings('show-traffice') == 'enable' && $r->client_approval != 'pending')
                <input type="hidden" id="user_Id" name="user_id" value="{{ $r->id }}">
                <input type="hidden" id="admin_user_Id" name="admin_user_Id" value="{{ $user_id }}">
                <div class='row mb-2 mt-3'>
                    <div class="col-md-6 mb-2 mt-3" id="addcsnvaus">
                        <canvas id="myChart" style="max-height: 1000px;" class="mb-5"></canvas>
                    </div>
                    <div class="col-md-6">
                        <h4 class="font-weight-bold">Last session details</h4>
                        <hr class="my-0">
                        <div>
                            <h5 class="mb-2"><strong>Last Link Up Time</strong>:
                                {{ $bandwidthUsage ? $bandwidthUsage['last-link-up-time'] : '-1' }}</h5>
                            <h5 class="mb-2"><strong>Last Logout Time</strong>:
                                {{ $lastLogoutTime ? $lastLogoutTime : '-1' }}</h5>
                            <div class="row my-3">
                                <div class="col">
                                    <h5><strong>Download:
                                        </strong>
                                        {{ number_format(($bandwidthUsage ? $bandwidthUsage['tx-byte'] : 0) / 1048576, 2, '.', '') }}
                                        MB
                                    </h5>
                                </div>
                                <div class="col">
                                    <h5><strong>Upload:
                                        </strong>{{ number_format(($bandwidthUsage ? $bandwidthUsage['rx-byte'] : 0) / 1048576, 2, '.', '') }}
                                        MB
                                    </h5>
                                </div>
                            </div>
                            <canvas id="pieChart" style="max-height: 250px;" class="mb-5"></canvas>
                        </div>
                    </div>
                </div>
            @endif
        </div>
    </div>
@endforeach
