@extends('layouts.app') @section('title', 'لوحة الطبيب') @section('page_title') لوحة الطبيب - د. {{ auth()->user()->name }} @endsection @section('content')

{{ auth()->user()->doctorAppointments()->whereDate('appointment_date', today())->count() }}

مواعيد اليوم

{{ auth()->user()->doctorAppointments()->distinct('patient_id')->count() }}

مرضى الطبيب

{{ auth()->user()->doctorAppointments()->where('status', 'مكتمل')->count() }}

حالات مكتملة

مواعيد اليوم
@foreach(auth()->user()->doctorAppointments()->whereDate('appointment_date', today())->with('patient')->get() as $appointment) @endforeach
الوقت اسم المريض رقم المريض رقم الهاتف نوع الزيارة الحالة الإجراءات
{{ $appointment->appointment_time->format('H:i') }} {{ $appointment->patient->name }} {{ $appointment->patient->patient_number ?? '-' }} {{ $appointment->patient->mobile }} {{ $appointment->type }} @switch($appointment->status) @case('مؤكد') {{ $appointment->status }} @break @case('في الانتظار') {{ $appointment->status }} @break @case('جديد') {{ $appointment->status }} @break @case('مكتمل') {{ $appointment->status }} @break @case('ملغي') {{ $appointment->status }} @break @endswitch
إضافة تشخيص سريع
المرضى الأكثر زيارة
@php $frequentPatients = auth()->user()->doctorAppointments() ->selectRaw('patient_id, COUNT(*) as visit_count') ->with('patient') ->groupBy('patient_id') ->orderBy('visit_count', 'desc') ->take(5) ->get(); @endphp @forelse($frequentPatients as $appointment)
{{ $appointment->patient->name }} {{ $appointment->visit_count }} {{ $appointment->visit_count == 1 ? 'زيارة' : 'زيارات' }}
@empty
لا توجد بيانات متاحة
@endforelse
@endsection