@extends('layouts.dashboard') @section('title', 'Employee Dashboard') @section('content')

Welcome back, {{ auth()->user()->name }}!

View your scheduled visits and manage your leave requests

Supervisor: {{ auth()->user()->supervisor->name ?? 'Not assigned' }}

Total Visits

{{ $stats['total_visits'] ?? 0 }}

Today's Visits

{{ $stats['todays_visits'] ?? 0 }}

Completed

{{ $stats['completed_visits'] ?? 0 }}

Leave Balance

15 days

Today's Schedule

{{ now()->format('l, F j, Y') }}

@php $todaysVisits = auth()->user()->visits() ->whereDate('scheduled_date', today()) ->with('client') ->orderBy('scheduled_time') ->get(); @endphp @if($todaysVisits->count() > 0)
@foreach($todaysVisits as $visit)
{{ $visit->client->name }}
{{ $visit->scheduled_time }} • {{ $visit->area }}
@if($visit->comments)
{{ Str::limit($visit->comments, 100) }}
@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
@if($visit->latitude && $visit->longitude) @endif
@endforeach
@else

No visits scheduled for today

Enjoy your day!

@endif

Upcoming Visits

@php $upcomingVisits = auth()->user()->visits() ->whereDate('scheduled_date', '>', today()) ->with('client') ->orderBy('scheduled_date') ->take(3) ->get(); @endphp @if($upcomingVisits->count() > 0)
@foreach($upcomingVisits as $visit)
{{ $visit->client->name }}
{{ $visit->scheduled_date->format('M d') }} • {{ $visit->scheduled_time }}
{{ $visit->area }}
@endforeach
@else

No upcoming visits

@endif
@endsection