@include('Partials.sidebar')
@include('Partials.header')
{{-- ── Page Title ── --}}

My Performance

Broker dashboard — {{ $admin->name ?? 'User' }} @if(isset($currentTenant)) • {{ $currentTenant->name ?? 'Tenant' }} @endif

  1. ›
  2. My Performance
{{-- ── No linked user warning (broker-only) ── --}} @if(!isset($frontendUserId) || !$frontendUserId)
Your broker account is not linked to a frontend user account. Bookings you close on the frontend will not appear here until your admin email matches a registered user email.
@endif {{-- ── Period Filter ── --}}
@php $periods = [ 'today' => 'Today', 'this_week' => 'This Week', 'this_month' => 'This Month', 'last_month' => 'Last Month', 'this_quarter' => 'This Quarter', 'this_year' => 'This Year', ]; @endphp @foreach($periods as $val => $label) {{ $label }} @endforeach {{ \Carbon\Carbon::parse($dateFrom)->format('d M') }} – {{ \Carbon\Carbon::parse($dateTo)->format('d M Y') }}
{{-- ── KPI Cards ── --}}
@foreach([ ['Total Bookings', $totalBookings ?? 0, '#3b82f6', 'fa-bookmark'], ['Confirmed', $confirmedBookings ?? 0, '#22c55e', 'fa-check-circle'], ['Pending', $pendingBookings ?? 0, '#f59e0b', 'fa-hourglass-half'], ['Cancelled', $cancelledBookings ?? 0, '#ef4444', 'fa-times-circle'], ['Conversion Rate', ($conversionRate ?? 0).'%', '#8b5cf6', 'fa-percentage'], ['Revenue Generated', $currency.number_format($totalRevenue, 2 ?? 0), '#10b981', 'fa-coins'], ['Avg Deal Size', $currency.number_format($avgDealSize, 2 ?? 0), '#6366f1', 'fa-chart-bar'], ['Total Commission', $currency.number_format($totalCommission, 2 ?? 0), '#c9a96e', 'fa-hand-holding-usd'], ] as [$label, $val, $color, $icon])
{{ $val }}
{{ $label }}
@endforeach
{{-- ── Commission Breakdown ── --}}
Commission Breakdown
@php $commStages = [ 'pending' => ['Pending', '#f59e0b'], 'approved' => ['Approved', '#3b82f6'], 'paid' => ['Paid', '#22c55e'], 'rejected' => ['Rejected', '#ef4444'], 'cancelled' => ['Cancelled', '#94a3b8'], ]; $commMax = max(array_values($commissionBreakdown ?? []) ?: [1]); @endphp @foreach($commStages as $key => [$label, $color]) @php $amt = $commissionBreakdown[$key] ?? 0; $pct = $commMax > 0 ? round(($amt / $commMax) * 100) : 0; @endphp
{{ $label }} {{ $currency }}{{ number_format($amt, 2) }}
@endforeach
{{-- ── Period Summary ── --}}
This Period
{{ $periodBookingCnt ?? 0 }}
Bookings
{{ $currency }}{{ number_format($periodRevenue, 2 ?? 0) }}
Revenue
{{ $currency }}{{ number_format($periodCommission, 2 ?? 0) }}
Commission
{{-- ── Monthly Trend + Recent Bookings ── --}}
6-Month Trend
Recent Bookings
All Bookings
@forelse($recentBookings ?? [] as $booking) @php $bsColors = ['confirmed'=>'#22c55e','pending'=>'#f59e0b','cancelled'=>'#ef4444']; $bsColor = $bsColors[$booking->booking_status] ?? '#94a3b8'; @endphp
{{ strtoupper(substr($booking->client_name ?? 'U', 0, 1)) }}
Unit {{ $booking->plot_number }}
{{ $booking->client_name ?? '—' }}
{{ ucfirst($booking->booking_status) }}
@empty
No bookings yet.
@endforelse
@include('Partials.footer')