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

<div>
    <div class="card-body table-border-style mt-2">
        <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">Disciplines</th>
                        <th style="padding: 8px">Responsables</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->school_matter->matter->libelle) }}
                            </td>
                            <td style="padding: 8px">
                                {{ ($item->user->sexe == 'F' ? 'Mme':'Mr').' '.strtoupper($item->user->first_name).' '.ucwords($item->user->last_name) }}
                            </td>
                        </tr> 
                    @empty
                        <tr>
                            <td colspan="4" class="text-center" style="padding: 8px">Underdefined data</td>
                        </tr>
                    @endforelse
                </tbody>
            </table>
        </div>
    </div>
</div>