@extends('layout.app') @section('title') {{ __('Dashboard') }} @stop @section('content')
@if (Auth::user()->user_name == 'admin')
{{ __('المدارس ') }}

{{ @\App\Models\School::count() }}

@endif
@if (Auth::user()->user_name != 'admin') @else @endif
{{ __('الطـلاب') }}
@php $user = Auth::user(); if ($user->user_name == 'admin') { $studentCount = \App\Models\Student::count(); } else { $studentCount = \App\Models\Student::where('school_id', $user->school_id)->count(); } @endphp

{{ $studentCount }}

@if (Auth::user()->user_name != 'admin')
@if (Auth::user()->user_name == 'admin') @else @endif
{{ __('الفصول الدراسية') }}

{{ @\App\Models\Grade::count() }}

@endif @if (Auth::user()->user_name != 'admin')
{{ __('البرامج') }}

{{ @\App\Models\Activity::where('school_id', Auth::user()->school_id)->count() }}

@endif @if (Auth::user()->user_name == 'admin')
{{ __('المجــالات') }}

{{ @\App\Models\Department::count() }}

{{ __('المستخدمين') }}
@php $user = Auth::user(); if ($user->user_name == 'admin') { $userCountall = \App\Models\User::count(); } else { $userCountall = \App\Models\User::count(); } @endphp

{{ $userCountall }}

@endif @if (Auth::user()->user_name != 'admin')
{{ __('المعلمين') }}
@php $user = Auth::user(); if ($user->user_name == 'admin') { $userCount = \App\Models\User::count(); } else { $userCount = \App\Models\User::where('school_id', $user->school_id)->count(); } @endphp

{{ $userCount }}

@endif
البرامج
الاستبانات
{{--
التأخيرات والغيابات
--}}

@if (Auth::user()->user_name != 'admin')
التقييم الذاتي
@php $totalDepartmentsScore = 0; $departmentsCount = count($departments); @endphp @foreach ($departments as $department) @php $totalStandardScore = 0; $totalStandards = $department->standards->count(); foreach ($department->standards as $standard) { $totalIndicatorScore = 0; $totalIndicators = $standard->indicators->count(); foreach ($standard->indicators as $indicator) { $totalParagraphScore = 0; $totalParagraphs = $indicator->paragraphs->count(); foreach ($indicator->paragraphs as $paragraph) { $totalRequirementsScore = 0; $totalRequirements = $paragraph->requirements->count(); foreach ($paragraph->requirements as $requirement) { $documentExists = $requirement->files ->where('school_id', auth()->user()->school_id) ->first() ? 1 : 0; $score = $documentExists ? 4 : 0; $totalRequirementsScore += $score; } $paragraphScore = $totalRequirements > 0 ? $totalRequirementsScore / $totalRequirements : 0; $totalParagraphScore += $paragraphScore; } $indicatorScore = $totalParagraphs > 0 ? $totalParagraphScore / $totalParagraphs : 0; $totalIndicatorScore += $indicatorScore; } $standardScore = $totalIndicators > 0 ? $totalIndicatorScore / $totalIndicators : 0; $totalStandardScore += $standardScore; } $departmentScore = $totalStandards > 0 ? $totalStandardScore / $totalStandards : 0; $totalDepartmentsScore += $departmentScore; // تحديد لون شريط التقدم بناءً على الدرجة if ($departmentScore < 1) { $color = '#dc3545'; // أحمر } elseif ($departmentScore < 2) { $color = '#ffc107'; // أصفر } elseif ($departmentScore < 3) { $color = '#17a2b8'; // أزرق } else { $color = '#28a745'; // أخضر } @endphp
{{ $department->name }}
{{ number_format(($departmentScore / 4) * 100, 1) }}%
{{ number_format($departmentScore, 1) }} / 4
@endforeach {{-- بطاقة الدرجة العامة للمدرسة --}}
الدرجة العامة للمدرسة
@if ($departmentsCount > 0) @php $averageSchoolScore = $totalDepartmentsScore / $departmentsCount; if ($averageSchoolScore < 1) { $color = '#dc3545'; // أحمر } elseif ($averageSchoolScore < 2) { $color = '#ffc107'; // أصفر } elseif ($averageSchoolScore < 3) { $color = '#17a2b8'; // أزرق } else { $color = '#28a745'; // أخضر } @endphp
{{ number_format(($averageSchoolScore / 4) * 100, 1) }}%
{{ number_format($averageSchoolScore, 1) }} / 4
@else
0%
0 / 4
@endif
{{-- نهاية بطاقة الدرجة العامة للمدرسة --}}
@endif @if (Auth::user()->user_name == 'admin')
أحدث المستخدمين
{{-- --}} @foreach ($latestUsers as $user) {{-- --}} @endforeach
#اسم المستخدم البريد الالكتروني اسم المدرسة تاريخ الإنشاء
{{ $user->id }}{{ $user->name }} {{ $user->email }} {{ $user->school ? $user->school->name : 'غير معروف' }} {{ $user->created_at->format('Y-m-d') }}
@endif @endsection @section('js') @endsection