@extends('layouts.app') @section('content')
DATA Performa Landingpage
@foreach ($datas as $item) @php // Initialize totals for each landing page $totalSpent = 0; $totalContact = 0; $totalCPContact = 0; $performanceCount = 0; @endphp
@foreach ($item['performances'] as $detail) @php $tanggalDetail = \Carbon\Carbon::parse($detail['tanggal']); $startOfMonth = \Carbon\Carbon::now()->startOfMonth(); $endOfMonth = \Carbon\Carbon::now()->endOfMonth(); @endphp {{-- @if ($tanggalDetail->between($startOfMonth, $endOfMonth)) --}} @php // Calculate totals for spending and contacts $totalSpent += (float) $detail['amount_spent']; $totalContact += (int) $detail['contact'] ?? 0; $totalCPContact += (float) $detail['total_performance']; $performanceCount++; @endphp {{-- @endif --}} @endforeach
Tanggal CPContact Kontak Spent
{{ $detail['tanggal'] }} {{ number_format(round((float) $detail['total_performance']), 0, ',', '.') }} {{ $detail['contact'] ?? '-' }} Rp {{ number_format((float) $detail['amount_spent'], 0, ',', '.') }}
@endforeach
@endsection