@extends('layouts.app') @php use App\Models\SiteVisitEvaluation; $saved = $evaluation->exists; $maxTotal = SiteVisitEvaluation::maxTotal(); $value = fn (string $field, $fallback = null) => old($field, $evaluation->{$field} ?? $fallback); $dateValue = fn (string $field) => old($field, $evaluation->{$field}?->format('Y-m-d')); @endphp @section('title', 'Site visit evaluation — '.$proposal->outlet) @section('heading', 'Site Visit Evaluation Form (SVEF)') @section('subheading', 'DOC/TNC/04 · Rev 0 · Eff date 1 Oct 2019 — for '.$proposal->outlet) @section('actions') @if ($saved) Print for signing PDF @endif Blank form Cancel @endsection @section('content') @if ($errors->any())
Please check the {{ $errors->count() }} highlighted {{ \Illuminate\Support\Str::plural('entry', $errors->count()) }} below.
@endif
@csrf @method('PUT')
{{-- ---------------------------------------------------- --}} {{-- Head of the form --}} {{-- ---------------------------------------------------- --}}
Company
Tick one only.
@foreach (SiteVisitEvaluation::entityOptions() as $key => $label)
@endforeach
@error('entity_other_name')
{{ $message }}
@enderror
@error('entity')
{{ $message }}
@enderror
@error('visit_date')
{{ $message }}
@enderror
From the proposal: {{ $proposal->outlet }}
@error('project_mall')
{{ $message }}
@enderror
From the proposal: {{ $proposal->landlord?->name ?: 'not set' }}
@error('developer_landlord')
{{ $message }}
@enderror
From the proposal: {{ $proposal->landlord_contact_person ?: 'not set' }}
@error('agent_contact_person')
{{ $message }}
@enderror
{{-- ---------------------------------------------------- --}} {{-- The five rated areas --}} {{-- ---------------------------------------------------- --}}
Rating — 1 (poor) to 5 (excellent) Overall rating: {{ $evaluation->rating_total ?? 0 }} / {{ $maxTotal }}
@foreach ($areas as $key => $area) @php $ratingName = "ratings[{$key}][rating]"; $current = old("ratings.{$key}.rating", $evaluation->ratingFor($key)); @endphp @endforeach
Area Description Rating Remark / comments
{{ $area['title'] }}
    @foreach ($area['points'] as $point)
  • {{ $point }}
  • @endforeach
@for ($n = 1; $n <= SiteVisitEvaluation::MAX_RATING; $n++)
@endfor
@error("ratings.{$key}.rating")
{{ $message }}
@enderror
@error("ratings.{$key}.remark")
{{ $message }}
@enderror
@error('overall_comments')
{{ $message }}
@enderror
{{-- ---------------------------------------------------- --}} {{-- Recommendation --}} {{-- ---------------------------------------------------- --}}
Recommendation
Tick one. The band your overall rating falls in is marked suggested.
@foreach (SiteVisitEvaluation::recommendationBands() as $key => $band)
@endforeach @error('recommendation')
{{ $message }}
@enderror
{{-- ---------------------------------------------------- --}} {{-- Sign-off --}} {{-- ---------------------------------------------------- --}}
Sign-off
@foreach ([ 'prepared' => 'Prepared by', 'reviewed' => 'Reviewed by', 'approved' => 'Approved by', ] as $stage => $label)
@error($stage.'_by_name')
{{ $message }}
@enderror
@error($stage.'_on')
{{ $message }}
@enderror
@endforeach
Cancel
@endsection @push('scripts') @endpush