@extends('layouts.app') @section('title', 'Complaint Statistics') @section('content')

Complaint Statistics

Total Tickets
{{ $totalTickets }}
Open Tickets
{{ $openTickets }}
In Progress
{{ $inProgressTickets }}
Resolved
{{ $resolvedTickets }}
Priority Distribution
@if($priorityStats->count() > 0)
@else

No data available for priority distribution

@endif
Category Distribution
@if($categoryStats->count() > 0)
@else

No data available for category distribution

@endif
Status Overview
@php $statuses = [ 'open' => $openTickets, 'in_progress' => $inProgressTickets, 'resolved' => $resolvedTickets, 'closed' => $closedTickets ]; $total = $totalTickets; @endphp @foreach($statuses as $status => $count) @php $percentage = $total > 0 ? round(($count / $total) * 100, 2) : 0; $colorClass = [ 'open' => 'bg-warning', 'in_progress' => 'bg-info', 'resolved' => 'bg-success', 'closed' => 'bg-secondary' ][$status]; @endphp @endforeach
Status Count Percentage Progress
{{ ucfirst(str_replace('_', ' ', $status)) }} {{ $count }} {{ $percentage }}%
{{ $percentage }}%
@endsection @section('scripts') @endsection