@extends('crm.layouts.master') @section('title','CRM') @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 (in_array($label, ['Deposit', 'In progress', 'Meeting'], true)) { $qualifiedCount += (int) ($statusCounts[$i] ?? 0); } } $qualifiedPct = $leads > 0 ? min(100, (int) round(($qualifiedCount / max(1, $leads)) * 100)) : 0; $dealsClosed = array_sum($depositCountSeries); $revenueMonth = $tradingStats['deposits_this_month'] ?? 0; @endphp @section('main-content')

CRM

Good Day,

{{ $welcomeName }}!

@if($isManager && !empty($tradingStats))

Pending Deposits

{{ $tradingStats['pending_deposits'] }}

View all →

Pending Withdrawals

{{ $tradingStats['pending_withdrawals'] }}

View all →

Active Portal Clients

{{ $tradingStats['active_clients'] }}

KYC Pending Review

{{ $tradingStats['pending_kyc'] }}

View queue →
@else @if(Auth::user()->access_level != 'Agent')

Total Users

{{ $users->count() }}

@endif

{{ Auth::user()->access_level == 'Agent' ? 'Leads Allow' : 'Total Leads' }}

{{ $leads }}

@if(Auth::user()->access_level == 'Admin')

Offices

{{ $offices->count() }}

@endif @if(Auth::user()->access_level == 'Admin' || Auth::user()->access_level == 'Office Manager')

Desks

{{ $desks->count() }}

@endif @endif

Leads Generated

{{ $leads }}

Qualified Leads

{{ $qualifiedCount }}

{{ $qualifiedPct }}% of pipeline

Deals Closed

{{ $dealsClosed }}

Last 30 days

Revenue Generated

${{ number_format($revenueMonth, 0) }}

This month

Overview (Last 30 Days)
Lead Source
@if(count($statusLabels))
@else

No lead status data yet.

@endif
@if($isManager)
Sessions by Countries
Lead Status Funnel
@if(count($statusLabels))
@else

No funnel data yet.

@endif
Agent Performance
@endif @if($isManager)
Lead list with leads status
@foreach($leadLists as $list) @endforeach
ID# List Name Priority Office Create Date Total Leads New Call again No answer Not interested Wrong Details Deposit In progress Meeting No money Language barrier
{{ $list->id }} {{ $list->list_name }} {{ $list->priority }} {{ $list->office_names }} {{ date('d-m-Y', strtotime($list->create_date)) }} {{ $list->total }} {{ $list->new_count }} {{ $list->call_again_count }} {{ $list->no_answer_count }} {{ $list->not_interested_count }} {{ $list->wrong_details_count }} {{ $list->deposit_count }} {{ $list->in_progress_count }} {{ $list->meeting_count }} {{ $list->no_money_count }} {{ $list->language_barrier_count }}
@endif @endsection @section('page-js') @endsection