| {{ $index + 1 }} |
{{ $noc->application_id }} |
{{ $noc->applicant_name }} |
{{ \Carbon\Carbon::parse($noc->date)->format('d-m-Y') }} |
{{ $noc->phone_no }} |
@php
$statusMap = [
'2' => 'Rejected',
];
$roleStatusMap = [
'Admin' => $noc->admin,
'Super Admin' => $noc->sup_admin,
'Citizen' => $noc->citizen,
'CLerk' => $noc->clerk_status,
'Junior Engineer' => $noc->jr_eng_status,
'Senior Engineer' => $noc->sr_eng_status,
'HOD' => $noc->hod_status,
'Citizen Engineer' => $noc->city_eng_status,
];
@endphp
{{-- Displaying the correct badge for the status --}}
@if (isset($roleStatusMap[Auth::user()->roles[0]->name]))
{!! $statusMap[$roleStatusMap[Auth::user()->roles[0]->name]] ?? $statusMap['2'] !!}
@else
{!! $statusMap['2'] !!}
@endif
|
{{-- Rejection Action --}}
@if ($noc->status == '2')
View Rejected
@else
{{-- Show view button for non-rejected applications --}}
@endif
|
@endforeach