@extends('layouts.app') @section('title', __('Attendance')) @section('content')
@include('layouts.leftside-menubar')
@include('components.pages-bar',['pageTitle' =>''. trans('Attendance').' / '. trans('Take Attendances').'']) @include('components.sectionbar.attendance')
{!! Form::open(['method' => 'post','autocomplete'=>'off']) !!}
{!! Form::label('section', trans('Section'), ['class' => 'control-label']) !!} {!! Form::select('section', $pluckSection , $section?? null , ['class' => 'select2 form-control','required','placeholder'=>'Choose']) !!} @error('section') {{ $message }} @enderror
{!! Form::label('exam', trans('Exam'), ['class' => 'control-label']) !!} {!! Form::select('exam', $pluckExam , $exam?? null , ['class' => 'select2 form-control','required','placeholder'=>'Choose']) !!} @error('exam') {{ $message }} @enderror
{!! Form::label('date', trans('Date'), ['class' => 'control-label']) !!} {!! Form::text('date', $date ?? date('d-m-Y') , ['class' => 'form-control','required','readonly']) !!} @error('date') {{ $message }} @enderror
{!! Form::close() !!}
@isset($students)
@php $update= false; @endphp @foreach ($students as $student) {{trans(school('country')->code == 'BD' ? 'Class' : 'Grade')}} - {{$student->section->class->name}}   @lang('Section') - {{ $student->section->section_number}} @lang('Attendance Date'):  {{ $date}} @break($loop->first) @endforeach
@foreach ($students as $student) @foreach ($student->attendance as $attendance) @if ($attendance->present == 1 || $attendance->present == 0) @php $update= true; @endphp @break @endif @endforeach @endforeach
@if ($students->count()) @if ($update)
@lang('Attendance Already Submitted,Now can edit Attendance')
@else
{!! Form::checkbox('attrCheckAll',1,null, ['class'=>'','id'=>'attrCheckAll']) !!}
@endif
@foreach($students as $student) @php $checked = false;$attrId=0;@endphp @foreach ($student->attendance as $attendance) @if ($attendance->present == 1) @php $checked = true;$attrId = $attendance->id;$remark = $attendance->remark ; @endphp @endif @endforeach @endforeach
# @lang('Student ID') @lang('Name') @lang('Attendance')
{{$loop->index +1}} {{$student->student_code}} {{$student->name}} @if ($update)
{!! Form::checkbox('adjustAtt',$checked ? 1 : '', null, ['class'=>'adjustAtt','checked'=>$checked,'id' => $student->student_code]) !!}
{!! Form::text('adjustAttRemark', null, ['class'=>'adjustAttR d-none form-control popTop','id' => 'adjustAtt'.$student->student_code,'data-attr'=>$attrId,'data-id' => $student->student_code,'title'=>'Correction remark','onblur'=>'adjustAttRemark(this)']) !!}
@else
{!! Form::checkbox('attendance', '1', null, ['class'=>'takeAttendance','id' => $student->student_code]) !!} @endif
@else @lang('No Related Data Found.') @endif @endisset
@endsection @push('script') @endpush