@extends('layouts.main_dashboard.app') @php $isArabic = app()->getLocale() === 'ar'; $items = $inquiries->getCollection(); $isParentScope = $viewType === 'parent'; @endphp @section('title', $isParentScope ? ($isArabic ? 'استفسارات أولياء الأمور' : 'Parent Inquiries') : ($isArabic ? 'استفسارات الطلاب' : 'Student Inquiries')) @section('page_heading', $isParentScope ? ($isArabic ? 'استفسارات أولياء الأمور' : 'Parent Inquiries') : ($isArabic ? 'استفسارات الطلاب' : 'Student Inquiries')) @section('page_subtitle', $isParentScope ? ($isArabic ? 'كل استفسارات أولياء الأمور الخاصة بمساقات القسم في شاشة موحدة.' : 'All parent inquiries related to department courses in one unified screen.') : ($isArabic ? 'كل استفسارات الطلاب الخاصة بمساقات القسم في شاشة موحدة.' : 'All student inquiries related to department courses in one unified screen.')) @section('skip_page_hero', true) @section('content')

{{ $isArabic ? 'الاستفسارات الظاهرة' : 'Visible inquiries' }}

{{ number_format($inquiries->total()) }}

{{ $isArabic ? 'بانتظار الرد' : 'Awaiting reply' }}

{{ number_format($openCount) }}

{{ $isArabic ? 'مواد القسم' : 'Department subjects' }}

{{ number_format($subjects->count()) }}

{{ $isArabic ? 'آخر استفسار' : 'Latest inquiry' }}

{{ $latestInquiry?->created_at?->format('Y-m-d') ?? '—' }}

{{ $isArabic ? 'تصفير' : 'Reset' }}

{{ $isParentScope ? ($isArabic ? 'قائمة استفسارات أولياء الأمور' : 'Parent inquiry list') : ($isArabic ? 'قائمة استفسارات الطلاب' : 'Student inquiry list') }}

{{ $isArabic ? 'المحتوى هنا على مستوى القسم كله، وليس فقط على مستوى مساقات رئيس القسم الشخصية.' : 'The content here covers the whole department, not only the head personal teaching load.' }}

@if($items->isEmpty())
{{ $isArabic ? 'لا توجد استفسارات مطابقة لهذا النطاق أو لهذه الفلاتر.' : 'No inquiries match this scope or the selected filters.' }}
@else
@foreach($items as $inquiry)

{{ $inquiry->title }}

{{ filled($inquiry->teacher_reply) ? ($isArabic ? 'تم الرد' : 'Answered') : ($isArabic ? 'بانتظار الرد' : 'Awaiting reply') }}
{{ $isParentScope ? ($isArabic ? 'ولي الأمر:' : 'Parent:') . ' ' . ($inquiry->parentUser?->name ?? '—') : ($isArabic ? 'الطالب:' : 'Student:') . ' ' . ($inquiry->student?->name ?? '—') }} {{ $isArabic ? 'المدرس:' : 'Teacher:' }} {{ $inquiry->teacher?->name ?? '—' }} {{ $isArabic ? 'المساق:' : 'Course:' }} {{ $inquiry->course?->name ?? '—' }} {{ $isArabic ? 'المادة:' : 'Subject:' }} {{ $inquiry->course?->subject?->name ?? '—' }}

{{ \Illuminate\Support\Str::limit($inquiry->message, 240) }}

@if($inquiry->teacher_id === auth()->id() && ! $isParentScope) {{ __('dashboard.View & Reply') }} @elseif($inquiry->teacher_id === auth()->id() && $isParentScope) {{ __('dashboard.View & Reply') }} @elseif($inquiry->course_id) {{ $isArabic ? 'فتح المساق' : 'Open Course' }} @endif
@endforeach
{{ $inquiries->appends(request()->query())->links('pagination::simple-tailwind') }}
@endif
@endsection