@extends('layouts.app') @section('title', 'Complaint Cell Dashboard') @section('content')
{{-- ========================================================= --}} {{-- HEADER --}} {{-- ========================================================= --}}

Complaint Cell Dashboard

Complaint Management & Resolution Overview
@if(request()->hasAny(['status', 'type', 'filter'])) Clear Filters @endif
{{-- ========================================================= --}} {{-- MAIN SUMMARY CARDS --}} {{-- ========================================================= --}}
{{-- TOTAL COMPLAINTS --}} {{-- TODAY / NEW COMPLAINTS --}} {{-- IN PROGRESS --}} {{-- RESOLVED --}}
{{-- ========================================================= --}} {{-- RECENT STATUS UPDATES --}} {{-- ========================================================= --}}
Recently Updated Complaints Last 24 Hours
@if($recentStatusUpdates->count() > 0)
@foreach($recentStatusUpdates as $update) {{-- Complaint ID --}} {{-- Complainant --}} {{-- Complaint Type --}} {{-- Status --}} {{-- Remarks --}} {{-- Updated By --}} {{-- Updated Time --}} {{-- View --}} @endforeach
Complaint # Complainant Type Status Remarks Updated By Updated Action
#{{ $update->complaint_id }} {{ $update->complaint->complainant_name ?? 'N/A' }} {{ $update->complaint->complaintType->type_name ?? 'N/A' }} @php $statusClass = match($update->status) { 'Resolved' => 'bg-success', 'Closed' => 'bg-dark', 'In Progress' => 'bg-warning text-dark', 'Pending' => 'bg-secondary', default => 'bg-primary' }; @endphp {{ $update->status }} {{ \Illuminate\Support\Str::limit($update->remarks, 50) }} {{ $update->user->name ?? 'System' }} {{ $update->created_at->diffForHumans() }}
{{ $update->created_at->format('d M Y h:i A') }}
@else
No recent status updates

No complaint status has been updated during the last 24 hours.

@endif
{{-- ========================================================= --}} {{-- DEADLINE BREAKDOWN --}} {{-- ========================================================= --}}
Complaint Resolution Deadline Swipe
{{-- ========================================================= --}} {{-- COMPLAINT BREAKDOWN --}} {{-- ========================================================= --}}
Complaints Breakdown
{{-- TODAY --}} {{-- THIS MONTH --}}
This Month {{ $currentMonthComplaints }}
{{-- PENDING --}} {{-- RESOLVED --}}
{{-- ========================================================= --}} {{-- CATEGORY SUMMARY --}} {{-- NOT SHOWN TO DEPARTMENT USERS --}} {{-- ========================================================= --}} @if(auth()->user()->role != 'department')
Complaints by Category
@forelse($categorySummary as $category) @php $percentage = $category['total'] > 0 ? ($category['resolved'] / $category['total']) * 100 : 0; @endphp @empty
No active complaint categories found.
@endforelse
@endif {{-- ========================================================= --}} {{-- GRAPHS --}} {{-- ========================================================= --}}
{{-- MONTHLY TREND --}}
Monthly Complaints Trend
{{-- RESOLUTION STATISTICS --}}
Complaints Resolution Stats
{{-- ============================================================= --}} {{-- CHART.JS --}} {{-- ============================================================= --}} @endsection {{-- ============================================================= --}} {{-- CSS --}} {{-- ============================================================= --}}