@extends('student.layouts.course') @section('titlePage', $data->title) @push('styles') @endpush @section('content')
@include('student.courses.inc.nav', ['url' => _route('student.courses.index')])

@if($data->type ==1) BACK @else BACK @endif


{{$data->title}}

@foreach ($data->sections_course as $section) @php $content = json_decode($section->content, true); $content = is_array($content) ? $content : []; $percent = \App\CourseStatus::getPercent([ 'course_id' => $data->id, 'section_course_id' => $section->id ],$content); $collapsed = "collapsed"; if ($section->id == $sectionCourseId || ($sectionCourseId == false && $loop->first)) { $collapsed = ""; } @endphp
@if (is_array($content) && count($content) > 0)
    @foreach ($content as $item) @php if (strpos($item, 'learning') !== false) { $idLearning = str_replace('learning_','', $item); $link = _route('student.free_course.freeCourseDetailType', [ $data->id, 'learning', $section->id, $idLearning, ]); $status = \App\CourseStatus::getStatus([ 'course_id' => $data->id, 'type' => 'learning', 'section_course_id' => $section->id, 'id_sub' => $idLearning, ]); $_learning = \App\LearningContents::where('id', $idLearning)->first('title'); $title = $_learning->title ?? null; }else{ if (strpos($item, 'assignment_') !== false) { $idAssignment = str_replace('assignment_','', $item); $link = _route('student.free_course.freeCourseDetailType', [ $data->id, 'assignment', $section->id, $idAssignment, ]); $status = \App\CourseStatus::getStatus([ 'course_id' => $data->id, 'type' => 'assignment', 'section_course_id' => $section->id, 'id_sub' => $idAssignment, ]); $_assignment = \App\Assignments::where('id', $idAssignment)->first('title'); $title = $_assignment->title ?? null; }else{ $idTest = str_replace('test_','', $item); $link = _route('student.free_course.freeCourseDetailType', [ $data->id, 'test', $section->id, $idTest, ]); $status = \App\CourseStatus::getStatus([ 'course_id' => $data->id, 'type' => 'test', 'section_course_id' => $section->id, 'id_sub' => $idTest, ]); $_test = \App\Tests::where('id', $idTest)->first('title'); $title = $_test->title ?? null; } } $text_class = "text-dark"; if ($status == \App\CourseStatus::STATUS_COMPLETED) { $text_class = "text-success"; }else if($status == \App\CourseStatus::STATUS_INPROGRESS){ $text_class = "text-warning"; } $status_final=$status; @endphp @if (!empty($title))
  • {{$title}} {{$status}}
  • @endif @endforeach
@endif
@endforeach
@isset($view) @include($view) @endisset @if (!is_student_master()) @if (is_null($data->payment)) @include('frontend.courses.free_course_detail') @endif @endif
{{-- --}}
@endsection @push('script') @include('student.courses.inc.script') @endpush