@canany(['hr_manager_hq', 'recycle_bin'])
@php $employeeCount = App\Models\Profile::onlyTrashed()->count(); $roleCount = App\Models\Role::onlyTrashed()->count(); $companyCount = App\Models\Company::onlyTrashed()->count(); $departmentCount = App\Models\Department::onlyTrashed()->count(); $teamCount = App\Models\Team::onlyTrashed()->count(); $divisionCount = App\Models\Division::onlyTrashed()->count(); $locationCount = App\Models\Location::onlyTrashed()->count(); $sicknessCount = App\Models\Sickness::onlyTrashed()->count(); $documentCount = App\Models\Documents::onlyTrashed()->count(); $public_holidaysCount = App\Models\PublicHolidays::onlyTrashed()->count(); $leavetypeCount = App\Models\LeaveType::onlyTrashed()->count(); @endphp {{-- Session: {{ session('recyclestore')}} timer: {{ session('recyclestore_expiration') }} --}}
@if ($selectSection === 'Employees')
Recycle Bin: Employees
@php $employees = App\Models\Profile::onlyTrashed()->get(); @endphp @if ($employees->isEmpty())
Recycle Bin is Empty
Employees Management
@else
@foreach ($employees as $employee) @if (!empty($employee->id)) @endif @endforeach
# Employee Ref Names Role Actions
{{ $employee->id }} @if ($employee && $employee->employee_ref) {{ $employee->employee_ref }} @else Unassigned @endif {{ $employee->name }} @php // Split the comma-separated role IDs into an array $roleIds = explode(',', $employee->jobtitle); // Retrieve the corresponding role names from the roles table $roleNames = App\Models\Role::whereIn('id', $roleIds)->pluck( 'rolename', ); @endphp @foreach ($roleNames as $roleName) {{ $roleName }} @endforeach
@endif
@elseif ($selectSection === 'Role')
Recycle Bin: Roles
@php $roles = App\Models\Role::onlyTrashed() ->with(['user', 'linemanager', 'holidayapprover', 'TeamName']) ->get(); @endphp @if ($roles->isEmpty())
Recycle Bin is Empty
Roles Management
@else
@foreach ($roles as $role) @if (!empty($role->id)) @endif @endforeach
# Roles Team Line Manager Holiday Approver Actions
{{ $role->id }} {{ $role->rolename }} @php $TeamIds = explode(',', $role->team); $TeamNames = App\Models\Team::whereIn('id', $TeamIds)->pluck( 'team', ); @endphp @if (!empty($role->team)) @foreach ($TeamNames as $TeamName) {{ $TeamName }} @endforeach @else Not Assigned @endif {{ $role->lineManager ? $role->lineManager->name : 'Not Assigned' }} {{ $role->holidayApprover ? $role->holidayApprover->name : 'Not Assigned' }}
@endif @elseif ($selectSection === 'Company')
Recycle Bin: Companies
@php $companies = App\Models\Company::onlyTrashed()->get(); @endphp @if ($companies->isEmpty())
Recycle Bin is Empty
Company Management
@else
@foreach ($companies as $company) @if (!empty($company->id)) @endif @endforeach
# Company Actions
{{ $company->id }} {{ $company->companyname }}
@endif @elseif ($selectSection === 'Department')
Recycle Bin: Departments
@php $departments = App\Models\Department::onlyTrashed()->get(); @endphp @if ($departments->isEmpty())
Recycle Bin is Empty
Departments Management
@else
@foreach ($departments as $department) @if (!empty($department->id)) @endif @endforeach
# Departments Actions
{{ $department->id }} {{ $department->departmentname }}
@endif
@elseif ($selectSection === 'Team')
Recycle Bin: Teams
@php $teams = App\Models\Team::onlyTrashed()->get(); @endphp @if ($teams->isEmpty())
Recycle Bin is Empty
Teams Management
@else
@foreach ($teams as $team) @if (!empty($team->id)) @endif @endforeach
# Team Actions
{{ $team->id }} {{ $team->team }}
@endif
@elseif ($selectSection === 'Division')
Viewing Recycle Bin: Division
@php $divisions = App\Models\Division::onlyTrashed()->get(); @endphp @if ($divisions->isEmpty())
Recycle Bin is Empty
Divisions Management
@else
@foreach ($divisions as $division) @if (!empty($division->id)) @endif @endforeach
# Division Actions
{{ $division->id }} {{ $division->divisionname }}
@endif
@elseif ($selectSection === 'Location')
Viewing Recycle Bin: Location
@php $locations = App\Models\Location::onlyTrashed()->get(); @endphp @if ($locations->isEmpty())
Recycle Bin is Empty
Locations Management
@else
@foreach ($locations as $location) @if (!empty($location->id)) @endif @endforeach
# Locations Country Code Actions
{{ $location->id }} {{ $location->locationname }} {{ $location->countrycode }}
@endif
@elseif ($selectSection === 'Sickness')
Viewing Recycle Bin: Sickness
@php $sickness = App\Models\Sickness::onlyTrashed()->get(); @endphp @if ($sickness->isEmpty())
Recycle Bin is Empty
Sickness Management
@else
@foreach ($sickness as $semployee) @if (!empty($semployee->id)) @endif @endforeach
# Employee Ref Name Actions
{{ $semployee->id }} @if (!empty($semployee->employeeref)) {{ $semployee->employeeref }} @else Unassigned @endif {{ $semployee->getUser->name }}
@endif
@elseif ($selectSection === 'Document')
Viewing Recycle Bin: Document
@php $documents = App\Models\Documents::onlyTrashed()->get(); @endphp @if ($documents->isEmpty())
Recycle Bin is Empty
Documents Management
@else
@foreach ($documents as $docs) @if (!empty($docs->id)) @endif @endforeach
# Document Name Description Section File Path Added by Actions
{{ $docs->id }} {{ $docs->docname }} {{ $docs->description }} {{ $docs->section }} @php $link = Storage::disk('documents')->url( 'app/documents/' . $docs->filepath, ); @endphp {{ $docs->filepath }} {{ $docs->addedbyempoyee->name }}
@endif
@elseif ($selectSection === 'public_holidays')
Recycle Bin: Public Holidays
@php $pub_holiday = App\Models\PublicHolidays::onlyTrashed()->get(); @endphp @if ($pub_holiday->isEmpty())
Recycle Bin is Empty
Public Holidays Management
@else
@foreach ($pub_holiday as $hol) @if (!empty($hol->id)) @endif @endforeach
# Description Date Country Actions
{{ $hol->id }} {{ $hol->description }} {{ $hol->date }} {{ $hol->country }}
@endif
@elseif ($selectSection === 'leave_type')
Recycle Bin: Leave Type
@php $leavetype = App\Models\LeaveType::onlyTrashed()->get(); @endphp @if ($leavetype->isEmpty())
Recycle Bin is Empty
Leave Type
@else
@foreach ($leavetype as $type) @if (!empty($type->id)) @endif @endforeach
# Leave Type Actions
{{ $type->id }} {{ $type->leave_type }}
@endif
@endif
@endcan