@php $isPdf = (($export_format ?? '') === 'pdf'); $isDocx = (($export_format ?? '') === 'docx'); $companyLogoCandidate = base_path('_Company/logo/logo_600x200.png'); $defaultLogoCandidate = public_path('img/Company/default_logo/default_logo_600x200.png'); $companyLogoFile = null; if (is_file($companyLogoCandidate)) { $companyLogoFile = str_replace('\\', '/', $companyLogoCandidate); } elseif (is_file($defaultLogoCandidate)) { $companyLogoFile = str_replace('\\', '/', $defaultLogoCandidate); } @endphp @if($isPdf)
@if(!empty($companyLogoFile)) @else {{ config('app.name', 'System') }} @endif
{{ $report_title ?? 'Kompletny Raport Szkolenia' }}
Szkolenie ID: {{ $training['id'] ?? '-' }}
Wygenerowano: {{ $generated_at ?? '-' }}
@endif

{{ $report_title ?? 'Kompletny Raport Szkolenia' }}

Raport obejmuje materialy, metode sprawdzenia wiedzy oraz kompletna liste uczestnikow.
Wygenerowano: {{ $generated_at ?? '-' }}
@php $reportSettings = is_array($report_settings ?? null) ? $report_settings : []; $settingsSections = is_array($reportSettings['sections'] ?? null) ? $reportSettings['sections'] : []; $settingsElements = is_array($reportSettings['elements'] ?? null) ? $reportSettings['elements'] : []; $settingsParticipantLists = is_array($reportSettings['participant_lists'] ?? null) ? $reportSettings['participant_lists'] : []; $chartImages = is_array($chart_images ?? null) ? $chart_images : []; $attendanceChartImage = trim((string) ($chartImages['attendance'] ?? '')); $resultsChartImage = trim((string) ($chartImages['results'] ?? '')); $participantVisibleColumns = is_array($participant_visible_columns ?? null) ? $participant_visible_columns : []; $participantsPresent = is_array($participants_present ?? null) ? $participants_present : []; $participantsAbsent = is_array($participants_absent ?? null) ? $participants_absent : []; $showMaterialsSection = !empty($settingsSections['materials']); $showMaterialsSummary = $showMaterialsSection && !empty($settingsElements['materials_summary']); $showMaterialsList = $showMaterialsSection && !empty($settingsElements['materials_list']); $showVerificationSection = !empty($settingsSections['verification']); $showVerificationSummary = $showVerificationSection && !empty($settingsElements['verification_summary']); $showVerificationMetrics = $showVerificationSection && !empty($settingsElements['verification_metrics']); $showAnalyticsSection = !empty($settingsSections['analytics']); $showAnalyticsTable = $showAnalyticsSection && !empty($settingsElements['analytics_table']); $showAnalyticsCharts = $showAnalyticsSection && !empty($settingsElements['analytics_charts']); $chartType = in_array(($reportSettings['chart_options']['type'] ?? 'vertical'), ['vertical', 'pie'], true) ? (string) $reportSettings['chart_options']['type'] : 'vertical'; $mandatory = is_array($mandatory_sections ?? null) ? $mandatory_sections : []; $participantsColspan = 2 + count($participantVisibleColumns); $showParticipantPresentList = !empty($settingsParticipantLists['present']); $showParticipantAbsentList = !empty($settingsParticipantLists['absent']); if (!$showParticipantPresentList && !$showParticipantAbsentList) { $showParticipantPresentList = true; } $optionalSectionNo = 5; @endphp

1. Metryczka szkolenia (Informacje podstawowe)

Temat / tytul szkolenia {{ $mandatory['training_card']['topic'] ?? ($training['topic'] ?? '-') }}
Termin i miejsce / platforma {{ $mandatory['training_card']['term_and_place'] ?? '-' }}
Podmiot prowadzacy / Trener {{ $mandatory['training_card']['provider'] ?? ($training['trainer'] ?? '-') }}
Liczba i profil uczestnikow {{ $mandatory['training_card']['participants_profile'] ?? '-' }}

2. Cel i zakres szkolenia

Cel glowny {{ $mandatory['goal_scope']['goal_main'] ?? ($training['goal'] ?? '-') }}
Zakres tematyczny {{ $mandatory['goal_scope']['scope'] ?? '-' }}

3. Przebieg szkolenia

Zgodnosc z planem {{ $mandatory['run']['plan'] ?? '-' }}
Zastosowane metody {{ $mandatory['run']['methods'] ?? '-' }}
Aktywnosc i zaangazowanie uczestnikow {{ $mandatory['run']['engagement'] ?? '-' }}

4. Lista uczestnikow szkolenia (lp. imie nazwisko)

@if($showParticipantPresentList)

4.1 Lista obecnych uczestnikow

@foreach($participantVisibleColumns as $column) @endforeach @forelse($participantsPresent as $participant) @foreach($participantVisibleColumns as $column) @php $key = (string) ($column['key'] ?? ''); $value = $key !== '' ? ($participant[$key] ?? '-') : '-'; @endphp @endforeach @empty @endforelse
Lp Imie i nazwisko{{ $column['label'] ?? '-' }}
{{ $participant['lp'] ?? '-' }} {{ $participant['full_name'] ?? '-' }}{{ $value }}
Brak obecnych uczestnikow.
@endif @if($showParticipantAbsentList)

4.2 Lista nieobecnych uczestnikow

@foreach($participantVisibleColumns as $column) @endforeach @forelse($participantsAbsent as $participant) @foreach($participantVisibleColumns as $column) @php $key = (string) ($column['key'] ?? ''); $value = $key !== '' ? ($participant[$key] ?? '-') : '-'; @endphp @endforeach @empty @endforelse
Lp Imie i nazwisko{{ $column['label'] ?? '-' }}
{{ $participant['lp'] ?? '-' }} {{ $participant['full_name'] ?? '-' }}{{ $value }}
Brak nieobecnych uczestnikow.
@endif @if($showMaterialsSection)

{{ $optionalSectionNo }}. Materialy szkoleniowe

@php $optionalSectionNo++; @endphp @if($showMaterialsSummary)
{{ $materials_description ?? 'Brak opisu materialow.' }}
@php $materialsTotal = (int) ($materials_stats['total'] ?? 0); $materialsSummaryItems = []; $introCount = (int) ($materials_stats['intro'] ?? 0); if ($introCount > 0) { $materialsSummaryItems[] = 'Wprowadzenie - '.$introCount; } $fileCount = (int) ($materials_stats['file'] ?? 0); if ($fileCount > 0) { $materialsSummaryItems[] = 'Plik - '.$fileCount; } $textCount = (int) ($materials_stats['text'] ?? 0); if ($textCount > 0) { $materialsSummaryItems[] = 'Materialy tekstowe - '.$textCount; } $linkCount = (int) ($materials_stats['link'] ?? 0); if ($linkCount > 0) { $materialsSummaryItems[] = 'Linki - '.$linkCount; } @endphp @endif @if($showMaterialsList) @forelse(($materials ?? []) as $idx => $material) @empty @endforelse
Lp Nazwa materialu Typ Opis / zrodlo
{{ $idx + 1 }} {{ $material['name'] ?? '-' }} {{ $material['type'] ?? '-' }} {{ $material['description'] ?? '-' }}
Brak materialow przypisanych do szkolenia.
@endif @endif @if($showVerificationSection)

{{ $optionalSectionNo }}. Metoda sprawdzenia wiedzy

@php $optionalSectionNo++; @endphp @if($showVerificationSummary)
{{ $verification_method_description ?? 'Brak opisu metody sprawdzenia wiedzy.' }}
@endif @if($showVerificationMetrics)
Test {{ $test['name'] ?? 'Brak testu' }} Status testu {{ $test['status'] ?? '-' }}
Prog zaliczenia {{ isset($test['passing_threshold']) && $test['passing_threshold'] !== null ? $test['passing_threshold'].'%' : '-' }} Maks. podejsc {{ $test['max_attempts'] ?? '-' }}
Limit czasu {{ !empty($test['time_limit']) ? $test['time_limit'].' min' : 'Brak limitu' }} Tryb pytan {{ $test['selection_mode'] ?? '-' }}
Liczba pytan {{ $test['questions_count'] ?? 0 }} Zakonczone podejscia {{ $test['attempts_checked'] ?? 0 }}
Laczna liczba podejsc {{ $test['attempts_total'] ?? 0 }} Uczestnicy z podejsciem {{ $test['attempted_users'] ?? 0 }}
@endif @endif @if($showAnalyticsSection && ($showAnalyticsTable || $showAnalyticsCharts))

{{ $optionalSectionNo }}. Podsumowanie analityczne

@php $optionalSectionNo++; @endphp @if($showAnalyticsTable) @foreach(($analytics_rows ?? []) as $row) @endforeach
Wskaznik Wartosc
{{ $row['label'] ?? '-' }} {{ $row['value'] ?? '-' }}
@endif @if($showAnalyticsCharts) @php $attendanceMax = 1; foreach (($attendance_chart ?? []) as $row) { $attendanceMax = max($attendanceMax, (int) ($row['value'] ?? 0)); } $resultsMax = 1; foreach (($results_chart ?? []) as $row) { $resultsMax = max($resultsMax, (int) ($row['value'] ?? 0)); } @endphp
Wykres 1: Frekwencja uczestnikow
@php $attendanceTotal = 0; foreach (($attendance_chart ?? []) as $row) { $attendanceTotal += max(0, (int) ($row['value'] ?? 0)); } @endphp @if(($isPdf || $isDocx) && $attendanceChartImage !== '')
Wykres frekwencji uczestnikow
@foreach(($attendance_chart ?? []) as $row) @php $value = (int) ($row['value'] ?? 0); $percent = $attendanceTotal > 0 ? round(($value / $attendanceTotal) * 100, 2) : 0; @endphp
{{ $row['label'] ?? '-' }} {{ $value }} ({{ $percent }}%)
@endforeach
@elseif($chartType === 'pie') @php $donutSize = 170; $donutStroke = 44; $donutCx = $donutSize / 2; $donutCy = $donutSize / 2; $donutR = ($donutSize - $donutStroke) / 2; $donutCircumference = 2 * pi() * $donutR; $donutHoleR = max(10, $donutR - ($donutStroke / 2) + 1); $attendanceSlices = []; $attendanceStart = 0.0; foreach (($attendance_chart ?? []) as $row) { $sliceValue = max(0, (int) ($row['value'] ?? 0)); if ($attendanceTotal <= 0 || $sliceValue <= 0) { continue; } $sliceAngle = round(($sliceValue / $attendanceTotal) * 360, 4); $sliceEnd = min(360, $attendanceStart + $sliceAngle); $attendanceSlices[] = ($row['color'] ?? '#999999').' '.$attendanceStart.'deg '.$sliceEnd.'deg'; $attendanceStart = $sliceEnd; } $attendancePieBackground = !empty($attendanceSlices) ? 'conic-gradient('.implode(', ', $attendanceSlices).')' : '#e5e7eb'; $attendanceOffset = 0.0; @endphp
@if($isPdf || $isDocx) @php $matrixSize = $isDocx ? 56 : 24; $cellSize = $isDocx ? 3 : 7; $center = ($matrixSize - 1) / 2; $outerRadius = ($matrixSize / 2) - 0.6; $innerRadius = $outerRadius * 0.48; $pieSlices = []; $sliceCursor = 0.0; foreach (($attendance_chart ?? []) as $row) { $sliceValue = max(0, (int) ($row['value'] ?? 0)); if ($sliceValue <= 0 || $attendanceTotal <= 0) { continue; } $sliceAngle = ($sliceValue / $attendanceTotal) * 360; $pieSlices[] = [ 'start' => $sliceCursor, 'end' => $sliceCursor + $sliceAngle, 'color' => $row['color'] ?? '#999999', ]; $sliceCursor += $sliceAngle; } if (!empty($pieSlices)) { $lastPieIdx = count($pieSlices) - 1; $pieSlices[$lastPieIdx]['end'] = 360.0; } @endphp @for($yy = 0; $yy < $matrixSize; $yy++) @for($xx = 0; $xx < $matrixSize; $xx++) @php $dx = $xx - $center; $dy = $yy - $center; $distance = sqrt(($dx * $dx) + ($dy * $dy)); $cellColor = ''; if ($distance <= $outerRadius && $distance >= $innerRadius) { $angle = rad2deg(atan2($dy, $dx)) + 90; if ($angle < 0) { $angle += 360; } foreach ($pieSlices as $slice) { if ($angle >= (float) $slice['start'] && $angle < (float) $slice['end']) { $cellColor = (string) ($slice['color'] ?? '#999999'); break; } } } @endphp @if($cellColor !== '') @else @endif @endfor @endfor
  
@else
@endif
@foreach(($attendance_chart ?? []) as $row) @php $value = (int) ($row['value'] ?? 0); $percent = $attendanceTotal > 0 ? round(($value / $attendanceTotal) * 100, 2) : 0; @endphp
{{ $row['label'] ?? '-' }} {{ $value }} ({{ $percent }}%)
@endforeach
@else @if($isPdf || $isDocx) @php $barMaxHeight = 150; @endphp @foreach(($attendance_chart ?? []) as $row) @php $value = max(0, (int) ($row['value'] ?? 0)); $height = $attendanceMax > 0 ? round(($value / $attendanceMax) * $barMaxHeight, 0) : 0; $height = $value > 0 ? max(6, (int) $height) : 0; @endphp @endforeach
{{ $value }}
@if($height > 0) @endif
 
 
{{ $row['label'] ?? '-' }}
@else
@foreach(($attendance_chart ?? []) as $row) @php $value = max(0, (int) ($row['value'] ?? 0)); $height = $attendanceMax > 0 ? round(($value / $attendanceMax) * 150, 0) : 0; $height = $value > 0 ? max(6, (int) $height) : 0; @endphp
{{ $value }}
{{ $row['label'] ?? '-' }}
@endforeach
@endif @endif
Wykres 2: Wyniki sprawdzenia wiedzy
@php $resultsTotal = 0; foreach (($results_chart ?? []) as $row) { $resultsTotal += max(0, (int) ($row['value'] ?? 0)); } @endphp @if(($isPdf || $isDocx) && $resultsChartImage !== '')
Wykres wynikow sprawdzenia wiedzy
@foreach(($results_chart ?? []) as $row) @php $value = (int) ($row['value'] ?? 0); $percent = $resultsTotal > 0 ? round(($value / $resultsTotal) * 100, 2) : 0; @endphp
{{ $row['label'] ?? '-' }} {{ $value }} ({{ $percent }}%)
@endforeach
@elseif($chartType === 'pie') @php $donutSize = 170; $donutStroke = 44; $donutCx = $donutSize / 2; $donutCy = $donutSize / 2; $donutR = ($donutSize - $donutStroke) / 2; $donutCircumference = 2 * pi() * $donutR; $donutHoleR = max(10, $donutR - ($donutStroke / 2) + 1); $resultSlices = []; $resultStart = 0.0; foreach (($results_chart ?? []) as $row) { $sliceValue = max(0, (int) ($row['value'] ?? 0)); if ($resultsTotal <= 0 || $sliceValue <= 0) { continue; } $sliceAngle = round(($sliceValue / $resultsTotal) * 360, 4); $sliceEnd = min(360, $resultStart + $sliceAngle); $resultSlices[] = ($row['color'] ?? '#999999').' '.$resultStart.'deg '.$sliceEnd.'deg'; $resultStart = $sliceEnd; } $resultPieBackground = !empty($resultSlices) ? 'conic-gradient('.implode(', ', $resultSlices).')' : '#e5e7eb'; $resultOffset = 0.0; @endphp
@if($isPdf || $isDocx) @php $matrixSize = $isDocx ? 56 : 24; $cellSize = $isDocx ? 3 : 7; $center = ($matrixSize - 1) / 2; $outerRadius = ($matrixSize / 2) - 0.6; $innerRadius = $outerRadius * 0.48; $pieSlices = []; $sliceCursor = 0.0; foreach (($results_chart ?? []) as $row) { $sliceValue = max(0, (int) ($row['value'] ?? 0)); if ($sliceValue <= 0 || $resultsTotal <= 0) { continue; } $sliceAngle = ($sliceValue / $resultsTotal) * 360; $pieSlices[] = [ 'start' => $sliceCursor, 'end' => $sliceCursor + $sliceAngle, 'color' => $row['color'] ?? '#999999', ]; $sliceCursor += $sliceAngle; } if (!empty($pieSlices)) { $lastPieIdx = count($pieSlices) - 1; $pieSlices[$lastPieIdx]['end'] = 360.0; } @endphp @for($yy = 0; $yy < $matrixSize; $yy++) @for($xx = 0; $xx < $matrixSize; $xx++) @php $dx = $xx - $center; $dy = $yy - $center; $distance = sqrt(($dx * $dx) + ($dy * $dy)); $cellColor = ''; if ($distance <= $outerRadius && $distance >= $innerRadius) { $angle = rad2deg(atan2($dy, $dx)) + 90; if ($angle < 0) { $angle += 360; } foreach ($pieSlices as $slice) { if ($angle >= (float) $slice['start'] && $angle < (float) $slice['end']) { $cellColor = (string) ($slice['color'] ?? '#999999'); break; } } } @endphp @if($cellColor !== '') @else @endif @endfor @endfor
  
@else
@endif
@foreach(($results_chart ?? []) as $row) @php $value = (int) ($row['value'] ?? 0); $percent = $resultsTotal > 0 ? round(($value / $resultsTotal) * 100, 2) : 0; @endphp
{{ $row['label'] ?? '-' }} {{ $value }} ({{ $percent }}%)
@endforeach
@else @if($isPdf || $isDocx) @php $barMaxHeight = 150; @endphp @foreach(($results_chart ?? []) as $row) @php $value = max(0, (int) ($row['value'] ?? 0)); $height = $resultsMax > 0 ? round(($value / $resultsMax) * $barMaxHeight, 0) : 0; $height = $value > 0 ? max(6, (int) $height) : 0; @endphp @endforeach
{{ $value }}
@if($height > 0) @endif
 
 
{{ $row['label'] ?? '-' }}
@else
@foreach(($results_chart ?? []) as $row) @php $value = max(0, (int) ($row['value'] ?? 0)); $height = $resultsMax > 0 ? round(($value / $resultsMax) * 150, 0) : 0; $height = $value > 0 ? max(6, (int) $height) : 0; @endphp
{{ $value }}
{{ $row['label'] ?? '-' }}
@endforeach
@endif @endif
@endif @endif
@if($isPdf) @endif