{{-- The Site Visit Evaluation Form laid out as DOC/TNC/04 prints it: masthead with the logo and document block, the four company boxes, the four header lines, the rating grid with one row per area and its points beneath, then overall comments, the four recommendation boxes and the three sign-offs. Shared by the browser print view and the dompdf export; $forPdf switches to a font dompdf embeds and trims the sizes to hold one page. --}} @php use App\Models\SiteVisitEvaluation; $forPdf = $forPdf ?? false; $maxRating = SiteVisitEvaluation::MAX_RATING; // dompdf reads the logo off disk; the browser gets it over http. $logo = $forPdf ? public_path('img/gintell-logo.jpg') : asset('img/gintell-logo.jpg'); $logoExists = is_file(public_path('img/gintell-logo.jpg')); $tick = fn (bool $on) => $on ? '✓' : ' '; @endphp Site Visit Evaluation Form (SVEF) — {{ $proposal->outlet }} @unless ($forPdf)
Download as PDF
@endunless {{-- ---------------------------------------------------------- --}} {{-- Masthead --}} {{-- ---------------------------------------------------------- --}}
SITE VISIT EVALUATION FORM ( SVEF ) DOC/TNC/04
Eff Date : 1 Oct 2019
REV : 0
{{-- Company: one box ticked --}} @php $entities = array_keys(SiteVisitEvaluation::entityOptions()); @endphp @foreach ([$entities[0], $entities[1]] as $key) @endforeach @foreach ([$entities[2], $entities[3]] as $key) @endforeach
{!! $tick($evaluation->entity === $key) !!} {{ SiteVisitEvaluation::entityOptions()[$key] }}
{!! $tick($evaluation->entity === $key) !!} {{ SiteVisitEvaluation::entityOptions()[$key] }} @if ($key === SiteVisitEvaluation::ENTITY_OTHERS) {{ $evaluation->entity === $key ? $evaluation->entity_other_name : '' }} @endif
{{-- Head of the form --}} @foreach ([ 'Date' => $evaluation->visit_date?->format('d M Y'), 'Project / Mall' => $evaluation->project_mall ?: $proposal->outlet, 'Developer / Landlord' => $evaluation->developer_landlord ?: $proposal->landlord?->name, 'Agent / Direct Contact Person' => $evaluation->agent_contact_person ?: $proposal->landlord_contact_person, ] as $label => $written) @endforeach
{{ $label }} : {{ $written }}
{{-- ---------------------------------------------------------- --}} {{-- Rating grid --}} {{-- ---------------------------------------------------------- --}} @for ($n = 1; $n <= $maxRating; $n++) @endfor @foreach ($areas as $key => $area) @php $given = $evaluation->ratingFor($key); $rows = count($area['points']) + 1; @endphp {{-- The area's own row carries the rating and the remark, which span the points listed beneath it. --}} @for ($n = 1; $n <= $maxRating; $n++) @endfor @foreach ($area['points'] as $point) @endforeach @endforeach
DESCRIPTION Rating 1 ( Poor) - 5 (Excellent) Remark/ Comments
{{ $n }}
{{ $area['title'] }}{!! $tick($given === $n) !!}{{ $evaluation->remarkFor($key) }}
{{ $point }}
OVERALL RATING {{ $evaluation->rating_total !== null ? $evaluation->rating_total.' / '.SiteVisitEvaluation::maxTotal() : '' }}
{{-- Overall comments --}}
Overall Comments :
@if (filled($evaluation->overall_comments))
{{ $evaluation->overall_comments }}
@else
@endif
{{-- Recommendation --}}
Recommendation :
@php $bands = SiteVisitEvaluation::recommendationBands(); // Laid out as the form prints them: the top band first, with // KIV beside it, then reject and re-proposal underneath. $order = [ [SiteVisitEvaluation::REC_RECOMMENDED, SiteVisitEvaluation::REC_KIV], [SiteVisitEvaluation::REC_REJECT, SiteVisitEvaluation::REC_RE_PROPOSAL], ]; @endphp @foreach ($order as $pair) @foreach ($pair as $key) @endforeach @endforeach
{!! $tick($evaluation->recommendation === $key) !!} {{ $bands[$key]['label'] }} ({{ $bands[$key]['from'] }} - {{ $bands[$key]['to'] }})
{{-- Sign-off --}} @foreach ([ 'Prepared By' => ['prepared_by_name', 'prepared_on'], 'Reviewed By' => ['reviewed_by_name', 'reviewed_on'], 'Approved By' => ['approved_by_name', 'approved_on'], ] as $role => $fields) @endforeach
{{ $role }} :
Name : {{ $evaluation->{$fields[0]} }}
Date : {{ $evaluation->{$fields[1]}?->format('d M Y') }}