{{-- ================== وضع القائمة ================== --}} @if ($mode === 'list')
{{-- العنوان --}}

التذاكر (الدعم الفني)

{{-- تبويبات الواردة / المغلقة --}}
{{-- كل الفلاتر + الإجراءات في صف واحد (مع التفاف عند الضيق) --}}
{{-- بحث بالبريد --}} {{-- فلتر الحالة --}} {{-- فلتر قناة الوصول --}} {{-- فلتر created_by --}} {{-- إجراء سريع لتغيير الحالة --}}
{{-- عدد لكل صفحة --}} {{-- مسح الفلاتر --}} {{-- زر إنشاء تذكرة جديدة --}}
@forelse ($tickets as $t) @php $statusKey = $t->status ?: 'pending'; $s = $statusMap[$statusKey] ?? ['label' => $statusKey, 'class' => 'kt-badge-outline']; $categoryKey = $t->category ?: null; $categoryLabel = $categoryKey ? ($categoryOptions[$categoryKey] ?? $categoryKey) : 'غير مصنّف'; @endphp {{-- اختيار فردي --}} @empty @endforelse
# رقم التذكرة اسم المرسِل البريد رقم الهاتف نوع التذكرة الحالة الإجراء
{{ $t->id }} {{ $t->ticket_no ?? '—' }} {{ $t->name ?? '—' }} {{ $t->email ?? '—' }} {{ $t->phone ?? '—' }} {{ $categoryLabel }} {{ $s['label'] }}
لا توجد تذاكر.
{{-- سبينر --}} {{-- فوتر --}}
{{-- ================== وضع التفاصيل ================== --}} @elseif ($mode === 'detail' && $current)

تفاصيل التذكرة #{{ $current->id }}

{{-- العمود الرئيسي --}}
{{-- بيانات التذكرة --}}

بيانات التذكرة

الاسم
{{ $current->name ?? '—' }}
البريد
{{ $current->email ?? '—' }}
الهاتف
{{ $current->phone ?? '—' }}
@php $statusKey = $current->status ?: 'pending'; $s = $statusMap[$statusKey] ?? ['label' => $statusKey, 'class' => 'kt-badge-outline']; $categoryKey = $current->category ?: null; $categoryLabel = $categoryKey ? ($categoryOptions[$categoryKey] ?? $categoryKey) : 'غير مصنّف'; $sourceKey = $current->source ?: null; $sourceLabel = $sourceKey ? ($sourceOptions[$sourceKey] ?? $sourceKey) : 'غير محدد'; @endphp
الحالة
{{ $s['label'] }}
تاريخ الإنشاء
{{ \Carbon\Carbon::parse($current->created_at)->timezone('Asia/Riyadh')->format('Y-m-d H:i') }}
نوع التذكرة
{{ $categoryLabel }}
قناة الوصول
{{ $sourceLabel }}
تم الإنشاء بواسطة
{{ $current->created_by ?? '—' }}
نص الرسالة
{{ $current->message ?? '—' }}
{{-- إرسال الرد --}}

إرسال رد للعميل

{{-- ردود جاهزة --}}
سيتم إدراج النص في الحقل أدناه، ويمكنك تعديله قبل الإرسال.
@error('replyContent'){{ $message }}@enderror
جاري الإرسال...
@if($current->title || $current->comment)
آخر رد محفوظ:
العنوان: {{ $current->title }}
{{ $current->comment }}
@endif
{{-- العمود الجانبي --}}
{{-- ملخص سريع --}}

ملخص سريع

@php $statusKey = $current->status ?: 'pending'; $s = $statusMap[$statusKey] ?? ['label' => $statusKey, 'class' => 'kt-badge-outline']; $categoryKey = $current->category ?: null; $categoryLabel = $categoryKey ? ($categoryOptions[$categoryKey] ?? $categoryKey) : 'غير مصنّف'; $sourceKey = $current->source ?: null; $sourceLabel = $sourceKey ? ($sourceOptions[$sourceKey] ?? $sourceKey) : 'غير محدد'; @endphp
رقم السجل (ID) #{{ $current->id }}
رقم التذكرة {{ $current->ticket_no ?? '—' }}
نوع التذكرة {{ $categoryLabel }}
قناة الوصول {{ $sourceLabel }}
تم الإنشاء بواسطة {{ $current->created_by ?? '—' }}
البريد {{ $current->email ?? '—' }}
الهاتف {{ $current->phone ?? '—' }}
{{-- عضوية GOVI --}} @if($linkedUser)
عضوية GOVI @if($linkedGovi) عضو GOVI @else غير عضو @endif
@endif
الحالة {{ $s['label'] }}
{{-- بيانات المستخدم المرتبط (إن وُجد) --}}

بيانات المستخدم (إن وُجد)

@if($linkedUser) @php $mno = $linkedUser->membership_number ?? null; $quickUrl = $mno ? url('/adminusers?u=' . $mno) : null; @endphp
الاسم {{ $linkedUser->name ?? '—' }}
البريد {{ $linkedUser->email ?? '—' }}
الجوال {{ $linkedUser->phone ?? '—' }}
نوع المستخدم {{ $linkedUser->user_type ?? '—' }}
@if($mno)
رقم العضوية {{ $mno }}
@endif @else
لا يوجد حساب مرتبط بهذا البريد.
@endif
{{-- إدارة التذكرة --}}

إدارة التذكرة

جاري التحديث...
{{-- end side column --}}
{{-- ================== وضع إنشاء تذكرة جديدة ================== --}} @elseif ($mode === 'create')

إنشاء تذكرة جديدة

{{-- بوكس معاينة المستخدم (إن وُجد) --}} @if($newIsLinkedUser && $newUserPreview)

تأكيد بيانات المستخدم

@php $mno = $newUserPreview->membership_number ?? null; @endphp
الاسم {{ $newUserPreview->name ?? '—' }}
البريد {{ $newUserPreview->email ?? '—' }}
الجوال {{ $newUserPreview->phone ?? '—' }}
نوع المستخدم {{ $newUserPreview->user_type ?? '—' }}
رقم العضوية {{ $mno ?? '—' }}
عضوية GOVI @if($newUserPreviewGovi) عضو GOVI @else غير عضو @endif
@endif
@if($newIsLinkedUser)
@error('newUserEmailLookup'){{ $message }}@enderror سيتم جلب بيانات الاسم والبريد والجوال تلقائياً عند التأكيد.
@else
@error('newName'){{ $message }}@enderror
@error('newEmail'){{ $message }}@enderror
@error('newPhone'){{ $message }}@enderror
@endif
@error('newTitle'){{ $message }}@enderror
@error('newCategory'){{ $message }}@enderror
@error('newSource'){{ $message }}@enderror
@error('newMessage'){{ $message }}@enderror
جاري إنشاء التذكرة...
@endif