@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
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
@php
// Get recent missed notifications from ticket data
$notifications = [];
if(isset($recentTickets)) {
foreach($recentTickets as $ticket) {
if($ticket->subject && strpos(strtolower($ticket->subject), 'missed notification') !== false) {
$notifications[] = [
'type' => 'missed',
'message' => $ticket->issue_desc ?? 'Missed notification alert',
'ticket_id' => $ticket->ticket_number ?? 'N/A',
'time' => $ticket->created_at ?? 'Recently',
'priority' => 'high'
];
} elseif($ticket->issue_status == 1) {
$notifications[] = [
'type' => 'new',
'message' => 'New ticket created: ' . ($ticket->issue_desc ?? 'New issue'),
'ticket_id' => $ticket->ticket_number ?? 'N/A',
'time' => $ticket->created_at ?? 'Recently',
'priority' => 'normal'
];
} elseif($ticket->assigned_staff_id == auth()->user()->id) {
$notifications[] = [
'type' => 'assigned',
'message' => 'Ticket assigned to you: ' . ($ticket->issue_desc ?? 'New assignment'),
'ticket_id' => $ticket->ticket_number ?? 'N/A',
'time' => $ticket->created_at ?? 'Recently',
'priority' => 'normal'
];
}
}
}
// Add system notifications
$notifications[] = [
'type' => 'system',
'message' => 'Dashboard loaded successfully',
'ticket_id' => null,
'time' => now()->format('Y-m-d H:i'),
'priority' => 'info'
];
// Sort by time (most recent first)
usort($notifications, function($a, $b) {
return strtotime($b['time']) - strtotime($a['time']);
});
// Limit to 10 most recent
$notifications = array_slice($notifications, 0, 10);
@endphp
@if(count($notifications) > 0)
@foreach($notifications as $index => $notification)
-
@if($notification['type'] == 'missed')
@elseif($notification['type'] == 'assigned')
@elseif($notification['type'] == 'urgent')
@elseif($notification['type'] == 'system')
@else
@endif
{{ $notification['message'] }}
@if($notification['ticket_id'])
Ticket #{{ $notification['ticket_id'] }}
@endif
{{ $notification['time'] }}
@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 }}
| 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
🔐 Access Control & User Management
Role Distribution
| Role |
Users |
Access Level |
| Super Admin |
2 |
Full Access |
| Administrator |
5 |
Admin Access |
| Troubleshooter |
12 |
Tech Access |
| Manager |
8 |
Management |
| Frontliner |
25 |
Limited |
| Supervisor |
6 |
Supervisor |
| Pharmacy User |
3 |
Pharmacy |
Recent User Activity
K Sumithra
Logged into system
2 minutes ago
Pooja
Accessed ticket management
15 minutes ago
Arthi V
Logged into system
1 hour ago
Nithya K
Logged out from system
2 hours ago
J Sakthivel
Modified user permissions
3 hours ago
Access Permissions Overview
Dashboard Access
61 Users
Ticket Management
45 Users
User Administration
7 Users
System Settings
2 Users
Reports Access
28 Users
API Access
Pending
Security Status
✓ All Secure
Today's Login Statistics
Peak Login Hours:
9:00 AM
2:00 PM
4:30 PM
⚠️ Security Alert
2 failed login attempts detected from unknown IP
K Sumithra
Logged into system
2 minutes ago
Pooja
Created new ticket #TCN1407
15 minutes ago
Arthi V
Resolved ticket #TCN1498
1 hour ago