@extends('admin.layouts.app') @section('title', get_setting('site_name') . ' | Subordinate Employees') @push('css') @endpush @section('content')
Subordinate Employee List
@if($employees->isEmpty())

No subordinate found in your list.

@else

Your direct subordinates are shown below with attendance, leave and visit info.

@endif
@foreach($employees as $selectedStaff)
{{ optional($selectedStaff->user)->name }} ({{ optional($selectedStaff->user)->id }})

Department: {{ optional($selectedStaff->department)->name ?? '-' }} | Designation: {{ optional($selectedStaff->designation)->name ?? '-' }} | Branch: {{ optional($selectedStaff->warehouse)->name ?? '-' }}

Recent Attendance (31)
@forelse(($attendancesByStaff[$selectedStaff->id] ?? collect()) as $att) @empty @endforelse
Date In Out Status
{{ $att->date }} {{ $att->signIn ?? '-' }} {{ $att->signOut ?? '-' }} {{ $att->status ?? '-' }}
No attendance found
Recent Leave (20)
@forelse(($leavesByStaff[$selectedStaff->id] ?? collect()) as $lv) @empty @endforelse
Apply Type Status
{{ $lv->apply_date ?? '-' }} {{ optional($lv->leave_type)->name ?? ($lv->type ?? '-') }} @if((int)$lv->status === 1) Approved @elseif((int)$lv->status === 2) Rejected @else Pending @endif
No leave found
Recent Visit (20)
@forelse(($visitsByStaff[$selectedStaff->id] ?? collect()) as $vs) @empty @endforelse
Apply Duration Status
{{ $vs->application_date ?? '-' }} {{ $vs->duration ?? 0 }} @if((int)$vs->status === 1) Approved @elseif((int)$vs->status === 2) Rejected @else Pending @endif
No visit found
Summary

Total Attendance Rows: {{ ($attendancesByStaff[$selectedStaff->id] ?? collect())->count() }}

Total Leave Rows: {{ ($leavesByStaff[$selectedStaff->id] ?? collect())->count() }}

Total Visit Rows: {{ ($visitsByStaff[$selectedStaff->id] ?? collect())->count() }}

@endforeach @endsection @section('script') @endsection