@extends('layouts.app') @section('content') {{-- PAGE HEADER WITH BREADCRUMB --}}
{{-- Title Section: Kutumia icon na title kwenye mstari mmoja --}}
{{-- Icon Kubwa na Rangi --}}
Contributions Differences Analysis
{{-- Breadcrumb Path Section --}}
{{-- IMPROVED FILTER CARD --}}
{{-- CARD HEADER: Title na Count --}}
{{-- Title kuu ya Filter --}}
Filter Options
{{-- Count ya records --}} @if($differences instanceof \Illuminate\Pagination\LengthAwarePaginator)
Total Records: {{ number_format($differences->total()) }}
@endif
{{-- CARD BODY: Form ya Filters --}}
{{-- DATE RANGE FILTER --}}
Select two consecutive months for comparison
{{-- DEPARTMENT FILTER --}}
Filter by specific department
{{-- ACTION BUTTONS --}}
{{-- Filter Button --}} {{-- Export Button --}} @if($differences instanceof \Illuminate\Pagination\LengthAwarePaginator && $differences->total() > 0) Export CSV @endif
{{-- QUICK FILTERS --}}
Quick Filters: Reset All
{{-- MAIN RESULTS CARD --}} @if($differences instanceof \Illuminate\Pagination\LengthAwarePaginator && $differences->total() > 0)
{{-- Kurekebisha hitilafu ya 'access array offset on value of type int' --}} @php // Pata items za ukurasa wa sasa kama Collection $dataCollection = collect($differences->items()); // Filter na kupata MonthYears zote kwa uangalifu $monthYears = $dataCollection->flatMap(function($diff) { if (is_array($diff) && isset($diff['details'])) { return array_keys($diff['details']); } return []; })->unique()->sort()->values()->toArray(); @endphp @foreach($monthYears as $my) @endforeach @forelse($differences as $difference) {{-- SN sahihi inazingatia ukurasa --}} @foreach($monthYears as $my) @endforeach @empty @endforelse
SN Name Monthly Salary Vote Code Department Change{{ \Carbon\Carbon::parse($my . '-01')->format('M Y') }}Action
{{ ($differences->currentPage() - 1) * $differences->perPage() + $loop->iteration }} {{ $difference['firstName'] }} {{ $difference['middleName'] }} {{ $difference['lastName'] }} {{ number_format($difference['monthlySalary'], 2) }} {{ $difference['voteCode'] }} {{ $difference['deptName'] }} @if ($difference['change_comment'] === 'Increase') Increase @elseif ($difference['change_comment'] === 'Decrease') Decrease @endif {{ number_format($difference['details'][$my] ?? 0, 2) }} View

No records found.

{{-- PAGINATION FOOTER --}} @if($differences->hasPages()) @endif
@elseif(request()->filled('start_date') && request()->filled('end_date'))
No Differences Found
No differences in deduction amounts found for Deduction Code 667 within the selected date range and department.
@endif @endsection