@extends('layouts.app') @section('title', 'Patrol Violations') @section('no-page-header') @section('content')
Monitor patrol violations and compliance issues
Total Violations
{{ $violations->count() }}
Unresolved
{{ $violations->where('is_resolved', false)->count() }}
Resolved
{{ $violations->where('is_resolved', true)->count() }}
Today
{{ $violations->getCollection()->filter(function($violation) { return \Carbon\Carbon::parse($violation->violation_time)->isToday(); })->count() }}
| ID | Type | Employee | Client | Services | Checkpoint | Time | Location | Status | Actions |
|---|---|---|---|---|---|---|---|---|---|
| {{ $violation->id }} | {{ ucfirst(str_replace('_', ' ', $violation->violation_type)) }} | {{ $violation->employee->full_name }} | {{ $violation->schedule?->client?->name ?? 'N/A' }} |
@if($violation->schedule?->client?->services)
@if(is_string($violation->schedule->client->services))
@foreach(explode(',', $violation->schedule->client->services) as $service)
{{ trim($service) }}
@endforeach
@elseif(is_array($violation->schedule->client->services))
@foreach($violation->schedule->client->services as $service)
{{ $service }}
@endforeach
@endif
@else
N/A
@endif
|
{{ $violation->checkpoint?->checkpoint_name ?? 'N/A' }} | {{ $violation->violation_time->format('M d, Y h:i A') }} | {{ $violation->latitude }}, {{ $violation->longitude }} | @if($violation->is_resolved) Resolved @else Unresolved @endif | |
| No violations found. | |||||||||