@extends('layouts.dashboard') @section('title', 'My Visits') @section('content')

My Visits

View and manage your scheduled visits

Total Visits

{{ $visits->total() }}

Scheduled

{{ $visits->where('status', 'scheduled')->count() }}

Completed

{{ $visits->where('status', 'completed')->count() }}

Today's Visits

{{ $visits->where('scheduled_date', today())->count() }}

@forelse($visits as $visit) @empty @endforelse
Date & Time
Client
Location
Status
Actions
{{ $visit->scheduled_date->format('M d, Y') }} @if($visit->scheduled_date->isToday()) Today @endif
{{ $visit->scheduled_time }}
@if($visit->started_at)
Started: {{ $visit->started_at->format('h:i A') }}
@endif @if($visit->completed_at)
Completed: {{ $visit->completed_at->format('h:i A') }}
@endif
{{ $visit->client->name }}
{{ $visit->client->contact_person ?? 'No contact' }}
{{ $visit->client->phone }}
{{ $visit->area }}, {{ $visit->city->name }}
{{ $visit->governorate->name }}
@if($visit->latitude && $visit->longitude) View on Map @endif
@php $statusColors = [ 'scheduled' => 'bg-yellow-100 text-yellow-800', 'in_progress' => 'bg-blue-100 text-blue-800', 'completed' => 'bg-green-100 text-green-800', 'cancelled' => 'bg-red-100 text-red-800' ]; @endphp {{ str_replace('_', ' ', ucfirst($visit->status)) }}
@if($visit->status == 'scheduled')
@csrf
@endif @if($visit->status == 'in_progress') @endif

No Visits Scheduled

You don't have any visits scheduled yet.

@if($visits->hasPages())
{{ $visits->links() }}
@endif
@endsection