@php($leadId = $lead->id ?? ($leadId ?? 0)) @php($confirmRoute = route('calendar.events.confirm-status')) @php($statusRoute = route('calendar.events.status')) @php($appointmentsGrouped = $leadAppointmentsGrouped ?? collect()) @php($tasksGrouped = $leadTasksGrouped ?? collect()) @php($priorityMap = $eventPriorityMap ?? []) @php($typeMap = $eventTypeMap ?? [])
{{-- Appointments Section --}}
APPOINTMENTS ({{ $appointmentsGrouped->flatten()->count() }})
@php($allAppointments = $appointmentsGrouped->flatten()) @forelse($allAppointments as $ev) @php($startDT = $ev->start_time) @php($endDT = $ev->end_time) @php($dayLabel = $startDT ? $startDT->format('l, M jS, Y') : 'Date N/A') @php($sameDay = ($startDT && $endDT) ? $startDT->isSameDay($endDT) : true) @php($start = $startDT ? $startDT->format($sameDay ? 'g:i A' : 'F j, Y g:i A') : '') @php($end = $endDT ? $endDT->format($sameDay ? 'g:i A' : 'F j, Y g:i A') : '') @php($durationHuman = \App\Helpers\Helper::humanInterval($startDT,$endDT))
{{ $dayLabel }} APPOINTMENT
Scheduled: {{ $start }} - {{ $end }}@if($durationHuman) ({{ $durationHuman }}) @endif
Set For: Avatar{{ $ev->setFor->full_name ?? 'N/A' }}
Set By: Avatar{{ $ev->setBy->full_name ?? 'N/A' }}
Description: {{ $ev->title }}
@if($ev->confirm_status == 2) Confirmed @else Confirm @endif @if($ev->seen_status == 2) Seen @else Seen ? @endif
@empty
No appointments found for this lead.
@endforelse
{{-- Tasks Section --}}
TASKS ({{ $tasksGrouped->flatten()->count() }})
@php($allTasks = $tasksGrouped->flatten()) @forelse($allTasks as $ev) @php($startDT = $ev->start_time) @php($endDT = $ev->end_time) @php($dayLabel = $startDT ? $startDT->format('l, M jS, Y') : 'Date N/A') @php($sameDay = ($startDT && $endDT) ? $startDT->isSameDay($endDT) : true) @php($start = $startDT ? $startDT->format($sameDay ? 'g:i A' : 'M j, Y g:i A') : '') @php($end = $endDT ? $endDT->format($sameDay ? 'g:i A' : 'M j, Y g:i A') : '') @php($durationHuman = \App\Helpers\Helper::humanInterval($startDT,$endDT)) @php($priorityInfo = $priorityMap[$ev->priority] ?? null)
{{ $dayLabel }} TASK
Scheduled: {{ $start }} - {{ $end }}@if($durationHuman) ({{ $durationHuman }}) @endif
Set For: Avatar{{ $ev->setFor->full_name ?? 'N/A' }}
Set By: Avatar{{ $ev->setBy->full_name ?? 'N/A' }}
Description: {{ $ev->title }}
@if($priorityInfo)
Priority: {{ $priorityInfo['name'] }}
@endif
@empty
No tasks found for this lead.
@endforelse
@push('styles') @endpush @push('page_script') @include('admin.calendar._calendar_script') @endpush