@extends('theme.master') @section('title', 'My Courses') @section('content') @include('admin.message') @php $gets = App\Breadcum::first(); @endphp @if(isset($gets))
@if($gets['img'] !== NULL && $gets['img'] !== '') {{$gets->text}} @else course @endif

{{ __('My Courses') }}

@endif @if(session('message'))
{{ session('message') }}
@endif @php $user_enrolled = App\Order::where('refunded', '0')->where('user_id', Auth::user()->id)->get(); @endphp @foreach($user_enrolled as $enrolled) @php $bigbluemeeting = App\BBL::where('course_id','=',$enrolled->course_id)->where('is_ended','!=',1)->where('link_by','!=', NULL)->get(); $zoommeeting = App\Meeting::where('course_id','=',$enrolled->course_id)->where('link_by','!=', NULL)->get(); @endphp @if(count($bigbluemeeting) > 0)

{{ __('BigBlue Meetings') }}

@endif @if(count($zoommeeting) > 0)

{{ __('Zoom Meetings') }}

@foreach($zoommeeting as $meeting)
@if($meeting['meeting_title'] !== NULL && $meeting['meeting_title'] !== '') course @endif
@if($meeting->user['user_img'] !== NULL && $meeting->user['user_img'] !== '') {{$meeting->meeting_title}} @else {{$meeting->meeting_title}} @endif
@endforeach
@endif @endforeach @php $item = App\Order::where('refunded', '0')->where('user_id', Auth::User()->id)->get(); @endphp @php $currentDate = Carbon\Carbon::now(); // Current date $user = Auth::user()->id; // Get the authenticated user ID $enroll = App\Order::where('refunded', '0') ->where('user_id', $user) ->where('enroll_expire', '>=', $currentDate) ->get(); @endphp @if(count($enroll) > 0)

{{ __('My Courses') }}

@foreach($enroll as $enrol) @if($enrol->course_id != NULL) @if($enrol->status == 1) @if($enrol->user_id == Auth::User()->id) @php // Fetch order information $order = App\Order::where('user_id', $enrol->user_id) ->where('course_id', $enrol->course_id) ->latest() ->first(); $enrollStart = Carbon\Carbon::parse($order->enroll_start); // Enrollment start date $enrollExpire = Carbon\Carbon::parse($order->enroll_expire); // Enrollment expiry date @endphp @if(isset($order) && now()->between($enrollStart, $enrollExpire))
@if($enrol->courses['preview_image'] !== NULL && $enrol->courses['preview_image'] !== '') student @else student @endif
@if($enrol->user['user_img'] !== NULL && $enrol->user['user_img'] !== '') {{$enrol->courses->title}} @else {{$enrol->courses->title}} @endif