@extends('admin.layouts.layout') @include('admin.components.date-time-picker') @section('content')

{{ isset($schedule) && $schedule->id ? 'Edit Appointment' : 'Create New Appointment' }}

Schedule & Property
{{-- Tenant Selection Section --}} @if(!session('tenant_id'))

Select Tenant *

@else @endif {{-- Evaluation Types Section --}}

Evaluation Types *

Select one or more evaluation types for this appointment
{{-- Selected evaluation types will be displayed here --}}
@php // Hydrate primary inspector (prefer is_primary=1) from existing schedule if present $__primaryInspectorId = ''; $__primaryInspectorName = ''; $__primaryInspectorAvatar = asset('images/no-profile.jpg'); if(isset($schedule) && $schedule->id){ $attached = $schedule->scheduleInspectors()->with('inspector')->get(); if($attached->count()){ $primaryRow = $attached->firstWhere('is_primary', 1) ?: $attached->sortBy('id')->first(); if($primaryRow){ $__primaryInspectorId = $primaryRow->inspector_id; if($primaryRow->inspector){ $__primaryInspectorName = trim(($primaryRow->inspector->first_name ?? '') . ' ' . ($primaryRow->inspector->last_name ?? '')) ?: 'Inspector'; $avatarData = $primaryRow->inspector->avatar ?? null; if(is_array($avatarData) && !empty($avatarData['thumb'])){ $__primaryInspectorAvatar = $avatarData['thumb']; } elseif(is_array($avatarData) && !empty($avatarData['original'])) { $__primaryInspectorAvatar = $avatarData['original']; } } } } } // Preferred language removed from design @endphp

Schedule Date & Time

@php($__today = date('Y-m-d')) @php( $__prefillDateIso = isset($schedule->scheduled_date) ? $schedule->scheduled_date->format('Y-m-d') : ($prefilledDate ?? '') ) scheduled_date) && $schedule->scheduled_date->format('Y-m-d') >= $__today)) min="{{ $__today }}" @endif required>
Select date to load availability...
No slot selected.
{{-- Preferred Language removed (not in design) --}}

Property Details

Property Images

Browse / Drag & Drop

You can select multiple images (JPEG / PNG up to 5MB each)
@if(isset($scheduleImages) && $scheduleImages->count()) @foreach($scheduleImages as $img) @php($fileData = \App\Models\Masters\File::file($img)) @php($imgPath = $img->cdn->cdn_root . $img->location . '/' . $img->file_name)
Image
@endforeach @endif
@if(isset($scheduleImages) && $scheduleImages->count()) @foreach($scheduleImages as $img) @endforeach @endif

Customers

@php($existingCustomers = isset($schedule) ? $schedule->scheduleCustomers()->with('customer')->get() : collect()) @forelse($existingCustomers as $row) @php($cust = $row->customer) @if($cust) @endif @empty @endforelse
Customer Name Customer Type Property Access Permission Granted? Email Phone/Mobile Action

{{ $cust->first_name }} {{ $cust->last_name }}

{{ $cust->email }} @php($phone = \App\Helpers\Helper::formatPhone($cust->phone ?? '')) @php($mobile = \App\Helpers\Helper::formatPhone($cust->mobile ?? '')) @php($phoneDisplay = []) @php($dummy = null) {{-- ensure previous @php block closed correctly --}} @php($phoneDisplay = array_filter([ $phone ? ('P: '.$phone) : null, $mobile ? ('M: '.$mobile) : null ])) {{ $phoneDisplay ? implode(' | ', $phoneDisplay) : 'N/A' }}
Edit Delete
There are no customers.
{{-- Additional details removed --}}
@push('page_script') @php($placeApiKey = \Config::get('settings.address_auto_populate_key')) @endpush @push('page_css') @endpush @endsection