@php
// Initialize chart data if not set
if (!isset($chartMonths)) {
$chartMonths = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
}
if (!isset($chartData)) {
$chartData = array_fill(0, 12, 0);
}
// Priority class helper function
if (!function_exists('getPriorityClass')) {
function getPriorityClass($priority) {
switch(strtolower($priority)) {
case 'critical': return 'priority-critical';
case 'high': return 'priority-high';
case 'medium': return 'priority-medium';
case 'low': return 'priority-low';
default: return 'priority-medium';
}
}
}
// Create dataPoints array to match CodeIgnitor structure
$dataPoints = array(
array("label"=>"New", "symbol" => "New", "y"=>$new_count1 ?? 0, "color"=>"blue"),
array("label"=>"Inprogress", "symbol" => "Inprogress", "y"=>$inprogress_count1 ?? 0, "color"=>"yellow"),
array("label"=>"Amend", "symbol" => "Amend", "y"=>$amend_count1 ?? 0, "color"=>"magenta"),
array("label"=>"Hold", "symbol" => "Hold", "y"=>$hold_count1 ?? 0, "color"=>"orange"),
array("label"=>"Resolved", "symbol" => "Resolved", "y"=>$resolved_count1 ?? 0, "color"=>"green"),
array("label"=>"Cancelled", "symbol" => "Cancelled", "y"=>$cancelled_count1 ?? 0, "color"=>"gray")
);
@endphp
HW Tracker Analytics
@include('sidebarss')
Healthy Watch – Ticket Dashboard
User Profile
{{ auth()->user()->id }}
{{ auth()->user()->name }}
{{ auth()->user()->email }}
{{ auth()->user()->role }}
{{ auth()->user()->last_login ?? now() }}
Notifications
@if(isset($notifications) && count($notifications) > 0)
@foreach($notifications as $index => $notification)
-
@if($notification['type'] == 'missed')
@elseif($notification['type'] == 'assigned')
@elseif($notification['type'] == 'urgent')
@elseif($notification['type'] == 'system')
@elseif($notification['type'] == 'resolved')
@else
@endif
{{ $notification['message'] }}
@if($notification['ticket_id'])
Ticket #{{ $notification['ticket_id'] }}
@endif
{{ \Carbon\Carbon::parse($notification['time'])->diffForHumans() }}
@if($notification['ticket_id'])
@endif
@endforeach
@else
-
No new notifications
@endif
New Tickets
{{ $new ?? 0 }}
In Progress
{{ $inprogress ?? 0 }}
Resolved
{{ $resolved ?? 0 }}
Frequent Issues
{{ $frequentIssues ?? 0 }}
{{ number_format($averageResponseTime, 1) }} hrs
{{ $averageResponseTime <= 2.4 ? '15%' : '8%' }} {{ $averageResponseTime <= 2.4 ? 'faster' : 'slower' }}
{{ number_format($satisfactionRate, 1) }}%
{{ abs($satisfactionRate - 94) }}% {{ $satisfactionRate >= 94 ? 'increase' : 'decrease' }}
{{ $activeUsers }}
{{ $activeUsers >= 38 ? 'Growing' : 'Stable' }}
{{ number_format($systemHealth, 1) }}%
{{ $systemHealth >= 95 ? 'Optimal' : ($systemHealth >= 90 ? 'Good' : 'Attention') }}
{{ number_format($avgResolutionTime, 1) }} hrs
Average time to resolve
{{ $criticalTickets }}
{{ $criticalTickets <= 3 ? 'Under Control' : 'Action Needed' }}
{{ $overdueTickets }}
{{ $overdueTickets <= 2 ? 'On Track' : 'Delayed' }}
{{ $ticketGrowthRate > 0 ? '+' : '' }}{{ number_format($ticketGrowthRate, 1) }}%
vs last month
| Ticket ID |
Issue |
Customer |
Priority |
Status |
Action |
@if(isset($recentTickets) && $recentTickets->count() > 0)
@foreach ($recentTickets as $t)
| {{ $t->ticket_number ?? 'N/A' }} |
{{ $t->issue ?? 'N/A' }} |
{{ $t->customer_name ?? 'N/A' }} |
{{ $t->priority ?? 'Medium' }}
|
{{ $t->status ?? 'N/A' }} |
|
@endforeach
@else
| No recent tickets found |
@endif
@if(isset($departmentStats) && $departmentStats->count() > 0)
@endif
@if(isset($systemStats) && $systemStats->count() > 0)
@endif