@extends('layouts.dashboard') @section('title', 'Visit Management') @section('content')

Visit Management

Schedule, track, and manage field visits

Scheduled

{{ \App\Models\Visit::where('status', 'scheduled')->count() }}

Upcoming

In Progress

{{ \App\Models\Visit::where('status', 'in_progress')->count() }}

Active

Completed

{{ \App\Models\Visit::where('status', 'completed')->count() }}

Finished

Cancelled

{{ \App\Models\Visit::where('status', 'cancelled')->count() }}

Cancelled
@forelse($visits as $visit) @empty @endforelse
Date & Time
Client
Employee
Location
Status
Actions
{{ $visit->scheduled_date->format('M d, Y') }}
{{ $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->phone }}
{{ $visit->employee->name }}
{{ $visit->employee->employee_id }}
{{ $visit->area }}, {{ $visit->city->name }}
{{ $visit->governorate->name }}
@if($visit->latitude && $visit->longitude) GPS Enabled @endif
@php $statusColors = [ 'scheduled' => 'bg-blue-100 text-blue-800', 'in_progress' => 'bg-amber-100 text-amber-800', 'completed' => 'bg-emerald-100 text-emerald-800', 'cancelled' => 'bg-red-100 text-red-800' ]; $statusIcons = [ 'scheduled' => 'fa-clock', 'in_progress' => 'fa-spinner', 'completed' => 'fa-check-circle', 'cancelled' => 'fa-times-circle' ]; @endphp {{ str_replace('_', ' ', ucfirst($visit->status)) }}
@if($visit->status == 'scheduled')
@csrf
@endif @if($visit->status == 'in_progress') @endif
@csrf @method('DELETE')

No Visits Found

You haven't scheduled any visits yet. Get started by scheduling your first field visit.

Schedule Your First Visit
@if($visits->hasPages())
{{ $visits->links() }}
@endif
@endsection