@extends('admin::layouts.plane') @section('content')

Students Enrolled in {{ $course->course_name }}

{{ Form::open(['method' => 'GET', 'id' => 'searchForm']) }} {{ Form::select('sort_by', ['first_name' => 'Sorted By Name', 'admission_no' => 'Sorted By UID'], Request::input('sort_by', 'first_name'), ['class' => 'form-control search', 'id' => 'sort_by', 'placeholder' => 'Sort By']) }} {{ Form::close() }} Dashboard

Code: {{ $course->course_code }}

Type: {{ $course->course_type }}

Scheme: {{ $course->scheme_name }}

Teacher: {{ $course->teacher_name }}

@php $course_category = $course->course_category; $alowed_types =[]; if ($course_category == 'theory') { if(!empty($course->internal)){ $alowed_types['internal'] = 'Theory Internal'; } if(!empty($course->mcq)){ $alowed_types['mcq'] = 'MCQ'; } } if ($course_category == 'practical') { if(!empty($course->practical)){ $alowed_types['partical_internal'] = 'Partical Internal'; } } $studentsBatches = array_chunk($students->toArray(), 10); // Chunk students into batches of 10 @endphp @foreach ($studentsBatches as $index => $batch)
@csrf @foreach($alowed_types as $type=>$type_name) @endforeach @foreach ($batch as $student) @foreach($alowed_types as $type=>$type_name) @php $absent_field = $type.'_absent'; $marks_field = $type; @endphp @endforeach @endforeach
UID Name ClassAbsent? {{ $type_name }} ({{ $course->$type }})
{{ $student->uid }} {{ $student->name }} {{ $student->class_name }} @if (isset($student->$absent_field) && $student->$absent_field) Absent @else @if (!isset($student->$marks_field) || $student->$marks_field === null) @endif @endif $absent_field) && $student->$absent_field ? 'disabled' : '' }}>
@endforeach
@endsection