@extends('layouts.landing') @section('title', 'Elearning') @section('content')

@if(domain($_SERVER['HTTP_HOST'])->company_name == 'Nlsalumni') E-continuing Legal Education @else E-learning @endif

@if(Auth::user()->isSuperAdmin() || Auth::user()->isTenant() || Auth::user()->isAdmin())
New Course
@endif
{{--
--}}
@if(count($courses) > 0) @foreach ($courses as $course)
@if($course->duration > 1) {{$course->duration}} mins eCLE Value @elseif($course->duration < 2) {{$course->duration}} min eCLE Value @elseif($course->duration >= 60 && $course->duration < 120) {{$course->duration / 60}} hr eCLE Value @elseif($course->duration >= 120) {{$course->duration / 60}} hrs eCLE Value @endif

{{Str::words($course->description, 10)}}

@php $review_count = App\Models\CourseReview::where('course_id', $course->id)->count(); $viewed_count = App\Models\ViewedCourse::where('course_id', $course->id)->count(); @endphp @if($review_count > 0) {{number_format($review_count)}} @endif
@if($viewed_count > 9999) {{substr($viewed_count, 0, -3)}}K views @elseif($viewed_count > 99999) {{substr($viewed_count, 0, -3)}}K views @elseif($viewed_count > 999999) {{substr($viewed_count, 0, -4)}}M views @elseif($viewed_count < 2) {{number_format($viewed_count)}} view @else {{number_format($viewed_count)}} views @endif
@endforeach @else
No courses created
@if(Auth::user()->isSuperAdmin() || Auth::user()->isTenant() || Auth::user()->isAdmin()) Create Course @endif
@endif
@if(count($courses) > 0) @foreach ($courses as $course)
@if($course->duration > 1) {{$course->duration}} mins eCLE Value @elseif($course->duration < 2) {{$course->duration}} min eCLE Value @elseif($course->duration >= 60 && $course->duration < 120) {{$course->duration / 60}} hr eCLE Value @elseif($course->duration >= 120) {{$course->duration / 60}} hrs eCLE Value @endif

{{Str::words($course->description, 10)}}

@php $review_count = App\Models\CourseReview::where('course_id', $course->id)->count(); $viewed_count = App\Models\ViewedCourse::where('course_id', $course->id)->count(); @endphp @if($review_count > 0) {{number_format($review_count)}} @endif
@if($viewed_count > 9999) {{substr($viewed_count, 0, -3)}}K views @elseif($viewed_count > 99999) {{substr($viewed_count, 0, -3)}}K views @elseif($viewed_count > 999999) {{substr($viewed_count, 0, -4)}}M views @elseif($viewed_count < 2) {{number_format($viewed_count)}} view @else {{number_format($viewed_count)}} views @endif
@endforeach @else
No courses created
Create Course
@endif
@endsection