@php use Carbon\Carbon; @endphp

<div class="row">
    <x-adminlte-card theme="lightblue" theme-mode="outline">
        <small>Found: </small> <strong>{{ count($humans) }} Record(s)</strong>
    </x-adminlte-card>
</div>

@php
    $headings = [
        'ID number',
        'Serial number',
        'First name',
        'Other names',
        'Sur name',
        'Nationality',
        'Gender',
        'Date of birth',
        'Action'
    ];
    $count=0;
@endphp

<x-adminlte-card>
    <x-adminlte-datatable id="clients-table searchResultsCard" :heads="$headings" striped hoverable bordered>

        @foreach($humans as $human)

            <tr>
                <td><h4 class="text-black">{{ $human->o_pid ?? '-' }}</h4></td>
                <td><h4 class="text-info">{{ $docums[0]['SER_NUM'] }}</h4></td>
                <td>{{ $human->name ?? '-' }}</td>
                <td>{{ $human->last_name ?? '-' }}</td>
                <td>{{ $human->surn ?? '-' }}</td>
                <td>KENYAN <span class="fi fi-ke" style="font-size: 1rem;"></span></td>
                <td>{{ $human->sex ?? '-' }}</td>
                <td>
                    {{ Carbon::parse($human->date_birth)->format("d-m-Y") ?? '-' }}
                </td>
                <td>
                    <button type="button"
                            class="btn bg-gradient-danger btn-sm"
                            wire:click="triggerModal"
                            data-bs-toggle="modal">
                        Open
                    </button>
                </td>
            </tr>
            @php $count+=1; @endphp
        @endforeach

    </x-adminlte-datatable>
</x-adminlte-card>
