@extends('layouts.app')
@section('title','Collector Dashboard')
@push('styles')
@endpush
@section('content')
@php $collector = auth()->user(); @endphp
Collector Dashboard
{{ $collector->name }}
{{ number_format($collector->getCoins()) }} NC earned
{{ $stats['confirmed'] }} completed
{{-- Earnings Banner --}}
@if($collector->getCoins() > 0)
Total Earnings from Pickups
You earn 10% of coins per confirmed pickup
{{ number_format($collector->getCoins()) }} NC
@endif
{{-- Stats --}}
{{ $stats['pending_all'] }}
Available
{{ $stats['assigned'] }}
Assigned to Me
{{ $stats['on_the_way'] }}
On the Way
{{ $stats['confirmed'] }}
Completed
{{-- My Active Pickups --}}
@if($myPickups->count() > 0)
My Active Pickups ({{ $myPickups->count() }})
@foreach($myPickups as $log)
{{ $log->address }}
{{ ucfirst($log->waste_category) }}
@if($log->weight_kg) {{ $log->weight_kg }} kg @endif
@if($log->scheduled_date) {{ \Carbon\Carbon::parse($log->scheduled_date)->format('d M Y') }} @endif
@if($log->user->isPremium()) Premium (2x coins) @endif
@if($log->status === 'assigned')
@endif
@if(in_array($log->status, ['assigned','on_the_way']))
@endif
@endforeach
@endif
{{-- Available Pickups --}}
Available Pickups ({{ $unassigned->count() }})
@forelse($unassigned as $log)
{{ $log->address }}
{{ ucfirst($log->waste_category) }}
@if($log->weight_kg) ~{{ $log->weight_kg }} kg @endif
@if($log->scheduled_date) {{ \Carbon\Carbon::parse($log->scheduled_date)->format('d M Y') }} @endif
@if($log->scheduled_time) {{ $log->scheduled_time }} @endif
@empty
No unassigned pickups right now
Check back soon or refresh the page.
@endforelse
{{-- Completed --}}
@if($completed->count() > 0)
Recently Completed
| User | Category | Weight | User Earned | Your Reward | Date |
@foreach($completed as $log)
| {{ $log->user->name }} |
{{ ucfirst($log->waste_category) }} |
{{ $log->weight_kg ? $log->weight_kg.' kg' : '-' }} |
{{ $log->coins_earned }} NC |
+{{ max(1, (int)round($log->coins_earned * 0.10)) }} NC |
{{ $log->confirmed_at?->format('d M Y') ?? $log->updated_at->format('d M Y') }} |
@endforeach
@endif
@endsection