@extends('layouts.app') @section('title', __('Merit List')) @section('content')
@include('layouts.leftside-menubar')
@include('components.pages-bar',['pageTitle' =>''. trans('Exams').' / '. trans('Tabulation').'']) @include('components.sectionbar.examination-bar')

{{Auth::user()->school->name}}

{{Auth::user()->school->address}}

{{Auth::user()->school->name}}

@lang('Tabulation Sheet')

@php $cName = subjectOrCourseNameWithOutS(); $className = school('country')->code == 'BD' ? transMsg('Class') : transMsg('Grade'); @endphp
@foreach($results as $result) @break @endforeach
{{$className}} @lang('Section') @lang('Group') @lang('Exam') @lang('Session')
{{$result->class_name}} {{$result->section_number}} {{$result->group}} {{$result->exam->exam_name}} @php $currentSession = currentSession(); @endphp {{$currentSession->schoolyear}}
@foreach($courses as $course) @endforeach @foreach($courses as $course) @endforeach @php $pre_stu=null;$student_array=array();$key=1;$td_ca =$td_mcq=$td_practical= false;@endphp @foreach($results as $result) @if (!in_array($result->student_code,$student_array)) @php array_push($student_array,$result->student_code);$pre_stu=$result->student_code;$sub_total=$sub_gpa=$subject_count=$optional_grade=0;$optional=$fail=false;$print_text=''; @endphp @foreach($courses as $course) @php $course_colspan=0; @endphp @if(in_array($course->id,explode(',',$result->course_groups))) @foreach($results as $t_result) @if($t_result->course_id == $course->id && $pre_stu == $t_result->student_code) @php $sub_total += round($t_result->marks);$sub_gpa +=$t_result->gpa;$subject_count++; @endphp @if ($t_result->ca) @php ${"ca" . $course->id} = true; $td_ca = true;@endphp @else @if (!isset(${"ca" . $course->id})) @php $course_colspan +=1 @endphp @push('script') @endpush @php $print_text= $print_text.'#ca_'.$course->id.'{display: none;}'@endphp @elseif(isset(${"ca" . $course->id}) && $td_ca) @endif @endif @if ($t_result->mcq) @php ${"mcq" . $course->id} = true;$td_mcq = true; @endphp @else @if (!isset(${"mcq" . $course->id})) @php $course_colspan +=1 @endphp @push('script') @endpush @php $print_text= $print_text.'#mcq_'.$course->id.'{display: none;}'@endphp @elseif(isset(${"mcq" . $course->id}) && $td_ca) @endif @endif @if ($t_result->practical) @php ${"practical" . $course->id} = true;$td_practical = true;@endphp @else @if (!isset(${"practical" . $course->id})) @php $course_colspan +=1 @endphp @push('script') @endpush @php $print_text= $print_text.'#practical_'.$course->id.'{display: none;}'@endphp @elseif(isset(${"practical" . $course->id}) && $td_practical) @endif @endif @if ($optional == false && $t_result->optional == 1) @php $optional=true; $optional_grade=$t_result->gpa; @endphp @endif @break @endif @endforeach @push('script') @endpush @else @endif @endforeach @endif @endforeach
@lang('SI') @lang('Student Code') @lang('Roll') @lang('Name'){{$course->name}}@lang('Final')
@lang('CA') @lang('CQ') @lang('MCQ') @lang('P') @lang('Mark') @lang('LG')@lang('Total') @lang('GPA') @lang('LG') @lang('Merit')
{{$key++}} {{$result->student_code}} {{$result->class_roll}} {{$result->student_name}}{{round($t_result->ca)}}0{{round($t_result->written)}}{{round($t_result->mcq)}}0{{round($t_result->practical)}}0{{round($t_result->marks)}} @php $gradesystemsMany = (new \App\CourseConfig())->gradeSystemMany($t_result->course_config_id); @endphp @foreach($gradesystemsMany as $gs) @if(round($t_result->marks) >= $gs->from_mark && round($t_result->marks) <= $gs->to_mark) @if (strtolower($gs->grade) == 'f') @php $fail=true; @endphp @endif {{$gs->grade}} @break @endif @endforeach {{round($sub_total)}} @php if($optional){ $subject_count = $subject_count -1 ; if ($optional_grade >= 2) { $optional_minus = 2; }elseif ($optional_grade >= 1) { $optional_minus = 1; } $sub_gpa = $sub_gpa - $optional_minus; } $gpa = $sub_gpa / $subject_count; if ($gpa > 5) { $gpa = 5; } if ($fail) echo '0.00'; else echo number_format($gpa,2); @endphp @php $first_gsystem = (new \App\Gradesystem())->where('school_id', auth()->user()->school_id)->select('grade_system_name')->distinct()->first(); $gradesystemsMany = (new \App\Gradesystem())->where('school_id', auth()->user()->school_id)->where('grade_system_name', $first_gsystem->grade_system_name)->get(); $previous_point=0; @endphp @foreach($gradesystemsMany as $gs) @if($gpa >= $gs->point && $gpa <= $previous_point) @if ($fail) F @else {{$gs->grade}} @endif @break @endif @php $previous_point=$gs->point @endphp @endforeach @if ($fail) F @else @php $position_no = 1; @endphp @foreach($t_marits as $merit) @if ($merit->student_code == $result->student_code) {{convert_ordinary($position_no)}} @endif @php $position_no ++; @endphp @endforeach @endif
@push('script') @endpush @endsection