@php use App\Models\SmHumanDepartment; @endphp @extends('dashboard.layouts.app') @section('content')
@if (session('success')) @endif @if ($errors->any()) @endif

Regularization & Permissions

Manage and track all regularization and permission requests

New Request
Show
entries
@if ($records->isNotEmpty()) Showing {{ $records->firstItem() ?? 0 }} to {{ $records->lastItem() ?? 0 }} of {{ $records->total() }} entries @endif
{{ auth()->user()?->full_name ?? auth()->user()?->staff?->first_name . ' ' . auth()->user()?->staff?->last_name }}
Filter by Request Type
{{ $records->count() }} Requests
@if ($records->isNotEmpty())
@foreach ($records as $record) @php $isHr = in_array( auth()->user()?->staff?->department_id, SmHumanDepartment::where('name', 'like', '%hr%')->pluck('id')->toArray(), ); $isManager = $record->staff->manager_id == auth()->user()?->staff?->id; $canApprove = $isHr || $isManager; @endphp @endforeach
Employee Type Date Reason Status Manager HR Approved At Actions
{{ $record->staff->full_name ?? 'N/A' }}
{{ $record->staff->staff_no ?? '' }}
{{ ucfirst($record->type) }}
{{ \Carbon\Carbon::parse($record->date)->format('d M, Y') }}
{{ $record->reason ?? '-' }}
@if (!is_null($record->approved_by) && !is_null($record->approved_hr_by)) @if ($record->approval_status == 2) Approved @else Rejected @endif @elseif ($record->approval_status == '0') Rejected @else @if (!isset($record->approved_by))
Awaiting Manager @if ($isManager)
@endif
@elseif (isset($record->approved_by) && !isset($record->approved_hr_by))
Awaiting HR @if ($isHr)
@endif
@endif @endif
{{ $record->approvedByName ?? 'Pending' }}
{{ $record->approvedHrByName ?? 'Pending' }}
@if ($record->approved_at)
{{ \Carbon\Carbon::parse($record->approved_at)->format('d M, Y h:i A') }}
@else @endif
@if (is_null($record->approved_by)) @endif
@if ($records->hasPages())
Showing {{ $records->firstItem() }} to {{ $records->lastItem() }} of {{ $records->total() }} entries
{{ $records->appends(request()->except('page'))->links('pagination::bootstrap-5') }}
@endif @else
No Requests Found

There are no regularization or permission requests matching your criteria.

Create New Request
@endif
@endsection @push('styles') @endpush @push('scripts') @endpush