@extends('hr_main') @section('title', '| Attendance Report') @section('content') @include('convert_word')

Daily Attendance Report

{!! Form::open([ 'url' => './report/daily-attendance-report', 'role' => 'form', 'class' => 'form-horizontal form-groups', 'id' => 'filterFormId', 'method' => 'get', ]) !!}
{!! Form::label('branchName', 'Branch: ', ['class' => 'control-label']) !!} {!! Form::select('branchName', $branchList, request()->get('branchName'), [ 'class' => 'form-control select2', 'id' => 'branchName', 'name' => 'branchName', 'required' => 'true', 'autocomplete' => 'off', ]) !!}
{!! Form::label('project', 'Project', ['class' => 'control-label']) !!} {!! Form::select('project_id', $projects, $searchProject, [ 'class' => 'form-control select2', 'id' => 'project_id', 'name' => 'project_id', ]) !!}
@if(isset($generatedSourceTypes))
@endif
{!! Form::label('date', 'Date : ', ['class' => 'control-label']) !!}
{!! Form::close() !!}
@if (isset($_GET['branchName']))

{{ $report_headers['company'] }}
{{ $report_headers['branch'] }}

{{ $report_headers['company_address'] }}

Branch: {{ $report_headers['branch'] }} Reporting Date: {{ $report_headers['reportOn'] }}
Project: {{ $report_headers['project'] }} Print Date: {{ date('d-m-Y H:i A') }}
@endif @if(isset($attendence_reports))
@php $sl = 1; @endphp @foreach($employeeInfo as $employee) @php $reportRowVisiable = true; $attendence = $attendence_reports->where('employee_id', $employee->id) ->where('attendenceDate', date('Y-m-d', strtotime($_GET['searchDate']))) ->first(); if($generatedSource && !$attendence) { $reportRowVisiable = false; } else { $isHoliday = in_array($_GET['searchDate'], $holiDays); $leaveStatus = @$leaves->where('emp_id_fk', $attendence->employee_id) ->where('from_date', '<=', date('Y-m-d', strtotime($_GET['searchDate']))) ->where('to_date', '>=', date('Y-m-d', strtotime($_GET['searchDate']))) ->first()->name; if($isHoliday) { $status = 'Holiday'; } if($setting_time && $attendence && $attendence->attendenceDate && $attendence->entryTime && $attendence->exitTime) { $start = ($attendence->exitTime) ? Carbon\Carbon::parse($attendence->attendenceDate . ' ' . $attendence->exitTime) : '00:00:00'; $end = ($attendence->entryTime) ? Carbon\Carbon::parse($attendence->attendenceDate . ' ' . $attendence->entryTime) : '00:00:00'; $workingHour = ($start != '00:00:00' && $end != '00:00:00') ? $start->diff($end)->format('%H:%I:%S') : '00:00:00'; $start = ($setting_time) ? Carbon\Carbon::createFromFormat('H:i:s', $setting_time) : '00:00:00'; $end = ($attendence->entryTime) ? Carbon\Carbon::createFromFormat('H:i:s', $attendence->entryTime) : '00:00:00'; $late = ($start != '00:00:00' && $end != '00:00:00') ? $start->diff($end)->format('%H:%I:%S') : '00:00:00'; if(!$isHoliday) { if(strtotime($setting_time) > strtotime(date('h:i A', strtotime($attendence->entryTime)))) { $status = 'Present'; $late = null; } else { $absent_time = strtotime($setting_time . '+3hours'); if (strtotime(date('h:i A', strtotime($attendence->entryTime))) > $absent_time) { $status = 'Absent'; } else { $status = 'Late'; } } } } else { $isHoliday = $workingHour = $late = null; if(!$leaveStatus) $leaveStatus = null; $status = 'Absent'; } } @endphp @if($reportRowVisiable) @endif @endforeach
# Emp. No. Emp. Name Gender Designation Att. Date In Time Out Time Working Hour Late Attendence Source Status Leave Status
{{ $sl++ }} {{ $employee->emp_id }} {{ $employee->emp_name_english }} {{ $employee->gender }} {{ $employee->designation }} {{ date('d-m-Y', strtotime($_GET['searchDate'])) }} {{ ($attendence && $attendence->entryTime && $attendence->entryTime != '00:00:00') ? date('h:i A', strtotime($attendence->entryTime)) : '--' }} {{ ($attendence && $attendence->exitTime && $attendence->exitTime != '00:00:00') ? date('h:i A', strtotime($attendence->exitTime)) : '--' }} {{ ($workingHour && $workingHour != '00:00:00') ? $workingHour : '--' }} {{ ($late && $late != '00:00:00') ? $late : '--' }} {{ ($attendence && $attendence->attendenceSource) ? $attendence->attendenceSource : '--' }} {{ (!$generatedSource) ? $status : '' }} {{ (!$generatedSource) ? $status : '' }}
@endif
@endsection