<?php
use App\Models\ReportQuarter;
use App\Models\AnimateurVisit;
use App\Services\RepportService;
use Livewire\Component;
?>

<div>
    <div class="table-responsive">
        <table class="table table-bordered" style="width: 100%">
            <thead>
            <tr>
                <th class="text-center" style="width: 3%; padding: 8px">N°</th>
                <th class="text-center" style="width: 25%; padding: 8px">Qualité de l'observateur</th>
                <th class="text-center" style="width: 17%; padding: 8px">Professeur</th>
                <th class="text-center" style="width: 15%; padding: 8px">Discipline</th>
                <th class="text-center" style="width: 15%; padding: 8px">Dates</th>
                <th class="text-center" style="width: 10%; padding: 8px">Hueres</th>
                <th class="text-center" style="width: 15%; padding: 8px">Classes</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">{{ ucfirst($item->qualite) }}</td>
                        <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">{{ ucfirst($item->school_matter->matter->libelle) }}</td>
                        <td class="text-center" style="padding: 8px">{{ date('d/m/Y', strtotime($item->date)) }}</td>
                        <td class="text-center" style="padding: 8px">{{ $item->time }}</td>
                        <td class="text-center" style="padding: 8px">{{ $item->classe->libelle }}</td>
                    </tr>
                @empty
                    <tr>
                        <td colspan="7" class="text-center" style="padding: 8px">Underdefined data</td>
                    </tr>
                @endforelse
            </tbody>
        </table>
    </div>
</div>