{{-- study/detail.blade.php — Phase 9.1 --}} @extends('layouts.app') @section('content') @include('components.analysis-nav', ['study' => $study, 'activeTab' => $activeTab]) @php $rows = []; foreach ($grid['rows'] as $r) { $cells = $r['cells']; $label = array_shift($cells); // first column is the interview id $rows[] = ['label' => $label, 'cells' => $cells]; } $headers = $grid['headers']; array_shift($headers); $totalCells = [ '', // Prénom '', // Sexe '', // Age '', // Lieu '', // N° Enq '', // Date ]; foreach ($grid['totals']['per_product'] as $avg) { $totalCells[] = $avg === null ? '' : number_format($avg, 2, ',', ' '); } $totals = [ 'label' => 'Moyenne (' . $grid['totals']['n_interviews'] . ' interviews)', 'cells' => $totalCells, ]; @endphp @include('components.report-display', [ 'title' => 'Détail — ' . ($study->Name ?? ('Étude #' . $study->Id)), 'subTitle' => ($study->Code ?? '') . ' · ' . ($study->ClientName ?? ''), 'headers' => $headers, 'rows' => $rows, 'totals' => $totals, 'csvHref' => route('kms.study.detail.export', $study->Id), 'csvFilename' => 'study_detail_' . $study->Id . '.csv', ]) @endsection