{{-- components/study-data-table.blade.php --}} {{-- Study list data table matching legacy show_table_StudyList() --}} {{-- See UI Spec §2.4 --}} {{-- HEADER ROWS (legacy-style grouping) --}} Id Code Nom Client Date Sexe Age Lieu Pays Nb Questionnaires Début Fin De A Moy. Total Produit 1 Produit 2 Produit 3 Produit 4 Produit 5 Produit 6 Produit 7 Produit 8 Produit 9 {{-- DATA ROWS (per study) --}} @foreach($studies as $study) @php $rowCount = (int) ($study->row_count ?? 1); $productRows = $study->product_rows ?? []; @endphp @for($rowIdx = 0; $rowIdx < $rowCount; $rowIdx++) @include('components.row', ['index' => $loop->index + $rowIdx]) @if($rowIdx === 0) View {{ $study->Code ?? '' }} {{ $study->Name ?: '' }} {{ $study->ClientName ?: '' }} {{ $study->StartDate ?: '' }} {{ (!empty($study->EndDate) && $study->EndDate !== '0000-00-00') ? $study->EndDate : '' }} {{ $study->Sexe === 'F' ? 'Femme' : ($study->Sexe === 'H' ? 'Homme' : ($study->Sexe ?: '')) }} {{ $study->Age_From ?: '' }} {{ $study->Age_To ?: '' }} {{ $study->age_avg !== null ? number_format((float) $study->age_avg, 2, ',', '') : '' }} {{ $study->Lieu ?: '' }} {{ $study->pays ?: '' }} {{ $study->nb_total ?: '' }} @endif @for($prodCol = 0; $prodCol < 9; $prodCol++) @php $prod = $productRows[$rowIdx][$prodCol] ?? null; @endphp @if($prod) {{ $prod['nb_forms'] ?: '' }} {{ $prod['avg_note'] !== null ? number_format((float) $prod['avg_note'], 2, ',', '') : '' }} {{ $prod['pref_count'] ?: '' }} {{ $prod['name'] ?: '' }} View   @else             @endif @endfor @endfor @endforeach