Driver Mechanical Sweeping Panel

Start sweeping tour on your assigned vehicle. Live GPS location is tracked every 10 seconds to record distance & route map.

@if($activeTour)
@if($activeTour->status === 'paused') SWEEPING PAUSED (DISTANCE & OVERLAPS FROZEN) @else DRIVER TOUR IN PROGRESS (GPS 10s ACTIVE) @endif
@endif
@if($activeTour)
Vehicle: {{ $activeTour->vehicle->vehicle_number ?? 'Vehicle' }} @if($activeTour->route) Route: {{ $activeTour->route->name }} @endif @if($activeTour->driverDuty) {{ $activeTour->driverDuty->duty_code }} @endif Driver: {{ $activeTour->employee->full_name ?? 'Driver' }}

Driver Active Mechanical Road Sweeping Telemetry

@if($activeTour->status === 'paused') @else @endif Finish & End Driver Duty
Distance Covered
{{ number_format($activeTour->total_distance_km, 3) }} KM

● Live 10s Geo-Coordinates Calculation

Total Duration (Elapsed)
{{ $activeTour->formatted_duration }}

Started at {{ $activeTour->start_time->format('h:i:s A') }}

GPS Ping Status (10s)
{{ $activeTour->waypoints->count() }} Pings

● Satellite Tracking Active

Driver Live Trajectory Route Map Connecting GPS...

Live Tour Photos & Proof of Work

Capture street cleaning photos with GPS coordinates during active duty.

{{ $activeTour->photos->count() }} Photos Captured
@error('tourPhoto') {{ $message }} @enderror
@if($activeTour->photos->isNotEmpty())
@foreach($activeTour->photos as $photo)
{{ $photo->caption }}
{{ $photo->caption ?: 'Tour Photo' }}
{{ $photo->taken_at ? $photo->taken_at->format('h:i A') : $photo->created_at->format('h:i A') }}
@if($photo->latitude && $photo->longitude)
πŸ“ {{ round($photo->latitude, 4) }}, {{ round($photo->longitude, 4) }}
@endif
@endforeach
@endif
Finish & Conclude Duty? Are you sure you want to end this road sweeping shift?
Distance Covered: {{ number_format($activeTour->total_distance_km, 3) }} KM
Total Duration: {{ $activeTour->formatted_duration }}
This will stop live GPS telemetry and record your completed duty report for admin inspection.
Cancel Yes, Finish Duty
@else

Your Assigned Job Command Center

Track and manage active, today's scheduled, upcoming, and completed duties.

@if($tabbedDuties->isNotEmpty()) @if($viewMode === 'list')
@foreach($tabbedDuties as $duty) @php $myAssignment = $duty->assignments->firstWhere('employee_id', $driverEmployee?->id) ?? $duty->assignments->firstWhere('employee_id', auth()->user()?->employee?->id); $myVehicle = $myAssignment?->vehicle ?? $duty->vehicle; $myStatus = $myAssignment?->status ?: $duty->status; $coDriverAssignments = $duty->assignments->where('employee_id', '!=', $driverEmployee?->id ?: auth()->user()?->employee?->id); @endphp
{{ $duty->shift_name ?: ucfirst($duty->shift) }} {{ $duty->duty_code }}
{{ $duty->formatted_shift_window ?: ($duty->duty_date?->format('d M Y') ?? 'Today') }}
Assigned Route

{{ $duty->route->name ?? 'Main Sector Sweeping' }}

@if($duty->route?->operating_days) πŸ“… {{ $duty->route->formatted_operating_days }} @endif
My Vehicle: {{ $myVehicle->vehicle_number ?? 'Vehicle' }}
@if($coDriverAssignments->isNotEmpty())
Co-Drivers: @foreach($coDriverAssignments as $co) {{ $co->employee?->first_name }} @if($co->employee?->mobile_number) ({{ $co->employee->mobile_number }}) @endif{{ !$loop->last ? ', ' : '' }} @endforeach
@endif
@if($myStatus === 'in_progress') Active Job @elseif($myStatus === 'completed') βœ“ Completed @elseif($myStatus === 'missed') ⚠️ Missed @elseif($myStatus === 'cancelled') Cancelled @else @if($duty->duty_date?->isToday()) Today @else Upcoming @endif @endif
@if($myStatus === 'in_progress') @elseif($myStatus === 'completed') @elseif($myStatus === 'missed') @elseif($myStatus === 'cancelled') Cancelled @else @endif
@endforeach
@else
@foreach($tabbedDuties as $duty) @php $myAssignment = $duty->assignments->firstWhere('employee_id', $driverEmployee?->id) ?? $duty->assignments->firstWhere('employee_id', auth()->user()?->employee?->id); $myVehicle = $myAssignment?->vehicle ?? $duty->vehicle; $myStatus = $myAssignment?->status ?: $duty->status; $coDriverAssignments = $duty->assignments->where('employee_id', '!=', $driverEmployee?->id ?: auth()->user()?->employee?->id); @endphp
{{ $duty->shift_name ?: ucfirst($duty->shift) }} Shift @if($myStatus === 'in_progress') Active Job @elseif($myStatus === 'completed') βœ“ Completed @elseif($myStatus === 'missed') ⚠️ Missed Shift @elseif($myStatus === 'cancelled') Cancelled @else @if($duty->duty_date?->isToday()) Scheduled Today @else Upcoming @endif @endif
{{ $duty->duty_code }}
Assigned Route

{{ $duty->route->name ?? 'Main Sector Sweeping' }}

@if($duty->route?->operating_days) πŸ“… Runs on: {{ $duty->route->formatted_operating_days }}  |  {{ number_format((float) ($duty->route?->total_distance_km ?: $duty->route?->lanes?->sum('distance_km')), 1) }} KM @endif
Assigned Vehicle {{ $myVehicle->vehicle_number ?? 'Vehicle' }}
Shift Window {{ $duty->formatted_shift_window ?: ($duty->duty_date?->format('d M Y') ?? 'Today') }}
@if($coDriverAssignments->isNotEmpty())
Co-Drivers Assigned to this Duty:
@foreach($coDriverAssignments as $co)
{{ $co->employee?->full_name }} Vehicle: {{ $co->vehicle?->vehicle_number ?? 'Assigned' }}
@if($co->employee?->mobile_number) {{ $co->employee->mobile_number }} @endif
@endforeach
@endif @if($duty->notes)
Admin Note: {{ $duty->notes }}
@endif
@if($myStatus === 'in_progress') @elseif($myStatus === 'completed')
Download Duty PDF @if($duty->photos->isNotEmpty()) @endif
@elseif($myStatus === 'missed') @elseif($myStatus === 'cancelled')
Duty Cancelled by Operations
@else @endif
@endforeach
@endif
{{ $tabbedDuties->links() }}
@else

No Duties Found in this Tab

There are currently no duties matching your search or selected tab status.

@endif
@endif @if($showPhotosModal && $viewingTour)
Shift Photo Log

Tour Photos β€” Vehicle {{ $viewingTour->vehicle->vehicle_number ?? 'Vehicle' }}

{{ $viewingTour->start_time?->format('d M Y, h:i A') }} β€’ {{ number_format($viewingTour->total_distance_km, 2) }} KM

Total Distance Covered {{ number_format($viewingTour->total_distance_km, 3) }} KM
Total Shift Duration {{ $viewingTour->formatted_duration }}
Assigned Route {{ $viewingTour->route->name ?? 'Main Sector Sweeping' }}
@if($viewingTour->route?->lanes && $viewingTour->route->lanes->isNotEmpty())

Route Sub-Routes & Sector Segments

{{ $viewingTour->route->lanes->count() }} Sub-Routes β€’ {{ number_format($viewingTour->route->total_distance_km ?? $viewingTour->route->lanes->sum('distance_km'), 2) }} Target KM
@foreach($viewingTour->route->lanes as $lane)
{{ $loop->iteration }}. {{ $lane->lane_name }} @if($lane->notes) {{ $lane->notes }} @endif
{{ number_format($lane->distance_km, 2) }} KM
@endforeach
@endif

Captured Tour Photos

@if($viewingTour->photos->isEmpty())

No photos captured on this sweeping tour.

@else
@foreach($viewingTour->photos as $p)
{{ $p->caption }} {{ ucfirst(str_replace('_', ' ', $p->stage)) }}
{{ $p->caption ?: 'Road Sweeping Verification Photo' }}
{{ $p->taken_at ? $p->taken_at->format('d M, h:i A') : $p->created_at->format('d M, h:i A') }} @if($p->latitude && $p->longitude) πŸ“ {{ round($p->latitude, 3) }}, {{ round($p->longitude, 3) }} @endif
@endforeach
@endif
@endif @if($showStartCameraModal)

Live Photo Verification Required

Snap driver live picture to unlock & start tour

@error('startPhoto') {{ $message }} @enderror
@if($pendingStartDutyId) @else @endif
@endif @if($showEndCameraModal)

Duty Completion Live Photo

Take a live photo before finishing your sweeping tour

@error('endPhoto') {{ $message }} @enderror
@endif @if($showRouteDetailsModal && $viewingRouteDutyId) @php $modalDuty = \App\Models\DriverDuty::with(['route.lanes', 'vehicle', 'shiftMaster', 'employee', 'assignments.employee', 'assignments.vehicle'])->find($viewingRouteDutyId); $modalRoute = $modalDuty?->route; @endphp

Route & Sub-Route Telematics Details

Duty Code: {{ $modalDuty?->duty_code }}  |  Route: {{ $modalRoute?->name }}

Total Route Distance {{ number_format((float) ($modalRoute?->total_distance_km ?: $modalRoute?->lanes?->sum('distance_km')), 2) }} KM
Sub-Routes Count {{ $modalRoute?->lanes?->count() ?? 0 }} Segments
Operating Days {{ $modalRoute?->formatted_operating_days ?? 'Daily' }}

Sub-Routes & Sector Lanes Breakdown

{{ $modalRoute?->lanes?->count() ?? 0 }} Registered Sub-Routes
@if($modalRoute?->lanes && $modalRoute->lanes->isNotEmpty())
@foreach($modalRoute->lanes->sortBy('sort_order') as $idx => $lane) @endforeach
# Sub-Route / Lane Name Distance (KM) Notes & Sector Boundaries
{{ $idx + 1 }} {{ $lane->lane_name }} {{ number_format((float) $lane->distance_km, 2) }} KM {{ $lane->notes ?: 'Standard Mechanical Sweeping Sector' }}
Total Route Distance (Sum of Sub-Routes): {{ number_format((float) $modalRoute->lanes->sum('distance_km'), 2) }} KM
@else
No sub-routes or lanes registered for this route. Total Route Distance: {{ number_format((float) $modalRoute?->total_distance_km, 2) }} KM.
@endif
@endif