@php // Chỉ hiển thị nút Guest mode cho tenant ICC $tenantConnection = \App\Helpers\HelperTenant::getCurrentTenantConnection(); @endphp
@foreach ($students as $student) @endforeach
#ID Tên học sinh Lớp Khóa học Tài khoản Email Điện thoại Hành động
{{ $student->id }} {{ $student->name }} @if($student->classesStudent->isNotEmpty()) @php $classNames = $student->classesStudent->pluck('name'); $displayedClasses = $classNames->take(1)->implode(', '); $remainingClasses = $classNames->slice(1)->implode(', '); @endphp {{ $displayedClasses }} @if($classNames->count() > 1) , @endif @else - @endif @if(isset($student->courses) && $student->courses->isNotEmpty()) @php $courseNames = $student->courses->unique('moodle_id')->pluck('moodle_name'); $displayedCourses = $courseNames->take(1)->implode(', '); $remainingCourses = $courseNames->slice(1)->implode(', '); @endphp {{ $displayedCourses }} @if($courseNames->count() > 1) , @endif @else - @endif {{ $student->username ?? '-' }} {{ $student->email }} {{ $student->phone ?? '-' }}
@if($tenantConnection === 'lms_tenant_icc' && in_array($currentEmail ?? '', ['test@hocmai.vn','thangnt@hocmai.vn','kienpn@ctv.hocmai.vn', 'tungtt@ctv.hocmai.vn'])) @endif
@if($students->hasPages())
Hiển thị {{ $students->firstItem() }} đến {{ $students->lastItem() }} trong tổng số {{ $students->total() }} kết quả
@if($students->onFirstPage()) @else @endif @php $currentPage = $students->currentPage(); $lastPage = $students->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($students->hasMorePages()) @else @endif
@endif