@extends('crm.layouts.master') @section('title','CRM Dashboard') @section('page-css') @endsection @php $welcomeName = explode(' ', trim(Auth::user()->name ?? 'there'))[0]; $isManager = in_array(Auth::user()->access_level, ['Admin', 'Office Manager']); $depositSeries = json_decode($deposit_amount, true) ?: []; $depositCountSeries = json_decode($deposit_count, true) ?: []; $statusLabels = json_decode($lead_status, true) ?: []; $statusCounts = json_decode($status_count, true) ?: []; $qualifiedCount = 0; foreach ($statusLabels as $i => $label) { if ($label === 'FTD') { $qualifiedCount += (int) ($statusCounts[$i] ?? 0); } } $qualifiedPct = $leads > 0 ? min(100, (int) round(($qualifiedCount / max(1, $leads)) * 100)) : 0; $dealsClosed = array_sum($depositCountSeries); $totalRevenue = $tradingStats['total_revenue'] ?? 0; $statusColors = \App\Support\LeadStatusRegistry::badgeClasses(); @endphp @section('main-content')
Good Day,
{{ now()->format('l, M j Y') }}
@if($isManager) ${{ number_format($tradingStats['client_assets'] ?? 0, 0) }} client assets @else All assigned leads @endif
{{ $qualifiedPct }}% of pipeline
@if($isManager) {{ $tradingStats['active_clients'] ?? 0 }} active clients @else Deposits approved @endif
Revenue
Active Clients
Client Assets
KYC Pending
No lead status data yet.
@endif| Lead | Country | Agent | Pipeline | Registered | Status | ||
|---|---|---|---|---|---|---|---|
|
{{ $initial }}
{{ $lead->fname }} {{ $lead->lname }}
|
{{ $lead->email }} | {{ $lead->country ?? '—' }} | {{ $lead->user->name ?? '—' }} |
|
{{ $lead->create_date }} | {{ $lead->status ?? 'New' }} |
No funnel data yet.
@endif| # | List Name | Office | Total | Need to Call | Call Back | FTD | Created |
|---|---|---|---|---|---|---|---|
| {{ $list->id }} | {{ $list->list_name }} | {{ $list->office_names }} | {{ $list->total }} | {{ $list->need_to_call_count }} | {{ $list->call_back_count }} | {{ $list->ftd_count }} | {{ date('d M Y', strtotime($list->create_date)) }} |