@extends('layouts.app') @section('title', 'Teacher Dashboard') @section('page-title', 'Teacher Dashboard') @section('content')

Welcome, {{ Auth::user()->username }}! 👨‍🏫

Here's your teaching overview for today.

My Classes
{{ $stats['assignedClassesCount'] ?? 0 }}
Total Students
{{ $stats['totalStudentsCount'] ?? 0 }}
Pending Submissions
{{ $stats['pendingSubmissionsCount'] ?? 0 }}
Today's Sessions
{{ $stats['todaySessionsCount'] ?? 0 }}
Today's Schedule
{{ $todaysSchedule->count() ?? 0 }}
@if($todaysSchedule && $todaysSchedule->count() > 0)
@foreach($todaysSchedule as $schedule)
{{ $schedule->subject->name ?? $schedule->subject->title ?? 'N/A' }}
{{ $schedule->batch->name ?? 'N/A' }}
{{ $schedule->start_time ? \Carbon\Carbon::parse($schedule->start_time)->format('h:i A') : 'Time not set' }} - {{ $schedule->end_time ? \Carbon\Carbon::parse($schedule->end_time)->format('h:i A') : 'Time not set' }}
{{ ucfirst($schedule->status) }}
@if($schedule->status !== 'completed') Take Attendance @endif
@endforeach
@else

No classes scheduled for today

Enjoy your day off or prepare for upcoming classes
@endif
Recent Submissions
{{ $recentSubmissions->count() ?? 0 }}
@if($recentSubmissions && $recentSubmissions->count() > 0)
@foreach($recentSubmissions as $submission)
{{ $submission->assignment->title }}
{{ $submission->submitted_at ? $submission->submitted_at->diffForHumans() : 'Not submitted' }}
{{ $submission->score ? 'Graded' : 'Pending' }}

{{ $submission->student->user->name ?? $submission->student->user->username ?? 'N/A' }}

{{ $submission->assignment->batch->name ?? 'N/A' }}

{{ $submission->assignment->subject->name ?? $submission->assignment->subject->title ?? 'N/A' }}
@if(!$submission->score) Grade @else Score: {{ $submission->score }}/{{ $submission->assignment->max_score }} @endif
@endforeach
@else

No recent submissions

Student submissions will appear here
@endif
Upcoming Assignment Deadlines
{{ $upcomingAssignments->count() ?? 0 }}
@if($upcomingAssignments && $upcomingAssignments->count() > 0)
@foreach($upcomingAssignments as $assignment)
{{ $assignment->title }}
Due: {{ $assignment->due_date ? $assignment->due_date->format('M d, Y') : 'No due date' }}
{{ $assignment->due_date && $assignment->due_date->isToday() ? 'Today' : ($assignment->due_date ? $assignment->due_date->diffForHumans() : 'No due date') }}

{{ $assignment->batch->name ?? 'N/A' }}

{{ Str::limit($assignment->instructions, 100) }}

Submissions: {{ $assignment->submissions_count ?? 0 }}/{{ $assignment->total_students ?? 0 }}
@endforeach
@else

No upcoming assignment deadlines

All assignments are properly scheduled
@endif
Class Statistics
@if(isset($classStatistics) && count($classStatistics) > 0)
@foreach($classStatistics as $class) @endforeach
Class Students Attendance Assignments
{{ $class['subject_name'] }}
{{ $class['batch_name'] }}
{{ $class['total_students'] }} {{ $class['attendance_rate'] }}% {{ $class['assignments_count'] }}
@else

No class statistics available

@endif
My Recent Materials
{{ $recentMaterials->count() ?? 0 }}
@if($recentMaterials && $recentMaterials->count() > 0)
@foreach($recentMaterials as $material)
@php // Determine file type icon and color $fileExtension = pathinfo($material->file_path, PATHINFO_EXTENSION); $fileType = strtolower($fileExtension); if (in_array($fileType, ['pdf'])) { $icon = 'file-pdf'; $color = 'danger'; } elseif (in_array($fileType, ['doc', 'docx'])) { $icon = 'file-word'; $color = 'primary'; } elseif (in_array($fileType, ['xls', 'xlsx'])) { $icon = 'file-excel'; $color = 'success'; } elseif (in_array($fileType, ['ppt', 'pptx'])) { $icon = 'file-powerpoint'; $color = 'warning'; } elseif (in_array($fileType, ['jpg', 'jpeg', 'png', 'gif'])) { $icon = 'file-image'; $color = 'info'; } else { $icon = 'file-alt'; $color = 'secondary'; } @endphp {{ Str::limit($material->title, 25) }}
{{ $material->created_at->diffForHumans() }}

{{ $material->class->batch->name ?? 'N/A' }}

{{ $material->published ? 'Published' : 'Draft' }}
@endforeach
@else

No materials uploaded yet

@endif
@endsection @section('scripts') @endsection