@extends('layouts.user_type.auth') @section('marketingFunnelReport')
{{-- KPI Cards Row (The main funnel visualization) --}}
@foreach($funnel_metrics as $metric) @php // Determine icon and color classes $icon_class = ''; $text_color = 'text-secondary'; $bg_opacity_color = 'rgba(108, 117, 125, 0.1)'; // Default: text-secondary (gray) if ($metric['title'] === 'Emails Sent') { $icon_class = 'fas fa-paper-plane'; $text_color = 'text-primary'; $bg_opacity_color = 'rgba(0, 123, 255, 0.1)'; } elseif ($metric['title'] === 'Delivered') { $icon_class = 'fas fa-truck'; $text_color = 'text-success'; $bg_opacity_color = 'rgba(40, 167, 69, 0.1)'; } elseif ($metric['title'] === 'Opened') { $icon_class = 'fas fa-envelope-open-text'; $text_color = 'text-warning'; $bg_opacity_color = 'rgba(255, 193, 7, 0.1)'; } elseif ($metric['title'] === 'Clicked Link') { $icon_class = 'fas fa-mouse-pointer'; $text_color = 'text-info'; $bg_opacity_color = 'rgba(23, 162, 184, 0.1)'; } elseif ($metric['title'] === 'Responded/Flagged') { $icon_class = 'fas fa-comments'; $text_color = 'text-danger'; $bg_opacity_color = 'rgba(220, 53, 69, 0.1)'; } @endphp {{-- Individual KPI Card --}}
{{-- Icon matching the rounded style in the image --}}

{{ $metric['title'] }}

{{-- Count and Percentage (bottom aligned) --}}
{{ number_format($metric['count']) }}

{{ $metric['percentage_of_total'] }}%

@endforeach
{{-- FINAL DESIGN: Total Labs Targeted Card (Simplified, matching the red-boxed area) --}}
{{-- Title and Total Count (Bolder text) --}}

Total Labs Targeted

{{ number_format($total_labs_targeted) }}

{{-- Simple List of Funnel Stages (Plain text as requested) --}}

Sent

Delivered

Opened

Clicked Link

Responded

{{-- END: KPI Cards Row --}} {{-- Detailed Email Log Table --}}
Detailed Email Log
@forelse($log_entries as $index => $log) @empty @endforelse
Sr. No. Customer Name Email Sent Date Subject Current Progress Action

{{ $index + 1 }}

{{ $log['lab_name'] }}

{{ $log['email'] }}

{{ $log['sent_date'] }}

{{ $log['subject'] }}

@php // Determine badge color based on progress $badge_color = 'primary'; if (str_contains($log['progress'], 'Clicked')) $badge_color = 'info'; elseif (str_contains($log['progress'], 'Opened')) $badge_color = 'warning'; elseif (str_contains($log['progress'], 'Delivered')) $badge_color = 'success'; @endphp {{ $log['progress'] }} View Log

No email logs found for the selected filters.

@endsection