@extends('layouts.app') @section('title', 'Dashboard') @section('heading', 'Good morning, ' . auth()->user()->full_name . ' ✦') @section('subheading', now()->format('l, F j, Y') . ($event ? ' · ' . $event->couple_name . '\'s Wedding' : '')) @section('topbar_actions') Add Contribution @endsection @section('content') {{-- Progress Banner --}} @if($event)
Total Collected
TZS {{ number_format($stats['total_confirmed']) }} / {{ number_format($event->target_budget) }}
{{ $stats['progress_percent'] }}% of target reached TZS {{ number_format($event->target_budget - $stats['total_confirmed']) }} remaining
@foreach([['Days to Go', $stats['days_to_go']], ['Contributors', $stats['total_contributors']], ['Gifts', $stats['total_gifts']]] as [$lbl, $val])
{{ $val }}
{{ $lbl }}
@if(!$loop->last)
@endif @endforeach
@endif {{-- Stats Grid --}}
@php $cards = [ ['Cash Collected (TZS)', number_format($stats['total_confirmed']), 'rose', '↑ Today', 'M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'], ['Pending Amount (TZS)', number_format($stats['total_pending']), 'gold', 'Pending', 'M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'], ['Gifts Registered', $stats['total_gifts'], 'green', 'Total', 'M20 12v10H4V12M22 7H2v5h20V7zM12 22V7'], ['Receipts Sent', $stats['receipts_sent'], 'blue', 'Auto', 'M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2zM22 6l-10 7L2 6'], ]; $topColors = ['rose'=>'linear-gradient(90deg,var(--rose),var(--rose-light))', 'gold'=>'linear-gradient(90deg,var(--gold),var(--gold-light))', 'green'=>'linear-gradient(90deg,var(--green),#4CAF82)', 'blue'=>'linear-gradient(90deg,var(--blue),#3A7AC8)']; $bgColors = ['rose'=>'var(--rose-pale)','gold'=>'var(--gold-pale)','green'=>'var(--green-pale)','blue'=>'var(--blue-pale)']; $txtColors= ['rose'=>'var(--rose)','gold'=>'var(--gold)','green'=>'var(--green)','blue'=>'var(--blue)']; @endphp @foreach($cards as [$label, $val, $color, $badge, $icon])
{{ $badge }}
{{ $val }}
{{ $label }}
@endforeach
{{-- Two Column --}}
{{-- Contributions Table --}}
Recent Contributions
View all →
@forelse($recent_contributions as $c) @empty @endforelse
Contributor Type Amount Date Status Action
{{ strtoupper(substr($c->contributor_name ?? 'U', 0, 2)) }}
{{ $c->contributor_name ?? 'Unknown' }}
{{ $c->contributor_phone }}
{{ ucfirst($c->type) }} {{ $c->type === 'cash' ? number_format($c->amount) : '—' }} {{ $c->created_at->format('M d, H:i') }} {{ ucfirst($c->status) }} @if($c->status === 'pending')
@csrf @method('PATCH')
@else View @endif
No contributions yet. Add the first one →
{{-- Right Sidebar --}}
{{-- Quick Actions --}}
Quick Actions
@foreach([ [route('contributions.create'), 'Add Cash', 'M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'], [route('gifts.create'), 'Add Gift', 'M20 12v10H4V12M22 7H2v5h20V7zM12 22V7'], [route('contributors.index'), 'Contributors', 'M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'], [route('reports.pdf'), 'Export PDF', 'M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8zM14 2v6h6M16 13H8M16 17H8M10 9H8'], ] as [$url, $label, $path]) {{ $label }} @endforeach
{{-- Recent Gifts --}}
Gift Registry
View all →
@forelse($recent_gifts as $gift)
{{ $gift->item_name }}
{{ $gift->donor_name }}
{{ ucfirst($gift->status) }}
@empty
No gifts registered yet.
@endforelse
@endsection