@extends('backEnd.master') @section('title') @lang('reports.merit_list_report') @endsection @section('mainContent')

@lang('common.select_criteria')

{{ Form::open(['class' => 'form-horizontal', 'route' => 'merit_list_reports', 'method' => 'POST', 'id' => 'search_student']) }}
@if(moduleStatusCheck('University'))
@includeIf('university::common.session_faculty_depart_academic_semester_level', ['required' => ['USN', 'UD', 'UA', 'US', 'USL'],'hide'=> ['USUB'] ])
{{ Form::select('exam_type',[""=>__('exam.select_exam').'*'], null , ['class' => 'primary_select form-control'. ($errors->has('exam_type') ? ' is-invalid' : ''), 'id'=>'select_exam_typ_subject']) }}
loader
@if ($errors->has('exam_type')) {{ @$errors->first('exam_type') }} @endif
@else
@if ($errors->has('exam')) {{ $errors->first('exam') }} @endif
@if ($errors->has('class')) {{ $errors->first('class') }} @endif
loader
@if ($errors->has('section')) {{ $errors->first('section') }} @endif
@endif
{{ Form::close() }}
@if(isset($allresult_data))

@lang('reports.merit_list_report')

{{generalSetting()->school_name}}

{{isset(generalSetting()->school_name)?generalSetting()->school_name:'Infix School Management ERP'}}

{{isset(generalSetting()->address)?generalSetting()->address:'Infix School Address'}}

@lang('common.email'): {{isset(generalSetting()->email)?generalSetting()->email:'hello@aorasoft.com'}}, @lang('common.phone'): {{isset(generalSetting()->phone)?generalSetting()->phone:'+96897002784'}}

{{-- start col-lg-8 --}}

@lang('reports.order_of_merit_list')

@lang('reports.academic_year') : {{@generalSetting()->academic_Year->year}}

@lang('reports.exam') : {{$exam_name}}

@lang('common.class') : {{$class_name}}

@lang('common.section') : {{$section->section_name}}

@lang('common.subjects')

@foreach($assign_subjects as $subject)

{{$subject->subject->subject_name}}

@endforeach
{{-- end col-lg-8 --}} {{-- sm_marks_grades --}}
{{--end sm_marks_grades --}}

@lang('reports.order_of_merit_list')

{{-- Mark Distributation Table Start --}}
@foreach($subjectlist as $subject) @endforeach @php $i = 1; @endphp @foreach($allresult_data as $key => $row) @php $student_detail = App\SmStudent::where('id', $row->student_id)->first(); $optional_subject = App\SmOptionalSubjectAssign::where('student_id', $student_detail->id) ->where('session_id', $student_detail->session_id) ->where('academic_id', getAcademicId()) ->first(); $optional_subject_id = $optional_subject ? $optional_subject->subject_id : null; $markslist = explode(',', $row->marks_string); $get_subject_id = explode(',', $row->subjects_id_string); $count = 0; $additioncheck = []; $subject_mark = []; $total_grade_point = 0; $total_grade_point_without_optional = 0; $number_of_subjects = count($markslist); $number_of_subjects_without_optional = 0; $current_total_marks = 0; // NEW variable to store current student's total marks @endphp @foreach($markslist as $mark) @php $is_optional = App\SmOptionalSubjectAssign::is_optional_subject($row->student_id, $get_subject_id[$count]); $grade_gpa = DB::table('sm_marks_grades') ->where('percent_from', '<=', $mark) ->where('percent_upto', '>=', $mark) ->where('academic_id', getAcademicId()) ->first(); $total_grade_point += @$grade_gpa->gpa; if (!$is_optional) { $total_grade_point_without_optional += @$grade_gpa->gpa; $number_of_subjects_without_optional++; } else { $additioncheck[] = $mark; } $current_total_marks += $mark; $count++; $subject_mark[] = $mark; @endphp @endforeach @php $gpa = number_format((float)$total_grade_point / $number_of_subjects_without_optional, 2, '.', ''); if ($gpa > 5) { $gpa = 5.00; } $gpa_without_optional = $number_of_subjects_without_optional ? number_format((float)$total_grade_point_without_optional / $number_of_subjects_without_optional, 2, '.', '') : $failgpa; @endphp @foreach($markslist as $mark) @endforeach @endforeach
@lang('common.name') @lang('student.admission_no') @lang('student.roll_no') @lang('reports.position') @lang('exam.total_mark') @lang('reports.gpa_without_additional') @lang('exam.gpa'){{$subject}}
{{ $row->student_name }} {{ $row->admission_no }} {{ $row->studentinfo->roll_no }} {{ $key + 1 }} {{ $current_total_marks }} {{ $gpa_without_optional }} {{ number_format($gpa, 2) }}{{ !empty($mark) ? $mark : 0 }}
{{-- Mark Distributation Table End --}}
@endif @endsection @if(moduleStatusCheck('University')) @push('script') @endpush @endif