{{-- Part G ยง1 โ€” Pictorial observations (wizard title is on parent; note + rows + previews). Optional: pass $reportPartGPictorialObservationRows when loading from the backend. --}} @php $reportG1SingleImage = $reportG1SingleImage ?? false; $reportG1CmrLayout = $reportG1CmrLayout ?? false; $reportG1SarTheme = $reportG1SarTheme ?? false; $reportG1DefaultFirstObservation = isset($reportG1DefaultFirstObservation) ? (string) $reportG1DefaultFirstObservation : ''; $gBase = 'report.part_g.pictorial_observations.rows'; $satelliteLabel = $reportG1DefaultFirstObservation; $reportPayloadG1 = $reportPayload ?? null; $g1PayloadArr = is_array($reportPayloadG1) ? $reportPayloadG1 : []; $g1UnitMode = old( 'report.part_g.pictorial_observations.reporting_mode', report_section_reporting_mode($g1PayloadArr, 'part_g.pictorial_observations.reporting_mode') ); if (! in_array((string) $g1UnitMode, ['single', 'unit_wise'], true)) { $g1UnitMode = 'single'; } $g1UnitWise = $g1UnitMode === 'unit_wise'; $g1DefaultRow = ['specific_observations' => $satelliteLabel]; $g1UnitsForView = report_part_g_pictorial_units_for_wizard($g1PayloadArr, $g1DefaultRow); $reportDraftIdForG1 = (int) old('report_draft_id', $reportDraftId ?? 0); $mecReportIdForG1 = (int) ($mecReportIdForG1 ?? 0); $mecReportWorkflowModeG1 = $mecReportWorkflowMode ?? null; $g1RdWorkflowAddRow = $mecReportWorkflowModeG1 === 'rd'; $gRowsOld = report_part_g_pictorial_single_rows_for_wizard($g1PayloadArr, $g1DefaultRow); @endphp @push('stylesheets') @endpush
{{ __('Reporting structure') }}

Note: MEO to add only relevant pictures corroborating major deficiencies or observations.

@if (! $reportG1CmrLayout) @if ($reportG1SarTheme) @else @endif @endif @if ($reportG1SarTheme) @else @endif
@if ($reportG1CmrLayout)
@foreach ($gRowsOld as $rIdx => $row) @php $obsDefault = (string) ($row['specific_observations'] ?? ''); $obs = old($gBase.'.'.$rIdx.'.specific_observations', $obsDefault); $updatedDefault = (string) ($row['updated_observation'] ?? ''); $updatedObs = old($gBase.'.'.$rIdx.'.updated_observation', $updatedDefault); $dotBase = $gBase.'.'.$rIdx.'.'; $slotNum = str_pad((string) ($rIdx + 1), 2, '0', STR_PAD_LEFT); @endphp @endforeach
S# Specific Observations Previos Picture New Picture Updated Observation
{{ $rIdx + 1 }} @error($dotBase.'specific_observations') {{ $message }} @enderror @include('reports.partials.g1-pictorial-picture-slot', [ 'rIdx' => $rIdx, 'row' => $row, 'slot' => 'picture_a', 'reportDraftIdForG1' => $reportDraftIdForG1, 'mecReportIdForG1' => $mecReportIdForG1, 'uploadTitle' => 'Previos Picture', 'uploadHint' => 'Click or drag to upload', 'uploadIcon' => 'fa-image', 'ariaFileLabel' => 'Previos picture, row '.($rIdx + 1), 'ariaRemoveLabel' => 'previos picture', ]) @include('reports.partials.g1-pictorial-picture-slot', [ 'rIdx' => $rIdx, 'row' => $row, 'slot' => 'picture_b', 'reportDraftIdForG1' => $reportDraftIdForG1, 'mecReportIdForG1' => $mecReportIdForG1, 'uploadTitle' => 'New Picture', 'uploadHint' => 'Click or drag to upload', 'uploadIcon' => 'fa-image', 'ariaFileLabel' => 'New picture, row '.($rIdx + 1), 'ariaRemoveLabel' => 'new picture', ]) @error($dotBase.'updated_observation') {{ $message }} @enderror
@else
@foreach ($gRowsOld as $rIdx => $row) @php $obsDefault = (string) ($row['specific_observations'] ?? ''); $obs = old($gBase.'.'.$rIdx.'.specific_observations', $obsDefault); $dotBase = $gBase.'.'.$rIdx.'.'; $storageA = old($gBase.'.'.$rIdx.'.picture_a_storage', $row['picture_a_storage'] ?? ''); $storageB = old($gBase.'.'.$rIdx.'.picture_b_storage', $row['picture_b_storage'] ?? ''); $nameA = old($gBase.'.'.$rIdx.'.picture_a_original_name', $row['picture_a_original_name'] ?? ''); $nameB = old($gBase.'.'.$rIdx.'.picture_b_original_name', $row['picture_b_original_name'] ?? ''); $previewUrlA = mec_report_part_g_attachment_preview_url($reportDraftIdForG1, $mecReportIdForG1, (int) $rIdx, 'picture_a', (string) $storageA); $previewUrlB = mec_report_part_g_attachment_preview_url($reportDraftIdForG1, $mecReportIdForG1, (int) $rIdx, 'picture_b', (string) $storageB); $slotNum = str_pad((string) ($rIdx + 1), 2, '0', STR_PAD_LEFT); @endphp
@if ($reportG1SarTheme) {{ __('Specific Observations') }} @else {{ $slotNum }} description @endif
@error($dotBase.'specific_observations') {{ $message }} @enderror
{{ $reportG1SarTheme ? __('Picture') : __('Evidence pictures') }}
@if (! $reportG1SingleImage)
@endif
@endforeach
@endif
{{-- /report-g1-single-wrap --}}
@php $g1FlatIdx = 0; @endphp @foreach ($g1UnitsForView as $uIdx => $g1Unit) @php $uRows = is_array($g1Unit['rows'] ?? null) && count($g1Unit['rows']) > 0 ? $g1Unit['rows'] : [$g1DefaultRow]; $uName = old('report.part_g.pictorial_observations.units.'.$uIdx.'.unit_name', $g1Unit['unit_name'] ?? ''); @endphp
@if (! $reportG1CmrLayout) @if ($reportG1SarTheme) @else @endif @endif @if ($reportG1SarTheme) @else @endif
@if ($reportG1CmrLayout)
@foreach ($uRows as $rIdx => $row) @php $obsDefault = (string) ($row['specific_observations'] ?? ''); $obs = old('report.part_g.pictorial_observations.units.'.$uIdx.'.rows.'.$rIdx.'.specific_observations', $obsDefault); $updatedDefault = (string) ($row['updated_observation'] ?? ''); $updatedObs = old('report.part_g.pictorial_observations.units.'.$uIdx.'.rows.'.$rIdx.'.updated_observation', $updatedDefault); $dotBase = 'report.part_g.pictorial_observations.units.'.$uIdx.'.rows.'.$rIdx.'.'; $nameBase = 'report[part_g][pictorial_observations][units]['.$uIdx.'][rows]['.$rIdx.']'; @endphp @php $g1FlatIdx++; @endphp @endforeach
S# Specific Observations Previos Picture New Picture Updated Observation
{{ $rIdx + 1 }} @include('reports.partials.g1-pictorial-picture-slot', [ 'rIdx' => $rIdx, 'row' => $row, 'slot' => 'picture_a', 'nameBase' => $nameBase, 'dotBase' => $dotBase, 'previewFlatIdx' => $g1FlatIdx, 'reportDraftIdForG1' => $reportDraftIdForG1, 'mecReportIdForG1' => $mecReportIdForG1, 'uploadTitle' => 'Previos Picture', 'uploadHint' => 'Click or drag to upload', 'uploadIcon' => 'fa-image', 'ariaFileLabel' => 'Previos picture', 'ariaRemoveLabel' => 'previos picture', ]) @include('reports.partials.g1-pictorial-picture-slot', [ 'rIdx' => $rIdx, 'row' => $row, 'slot' => 'picture_b', 'nameBase' => $nameBase, 'dotBase' => $dotBase, 'previewFlatIdx' => $g1FlatIdx, 'reportDraftIdForG1' => $reportDraftIdForG1, 'mecReportIdForG1' => $mecReportIdForG1, 'uploadTitle' => 'New Picture', 'uploadHint' => 'Click or drag to upload', 'uploadIcon' => 'fa-image', 'ariaFileLabel' => 'New picture', 'ariaRemoveLabel' => 'new picture', ])
@else
@foreach ($uRows as $rIdx => $row) @php $obsDefault = (string) ($row['specific_observations'] ?? ''); $obs = old('report.part_g.pictorial_observations.units.'.$uIdx.'.rows.'.$rIdx.'.specific_observations', $obsDefault); $dotBase = 'report.part_g.pictorial_observations.units.'.$uIdx.'.rows.'.$rIdx.'.'; $nameBase = 'report[part_g][pictorial_observations][units]['.$uIdx.'][rows]['.$rIdx.']'; $storageA = old($dotBase.'picture_a_storage', $row['picture_a_storage'] ?? ''); $storageB = old($dotBase.'picture_b_storage', $row['picture_b_storage'] ?? ''); $nameA = old($dotBase.'picture_a_original_name', $row['picture_a_original_name'] ?? ''); $nameB = old($dotBase.'picture_b_original_name', $row['picture_b_original_name'] ?? ''); $previewUrlA = mec_report_part_g_attachment_preview_url($reportDraftIdForG1, $mecReportIdForG1, $g1FlatIdx, 'picture_a', (string) $storageA); $previewUrlB = mec_report_part_g_attachment_preview_url($reportDraftIdForG1, $mecReportIdForG1, $g1FlatIdx, 'picture_b', (string) $storageB); $slotNum = str_pad((string) ($rIdx + 1), 2, '0', STR_PAD_LEFT); @endphp
@if ($reportG1SarTheme) {{ __('Specific Observations') }} @else {{ $slotNum }} description @endif
{{ $reportG1SarTheme ? __('Picture') : __('Evidence pictures') }}
@if (! $reportG1SingleImage)
@endif
@php $g1FlatIdx++; @endphp @endforeach
@endif
@endforeach
@if ($reportG1CmrLayout) @include('reports.partials.g1-cmr-additional-pictures') @endif @if ($reportG1CmrLayout) @elseif ($reportG1SingleImage) @else @endif @if ($reportG1CmrLayout) @elseif ($reportG1SingleImage) @else @endif @push('scripts') @endpush