@extends('bn.dashboard.layout') @section('dashboard-content')

কোর্সসমূহ

আপনার এনরোল করা কোর্সগুলো সহজে ট্র্যাক করুন এবং শেখা শুরু করুন।

@if(!empty($statusCounts))
{{ $statusCounts['paid'] ?? 0 }} Paid
{{ $statusCounts['free'] ?? 0 }} Free
{{ $statusCounts['pending'] ?? 0 }} Pending
{{ $itemCount ?? 0 }} Total
@endif
@if(!empty($mappingProblem) && ($itemCount ?? 0) === 0)
Couldn’t match your dashboard login to a WordPress user. Make sure your Laravel user has a wp_user_id set or matching email exists in wp_users.user_email.
@endif
@forelse ($courses as $c) @php $hasSale = !is_null($c->sale_price) && !is_null($c->regular_price) && (float)$c->sale_price < (float)$c->regular_price; $regular = is_null($c->regular_price) ? null : (float)$c->regular_price; $sale = is_null($c->sale_price) ? null : (float)$c->sale_price; $price = (float)($c->discount_price ?? $sale ?? $regular ?? 0); $status = strtolower($c->payment_status ?? 'unknown'); $badgeClass = match($status) { 'paid' => 'success', 'free' => 'primary', 'pending' => 'warning', default => 'dark' }; $pct = is_null($c->progress_percent) ? 0 : max(0, min(100, (int)$c->progress_percent)); $courseUrl = !empty($c->post_name) ? url('/course/'.$c->post_name) : url('/?post_type=courses&p='.$c->course_id); $cover = $c->image_url ?: asset('assets/images/no-image.png'); @endphp
{{-- LEFT IMAGE --}}
Course Image
{{ ucfirst($status) }}
{{-- RIGHT CONTENT --}}
{{-- TOP --}}

{{ $c->post_title ?? 'Untitled Course' }}

{{-- PROGRESS --}}
Course Progress {{ $pct }}%
{{-- BOTTOM --}}
Ordered: {{ \Carbon\Carbon::parse($c->created_at_gmt) ->timezone(config('app.timezone','UTC')) ->format('M d, Y') }} @if($hasSale) ৳ {{ number_format($regular, 2) }}
৳ {{ number_format($sale, 2) }}
@else
৳ {{ number_format($price, 2) }}
@endif
@php $status = strtolower($c->payment_status ?? ''); @endphp @if($status === 'paid') Continue Reading @else Complete Enrollment @endif
@empty
No Course

No Courses Found

You haven’t enrolled in any courses yet.

Browse Courses
@endforelse {{-- PAGINATION --}} @if($courses->count())
{{ $courses->withQueryString()->onEachSide(0)->links('pagination::simple-bootstrap-4') }}
@endif
{{-- STYLES --}} @endsection