@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
My Tasks Wallet
{{-- 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)
{{ strtoupper(substr($log->user->name,0,2)) }}
{{ $log->user->name }}
{{ $log->user->phone ?? 'No phone' }}
{{ $log->statusLabel() }}
{{ $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')
@csrf
@endif @if(in_array($log->status, ['assigned','on_the_way']))
@csrf
@csrf
@endif
@endforeach @endif {{-- Available Pickups --}}
Available Pickups ({{ $unassigned->count() }})
@forelse($unassigned as $log)
{{ strtoupper(substr($log->user->name,0,2)) }}
{{ $log->user->name }}
{{ $log->user->phone ?? 'No phone' }}    {{ $log->created_at->diffForHumans() }}
{{ $log->user->isPremium() ? ' Premium Priority' : 'Unassigned' }}
{{ $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
@csrf
@if($log->user->phone) Call User @endif
@empty
No unassigned pickups right now
Check back soon or refresh the page.
@endforelse {{-- Completed --}} @if($completed->count() > 0)
Recently Completed
@foreach($completed as $log) @endforeach
UserCategoryWeightUser EarnedYour RewardDate
{{ $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') }}
@endif @endsection