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

Total Violations

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

Resolved

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

Unresolved

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

Resolution Rate

Visual Analytics
Violation Types Distribution
Time-based Patterns
Detailed Violations
@forelse($report['details'] as $violation) @empty @endforelse
Employee Geofence Violation Type Violation Time Location Status Resolution Notes Actions
{{ $violation->employee->full_name ?? 'Unknown Employee' }}
{{ $violation->employee->profile->employee_id ?? '' }}
{{ $violation->geofence->name ?? 'Unknown Geofence' }}
{{ ucfirst(str_replace('_', ' ', $violation->violation_type)) }}
{{ $violation->violation_time->format('M d, Y') }}
{{ $violation->violation_time->format('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
Try adjusting your filters to see more results

Violation Hotspots

@forelse($report['hotspots']['top_hotspots'] ?? [] as $hotspot) @empty @endforelse
Geofence Violations Employees Risk Level
{{ $hotspot['geofence']['name'] ?? 'Unknown Geofence' }}
{{ $hotspot['violation_count'] }}
{{ $hotspot['unique_employees'] }}
@php $riskLevel = $hotspot['violation_count'] > 10 ? 'High' : ($hotspot['violation_count'] > 5 ? 'Medium' : 'Low'); $riskColor = $riskLevel === 'High' ? 'red' : ($riskLevel === 'Medium' ? 'yellow' : 'green'); @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'] ?? 'Unknown Employee' }}
{{ $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' ? 'red' : ($riskLevel === 'Medium' ? 'yellow' : 'green'); @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' ? 'red' : ($riskLevel === 'Medium' ? 'yellow' : 'green'); @endphp {{ $riskLevel }}
No daily data available
@endsection