Inspection Plan Report

@if ($report) @endif

TITLE: @if ($report->title)  {{ $report->title }} @else  N/A @endif

DOCUMENT NUMBER: @if ($report->document_number)  {{ $report->document_number }} @else  N/A @endif

AUTHORIZED BY: @if ($report->authorised_by_first_name)  {{ $report->authorised_by_first_name }} {{ $report->authorised_by_last_name }} @else  N/A @endif

ISSUE DATE: @if ($report->issue_date)  {{ $report->issue_date }} @else  N/A @endif

REVISION NUMBER: @if ($report->revision_number)  {{ $report->revision_number }} @else  N/A @endif

REVISION DATE: @if ($report->revision_date)  {{ $report->revision_date }} @else  N/A @endif

@if ($report) @endif

PRINCIPAL CONTRACTOR: @if ($report->principal_contractor)  {{ $report->principal_contractor }} @else  N/A @endif

PROJECT NAME: @if ($report->project_name)  {{ $report->project_name }} @else  N/A @endif

JOB NUMBER: @if ($report->job_number)  {{ $report->job_number }} @else  N/A @endif

BUILDING: @if ($report->building)  {{ $report->building }} @else  N/A @endif

ACTIVITY: @if ($report->activity)  {{ $report->activity }} @else  N/A @endif

OPEN DATE: @if ($report->open_date)  {{ $report->open_date }} @else  N/A @endif

ITP: @if ($report->itp_reference_number)  {{ $report->itp_reference_number }} @else  N/A @endif

CLOSE DATE: @if ($report->close_date)  {{ $report->close_date }} @else  N/A @endif

Site: @if ($report->sites_title)  {{ $report->sites_title }} @else  N/A @endif

Supervisor: @if (isset($supervisors) && $supervisors && $supervisors->count() > 0)   @foreach ($supervisors as $supervisor) {{ $supervisor->emp_personal_supervisor_detail_f_name ?? '' }} {{ $supervisor->emp_personal_supervisor_detail_last_name ?? '' }} @if (!$loop->last) , @endif @endforeach @else  N/A @endif

Forman: @if ($report->emp_personal_forman_detail_f_name)   {{ $report->emp_personal_forman_detail_f_name }} {{ $report->emp_personal_forman_detail_last_name }} @else  N/A @endif

@if ($forms)
@forelse ($forms as $stepName => $steps)
@php $step = $steps->first(); $metaHeaders = $steps->where('is_table', '0')->pluck('meta_title')->unique(); $stepImages = $steps->pluck('inspection_image')->unique(); $metaValues = $steps->where('is_table', '0')->groupBy('meta_title'); $signatures = $steps->pluck('inspection_plan_signature')->unique(); @endphp

{{ str_replace('_', ' ', $stepName) }}

@if ($step) @endif

LEVEL: @if ($step->level)  {{ $step->level }} @endif

TO LEVEL: @if ($step->to_level)  {{ $step->to_level }} @endif

POUR: @if ($step->pour)  {{ $step->pour }} @endif

ARCHITECTURAL DRAWING NUMBER: @if ($step->architectural_drawing_number)  {{ $step->architectural_drawing_number }} @endif

STRUCTURAL DRAWING NUMBER: @if ($step->structectural_drawing_number)  {{ $step->structectural_drawing_number }} @endif

POST TENSION DRAWING NUMBER: @if ($step->Post_Tension_Drawing_Number)  {{ $step->Post_Tension_Drawing_Number }} @endif

PARTIAL HANDOVER: @if ($step->partial_handover)  Yes @endif

PARTIAL HANDOVER DATE: @if ($step->partial_Handover_date)  {{ $step->partial_Handover_date }} @endif

PARTIAL HANDOVER TIME: @if ($step->partial_Handover_time)  {{ $step->partial_Handover_time }} @endif

PARTIAL HANDOVER LOCATION: @if ($step->partial_Handover_location)  {{ $step->partial_Handover_location }} @endif

COMPLETE HANDOVER: @if ($step->complete_handover)  Yes @endif

COMPLETE HANDOVER DATE: @if ($step->complete_handover_date)  {{ $step->complete_handover_date }} @endif

COMPLETE HANDOVER TIME: @if ($step->complete_handover_time)  {{ $step->complete_handover_time }} @endif

COMPLETE HANDOVER LOCATION: @if ($step->complete_handover_Location)  {{ $step->complete_handover_Location }} @endif
{{-- Blue header bar at the top --}}
Tables
@if ($metaHeaders->isNotEmpty()) @php $uniqueMetaValues = $metaValues->map(function ($values) { return $values->pluck('meta_value')->unique()->values(); }); $maxRows = $uniqueMetaValues->map->count()->max(); @endphp {{-- Table container --}}
@php $rowsPerTable = 3; $totalTables = ceil($maxRows / $rowsPerTable); @endphp @for ($tableIndex = 0; $tableIndex < $totalTables; $tableIndex++) @if ($tableIndex > 0)
@endif @foreach ($metaHeaders as $header1) @for ($rowIndex = $tableIndex * $rowsPerTable; $rowIndex < min(($tableIndex + 1) * $rowsPerTable, $maxRows); $rowIndex++) @endfor @endforeach
{{ $header1 }} @if ($uniqueMetaValues->has($header1) && isset($uniqueMetaValues[$header1][$rowIndex])) {{ $uniqueMetaValues[$header1][$rowIndex] }} @else -- @endif
@endfor
@else

No Table data available.

@endif
@if ($signatures->isNotEmpty())
@foreach ($steps->unique('inspection_plan_employee_name')->chunk(2) as $pair) @endforeach
Fastform Group Australia Pty Ltd Principal Contractor
Name: {{ $pair[0]->inspection_plan_employee_name ?? '' }} Name: @if(isset($pair[1])) {{ $pair[1]->inspection_plan_employee_name }} @endif
Signature: @php $leftSignature = $pair[0]->inspection_plan_signature; @endphp @if(is_string($leftSignature) && !empty($leftSignature)) Signature @else No signature available @endif Signature: @if(isset($pair[1])) @php $rightSignature = $pair[1]->inspection_plan_signature; @endphp @if(is_string($rightSignature) && !empty($rightSignature)) Signature @else No signature available @endif @endif
Date: {{ $pair[0]->inspection_plan_date ?? 'N/A' }} Date: @if(isset($pair[1])) {{ $pair[1]->inspection_plan_date ?? 'N/A' }} @endif
@else

No signatures available for this section.

@endif
@if ($stepImages->isNotEmpty())
Inspection Files
@foreach ($stepImages as $file) @php $extension = strtolower(pathinfo($file, PATHINFO_EXTENSION)); $filename = pathinfo($file, PATHINFO_FILENAME); @endphp @if ($extension === 'pdf')
PDF Icon
{{ $filename }}
@else
Inspection Image
@endif @endforeach
@else

No inspection images available for this step.

@endif @empty

@endforelse
Details

{{$report->description ?? ''}}

@endif