@extends('layouts.app') @section('title', 'Ticket Reports') @section('content')

Ticket Reports

Analytics and performance metrics

Total Tickets

{{ $stats['total'] }}

Pending

{{ $stats['pending'] }}

Resolved

{{ $stats['resolved'] }}

Avg Resolution

{{ $stats['avg_resolution_hours'] }}h

Issue Breakdown

@forelse($issueBreakdown as $issue) @php $percentage = $stats['total'] > 0 ? round(($issue->count / $stats['total']) * 100) : 0; @endphp
{{ $issue->name }} {{ $issue->count }} ({{ $percentage }}%)
@empty

No data available

@endforelse

Product Breakdown

@forelse($productBreakdown as $product) @php $percentage = $stats['total'] > 0 ? round(($product->count / $stats['total']) * 100) : 0; @endphp
{{ $product->name }} {{ $product->count }} ({{ $percentage }}%)
@empty

No data available

@endforelse

Priority Distribution

@php $priorityColors = ['urgent' => '#ef4444', 'high' => '#f97316', 'medium' => '#3b82f6', 'low' => '#9ca3af']; $priorityLabels = ['urgent' => 'Urgent', 'high' => 'High', 'medium' => 'Medium', 'low' => 'Low']; @endphp
@foreach(['urgent', 'high', 'medium', 'low'] as $priority)
{{ $priorityDistribution->get($priority)->count ?? 0 }}

{{ $priorityLabels[$priority] }}

@endforeach

Status Overview

@php $statusColors = [ 'pending' => 'bg-yellow-500', 'picked_up' => 'bg-indigo-500', 'in_progress' => 'bg-blue-500', 'transferred' => 'bg-orange-500', 'resolved' => 'bg-green-500', 'reopened' => 'bg-red-500', ]; $statusLabels = [ 'pending' => 'Pending', 'picked_up' => 'Picked Up', 'in_progress' => 'In Progress', 'transferred' => 'Transferred', 'resolved' => 'Resolved', 'reopened' => 'Reopened', ]; @endphp
@foreach($statusLabels as $status => $label)
{{ $statusDistribution->get($status)->count ?? 0 }}

{{ $label }}

@endforeach

Ticket Trend (Last 6 Months)

Department Performance

@forelse($departmentPerformance as $dept) @empty @endforelse
Department Total Resolved Avg Time
{{ $dept->name }} {{ $dept->total_tickets }} {{ $dept->resolved_tickets }} {{ $dept->avg_resolution_hours }}h
No data available

Top Staff Performance

@forelse($staffPerformance as $staff) @empty @endforelse
Staff Department Handled Resolved
{{ $staff->name }} {{ $staff->department->name ?? '-' }} {{ $staff->total_handled }} {{ $staff->resolved_count }}
No data available
@endsection