@extends('layouts.app') @section('title', 'Trip Management') @section('subtitle', 'Track vehicle trips and fuel consumption') @section('content')
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif

Total Trips

{{ $stats['total_trips'] }}

Active

{{ $stats['active_trips'] }}

Completed

{{ $stats['completed_trips'] }}

Total Distance

{{ number_format($stats['total_distance']) }} km

Clear

Trip Records

@forelse($trips as $trip) @empty @endforelse
Trip Details Vehicle Driver Duration Distance Status Actions
{{ $trip->destination }}
{{ $trip->purpose }}
{{ $trip->start_time->format('M d, Y H:i') }}
{{ $trip->vehicle->registration_number }}
{{ $trip->vehicle->make }} {{ $trip->vehicle->model }}
{{ $trip->driver->user->initials }}
{{ $trip->driver->user->full_name }}
{{ $trip->driver->user->employee_id }}
@if($trip->duration) {{ floor($trip->duration / 60) }}h {{ $trip->duration % 60 }}m @else Ongoing @endif @if($trip->distance) {{ number_format($trip->distance) }} km @else - @endif {{ ucfirst($trip->status) }}
@if($trip->status === 'active') @endif

No trips found

Try adjusting your filters or start a new trip.

@if($trips->hasPages())
Showing {{ $trips->firstItem() }} to {{ $trips->lastItem() }} of {{ $trips->total() }} results
@if($trips->previousPageUrl()) Previous @endif @foreach($trips->getUrlRange(1, $trips->lastPage()) as $page => $url) @if($page == $trips->currentPage()) {{ $page }} @else {{ $page }} @endif @endforeach @if($trips->nextPageUrl()) Next @endif
@endif
@endsection