@extends('SuperAdmin.layout.layout') @section('title', $department->name . ' Department') @section('page-name', 'Departments') @section('sub-page-name', 'Service Department') @section('pagelink', 'departments') @section('body')

{{ $department->name }} Department

Manger: {{ $manager_count }}

Admins: {{ $admin_count }}


@foreach ($categories as $index => $category) @if($index === 0)
@php if($category == 'Manager') { $catemployees = $employees->where('role', $category)->where('department_id', $department->id)->all(); $catemployees = array_values($catemployees); // Initialize variables to keep track of current index $currentIndex = request()->input('current', 0); // Default to 0 $totalManagers = count($catemployees) == 0 ? 1 : count($catemployees); $currentIndex = $currentIndex % $totalManagers; // Wrap around if out of bounds } @endphp

Personal Information

@if($totalManagers > 1) {{-- Navigation buttons --}}
{{-- Next Button --}}
@endif
{{-- Display current manager based on the index --}} @foreach($catemployees as $index => $employee) @if($index == $currentIndex)

Name

{{$employee->name ?? 'N/A'}}

Mobile Number

{{$employee->phn ?? 'N/A'}}

Email Address

{{$employee->email ?? 'N/A'}}

Date of Birth

{{\Carbon\Carbon::parse($employee->dob)->format('M d, Y') ?? 'N/A'}}

Marital Status

{{$employee->marital ?? 'N/A'}}

Gender

{{$employee->gender ?? 'N/A'}}

Nationality

{{$employee->nationality ?? 'N/A'}}

Address

{{$employee->address ?? 'N/A'}}

City

{{$employee->city ?? 'N/A'}}

State

{{$employee->state ?? 'N/A'}}

Zip Code

{{$employee->zip ?? 'N/A'}}
@endif @endforeach

Task and Point Tabel

@foreach($categories as $category) @if($category != 'Admin' && $category != 'Manager')
Category: {{$category}}
{{-- --}}
@foreach($targets as $lowTarget) @if($lowTarget->category == $category)

1 Point

@if($lowTarget->product_id == null)

{{$lowTarget->custom}}

Will Get 1 Point

@else

Sell {{$lowTarget->product}}

Will Get 1 Point

@endif
@endif @endforeach
@endif @endforeach
@else
{{--
--}} {{--
--}} {{-- --}} {{--
--}} {{--
--}}
@if($category == 'Admin') @endif {{-- --}} @php if ($category == 'Admin') { $catemployees = $employees->where('role', $category)->where('department_id', $department->id)->all(); } else { $catemployees = $employees->where('category', $category)->where('department_id', $department->id)->all(); } @endphp @foreach ($catemployees as $employee) @if($employee->category == $category && $employee->role == 'Employee') @elseif($employee->role == $category && $employee->department_id == $department->id) {{-- --}} @endif @endforeach
Employee Name Employee ID TypeCategoryStatusAction
@if (!empty($employee->image)) Employee Image @else {{ strtoupper(implode('', array_merge(array_map(fn($part) => is_numeric($part) ? $part : $part[0], array_slice(explode(' ', $employee->name), 0, 2)),preg_match('/\d/', $employee->name, $matches) ? [$matches[0]] : []))) }} @endif {{ $employee->name }} {{ $employee->employee_id }} {{ $employee->role }} @if ($employee->status == 0) Pending @elseif($employee->status == 1) Inactive @elseif($employee->status == 2) Active @endif
@if (!empty($employee->image)) Employee Image @else {{ strtoupper(implode('', array_merge(array_map(fn($part) => is_numeric($part) ? $part : $part[0], array_slice(explode(' ', $employee->name), 0, 2)),preg_match('/\d/', $employee->name, $matches) ? [$matches[0]] : []))) }} @endif    {{ $employee->name }} {{ $employee->employee_id }} {{ $employee->role }} {{ $employee->category }} @if ($employee->status == 0) Pending @elseif($employee->status == 1) Inactive @elseif($employee->status == 2) Active @endif --}} {{-- --}} {{--
@endif @endforeach
@endsection @section('custom-scripts') @endsection