@extends('layouts.app') @section('title', 'Dashboard') @section('page-specific-style') @endsection @section('content')

Overview

Spend

${{ formatNumberShort($totalSpend) }}

Revenue

${{ formatNumberShort($totalRevenue) }}

Profit

${{ formatNumberShort($totalProfit) }}

Leads

{{ formatNumberShort($totalLeadCount) }}

Conversions

{{ formatNumberShort($totalConversions) }}

CPA

${{ formatNumberShort($dashboardCpa) }}

{{--
Monthly Premium

${{ formatNumberShort($totalPremium) }}

Annualized Premium

${{ formatNumberShort($actualPremium) }}

--}}

Account Insights

@forelse ($accountInsights as $insight) @empty @endforelse
Source Account Name Impressions Clicks CTR CPC Conversions Spend Date
{{ strtoupper($insight->source ?? 'N/A') }} {{ $insight->account_name ?? 'N/A' }} {{ formatNumberShort($insight->impressions ?? 0) }} {{ formatNumberShort($insight->clicks ?? 0) }} {{ $insight->ctr ?? 0 }} {{ $insight->cpc ?? 0 }} {{ formatNumberShort($insight->conversions ?? 0) }} ${{ number_format($insight->spend ?? 0, 2) }} {{ $insight->date_start ? \Carbon\Carbon::parse($insight->date_start)->format('j M Y') : 'N/A' }}
Data not found!
Total {{ formatNumberShort($accountInsightsTotals->impressions ?? 0) }} {{ formatNumberShort($accountInsightsTotals->clicks ?? 0) }} {{ formatNumberShort($accountInsightsTotals->conversions ?? 0) }} ${{ number_format($accountInsightsTotals->spend ?? 0, 2) }}

Campaign Insights

@forelse ($campaignInsights as $insight) @empty @endforelse
Source Campaign Name Impressions Clicks Spend Conversions Date
{{ strtoupper($insight->source ?? 'N/A') }} {{ $insight->campaign_name ?? 'N/A' }} {{ formatNumberShort($insight->impressions ?? 0) }} {{ formatNumberShort($insight->clicks ?? 0) }} ${{ number_format($insight->spend ?? 0, 2) }} {{ formatNumberShort($insight->conversions ?? 0) }} {{ $insight->date_start ? \Carbon\Carbon::parse($insight->date_start)->format('j M Y') : 'N/A' }}
Data not found!
Total {{ formatNumberShort($campaignInsightsTotals->impressions ?? 0) }} {{ formatNumberShort($campaignInsightsTotals->clicks ?? 0) }} ${{ number_format($campaignInsightsTotals->spend ?? 0, 2) }} {{ formatNumberShort($campaignInsightsTotals->conversions ?? 0) }}

Ad Insights

@forelse ($adInsights as $insight) @empty @endforelse
Source Name Impressions Clicks Spend Date
{{ strtoupper($insight->source ?? 'N/A') }} {{ $insight->name ?? 'N/A' }} {{ formatNumberShort($insight->impressions ?? 0) }} {{ formatNumberShort($insight->clicks ?? 0) }} ${{ number_format($insight->spend ?? 0, 2) }} {{ $insight->date_start ? \Carbon\Carbon::parse($insight->date_start)->format('j M Y') : 'N/A' }}
Data not found!
Total {{ formatNumberShort($adInsightsTotals->impressions ?? 0) }} {{ formatNumberShort($adInsightsTotals->clicks ?? 0) }} ${{ number_format($adInsightsTotals->spend ?? 0, 2) }}

Leads

@forelse($summary as $source => $counts) @empty @endforelse @if(count($summary) > 0) @if (($totals['new'] - array_sum(array_column($summary, 'new'))) > 0 || ($totals['open'] - array_sum(array_column($summary, 'open'))) > 0 || ($totals['won'] - array_sum(array_column($summary, 'won'))) > 0 || ($totals['closed'] - array_sum(array_column($summary, 'closed'))) > 0) @endif @endif @if(count($summary) > 0) @endif
Source New Open Won Closed
{{ $source == '' || $source == null ? 'Null' : $source }} {{ $counts['new'] }} {{ $counts['open'] }} {{ $counts['won'] }} {{ $counts['closed'] }}
Data not found!
Null {!! $totals['new'] - array_sum(array_column($summary, 'new')) > 0 ? $totals['new'] - array_sum(array_column($summary, 'new')) : 0 !!} {!! $totals['open'] - array_sum(array_column($summary, 'open')) > 0 ? $totals['open'] - array_sum(array_column($summary, 'open')) : 0 !!} {!! $totals['won'] - array_sum(array_column($summary, 'won')) > 0 ? $totals['won'] - array_sum(array_column($summary, 'won')) : 0 !!} {!! $totals['closed'] - array_sum(array_column($summary, 'closed')) > 0 ? $totals['closed'] - array_sum(array_column($summary, 'closed')) : 0 !!}
Total {{ $totals['new'] }} {{ $totals['open'] }} {{ $totals['won'] }} {{ $totals['closed'] }}
@php $hasData = false; @endphp @forelse($assignedToUsers as $user) @php $new = $agentSummary[$user->id]['new'] ?? 0; $open = $agentSummary[$user->id]['open'] ?? 0; $won = $agentSummary[$user->id]['won'] ?? 0; $closed = $agentSummary[$user->id]['closed'] ?? 0; @endphp @if($new != 0 || $open != 0 || $won != 0 || $closed != 0) @php $hasData = true; @endphp @endif @empty @endforelse @if ($hasData) @php $agentTotals = [ 'new' => array_sum(array_column($agentSummary, 'new')), 'open' => array_sum(array_column($agentSummary, 'open')), 'won' => array_sum(array_column($agentSummary, 'won')), 'closed' => array_sum(array_column($agentSummary, 'closed')) ]; @endphp @if (($totals['new'] - $agentTotals['new']) > 0 || ($totals['open'] - $agentTotals['open']) > 0 || ($totals['won'] - $agentTotals['won']) > 0 || ($totals['closed'] - $agentTotals['closed']) > 0) @endif @endif @if($hasData) @else @endif
Agent New Open Won Closed
{{ $user->name }} {{ $new }} {{ $open }} {{ $won }} {{ $closed }}
No agents found
Null {{-- sum of new from the able and minus $$totalLeadCount --}} {!! $totals['new'] - $agentTotals['new'] > 0 ? $totals['new'] - $agentTotals['new'] : 0 !!} {!! $totals['open'] - $agentTotals['open'] > 0 ? $totals['open'] - $agentTotals['open'] : 0 !!} {!! $totals['won'] - $agentTotals['won'] > 0 ? $totals['won'] - $agentTotals['won'] : 0 !!} {!! $totals['closed'] - $agentTotals['closed'] > 0 ? $totals['closed'] - $agentTotals['closed'] : 0 !!}
Total {{ $totals['new'] }} {{ $totals['open'] }} {{ $totals['won'] }} {{ $totals['closed'] }}
No data found
@endsection @section('page-specific-script') @endsection