@php use App\Models\Staff;use Carbon\Carbon; @endphp @extends('admin.layouts.app') @section('title',get_setting('site_name').' Attendance Report') @section('content')
{{ __('Attendance Report') }}
{{ __('For Staff Wise Report Only') }}
{{ __('For Specific Date Wise Only') }}
{{ __('Reset') }}
{{-- ---------- STAFF WISE MONTHLY (Printable) ---------- --}} @if(($report ?? 'staff') === 'staff' && ($year && $month && $staff_details))
@if(get_setting('system_logo_white')) {{ get_setting('site_name') }} @endif
{{ get_setting('site_name') }}
{{ optional($staff_details->warehouse)->address }}
{{ __('Export CSV') }}
Attendance Report On {{ Carbon::create($year, $month, 1)->format('F') }} - {{ $year }}
Employee Code 0{{ optional($staff_details->user)->id }} Designation {{ optional($staff_details->designation)->name ?? '-' }}
Employee Name {{ optional($staff_details->user)->name }} Warehouse/Branch {{ optional($staff_details->warehouse)->name }}
@for($day = 1; $day <= Carbon::create($year, $month, 1)->daysInMonth; $day++) @php $currentDate = Carbon::create($year, $month, $day)->format('Y-m-d'); $foundStatus = false; @endphp @endfor
Date Status In Time Out Time Remarks
{{ $currentDate }} ({{ date('l', strtotime($currentDate)) }}) @foreach($salesData as $sale) @if($sale->date == $currentDate) {{ $sale->status }} @php $foundStatus = true; @endphp @endif @endforeach @foreach($holiday_data as $sale) @if($sale == $currentDate) {{ __('H') }} @php $foundStatus = true; @endphp @endif @endforeach @foreach($half_leaves as $half) @if($half == $currentDate) {{ __('Half Leave') }} @php $foundStatus = true; @endphp @endif @endforeach @foreach($weekend_data as $weekend) @if(date('l', strtotime($currentDate)) == $weekend) {{ __('W') }} @php $foundStatus = true; @endphp @endif @endforeach @foreach($leave_data as $leave) @if($leave == $currentDate) {{ __('L') }} @php $foundStatus = true; @endphp @endif @endforeach @if(!$foundStatus) {{ __('A') }} @endif @foreach($salesData as $sale) @if($sale->date == $currentDate && $sale->status != 'L') {{date('h:i A',strtotime($sale->signIn))}} @endif @endforeach @foreach($salesData as $sale) @if($sale->date == $currentDate && $sale->status != 'L') {{date('h:i A',strtotime($sale->signOut))}} @endif @endforeach @foreach($salesData as $sale) @if(Carbon::create($year,$month,$day)->format('Y-m-d')==$sale->date) {!! $sale->remarks !!} @endif @endforeach
@endif {{-- ---------- Department Wise / Branch Wise (Monthly Summary) ---------- --}} @if((($report ?? '') === 'department_summary' || ($report ?? '') === 'branch_summary') && !empty($monthly))
@if(get_setting('system_logo_white')) {{ get_setting('site_name') }} @endif
{{ get_setting('site_name') }}
{{ __('Monthly Attendance Summary') }} — {{ Carbon::create($monthly['year'], $monthly['month'], 1)->format('F') }} {{ $monthly['year'] }}
{{ __('Export CSV') }}
@forelse($monthly['rows'] as $k => $r) @empty @endforelse
# {{ __('Employee') }} {{ __('Department') }} {{ __('Branch') }} {{ __('Present') }} {{ __('Late') }} {{ __('Absent') }} {{ __('Leave') }} {{ __('Half leave') }} {{ __('Holiday') }} {{ __('Weekend') }} {{ __('Total') }}
{{ $k+1 }} {{ optional($r['staff']->user)->name }} ({{ $r['staff']->user_id ?? optional($r['staff']->user)->id }}) {{ optional($r['staff']->department)->name ?? '—' }} {{ optional($r['staff']->warehouse)->name ?? '—' }} {{ $r['present'] }} {{ $r['late'] }} {{ $r['absent'] }} {{ $r['leave'] }} {{ $r['half'] }} {{ $r['holiday'] }} {{ $r['weekend'] }} {{ $r['total_days'] }}
{{ __('No records found') }}
@endif {{-- ---------- Department Wise / Branch Wise (Monthly Grid) ---------- --}} @if((($report ?? '') === 'department_grid' || ($report ?? '') === 'branch_grid') && !empty($monthlyGrid))
{{ __('Monthly Attendance Grid') }}
{{ Carbon::create($monthlyGrid['year'], $monthlyGrid['month'], 1)->format('F') }} {{ $monthlyGrid['year'] }} — {{ __('Legend') }}: P={{__('Present')}}, L={{__('Late')}}, A={{__('Absent')}}, H={{__('Holiday')}}, W={{__('Weekend')}}, LV={{__('Leave')}}, HL={{__('Half Leave')}}
{{ __('Export CSV') }}
@foreach($monthlyGrid['dayNumbers'] as $d) @endforeach @forelse($monthlyGrid['rows'] as $k => $r) @foreach($r['cells'] as $c) @php $cls = strtolower($c); if ($cls === 'p') $cls = 'p'; elseif ($cls === 'l') $cls = 'l'; elseif ($cls === 'a') $cls = 'a'; elseif ($cls === 'h') $cls = 'h'; elseif ($cls === 'w') $cls = 'w'; elseif ($cls === 'lv') $cls = 'lv'; elseif ($cls === 'hl') $cls = 'hl'; else $cls = ''; @endphp @endforeach @empty @endforelse
# {{ __('Employee') }} {{ __('Department') }} {{ __('Branch') }}{{ $d }}{{ __('P') }} {{ __('L') }} {{ __('A') }} {{ __('LV') }} {{ __('HL') }} {{ __('H') }} {{ __('W') }}
{{ $k+1 }} {{ optional($r['staff']->user)->name }} ({{ $r['staff']->user_id ?? optional($r['staff']->user)->id }}) {{ optional($r['staff']->department)->name ?? '—' }} {{ optional($r['staff']->warehouse)->name ?? '—' }}{{ $c }}{{ $r['totals']['P'] }} {{ $r['totals']['L'] }} {{ $r['totals']['A'] }} {{ $r['totals']['LV'] }} {{ $r['totals']['HL'] }} {{ $r['totals']['H'] }} {{ $r['totals']['W'] }}
{{ __('No records found') }}
@endif {{-- ---------- Specific Date Wise ---------- --}} @if((($report ?? '') === 'date') && !empty($daily))
@if(get_setting('system_logo_white')) {{ get_setting('site_name') }} @endif
{{ get_setting('site_name') }}
{{ __('Specific Date Wise Attendance Report') }} — {{ $daily['date'] }} ({{ date('l', strtotime($daily['date'])) }})
{{ __('Export CSV') }}
@forelse($daily['rows'] as $k => $r) @empty @endforelse
# {{ __('Employee') }} {{ __('Department') }} {{ __('Branch') }} {{ __('Status') }} {{ __('In') }} {{ __('Out') }} {{ __('Remarks') }}
{{ $k+1 }} {{ optional($r['staff']->user)->name }} ({{ $r['staff']->user_id ?? optional($r['staff']->user)->id }}) {{ optional($r['staff']->department)->name ?? '—' }} {{ optional($r['staff']->warehouse)->name ?? '—' }} {{ $r['status'] }} {{ $r['signIn'] ? date('h:i A', strtotime($r['signIn'])) : '—' }} {{ $r['signOut'] ? date('h:i A', strtotime($r['signOut'])) : '—' }} {!! $r['remarks'] ?? '—' !!}
{{ __('No Records Found') }}
@endif @endsection @section('script') @endsection