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

Branch Wise Attendance Report

{!! Form::open([ 'url' => './report/branch-wise-attendance-report', 'role' => 'form', 'class' => 'form-horizontal form-groups', 'id' => 'filterFormId', 'method' => 'get', ]) !!}
{!! Form::label('branchName', 'Branch Name : ', ['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('fromDate', 'From Date : ', ['class' => 'control-label']) !!}
{!! Form::label('toDate', 'To 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_infos))
@php $serial = 1; @endphp @foreach($employees as $employee) @php $rowGenerateCount = $totalLateCount = $totalLeaveCount = 0; @endphp @foreach($dates as $key => $date) @php $reportRowVisiable = true; $dateWiseAttendenceInfo = $attendence_infos->where('employee_id', $employee->emp_id_fk) ->where('attendenceDate', $date)->first(); if($generated_source != 'All' && !$dateWiseAttendenceInfo) { $reportRowVisiable = false; } @endphp @if($reportRowVisiable) @php $rowGenerateCount = $rowGenerateCount + 1; $device = $workingHour = $late = $leaveStatus = null; $status = 'Absent'; $leaveStatus = @$leaves->where('emp_id_fk', $employee->emp_id_fk) ->where('from_date', '<=', date('Y-m-d', strtotime($date))) ->where('to_date', '>=', date('Y-m-d', strtotime($date))) ->first()->name; if($dateWiseAttendenceInfo) { $device = $devices->whereIn('id', $dateWiseAttendenceInfo->attendenceDeviceId)->first(); if($setting_time && $dateWiseAttendenceInfo->attendenceDate && $dateWiseAttendenceInfo->entryTime && $dateWiseAttendenceInfo->exitTime) { $start = ($dateWiseAttendenceInfo->exitTime) ? Carbon\Carbon::parse($dateWiseAttendenceInfo->attendenceDate . ' ' . $dateWiseAttendenceInfo->exitTime) : '00:00:00'; $end = ($dateWiseAttendenceInfo->entryTime) ? Carbon\Carbon::parse($dateWiseAttendenceInfo->attendenceDate . ' ' . $dateWiseAttendenceInfo->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 = ($dateWiseAttendenceInfo->entryTime) ? Carbon\Carbon::createFromFormat('H:i:s', $dateWiseAttendenceInfo->entryTime) : '00:00:00'; $late = ($start != '00:00:00' && $end != '00:00:00') ? $start->diff($end)->format('%H:%I:%S') : '00:00:00'; if(strtotime($setting_time) > strtotime(date('h:i A', strtotime($dateWiseAttendenceInfo->entryTime)))) { $status = 'Present'; $late = null; } else { $absent_time = strtotime($setting_time . '+3hours'); if (strtotime(date('h:i A', strtotime($dateWiseAttendenceInfo->entryTime))) > $absent_time) { $status = 'Absent'; } else { $status = 'Late'; } } } } if($late != null) $totalLateCount = $totalLateCount + 1; if($leaveStatus) $totalLeaveCount = $totalLeaveCount + 1; @endphp @endif @endforeach @if($rowGenerateCount != 0) @endif @endforeach
# Emp. No. Emp. Name Gender Designation Att. Date In Time Out Time Working Hour Late Attendence Source Branch Device Status Leave Status
{{ $serial++ }} {{ @$employee->emp_id }} {{ @$employee->emp_name_english }} {{ @$employee->gender }} {{ @$employee->designation }} {{ date('d-m-Y', strtotime($date)) }} {{ ($dateWiseAttendenceInfo && isset($dateWiseAttendenceInfo->entryTime) && $dateWiseAttendenceInfo->entryTime != '00:00:00') ? date('h:i A', strtotime($dateWiseAttendenceInfo->entryTime)) : '--' }} {{ ($dateWiseAttendenceInfo && isset($dateWiseAttendenceInfo->exitTime) && $dateWiseAttendenceInfo->exitTime != '00:00:00') ? date('h:i A', strtotime($dateWiseAttendenceInfo->exitTime)) : '--' }} {{ (isset($workingHour)) ? $workingHour : '' }} {{ (isset($late)) ? $late : '' }} {{ ($dateWiseAttendenceInfo && isset($dateWiseAttendenceInfo->attendenceSource)) ? $dateWiseAttendenceInfo->attendenceSource : '' }} {{ @$employee->branch }} {{ (isset($device)) ? $device->device_serial_number : '' }} {{ (isset($status) && $generated_source == 'All') ? $status : '' }} {{ (isset($leaveStatus) && $generated_source == 'All') ? $leaveStatus : '' }}
Total Count {{ $totalLateCount }} {{ $totalLeaveCount }}
@endif
@endsection