@extends('layouts.app') @section('title', 'Geofence Violations Report') @section('no-page-header') @section('content')
Geofence Violations Report
{{ $report['summary']['total_violations'] }}

Total Violations

{{ $report['summary']['resolved_violations'] }}

Resolved

{{ $report['summary']['unresolved_violations'] }}

Unresolved

{{ $report['summary']['resolution_rate'] }}%

Resolution Rate

{{ $report['summary']['most_common_type'] }}

Most Common Type

{{ count($report['summary']['violation_types']) }}

Violation Types

Violation Types Distribution
Time-based Patterns
@forelse($report['details'] as $violation) @empty @endforelse
Employee Geofence Violation Type Violation Time Location Status Resolution Notes Actions
{{ $violation->employee->full_name }}
{{ $violation->employee->profile->employee_id ?? '' }}
{{ $violation->geofence->name }} {{ ucfirst(str_replace('_', ' ', $violation->violation_type)) }} {{ $violation->violation_time->format('M d, Y h:i A') }} {{ $violation->latitude }}, {{ $violation->longitude }} {{ $violation->is_resolved ? 'Resolved' : 'Unresolved' }} {{ $violation->resolution_notes ?? 'N/A' }}
@if(!$violation->is_resolved) @endif
No violation records found
Violation Hotspots
@forelse($report['hotspots']['top_hotspots'] ?? [] as $hotspot) @empty @endforelse
Geofence Violations Unique Employees Risk Level
{{ $hotspot['geofence']['name'] }} {{ $hotspot['violation_count'] }} {{ $hotspot['unique_employees'] }} @php $riskLevel = $hotspot['violation_count'] > 10 ? 'High' : ($hotspot['violation_count'] > 5 ? 'Medium' : 'Low'); $riskColor = $riskLevel === 'High' ? 'danger' : ($riskLevel === 'Medium' ? 'warning' : 'success'); @endphp {{ $riskLevel }}
No hotspots data available
Employee Violation Patterns
@forelse($report['patterns']['employee_violation_patterns'] ?? [] as $pattern) @empty @endforelse
Employee Violations Geofences Common Type
{{ $pattern['employee']['full_name'] }} {{ $pattern['violation_count'] }} {{ $pattern['geofences_violated'] }} @php $mostCommonType = $pattern['violation_types']->sortDesc()->keys()->first(); @endphp {{ ucfirst(str_replace('_', ' ', $mostCommonType)) }}
No pattern data available
Hourly Violation Pattern
@forelse($report['patterns']['hourly_pattern'] ?? [] as $hour => $count) @empty @endforelse
Hour Violations Risk Level
{{ $hour }}:00 {{ $count }} @php $riskLevel = $count > 5 ? 'High' : ($count > 2 ? 'Medium' : 'Low'); $riskColor = $riskLevel === 'High' ? 'danger' : ($riskLevel === 'Medium' ? 'warning' : 'success'); @endphp {{ $riskLevel }}
No hourly data available
Daily Violation Pattern
@forelse($report['patterns']['daily_pattern'] ?? [] as $day => $count) @empty @endforelse
Day Violations Risk Level
{{ $day }} {{ $count }} @php $riskLevel = $count > 10 ? 'High' : ($count > 5 ? 'Medium' : 'Low'); $riskColor = $riskLevel === 'High' ? 'danger' : ($riskLevel === 'Medium' ? 'warning' : 'success'); @endphp {{ $riskLevel }}
No daily data available
@endsection @section('scripts') @endsection