<?php
use App\Models\CeActivite;
use App\Models\ReportQuarter;
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: 17%; padding: 8px">Activités</th>
                <th class="text-center" style="width: 15%; padding: 8px">Thèmes</th>
                <th class="text-center" style="width: 15%; padding: 8px">Disciplines</th>
                <th class="text-center" style="width: 15%; padding: 8px">Lieux</th>
                <th class="text-center" style="width: 10%; padding: 8px">Dates</th>
                <th class="text-center" style="width: 25%; padding: 8px">Observations</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->activite) }}</td>
                    <td style="padding: 8px">{{ ucfirst($item->theme) }}</td>
                    <td style="padding: 8px">{{ ucfirst($item->school_matter->matter->libelle) }}</td>
                    <td class="text-center" style="padding: 8px">{{ $item->lieu }}</td>
                    <td class="text-center" style="padding: 8px">{{ date('d/m/Y', strtotime($item->date)) }}</td>
                    <td style="padding: 8px">{{ ucfirst($item->texte) }}</td>
                </tr>
            @empty
                <tr>
                    <td colspan="7" class="text-center" style="padding: 8px">Underdefined data</td>
                </tr>
            @endforelse
            </tbody>
        </table>
    </div>
</div>