<div class="my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
    <div class="py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8">
        <div class="shadow overflow-hidden border-b border-gray-200 sm:rounded-lg">
            <table id="dataTable" class="min-w-full divide-y divide-gray-200">

                <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 scope="col" style="width:150px">
                            User Info
                        </th>
                        <th scope="col" class="no-wrap">
                            Created Date
                        </th>
                        <th scope="col" class="noprin">
                        </th>
                    </tr>
                </thead>
                <tbody>

                    @foreach ($list as $r)
                        {{-- {{dd($r)}} --}}
                        <tr @if ($r->clients_status == 'deactive') class="deactive" @endif>
                            {{-- <tr> --}}
                            {{-- <td class="text-center">
                                <a class="btn btn-info btn-block btn-xs"
                                    href="{{ route('getPaymentHistory', $r->client_id) }}">@php(printf('CID%04d', $r->client_id))</a>

                                <a href="{{ route('getCustomerLogHistory', $r->userid) }}"
                                    class="noprint btn btn-primary btn-xs btn-block">Log</a>
                            </td>
                            <td class="no-wrap">
                                {{ $r->userid }}
                                <br>
                                {{ $r->password }}
                                <br>
                                @if (isset($online) && in_array($r->userid, $online))
                                    <span class="btn btn-success btn-xs">Online</span>
                                @else
                                    <span class="btn btn-danger btn-xs">Ofline</span>
                                @endif
                            </td> --}}
                            {{-- @if ($r->clients_status == 'expired')
                                <td style="background:red" class="deactive">
                                    <x-Custom.Status status="{{ $r->clients_status }}" />
                                </td>
                            @elseif($r->clients_status == 'deactive')
                                <td style="background:red">
                                    <x-Custom.Status status="{{ $r->clients_status }}" />
                                </td>
                            @elseif($r->clients_status == 'active')
                                <td style="background:rgb(0, 119, 255)">
                                    <x-Custom.Status status="{{ $r->clients_status }}" />
                                </td>
                            @elseif($r->clients_status == 'disable')
                                <td style="background:rgb(243, 187, 4)">
                                    <x-Custom.Status status="{{ $r->clients_status }}" />
                                </td>
                            @elseif($r->client_approval == 'pending')
                                <td>
                                    {{ $r->client_approval }}
                                </td>
                            @else
                                <td>
                                    <x-Custom.Status status="{{ $r->clients_status }}" />
                                </td>
                            @endif
                            @if ($r->clients_status == 'expired')
                                <td style="background:red" class="whitespace-nowrap">
                                    {{ date('d-M-Y', strtotime($r->expire_date)) }}
                                </td>
                            @else
                                <td style="background:rgb(0, 119, 255)" class="whitespace-nowrap">
                                    {{ date('d-M-Y', strtotime($r->expire_date)) }}
                                </td>
                            @endif --}}

                            <td>
                                <p style="font-size:14px;">
                                    B Cycle: {{ $r->billing_cycle }}
                                    <br>
                                    B Amount: @role('Sub Reseller')
                                        @if ($r->subreseller == 'yes')
                                            {{ $r->sub_package_rate }}
                                        @else
                                            {{ $r->package_rate }}
                                        @endif
                                    @else
                                        {{ $r->package_rate }}
                                    @endrole <br>
                                    OTC : {{ $r->otc }}
                                </p>
                            </td>

                            <td class="no-wrap">
                                @role('Sub Reseller')
                                    @if ($r->subreseller == 'yes')
                                        {{ $r->sub_package_name }}
                                    @else
                                        {{ $r->package_name }}
                                    @endif
                                @else
                                    {{ $r->package_name }}
                                @endrole
                            </td>
                            <td class="no-wrap">
                                {{ $r->popname ?? '' }}
                            </td>
                            <td>
                                <p style="font-size:14px;">
                                    Name: {{ $r->clients_name ?? '' }}, <br>
                                    C No: {{ $r->contact_no ?? '' }}</p>
                            </td>
                            <td style="width:350px;">
                                <p style="font-size:14px;">
                                    Flat No: {{ $r->flat_no ?? '' }} ,
                                    Building Name: {{ $r->building_name ?? '' }} ,<br>
                                    Road No: {{ $r->road_no ?? '' }} ,<br>
                                    Block/Sector: {{ $r->block_sector ?? '' }} ,
                                    Area : {{ $r->area ?? '' }} </p>
                            </td>
                            <td class="whitespace-nowrap">
                                {{ date('d-M-Y', strtotime($r->created_at)) }}
                            </td>

                            {{-- <td class="text-center noprint" style="width:160px;">
                                <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="{{ route('clients.show', $r->client_id) }}"
                                            class="dropdown-item">Details</a>
                                        @can('mac-customer_edit')
                                            <a href="{{ route('clients.edit', $r->client_id) }}"
                                                class="dropdown-item">Edit</a>
                                        @endcan
                                        <div class="mb-1"></div>
                                        @if ($r->client_approval == 'pending')
                                            @can('new-customer-approve')
                                                <form method="POST" action="{{ route('clinetApprove', $r->id) }}">
                                                    @method('post')
                                                    @csrf
                                                    <input type="hidden" name="user_approve" value="{{ $r->id }}">
                                                    <button
                                                        onclick="return confirm('Are you sure you want to Approved this user ?');"
                                                        type="submit" class="dropdown-item">Approve</button>
                                                </form>
                                            @endcan
                                        @endif

                                        @if ($r->clients_status == 'disable')
                                            @can('id-enable')
                                                <a href="{{ route('idEnable', $r->client_id) }}"
                                                    onclick="return confirm('Are you sure you want to Enable the ID?');"
                                                    class="dropdown-item">Enable</a>

                                            @endcan
                                        @endif

                                        @if ($r->clients_status == 'active')
                                            @can('id-disable')
                                                <a href="{{ route('idDisable', $r->client_id) }}"
                                                    onclick="return confirm('Are you sure you want to Disable the ID?');"
                                                    class="confirmDisable dropdown-item">Disable</a>

                                            @endcan
                                        @endif

                                        @can('mac-customer_destroy')

                                            <form method="POST" action="{{ route('clients.destroy', $r->client_id) }}">
                                                @method('DELETE')
                                                @csrf
                                                <button
                                                    onclick="return confirm('Are you sure you want to Delete this user ?');"
                                                    type="submit" class="dropdown-item">Delete</button>
                                            </form>
                                        @endcan

                                        @can('customer-recharge')

                                            @if ($r->clients_status == 'active')

                                            @endif
                                            @if ($r->clients_status == 'expired')

                                            @endif

                                        @endcan



                                    </div>
                                </div>

                            </td> --}}

                        </tr>

                    @endforeach


                </tbody>

            </table>

            <div class="p-5">
                {{-- {{ $list->links() }} --}}
            </div>
        </div>
    </div>
</div>
