<?php
use App\Models\ReportQuarter;
use App\Models\ConseilSchool;
use App\Services\Chapter3Service;
use Livewire\Component;
?>

<div>
    <div class="table-responsive">
        <table class="table table-bordered" style="width: 100%">
            <thead>
                <tr>
                    <th class="text-center" style="padding: 8px">N°</th>
                    <th style="padding: 8px">Nom et Prénons</th>
                    <th style="padding: 8px">Fonctions</th>
                </tr>
            </thead>
            <tbody>
                @php $i = 1; @endphp
                @forelse ($data as $item)
                    <tr>
                        <th class="text-center" style="padding: 8px">{{ $i < 10 ? '0'.$i++:$i++ }}</th>
                        <td style="padding: 8px">
                            {{ ($item->user->sexe == 'F' ? 'Mme':'Mr').' '.strtoupper($item->user->first_name).' '.ucwords($item->user->last_name) }}
                        </td>
                        <td style="padding: 8px">
                            {{ ucwords($item->user->role->role) }}
                        </td>
                    </tr> 
                @empty
                    <tr>
                        <td colspan="3" class="text-center" style="padding: 8px">Underdefined data</td>
                    </tr>
                @endforelse
            </tbody>
        </table>
    </div>
</div>