@section('title', 'تفاصيل المخالفة') @section('page-title', 'تفاصيل المخالفة') @section('page-description', $violation->violation_number)
@if(session('success'))

{{ session('success') }}

@endif {{-- Violation Info Card --}}

{{ $violation->violationType->name ?? '-' }}

{{ $violation->violation_number }}

{{ \App\Models\ViolationType::getSeverities()[$violation->severity] ?? $violation->severity }} {{ \App\Models\Violation::getStatuses()[$violation->status] ?? $violation->status }}

الكيان

{{ $violation->violatable_type == 'company' ? 'الشركة' : ($violation->violatable->name ?? 'محطة') }}

تاريخ المخالفة

{{ $violation->violation_date ? \Carbon\Carbon::parse($violation->violation_date)->format('Y-m-d') : '-' }}

مُبلّغ بواسطة

{{ $violation->reporter->name ?? '-' }}

مبلغ الغرامة

{{ number_format($violation->fine_amount) }} ر.س

حالة الدفع

@if($violation->is_paid)

✓ مدفوعة - {{ number_format($violation->paid_amount) }} ر.س

@elseif($violation->fine_amount > 0)

غير مدفوعة

@else

-

@endif

مهلة الحل

{{ $violation->resolution_deadline ? \Carbon\Carbon::parse($violation->resolution_deadline)->format('Y-m-d') : '-' }}

@if($violation->description)

الوصف: {{ $violation->description }}

@endif @if($violation->resolution_notes)

ملاحظات الحل: {{ $violation->resolution_notes }}

@endif {{-- Status Update & Payment --}}
@if(!in_array($violation->status, ['closed', 'verified']))
@csrf @method('PATCH') @if($violation->status == 'open') @elseif($violation->status == 'acknowledged') @elseif($violation->status == 'in_progress') @elseif($violation->status == 'resolved') @endif
@endif @if(!$violation->is_paid && $violation->fine_amount > 0) @endif
{{-- Payment Form (Hidden) --}} {{-- Corrective Action Form (Hidden) --}} {{-- Corrective Actions List --}} @if($violation->correctiveActions && $violation->correctiveActions->count() > 0)

الإجراءات التصحيحية

@foreach($violation->correctiveActions as $action)
{{ ['immediate' => 'إجراء فوري', 'corrective' => 'إجراء تصحيحي', 'preventive' => 'إجراء وقائي'][$action->action_type] ?? $action->action_type }}

{{ $action->description }}

@if($action->due_date)

{{ \Carbon\Carbon::parse($action->due_date)->format('Y-m-d') }}

@endif
@if(!$action->completed_at)
@csrf @method('PATCH')
@else ✓ مكتمل {{ $action->completed_at->format('Y-m-d') }} @endif
@endforeach
@endif العودة لقائمة المخالفات