@extends('layouts.app') @section('title', 'Rider Referrals Dashboard') @section('content')

Rider Referrals

Track referrals from boda boda riders and process weekly payouts.

{{-- Stat tiles --}}
Referrals this month
{{ number_format($tile['referrals_this_month']) }}
{{ number_format($tile['successful_this_month']) }} successful
Owed (unpaid)
KES {{ number_format($tile['owed_kes']) }}
Successful, not yet paid
Paid this month
KES {{ number_format($tile['paid_this_month_kes']) }}
Active riders
{{ number_format($tile['active_riders']) }}
{{-- Top riders this month --}}

Top Riders — This Month

@if($topRiders->isEmpty())
No successful referrals yet this month.
@else @foreach($topRiders as $r) @endforeach
Rider Referrals KES Earned
{{ $r->first_name }} {{ $r->last_name }}
{{ $r->rider_code }}
{{ number_format($r->referral_count) }} {{ number_format($r->total_amount) }}
@endif
{{-- Riders needing payout --}}

Riders Awaiting Payout

@if($needPayout->isEmpty())
No unpaid successful referrals.
@else @foreach($needPayout as $r) @endforeach
Rider M-Pesa Count Owed
{{ $r->first_name }} {{ $r->last_name }}
{{ $r->rider_code }}
{{ $r->mpesa_number }} {{ number_format($r->cnt) }} {{ number_format($r->total) }}
@endif
@endsection