@extends('components.app-layout') @section('title', 'Church Dashboard') @php $dynamicSubtitle = 'Welcome to ' . ($organizationSettings['name'] ?? 'Presbyterian Church of Ghana') . ' Management System'; @endphp @section('subtitle', $dynamicSubtitle) @section('content')
@if($organizationSettings['logo'])
Organization Logo
@else
@endif

Welcome to {{ $organizationSettings['name'] }}

{{ $organizationSettings['slogan'] }}

Empowering our congregation through digital ministry management and community connection

{{ $churchStats['total_members'] ?? 0 }}
Members
{{ $churchStats['total_families'] ?? 0 }}
Families
{{ $churchStats['total_events'] ?? 0 }}
Total Events
{{ number_format($churchStats['sms_credits'] ?? 0, 2) }}
SMS Credits
@if(($churchStats['sms_credits'] ?? 0) == 0)
Check API Config
@endif

Active Members

{{ $churchStats['active_members'] ?? 9 }}

{{ $churchStats['active_members'] ?? 9 }} active {{ ($churchStats['total_members'] ?? 9) - ($churchStats['active_members'] ?? 9) }} inactive

Church Families

{{ $churchStats['total_families'] ?? 0 }}

Growing community

Active Ministries

{{ $churchStats['total_ministries'] ?? 0 }}

Serving together

Donations {{ date('Y') }}

GHS {{ number_format($churchStats['total_donations_this_year'] ?? 0) }}

Faithful giving

New Members

{{ $memberStats['new_members_this_month'] ?? 0 }}

This month {{ $memberStats['new_members_this_year'] ?? 0 }} this year

Baptized Members

{{ $memberStats['baptized_members'] ?? 0 }}

{{ round((($memberStats['baptized_members'] ?? 0) / max($churchStats['total_members'], 1)) * 100) }}% of total

Ministry Members

{{ $ministryStats['total_ministry_members'] ?? 0 }}

{{ round((($ministryStats['total_ministry_members'] ?? 0) / max($churchStats['total_members'], 1)) * 100) }}% engaged

Reachable Members

{{ $memberStats['members_with_email'] + $memberStats['members_with_phone'] ?? 0 }}

{{ $memberStats['members_with_email'] ?? 0 }} email {{ $memberStats['members_with_phone'] ?? 0 }} phone

No. of Birthdays This Month

{{ $churchStats['birthdays_this_month'] ?? 2 }}

{{ $churchStats['birthdays_this_week'] ?? 0 }} this week

No. of Payments

{{ $churchStats['total_payments'] ?? 0 }}

{{ $churchStats['payments_this_month'] ?? 0 }} this month

Recent Church Activities

Latest updates
@if(isset($recentMembers) && $recentMembers->count() > 0) @foreach($recentMembers as $member)

New member joined

{{ $member->full_name }} from {{ $member->family->family_name ?? 'Unknown' }} family

Member ID: {{ $member->member_id }} {{ $member->created_at->diffForHumans() }}
@endforeach @endif @if(isset($recentDonations) && $recentDonations->count() > 0) @foreach($recentDonations->take(3) as $donation)

New donation received

GHS {{ number_format($donation->amount, 2) }} - {{ ucfirst($donation->type) }}

{{ $donation->member->full_name ?? 'Anonymous' }} {{ $donation->created_at->diffForHumans() }}
@endforeach @endif @if((!isset($recentMembers) || $recentMembers->count() == 0) && (!isset($recentDonations) || $recentDonations->count() == 0))

No recent church activities

Activities will appear here as they happen

@endif

Upcoming Events

View all
@if(isset($upcomingEvents) && $upcomingEvents->count() > 0)
@foreach($upcomingEvents as $event)

{{ $event->title }}

{{ $event->ministry->name ?? 'General' }}

{{ $event->start_datetime->format('M j, Y') }} {{ $event->start_datetime->format('g:i A') }}
@endforeach
@else

No upcoming events

Schedule your next church event

@endif

Membership Growth

{{ date('Y') }} Overview

Donation Trends

{{ date('Y') }} Monthly Overview

GHS {{ number_format(array_sum($monthlyDonations)) }}
Total {{ date('Y') }}

PCG Year Groups

Presbyterian Church of Ghana age classifications

@if($memberStats['unassigned_year_group'] > 0)
{{ $memberStats['unassigned_year_group'] }} unassigned
@endif
@foreach($yearGroupStats as $yearGroup)
@if($yearGroup->name == "Children's Service") @elseif($yearGroup->name == "Junior Youth") @elseif($yearGroup->name == "Young People's Guild") @elseif($yearGroup->name == "Young Adults' Fellowship") @else @endif
{{ $yearGroup->members_count }}
{{ $yearGroup->abbreviation }}
{{ $yearGroup->name }}
{{ $yearGroup->min_age }}-{{ $yearGroup->max_age == 999 ? '∞' : $yearGroup->max_age }} years
@if($yearGroup->active_members_count != $yearGroup->members_count)
{{ $yearGroup->active_members_count }} active
@endif
@endforeach
@if($yearGroupStats->isEmpty())

No year groups configured

Set up PCG year groups to see member distribution

@endif
@endsection