@extends('layouts-v2.app') @section('content')
Trang chủ Danh sách lớp học

@if(isset($filterInfo) && $filterInfo['isProductList']) Danh sách lớp học - {{ $filterInfo['productName'] }} @else Danh sách lớp học @endif

@if(session('success-v2')) @endif @if(session('error-v2')) @endif
@if(isset($filterInfo) && $filterInfo['isProductList']) @if($filterInfo['categoryId']) @endif @if($filterInfo['courseId']) @endif @endif
Xóa
@if(isset($filterInfo) && $filterInfo['isProductList']) Tổng số lớp: {{ $filterInfo['classCount'] }} @else Tổng số lớp: {{ count($classesAll) }} @endif
@forelse($classes as $index => $class) @empty @endforelse
STT Tên lớp Sĩ số Trạng thái Khóa học DS học sinh DS giáo viên Hành động
{{ ($classes->currentPage() - 1) * $classes->perPage() + $index + 1 }} {{ $class->name }} {{ $class->studentCount() }} @if($class->status == 0) Đang vận hành @else Đã kết thúc @endif @if(isset($class->courses) && $class->courses->isNotEmpty()) @php $courseNames = $class->courses->pluck('moodle_name')->unique()->values(); $displayedCourses = $courseNames->take(1)->implode(', '); @endphp
{{ $displayedCourses }} @if($courseNames->count() > 1) @endif
@else - @endif

Không có dữ liệu

@if($classes->hasPages())
Hiển thị {{ $classes->firstItem() ?? 0 }} - {{ $classes->lastItem() ?? 0 }} trong tổng số {{ $classes->total() }} kết quả
@if($classes->onFirstPage()) @else @endif @php $currentPage = $classes->currentPage(); $lastPage = $classes->lastPage(); $onEachSide = 2; // Số trang hiển thị mỗi bên của trang hiện tại // Tính toán phạm vi trang cần hiển thị $windowStart = max(1, $currentPage - $onEachSide); $windowEnd = min($lastPage, $currentPage + $onEachSide); @endphp {{-- Hiển thị trang đầu tiên nếu không nằm trong window --}} @if($windowStart > 1) 1 @if($windowStart > 2) ... @endif @endif {{-- Hiển thị các trang trong window --}} @for($page = $windowStart; $page <= $windowEnd; $page++) @if($page == $currentPage) {{ $page }} @else {{ $page }} @endif @endfor {{-- Hiển thị trang cuối cùng nếu không nằm trong window --}} @if($windowEnd < $lastPage) @if($windowEnd < $lastPage - 1) ... @endif {{ $lastPage }} @endif @if($classes->hasMorePages()) @else @endif
@endif
@endsection @section('scripts') @endsection