@extends('backEnd.master') @section('title') @lang('student.attendance') @endsection @push('css') @endpush @section('mainContent')
@php $year=date('Y'); @endphp
@if(session()->has('message-success'))
{{ session()->get('message-success') }}
@elseif(session()->has('message-danger'))
{{ session()->get('message-danger') }}
@endif

@lang('common.select_criteria')

{{ Form::open(['class' => 'form-horizontal', 'files' => true, 'route' => 'student_my_attendance_search', 'method' => 'POST', 'enctype' => 'multipart/form-data', 'id' => 'search_student']) }}
@if ($errors->has('month')) {{ $errors->first('month') }} @endif
@if ($errors->has('year')) {{ $errors->first('year') }} @endif
{{ Form::close() }}
@if(isset($records))
@foreach($records as $key => $record)
@lang('student.present'): P
@lang('student.late'): L
@lang('student.absent'): A
@lang('student.half_day'): F
@lang('student.holiday'): H
@lang('common.print')
@for($i = 1; $i<=@$days; $i++) @endfor @php $studentAttendance = $record->studentAttendanceByMonth($month, $year); @endphp @php @$total_attendance = 0; @endphp @php @$count_absent = 0; @endphp @for($i = 1; $i<=@$days; $i++) @php @$date = @$year.'-'.@$month.'-'.$i; @endphp @endfor
P L A H F % {{$i}}
@php @$date = @$year.'-'.@$month.'-'.$i; @$day = date("D", strtotime(@$date)); echo @$day; @endphp
@php $p = 0; @endphp @foreach($studentAttendance as $value) @if(@$value->attendance_type == 'P') @php $p++; @$total_attendance++; @endphp @endif @endforeach {{$p}} @php $l = 0; @endphp @foreach($studentAttendance as $value) @if(@$value->attendance_type == 'L') @php $l++; @$total_attendance++; @endphp @endif @endforeach {{$l}} @php $a = 0; @endphp @foreach($studentAttendance as $value) @if(@$value->attendance_type == 'A') @php $a++; @$count_absent++; @$total_attendance++; @endphp @endif @endforeach {{$a}} @php $h = 0; @endphp @foreach($studentAttendance as $value) @if(@$value->attendance_type == 'H') @php $h++; @$total_attendance++; @endphp @endif @endforeach {{$h}} @php $f = 0; @endphp @foreach($studentAttendance as $value) @if(@$value->attendance_type == 'F') @php $f++; @$total_attendance++; @endphp @endif @endforeach {{$f}} @php @$total_present = @$total_attendance - @$count_absent; if(@$count_absent == 0){ echo '100%'; }else{ @$percentage = @$total_present / @$total_attendance * 100; echo number_format((float)@$percentage, 2, '.', '').'%'; } @endphp @foreach($studentAttendance as $value) @if(strtotime(@$value->attendance_date) == strtotime(@$date)) {{@$value->attendance_type}} @endif @endforeach
@endforeach
@endif @endsection @include('backEnd.partials.data_table_js')