<div class="table-responsive" id="result">
    <table id="dataTable" class="table table-bordered table-striped">
        <thead class="bg-gray-50">
            <tr>
                <th>ID</th>
                <th>Username</th>
                <th>Client IP</th>
                <th>MAC Address</th>
                <th>Download</th>
                <th>Upload</th>
                <th>Login</th>
                <th>Logout</th>
                <th>Reason</th>
            </tr>
        </thead>
        <tbody>
            @php
                $total_down = 0;
                $total_up = 0;
            @endphp
            @foreach ($list as $r)
                <tr>
                    <td>{{ $r->session_id }}</td>
                    <td>{{ $r->username }}</td>
                    <td>{{ $r->ip_address }}</td>
                    <td>{{ $r->mac_address }}</td>
                    <td style="text-align:right">
                        {{ round(($r->downloaded) ) }} MB
                    </td>
                    <td style="text-align:right">
                        {{ round(($r->uploaded) ) }} MB
                    </td>
                    <td>{{ $r->session_start_time }}</td>
                    <td>{{ $r->session_end_time }}</td>
                    <td>{{ $r->last_disconnect_reason }}</td>
                    @php($total_down += round(($r->downloaded)))
                    @php($total_up += round(($r->uploaded) ))
                </tr>
            @endforeach
            <tr>
                <td colspan="4" style="text-align:right"><strong>Total</strong></td>
                <td style="text-align:right"><strong>{{ $total_down }}</strong> MB</td>
                <td style="text-align:right"><strong>{{ $total_up }}</strong> MB</td>
                <td colspan="3"></td>
            </tr>
        </tbody>
    </table>
</div>
