@extends('layouts.app') @section('content')

My Advertisements

Create New Ad
Active Ads
{{ $ads->where('status', 'active')->count() }}
Total Impressions
{{ number_format($totalImpressions) }}
Total Clicks
{{ number_format($totalClicks) }}
Average CTR
{{ number_format($avgCtr, 2) }}%
@if($ads->isEmpty())
You have no ads yet. Click "Create New Ad" to start.
@else
@foreach($ads as $ad)
@if($ad->type === 'video') {{ $ad->title }}
@elseif($ad->type === 'image') {{ $ad->title }} @else
{{ $ad->title }}
@endif
@switch($ad->status) @case('active') Active @break @case('pending') @case('pending_payment') Pending @break @case('expired') Expired @break @default {{ ucfirst($ad->status) }} @endswitch

{{ $ad->title ?? 'Untitled Ad' }}

Impressions
{{ number_format($ad->metrics['total_impressions'] ?? 0) }}
Clicks
{{ number_format($ad->metrics['total_clicks'] ?? 0) }}
CTR
{{ number_format($ad->metrics['ctr'] ?? 0, 2) }}%
{{ $ad->start_at ? Carbon\Carbon::parse($ad->start_at)->format('M j, Y') : 'Not started' }} — {{ $ad->end_at ? Carbon\Carbon::parse($ad->end_at)->format('M j, Y') : 'No end date' }}
View Details @if($ad->status === 'active') ● Live @elseif(in_array($ad->status, ['pending', 'pending_payment'])) Complete Setup @endif
@endforeach
@endif
@endsection