@extends('layouts.admin') @section('title', 'Dashboard') @section('page-title', 'Dashboard') @section('page-subtitle', 'Church overview and statistics') @section('content')

Total Members

{{ number_format($stats['total_members']) }}

{{ $stats['new_members_this_month'] }} this month

Active Members

{{ number_format($stats['active_members']) }}

{{ round($stats['active_members'] / max($stats['total_members'], 1) * 100) }}% of total

Visitors

{{ number_format($stats['total_visitors']) }}

{{ $stats['new_visitors_this_month'] }} this month

Follow-ups

{{ $stats['pending_follow_ups'] }}

@if($stats['overdue_follow_ups'] > 0)

{{ $stats['overdue_follow_ups'] }} overdue

@endif

Total Donations

GH₵{{ number_format($stats['total_donations'], 2) }}

GH₵{{ number_format($stats['donations_this_month'], 2) }} this month

Total Expenses

GH₵{{ number_format($stats['total_expenses'], 2) }}

GH₵{{ number_format($stats['expenses_this_month'], 2) }} this month

Upcoming Events

{{ $eventStats['upcoming_events'] }}

{{ $eventStats['events_this_month'] }} this month

Attendance Trends

Last 6 months overview

View Report
@php $totalAttendance = collect($attendanceTrends)->sum('count'); $avgAttendance = count($attendanceTrends) > 0 ? round($totalAttendance / count($attendanceTrends)) : 0; $maxAttendance = collect($attendanceTrends)->max('count') ?? 0; @endphp

{{ number_format($totalAttendance) }}

Total Attendance

{{ number_format($avgAttendance) }}

Monthly Average

{{ number_format($maxAttendance) }}

Highest Month

Membership Status

@php $statusColors = ['active' => 'bg-green-500', 'new' => 'bg-blue-500', 'inactive' => 'bg-gray-500', 'prospect' => 'bg-yellow-500', 'transferred' => 'bg-purple-500', 'deceased' => 'bg-red-500']; @endphp @foreach($membershipBreakdown as $status => $count)
{{ $status }}
{{ $count }}
@endforeach

Gender Distribution

Male
{{ $genderBreakdown['male'] }}
Female
{{ $genderBreakdown['female'] }}
@if($genderBreakdown['other'] > 0)
Other
{{ $genderBreakdown['other'] }}
@endif

Financial Overview

Last 6 months trends

Income
Expenses

GH₵{{ number_format(array_sum(array_column($financialTrends, 'income')), 0) }}

Total Income

GH₵{{ number_format(array_sum(array_column($financialTrends, 'expenses')), 0) }}

Total Expenses

GH₵{{ number_format(array_sum(array_column($financialTrends, 'net_balance')), 0) }}

Net Balance

GH₵{{ number_format(collect($financialTrends)->avg('income') ?? 0, 0) }}

Avg Monthly

Recent Donations

View All
@forelse($recentActivity['recent_donations'] as $donation)

{{ $donation->is_anonymous ? 'Anonymous' : ($donation->donor_name ?? $donation->member?->full_name ?? 'Unknown') }}

{{ $donation->donationType?->name ?? 'General' }}

GH₵{{ number_format($donation->amount, 2) }}
@empty

No recent donations

@endforelse

Upcoming Follow-ups

View All
@forelse($upcomingFollowUps as $followUp) @empty @endforelse
Date Type Member/Visitor Assigned To Status
{{ $followUp->follow_up_date->format('M d, Y') }} {{ $followUp->type }} {{ $followUp->member?->full_name ?? $followUp->visitor?->full_name ?? 'N/A' }} {{ $followUp->assignee?->name ?? 'Unassigned' }} {{ ucfirst($followUp->status) }}
No upcoming follow-ups

Upcoming Events

View All
@forelse($upcomingEvents as $event) @empty @endforelse
Event Date & Time Location Type RSVPs
{{ $event->title }}
{{ $event->start_date->format('M d, Y') }} {{ $event->start_date->format('h:i A') }}
{{ $event->location ?? 'TBD' }} {{ str_replace('_', ' ', $event->event_type) }} {{ $event->rsvps_count }}
No upcoming events
@if(count($activeFundraisers) > 0)

Active Fundraisers

View All
@foreach($activeFundraisers as $fundraiser)

{{ $fundraiser->title }}

{{ $fundraiser->type }}
Progress {{ round($fundraiser->progress_percentage, 1) }}%
GH₵{{ number_format($fundraiser->raised_amount, 0) }} of GH₵{{ number_format($fundraiser->target_amount, 0) }}
@if($fundraiser->end_date)
{{ \Carbon\Carbon::parse($fundraiser->end_date)->diffForHumans() }} View Details
@endif
@endforeach
@endif

System Trends

Last 30 days comparison

{{ $systemTrends['fundraisers']['total'] }}

Fundraisers

{{ $systemTrends['fundraisers']['active'] }} active GH₵{{ number_format($systemTrends['fundraisers']['total_raised'], 0) }} raised

{{ $systemTrends['sunday_school']['classes'] }}

Children Ministry

{{ $systemTrends['sunday_school']['students'] }} children

{{ $systemTrends['prayer_requests']['pending'] }}

Prayer Requests

{{ $systemTrends['prayer_requests']['answered_this_month'] }} answered this month

{{ $systemTrends['equipment']['available'] }}

Equipment Available

{{ $systemTrends['equipment']['total'] }} total / {{ $systemTrends['equipment']['in_maintenance'] }} in maintenance

Growth

Monthly Metrics

Members: {{ $systemTrends['growth_metrics']['members_growth'] >= 0 ? '+' : '' }}{{ $systemTrends['growth_metrics']['members_growth'] }}%
Visitors: {{ $systemTrends['growth_metrics']['visitors_growth'] >= 0 ? '+' : '' }}{{ $systemTrends['growth_metrics']['visitors_growth'] }}%
Donations: {{ $systemTrends['growth_metrics']['donations_growth'] >= 0 ? '+' : '' }}{{ $systemTrends['growth_metrics']['donations_growth'] }}%

System Analytics

Comprehensive system overview

{{ $systemAnalytics['users_count'] }}

System Users

{{ $systemAnalytics['roles_count'] }}

Roles

{{ $systemAnalytics['services_count'] }}

Services

{{ $systemAnalytics['clusters_count'] }}

Clusters

{{ $systemAnalytics['adult_members'] }}

Adult Members

{{ $systemAnalytics['minor_members'] }} minors

{{ $systemAnalytics['pending_follow_ups'] }}

Pending Follow-ups

@if($systemAnalytics['overdue_follow_ups'] > 0)

{{ $systemAnalytics['overdue_follow_ups'] }} overdue

@endif

{{ round($systemAnalytics['avg_weekly_attendance']) }}

Avg Weekly Attendance

{{ round($systemAnalytics['avg_donation']) }}

Avg Donation (GH₵)

{{ round($systemAnalytics['avg_tithe']) }}

Avg Tithe (GH₵)

{{ $systemAnalytics['total_tithes'] }}

Total Tithes Records

{{ $systemAnalytics['total_welfare'] }}

Total Welfare Records

@endsection @section('inline_scripts') @endsection