Danh sách học viên đăng ký

Khóa học: {{ $course->title }} | Ngày bắt đầu: {{ \Carbon\Carbon::parse($course->start_date)->format('d/m/Y') }}

@php $paidCount = $registrations->where('payment_status', 'paid')->count(); $pendingCount = $registrations->where('payment_status', 'pending')->count(); $cancelledCount = $registrations->where('payment_status', 'cancelled')->count(); // Tính doanh thu dựa trên giá thực tế khi đăng ký, fallback về giá hiện tại nếu chưa có $totalRevenue = $registrations->where('payment_status', 'paid')->sum(function($registration) use ($course) { return $registration->actual_price ?? $course->price; }); @endphp
Đã thanh toán
{{ $paidCount }}
Chờ thanh toán
{{ $pendingCount }}
Đã hủy
{{ $cancelledCount }}
Tổng doanh thu
{{ number_format($totalRevenue) }}₫
@foreach($registrations as $index => $registration) @endforeach
STT Họ tên Sđt Ngày đăng ký Trạng thái thanh toán Người tạo
{{ $index + 1 }}
{{ $registration->student_name }}
{{ $registration->student_phone }}
{{ \Carbon\Carbon::parse($registration->created_at)->format('d/m/Y H:i') }}
@php $statusConfig = match($registration->payment_status) { 'paid' => ['label' => 'Đã thanh toán', 'style' => 'background-color: #dcfce7; color: #166534; padding: 4px 10px; border-radius: 9999px; font-size: 12px; font-weight: 500;'], 'pending' => ['label' => 'Chờ thanh toán', 'style' => 'background-color: #fef3c7; color: #92400e; padding: 4px 10px; border-radius: 9999px; font-size: 12px; font-weight: 500;'], 'cancelled' => ['label' => 'Đã hủy', 'style' => 'background-color: #fee2e2; color: #991b1b; padding: 4px 10px; border-radius: 9999px; font-size: 12px; font-weight: 500;'], default => ['label' => 'Không xác định', 'style' => 'background-color: #f3f4f6; color: #374151; padding: 4px 10px; border-radius: 9999px; font-size: 12px; font-weight: 500;'] }; @endphp {{ $statusConfig['label'] }}
{{ $registration->creator ? $registration->creator->name : 'N/A' }}
@if($registrations->count() > 0)
Tổng số học viên: {{ $registrations->count() }} Đã thanh toán: {{ $paidCount }} Doanh thu: {{ number_format($totalRevenue) }}₫
Cập nhật lần cuối: {{ \Carbon\Carbon::parse($course->updated_at)->format('d/m/Y H:i') }}
@endif