@extends('backEnd.master') @section('title') @lang('student.student_attendance_report') @endsection @section('mainContent') @push('css') @endpush

@lang('common.select_criteria')

{{ Form::open(['class' => 'form-horizontal', 'files' => true, 'url' => 'subject-attendance-average-report', 'method' => 'POST', 'enctype' => 'multipart/form-data', 'id' => 'search_student']) }}
@php $current_month = date('m'); @endphp @if(moduleStatusCheck('University')) @includeIf('university::common.session_faculty_depart_academic_semester_level',['required'=>['USN', 'UF', 'UD', 'UA', 'US', 'USL'], 'hide'=>['USUB']])
@if ($errors->has('month')) {{ $errors->first('month') }} @endif
@if ($errors->has('year')) {{ $errors->first('year') }} @endif
@else @include('backEnd.common.search_criteria', [ 'div'=>'col-lg-3', 'required'=>['class', 'section'], 'visiable'=>['class', 'section'], ])
@if ($errors->has('month')) {{ $errors->first('month') }} @endif
@if ($errors->has('year')) {{ $errors->first('year') }} @endif
@endif
{{ Form::close() }}
@if(isset($attendances))

@lang('student.student_attendance_report') P: L: A: F: H:

@if(userPermission('subject-attendance/print')) @if(moduleStatusCheck('University')) @lang('common.print') @else @lang('common.print') @endif @endif
@lang('student.present'): P
@lang('student.late'): L
@lang('student.absent'): A
@lang('student.half_day'): F
@lang('student.holiday'): H
@for($i = 1; $i<=$days; $i++) @endfor @php $total_grand_present = 0; $total_late = 0; $total_absent = 0; $total_holiday = 0; $total_halfday = 0; @endphp @foreach($attendances as $values) @php $last_key_number = array_key_last(array($values)); @endphp @php $total_attendance = 0; @endphp @php $count_absent = 0; @endphp @for($i = 1; $i<=$days; $i++) @php $date = $year.'-'.$month.'-'.$i; $y = 0; @endphp @endfor @endforeach
@lang('student.name') @lang('student.admission_no') P L A F H % {{$i}}
@php $date = $year.'-'.$month.'-'.$i; $day = date("D", strtotime($date)); echo $day; @endphp
@php $student = 0; @endphp @foreach($values as $value) @php $student++; @endphp @if($student == 1) {{@$value->student->full_name}} @endif @endforeach @php $student = 0; @endphp @foreach($values as $value) @php $student++; @endphp @if($student == 1) {{@$value->student->admission_no}} @endif @endforeach @php $p = 0; @endphp @foreach($values as $value) @if($value->attendance_type == 'P') @php $p++; $total_attendance++; $total_grand_present++; @endphp @endif @endforeach {{$p}} @php $l = 0; @endphp @foreach($values as $value) @if($value->attendance_type == 'L') @php $l++; $total_attendance++; $total_late++; @endphp @endif @endforeach {{$l}} @php $a = 0; @endphp @foreach($values as $value) @if($value->attendance_type == 'A') @php $a++; $count_absent++; $total_attendance++; $total_absent++; @endphp @endif @endforeach {{$a}} @php $f = 0; @endphp @foreach($values as $value) @if($value->attendance_type == 'F') @php $f++; $total_attendance++; $total_halfday++; @endphp @endif @endforeach {{$f}} @php $h = 0; @endphp @foreach($values as $value) @if($value->attendance_type == 'H') @php $h++; $total_attendance++; $total_holiday++; @endphp @endif @endforeach {{$h}} @php $total_present = $total_attendance - $count_absent; @endphp {{$total_present.'/'.$total_attendance}}
@php if($count_absent == 0){ echo '100%'; }else{ $percentage = $total_present / $total_attendance * 100; echo number_format((float)$percentage, 2, '.', '').'%'; } @endphp
@php $date_present=0; $date_absent=0; $date_total_class=0; @endphp @foreach($values as $key => $value) @if(strtotime($value->attendance_date) == strtotime($date)) @php if($value->attendance_type=='P'){ $date_present++; }else{ $date_absent++; } $date_total_class=$date_present+$date_absent; @endphp {{-- {{$value->attendance_type}} --}} @endif @endforeach {{-- Date Report --}} @if ($date_total_class!=0) {{$date_present.'/'.$date_total_class}}
@php if($date_absent == 0){ echo '100%'; }else{ if ($date_present!=0) { $date_percentage = $date_present / $date_total_class * 100; echo @number_format((float)$date_percentage, 2, '.', '').'%'; }else{ echo '0%'; } } @endphp @endif
@endif @endsection @include('backEnd.partials.data_table_js')