@extends('employee.layouts.app')
{{-- @section('page-title')
{{ __('Dashboard Overview') }}
@endsection --}}
@push('theme-script')
@endpush
@section('content')
{{ __('Dashboard Overview') }}
Tracking performance for {{ $periodLabel ?? ucfirst($period ?? 'weekly') }}
@foreach (['daily', 'weekly', 'monthly'] as $p)
@endforeach
@php
$cards = [
['title' => 'Total Leads', 'key' => 'total_leads', 'icon' => 'ti ti-target', 'bg' => '#28c76f'],
['title' => 'Active Leads', 'key' => 'active_leads', 'icon' => 'ti ti-bolt', 'bg' => '#00cfe8'],
['title' => 'Converted', 'key' => 'won_leads', 'icon' => 'ti ti-trophy', 'bg' => '#ff9f43'],
['title' => 'Lost', 'key' => 'lost_leads', 'icon' => 'ti ti-circle-x', 'bg' => '#ea5455'],
['title' => 'Invalid', 'key' => 'invalid_leads', 'icon' => 'ti ti-ban', 'bg' => '#6c757d'],
['title' => 'Unassigned', 'key' => 'unassigned_leads', 'icon' => 'ti ti-user-exclamation', 'bg' => '#7367f0'],
['title' => 'Follow-up Due', 'key' => 'followup_due', 'icon' => 'ti ti-calendar-event', 'bg' => '#f59f00'],
];
@endphp
@foreach ($cards as $card)
{{ __($card['title']) }}
{{ number_format(($stats[$card['key']]['count'] ?? 0)) }}
@php($growth = $stats[$card['key']]['growth'] ?? null)
{{ abs((int) ($growth ?? 0)) }}%
{{ __('vs prev') }}
@endforeach
| {{ __('Lead Name') }} |
{{ __('Phone Number') }} |
{{ __('Status') }} |
{{ __('Created Date') }} |
@forelse ($recentLeads as $lead)
{{ substr($lead['name'] ?? 'U', 0, 1) }}
{{ $lead['name'] ?? __('Unknown') }}
|
{{ $lead['phone'] }} |
{{ ucwords(str_replace('_', ' ', $lead['status'] ?? 'Contacted')) }}
|
{{ \Carbon\Carbon::parse($lead['created_at'])->format('d M, Y') }} |
@empty
| {{ __('No leads found') }} |
@endforelse
@endsection
@push('script-page')
@endpush