Inspection Report
Navigate through sections
{{-- PDF Generation Progress Bar --}} {{-- PDF Generation Buttons --}}
@php $pdfUrl = route('admin.report-pdf.generate-pdf-get', $schedule->id ?? ''); if (isset($templateId) && $templateId) { $pdfUrl .= '?template_id=' . $templateId; } @endphp Generate PDF Report
@if(isset($scheduleImages) && count($scheduleImages) > 0) @if(count($scheduleImages) > 1) {{-- Image slideshow for multiple images --}}
@foreach($scheduleImages as $index => $image)
@endforeach
{{-- Navigation arrows --}} {{-- Image counter --}}
1 of {{ count($scheduleImages) }} Property Images
{{-- Dot indicators --}}
@foreach($scheduleImages as $index => $image) @endforeach
@else {{-- Single image display --}} Property Cover Image @endif @elseif(isset($coverImage) && $coverImage) {{-- Fallback to cover image --}} Property Cover Image @endif
@if(isset($inspectors) && count($inspectors) > 0) @php $inspectorArray = $inspectors->toArray(); @endphp @for($i = 0; $i < count($inspectorArray); $i += 2) {{-- First inspector in the row --}} {{-- Second inspector in the row (if exists) --}} @if(isset($inspectorArray[$i + 1])) @else {{-- Fill empty cells if odd number of inspectors --}} @endif @endfor @else {{-- Fallback when no inspectors assigned --}} @endif
Inspectors
Inspector {{ $inspectorArray[$i]['name'] }} Inspector {{ $inspectorArray[$i + 1]['name'] }}
Inspector No Inspector Assigned
@if(isset($agents) && count($agents) > 0) @foreach($agents as $agent) @endforeach @else {{-- Fallback when no agents assigned --}} @endif
Agents
Agent
{{ $agent['name'] }}
@if($agent['phone'])
{{ $agent['phone'] }}
@endif
Agent No Agent Assigned
@if(isset($customers) && count($customers) > 0) @foreach($customers as $customer) @endforeach @else {{-- Fallback when no customers assigned --}} @endif
Clients
Client
{{ $customer['name'] }}
@if($customer['phone'])
{{ $customer['phone'] }}
@endif
Client No Client Assigned
{{ $propertyAddress ?: 'Property Address Not Available' }}
@if($inspectors->isNotEmpty() && $customers->isNotEmpty()) {{ $inspectors->first()['name'] }} Prepared for {{ $customers->first()['name'] }}
@elseif($inspectors->isNotEmpty()) Inspector: {{ $inspectors->first()['name'] }}
@elseif($customers->isNotEmpty()) Prepared for {{ $customers->first()['name'] }}
@endif {{ $scheduledDateTime ?: 'Schedule Date/Time Not Available' }}
Choose the right inspector the first time!
{{-- Akash Section Dynamic Sections from Database --}} @if(isset($sectionsWithDetails) && count($sectionsWithDetails) > 0) @foreach($sectionsWithDetails as $section) @php // Check if section has any items with data to display $sectionHasContent = false; if(isset($section['item_types']) && count($section['item_types']) > 0) { foreach($section['item_types'] as $itemType) { // Check if item type has description if(isset($itemType['item_description']) && !empty($itemType['item_description'])) { $sectionHasContent = true; break; } // Check if item type has items if(isset($itemType['items']) && count($itemType['items']) > 0) { foreach($itemType['items'] as $item) { // Show section if item has comments OR if it's a section report item (item_type_id == 1) with status != 5 if(isset($item['comments']) && count($item['comments']) > 0) { $sectionHasContent = true; break 2; } if($itemType['item_type_id'] == 1 && $item['item_status'] != 5 && $item['item_is_required'] == 1) { $sectionHasContent = true; break 2; } } } } } @endphp @if($sectionHasContent) @endif @endforeach @endif
All Defects By Priority
@if(isset($priorityData) && count($priorityData) > 0) @foreach($priorityData as $priority) @endforeach @else {{-- Fallback to static data if no dynamic priority data available --}} @endif
@if(strtolower($priority['name']) == 'high') @elseif(strtolower($priority['name']) == 'medium') @elseif(strtolower($priority['name']) == 'low') @else {{ substr($priority['name'], 0, 1) }} @endif

{{ $priority['name'] }}

{{ $priority['count'] }}
{{-- VIEW ALL Button --}}

High

1

Medium

9

Low

32
Cover Letter
Letter to buyer:
@if($coverLetterContent) {!! $coverLetterContent !!} @endif
@php // Check if any inspector has a certificate $hasCertificates = false; if (isset($inspectors) && count($inspectors) > 0) { foreach ($inspectors as $inspector) { if ($inspector['certificate']) { $hasCertificates = true; break; } } } @endphp @if($hasCertificates) @endif
Inspector Profile
@if(isset($inspectors) && count($inspectors) > 0) @foreach($inspectors as $index => $inspector)
Inspector Photo @if($inspector['phone']) @endif

Name:

{{ $inspector['name'] }}

Email Address:

{{ $inspector['email'] }}

Phone:

{{ $inspector['phone'] }}

@if($inspector['license_number'])

Licence Number: {{ $inspector['license_number'] ?? 'Not Available' }}

@else {{-- Fallback if no associations --}}

Licence Number: Not Available

@endif {{-- Dynamic association information --}} @if($inspector['associations'] && count($inspector['associations']) > 0)

Associations Information:

@foreach($inspector['associations'] as $index => $association) @if($association['association_name']) {{ $association['association_name'] }} @endif @if($association['association_license_no'])   {{ $association['association_license_no'] }} @endif @if(!$loop->last && ($association['association_name'] || $association['association_license_no']))      @endif @endforeach

@else

Associations Information:

No Associations Available

@endif
@endforeach @else {{-- Fallback to static content if no inspector data --}}

Name:

No Inspector Assigned

Email Address:

Not Available

@endif

Inspectors Certification

@if(isset($inspectors) && count($inspectors) > 0) {{-- Display certificates only for inspectors who have them --}} @foreach($inspectors as $inspector) @if($inspector['certificate']) @if($inspector['certificate']['is_image']) {{-- Display image certificate --}}

{{ $inspector['name'] }} Certificate

{{ $inspector['name'] }} Certificate
@else {{-- Display PDF certificate as link --}}

{{ $inspector['name'] }} Certificate

PDF Document

{{ $inspector['certificate']['file_name'] }}

Click to view full certificate

@endif {{-- Display association logos for this inspector --}} @if(isset($inspector['associations']) && count($inspector['associations']) > 0) @php $hasLogos = false; foreach($inspector['associations'] as $assoc) { if($assoc['logo']) { $hasLogos = true; break; } } @endphp @if($hasLogos)

Association Logos

@foreach($inspector['associations'] as $association) @if($association['logo'] && $association['logo']['is_image'])
{{ $association['association_name'] ?? 'Association Logo' }}
@endif @endforeach
@endif @endif @endif {{-- Note: Removed the @else block to hide inspectors without certificates --}} @endforeach @endif
Introduction
Property & Inspection Information

Full Address

{{ isset($property) && $property->search_location ? $property->search_location : 'Address Not Available' }}

Square Footage

{{ isset($property) && $property->square_feet ? number_format($property->square_feet) . ' sq ft' : 'Not Available' }}

Year Built

{{ isset($property) && $property->year_built ? $property->year_built : 'Not Available' }}
Report Introduction
@if(isset($introductions) && count($introductions) > 0) @foreach($introductions as $index => $introduction) @if($introduction->title)

{{ $introduction->title }}

@endif
{!! $introduction->description !!}
@if($index < count($introductions) - 1)
@endif @endforeach @elseif($introductionContent) {!! $introductionContent !!} @endif
TABLE of content
{{-- Dynamic Report Sections TABLE of content --}} @if(isset($reportSections) && $reportSections->count() > 0) @foreach($reportSections as $section) @php // Check if section has any items with data $sectionHasContent = false; if(isset($sectionsWithDetails) && count($sectionsWithDetails) > 0) { foreach($sectionsWithDetails as $sectionDetail) { if($sectionDetail['id'] == $section->id) { if(isset($sectionDetail['item_types']) && count($sectionDetail['item_types']) > 0) { foreach($sectionDetail['item_types'] as $itemType) { // Check if item type has description if(isset($itemType['item_description']) && !empty($itemType['item_description'])) { $sectionHasContent = true; break; } // Check if item type has items if(isset($itemType['items']) && count($itemType['items']) > 0) { foreach($itemType['items'] as $item) { // Show section if item has comments OR if it's a section report item (item_type_id == 1) with status != 5 if(isset($item['comments']) && count($item['comments']) > 0) { $sectionHasContent = true; break 3; } if($itemType['item_type_id'] == 1 && $item['item_status'] != 5 && $item['item_is_required'] == 1) { $sectionHasContent = true; break 3; } } } } } break; } } } @endphp @if($sectionHasContent) @endif @endforeach @endif
Section Name
Cover Letter
Inspector Profile
Introduction
Comment Key Or Definition Of Recommendation
Summary
@if($section->image_url) {{ substr($section->title, 0, 1) }} @else {{ substr($section->title, 0, 1) }} @endif {{ $section->title }}
Attachment
Invoice
Closing Statement
Comment Key Or Definition Of Recommendation

The following definitions of comment descriptions represent this inspection report. All comments by the inspector should be considered before purchasing this home. Any recommendations by the inspector to repair or replace suggests a second opinion or further inspection by a qualified contractor. All costs associated with further inspection fees and repair or replacement of item, component or unit should be considered before you purchase the property.

# Image Name Description
1. Inspected Inspected(I) I visually observed the item, component or unit and if no other comments were made then it appeared to be functioning as intended allowing for normal wear and tear.
2. Not Inspected Not Inspected(N) I did not inspect this item, component or unit and made no representations of whether or not it was functioning as intended and will state a reason for not inspecting.
3. Absent Absent(A) This item, component or unit is not in this home or building and I am unable to determine if it is needed.
4. Repair/Replace Repair/Replace(R) The item, component or unit is not functioning as intended, or needs further inspection by a qualified contractor. Items, components or units that can be repaired to satisfactory condition may not need replacement.
5. High Priority High This item, component or unit has been identified as high priority and requires immediate attention.
6. Medium Priority Medium
7. Low Priority Low This item, component or unit has been identified as low priority and requires attention at a later time.
8. Repair or Replace Repair or Replace The item, component or unit is not functioning as intended. Replacement may not be required if repair can be made to satisfactory condition.
9. Safety Issues Safety Issues This defect poses an immediate hazard to occupant health or well-being. Further testing or evaluation may be recommended prior to occupancy.
10. FHA FHA This defect will likely be flagged for correction during the appraisal process if your loan is backed by the government through the Federal Housing Association.
11. HOA HOA This defect will likely fall under the responsibility of the Homeowner Association. Please consult the bylaws with your real estate agent or attorney.
12. Monitor Monitor The item, component, or unit is under suspicion and needs to be watched for further development or escalation.
All Defects By Summary
@if(isset($defectSummary) && count($defectSummary) > 0) @foreach($defectSummary as $index => $summary)

{{ $summary['name'] }}

@if($summary['count'] > 0) View All ({{ $summary['count'] }}) @else View All ({{ $summary['count'] }}) @endif
@endforeach @else {{-- Fallback to original static data if no dynamic summary --}}

Repair or Replace

View All (0)

Safety Issues

View All (0)

FHA

View All (0)
@endif
@if(isset($section['item_types']) && count($section['item_types']) > 0) @foreach($section['item_types'] as $itemType) @if($itemType['item_type_id'] != 1) @endif @endforeach {{-- Dynamic Materials Section --}} @if(isset($section['material_categories']) && count($section['material_categories']) > 0) @endif {{-- Section Report Akash --}} @foreach($section['item_types'] as $itemType) @if($itemType['item_type_id'] == 1) @php // Filter out items where item_status == 5 AND item_is_required == 0 $filteredItems = []; if(isset($itemType['items']) && count($itemType['items']) > 0) { foreach($itemType['items'] as $item) { // Exclude items with status 5 (Excluded) AND is_required 0 (Not Required) if (($item['item_status'] != 5 && $item['item_is_required'] == 1)) { $filteredItems[] = $item; } } } @endphp @if(count($filteredItems) > 0) @endif @endif @endforeach @endif
{{ $section['title'] }}
@php $hasComments = false; if(isset($itemType['items']) && count($itemType['items']) > 0) { foreach($itemType['items'] as $item) { if(isset($item['comments']) && count($item['comments']) > 0) { $hasComments = true; break; } } } @endphp @if(isset($itemType['item_description']) || $hasComments) @endif @if(isset($itemType['item_description'])) @endif {{-- Comments Section --}} @if(isset($itemType['items']) && count($itemType['items']) > 0) @foreach($itemType['items'] as $item) @if(isset($item['comments']) && count($item['comments']) > 0) @foreach($item['comments'] as $comment) @endforeach @endif @endforeach @endif
{{ $itemType['item_type_title'] }}

{{ $itemType['item_type_title'] }}

{!! nl2br(e($itemType['item_description'])) !!}

Comment - {{ $item['item_title'] }}

{{ $comment['title'] ?? $comment['item_title'] }} @if(isset($comment['location']) && $comment['location']) - {{ $comment['location'] }} @endif

{{-- Display attached files for this comment --}} @if(isset($comment['files']) && count($comment['files']) > 0) @endif
{!! $comment['description'] !!}
@foreach($comment['files'] as $file) @php $isImage = $file['is_image'] ?? (isset($file['original_name']) && preg_match('/\.(jpg|jpeg|png|gif|bmp|webp)$/i', $file['original_name'])); $isVideo = $file['is_video'] ?? (isset($file['original_name']) && preg_match('/\.(mp4|mov|avi|mkv|webm|ogg|3gp|flv|wmv)$/i', $file['original_name'])); $fileName = $file['original_name'] ?? 'Unknown File'; $fileUrl = $file['file_url'] ?? '#'; @endphp @if($isImage) {{-- Image preview with click to open in new tab --}}
{{ $fileName }}
IMG
@elseif($isVideo) {{-- Video preview with click to open in new tab --}}
VID
@else {{-- Other file types with appropriate icons --}} @php $fileIcon = '📄'; $fileExtension = pathinfo($fileName, PATHINFO_EXTENSION); $fileExtension = strtolower($fileExtension); switch ($fileExtension) { case 'pdf': $fileIcon = '📄'; break; case 'doc': case 'docx': $fileIcon = '📝'; break; case 'xls': case 'xlsx': $fileIcon = '📊'; break; case 'ppt': case 'pptx': $fileIcon = '📋'; break; case 'txt': $fileIcon = '📃'; break; case 'zip': case 'rar': case '7z': $fileIcon = '🗂️'; break; case 'mp3': case 'wav': case 'ogg': $fileIcon = '🎵'; break; default: $fileIcon = '📄'; } @endphp
{{ strtoupper($fileExtension ?: 'FILE') }}
{{ $fileIcon }}
{{ $fileName }}
@if(isset($file['label']) && $file['label'])
{{ $file['label'] }}
@endif
CLICK TO OPEN
@endif @endforeach
{{ $section['title'] }} Materials
@foreach($section['material_categories'] as $material) @endforeach

{{ $material['name'] ?: $material['title'] }}

@if(isset($material['answers']) && $material['answers'])

{{ $material['answers'] }}

@elseif($material['description'])

{!! nl2br(e($material['description'])) !!}

@endif {{-- Display material attachments --}} @if(isset($material['files']) && count($material['files']) > 0)
@foreach($material['files'] as $file) @php $isImage = $file['is_image'] ?? (isset($file['original_name']) && preg_match('/\.(jpg|jpeg|png|gif|bmp|webp)$/i', $file['original_name'])); $isVideo = $file['is_video'] ?? (isset($file['original_name']) && preg_match('/\.(mp4|mov|avi|mkv|webm|ogg|3gp|flv|wmv)$/i', $file['original_name'])); $fileName = $file['original_name'] ?? 'Unknown File'; $fileUrl = $file['file_url'] ?? '#'; @endphp @if($isImage) {{-- Image preview with click to open in new tab --}}
{{ $fileName }}
IMG
@elseif($isVideo) {{-- Video preview with click to open in new tab --}}
VID
@else {{-- Other file types with appropriate icons --}} @php $fileIcon = '📄'; $fileExtension = pathinfo($fileName, PATHINFO_EXTENSION); $fileExtension = strtolower($fileExtension); switch ($fileExtension) { case 'pdf': $fileIcon = '📄'; break; case 'doc': case 'docx': $fileIcon = '📝'; break; case 'xls': case 'xlsx': $fileIcon = '📊'; break; case 'ppt': case 'pptx': $fileIcon = '📋'; break; case 'txt': $fileIcon = '📃'; break; case 'zip': case 'rar': case '7z': $fileIcon = '🗂️'; break; case 'mp3': case 'wav': case 'ogg': $fileIcon = '🎵'; break; default: $fileIcon = '📄'; } @endphp
{{ strtoupper($fileExtension ?: 'FILE') }}
{{ $fileIcon }}
{{ $fileName }}
CLICK TO OPEN
@endif @endforeach
@endif
{{-- Comments Section --}} @if(isset($itemType['items']) && count($itemType['items']) > 0) @php $hasAnyComments = false; @endphp @foreach($itemType['items'] as $item) @if($item['item_status'] != 5 && isset($item['comments']) && count($item['comments']) > 0) @php $hasAnyComments = true; @endphp @endif @endforeach @if($hasAnyComments) @endif @foreach($itemType['items'] as $item) @if($item['item_status'] != 5 && isset($item['comments']) && count($item['comments']) > 0) {{-- Item Name Header for each item's comments --}} @foreach($item['comments'] as $comment) @endforeach @endif @endforeach @endif
{{ $itemType['item_type_title'] }} Section Report
@foreach($filteredItems as $item) {{-- Status indicators based on item_status: 1=Inspected, 2=Not Inspected, 3=Absent, 4=Repair/Replace, 5=Excluded --}} @endforeach
Section Items I N A R
{{ $item['item_title'] }} @if(isset($item['comments']) && count($item['comments']) > 0) ({{ count($item['comments']) }} comment{{ count($item['comments']) > 1 ? 's' : '' }}) @endif @if($item['item_status'] == 1) @else   @endif @if($item['item_status'] == 2) @else   @endif @if($item['item_status'] == 3) @else   @endif @if($item['item_status'] == 4) @else   @endif
(I = Inspected, N = Not Inspected, A = Absent, R = Repair/Replace)
Comment
{{ $item['item_title'] }} @php $priorities = []; foreach($item['comments'] as $comment) { if(isset($comment['priority_name']) && $comment['priority_name']) { $priorities[] = $comment['priority_name']; } } $uniquePriorities = array_unique($priorities); @endphp @if(count($uniquePriorities) > 0) @foreach($uniquePriorities as $priority) {{ $priority }} @endforeach @endif

{{ $comment['title'] ?? $item['item_title'] }} @if(isset($comment['location']) && $comment['location']) - {{ $comment['location'] }} @endif

{{-- Display attached files for this comment --}} @if(isset($comment['files']) && count($comment['files']) > 0) @endif
{!! $comment['description'] !!}
@foreach($comment['files'] as $file) @php $isImage = $file['is_image'] ?? (isset($file['original_name']) && preg_match('/\.(jpg|jpeg|png|gif|bmp|webp)$/i', $file['original_name'])); $isVideo = $file['is_video'] ?? (isset($file['original_name']) && preg_match('/\.(mp4|mov|avi|mkv|webm|ogg|3gp|flv|wmv)$/i', $file['original_name'])); $fileName = $file['original_name'] ?? 'Unknown File'; $fileUrl = $file['file_url'] ?? '#'; $fileLabel = $file['label'] ?? ''; @endphp @if($isImage) {{-- Image preview with click to open in new tab --}}
{{ $fileName }}
IMG
@elseif($isVideo) {{-- Video preview with click to open in new tab --}}
VID
@else {{-- Other file types with appropriate icons --}} @php $fileIcon = '📄'; $fileExtension = pathinfo($fileName, PATHINFO_EXTENSION); $fileExtension = strtolower($fileExtension); switch ($fileExtension) { case 'pdf': $fileIcon = '📄'; break; case 'doc': case 'docx': $fileIcon = '📝'; break; case 'xls': case 'xlsx': $fileIcon = '📊'; break; case 'ppt': case 'pptx': $fileIcon = '📋'; break; case 'txt': $fileIcon = '📃'; break; case 'zip': case 'rar': case '7z': $fileIcon = '🗂️'; break; case 'mp3': case 'wav': case 'ogg': $fileIcon = '🎵'; break; default: $fileIcon = '📄'; } @endphp
{{ strtoupper($fileExtension ?: 'FILE') }}
{{ $fileIcon }}
{{ $fileName }}
@if($fileLabel)
{{ $fileLabel }}
@endif
CLICK TO OPEN
@endif @endforeach
Attachment
@if(isset($attachments) && $attachments->count() > 0) {{-- Dynamic attachments from database --}} @foreach($attachments->chunk(4) as $chunk) @foreach($chunk as $attachment) @if(!$loop->last) @endif @endforeach {{-- Fill remaining cells if less than 4 in this row --}} @for($i = $chunk->count(); $i < 4; $i++) @if($i > 0) @endif @endfor @endforeach
@if($attachment['file_url']) @if($attachment['is_pdf']) @elseif($attachment['is_image'] ?? false) @else @endif

{{ $attachment['name'] }}

@else @if($attachment['is_pdf']) @elseif($attachment['is_image'] ?? false) @else @endif

{{ $attachment['name'] }}

@endif
   
@endif
Invoice Details

Invoice ID

INV-389-003691

 

Invoice Date

21 April 2025

 

Inspection ID

AP-389-003733

 

Invoice Status

Paid

Property Address

2222 170th Street, Hazel Crest, Illinois, USA, 60429

Invoice Note

Thank you for your business and trust!

Client Information

@if(isset($customers) && count($customers) > 0) @foreach($customers as $customer)

{{ $customer['name'] }}

@if($customer['phone'])

{{ $customer['phone'] }}

@endif @if($customer['email'])

{{ $customer['email'] }}

@endif
@endforeach @else

No Client Assigned

N/A

@endif
Fees Details Amount
Single Family Home Inspection $535.00
Total Fee $535.00
Single Family Home Inspection $50.00
Sub Total $485.00
Grand Total $485.00
Payment Details Amount

04/21/2025 | 11:28 pm

Paid by E-Transfer:Zelle

$485.00
Amount Paid $485.00
Closing Statement

RECOMMENDED NEXT STEPS

@if(isset($closingStatements) && count($closingStatements) > 0) {{-- Display all closing statements for the template --}} @foreach($closingStatements as $index => $closingStatement) @if($index > 0)
@endif @if(!empty($closingStatement['title']))

{{ $closingStatement['title'] }}

@endif
{!! $closingStatement['description'] ?? '' !!}
@endforeach @elseif(isset($closingStatementContent) && $closingStatementContent) {{-- Fallback to single closing statement --}}
{!! $closingStatementContent !!}
@else {{-- No closing statement found --}}
No closing statement available for this template.
@endif
{{-- Defect Summary Modal --}} @auth
@php $isReportCompleted = false; $completedTemplate = null; if(isset($inspectionTemplates) && $inspectionTemplates->isNotEmpty()) { if(isset($templateId) && $templateId) { // Check only the current template if templateId is specified foreach($inspectionTemplates as $template) { if($template->id == $templateId && $template->is_inspection_completed) { $isReportCompleted = true; $completedTemplate = $template; break; } } } else { // If no specific template, check if any template is completed (backward compatibility) foreach($inspectionTemplates as $template) { if($template->is_inspection_completed) { $isReportCompleted = true; $completedTemplate = $template; break; } } } } @endphp @if(!$isReportCompleted) @else
Report Already Submitted
By: {{ $completedTemplate->completedBy->full_name ?? $completedTemplate->completedBy->name ?? 'Unknown' }} on @if($completedTemplate && $completedTemplate->inspection_complete_at) @php try { $date = is_string($completedTemplate->inspection_complete_at) ? \Carbon\Carbon::parse($completedTemplate->inspection_complete_at) : $completedTemplate->inspection_complete_at; echo $date->format('m-d-Y'); } catch (\Exception $e) { echo 'Unknown date'; } @endphp @else Unknown date @endif
@endif
@endauth