@extends('backend.layouts.layout') @section('content')
Back to Tasks
Edit Task

{{ $task->task_name }}

Task ID: {{ $task->id }}

{{ ucfirst($task->priority) }} Priority
{{ ucfirst($task->status) }}
Description
{{ $task->description ?: 'No description provided' }}
Client
{{ $task->client->client_name }}
Assigned Employee
{{ $task->assignedEmployee->first_name }} {{ $task->assignedEmployee->last_name }}
Checklist
@if($task->checklist) @php $checklist = json_decode($task->checklist, true); if (json_last_error() === JSON_ERROR_NONE && is_array($checklist)) { echo '
    '; foreach ($checklist as $item) { echo '
  • ' . e($item) . '
  • '; } echo '
'; } else { echo $task->checklist; } @endphp @else No checklist provided @endif
Scheduled Date & Time
{{ $task->scheduled_date->format('F d, Y') }} @if($task->start_time || $task->end_time)
@if($task->start_time && $task->end_time) {{ date('h:i A', strtotime($task->start_time)) }} - {{ date('h:i A', strtotime($task->end_time)) }} @elseif($task->start_time) Starts at {{ date('h:i A', strtotime($task->start_time)) }} @elseif($task->end_time) Ends at {{ date('h:i A', strtotime($task->end_time)) }} @endif @endif
Duration
{{ $task->estimated_duration }} hours
Recurrence
@if($task->is_recurring) Recurring Task
Frequency: {{ ucfirst($task->frequency) }}
@if($task->end_date) End Date: {{ date('F d, Y', strtotime($task->end_date)) }} @endif
@else One-time Task @if($task->end_date)
End Date: {{ date('F d, Y', strtotime($task->end_date)) }} @endif @endif
@if($formattedDays)
Scheduled Days
@foreach(['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'] as $day) {{ $day }} @endforeach
@endif
Properties & Units
@if($task->taskProperties->count() > 0)
@foreach($task->taskProperties as $taskProperty)
{{ $taskProperty->property->property_name }}

{{ $taskProperty->property->address }}

@if($taskProperty->property_details) @php $details = json_decode($taskProperty->property_details, true); $allUnitsSelected = $details['all_units_selected'] ?? false; $selectedUnits = $details['selected_units'] ?? []; @endphp @if($allUnitsSelected)
All units selected
@elseif(count($selectedUnits) > 0)
Selected Units:
@foreach($selectedUnits as $unitId) @php $unitDetail = $taskProperty->property->propertyDetails ->where('id', $unitId) ->first(); @endphp @if($unitDetail) {{ $unitDetail->key }}: {{ $unitDetail->value }} @endif @endforeach
@else
Entire property selected
@endif @else
No unit details specified
@endif
@endforeach
@else
No properties assigned to this task
@endif
Task Timeline
Created
{{ $task->created_at->format('F d, Y h:i A') }}
Last Updated
{{ $task->updated_at->format('F d, Y h:i A') }}
@if($task->is_recurring && $task->end_date)
Recurrence End Date
{{ date('F d, Y', strtotime($task->end_date)) }}
@endif
Edit Task
@endsection @push('script') @endpush