@extends('admin.layouts.app') @section('title', 'Jobs Management') @section('content')

Jobs Management

Review and manage job postings

+ Add Job Export CSV @if(auth('admin')->check() && auth('admin')->user()->isSuperAdmin()) @endif
@include('admin.jobs._filters')
@include('admin.components.stat_card', [ 'label' => 'Total Jobs', 'value' => $summary['total'] ?? 0, 'icon' => 'fa-solid fa-briefcase', 'color' => 'blue', 'sparkline' => $summary['trend_jobs'] ?? [] ]) @include('admin.components.stat_card', [ 'label' => 'Open', 'value' => $summary['open'] ?? 0, 'icon' => 'fa-solid fa-circle-check', 'color' => 'emerald', 'sparkline' => [] ]) @include('admin.components.stat_card', [ 'label' => 'Pending', 'value' => $summary['pending'] ?? 0, 'icon' => 'fa-solid fa-clock', 'color' => 'amber', 'sparkline' => [] ]) @include('admin.components.stat_card', [ 'label' => 'Filled', 'value' => $summary['filled_total'] ?? 0, 'icon' => 'fa-solid fa-user-check', 'color' => 'orange', 'sparkline' => $summary['trend_filled'] ?? [] ])
@include('admin.dashboard._quick_actions') @if(auth('admin')->check() && auth('admin')->user()->isSuperAdmin()) @endif @php $headers = []; if(auth('admin')->check() && auth('admin')->user()->isSuperAdmin()) { $headers[] = ['label' => '', 'class' => 'w-12']; } $headers = array_merge($headers, [ ['label' => 'Job Title', 'class' => ''], ['label' => 'Employer', 'class' => ''], ['label' => 'Location', 'class' => ''], ['label' => 'Type', 'class' => 'w-36'], ['label' => 'Applications', 'class' => 'w-20'], ['label' => 'Shortlisted', 'class' => 'w-24 text-center'], ['label' => 'Interviewed', 'class' => 'w-24 text-center'], ['label' => 'Rejected', 'class' => 'w-24 text-center'], ['label' => 'Status', 'class' => 'w-28'], ['label' => 'Actions', 'class' => 'text-right w-36'], ]); $rows = []; foreach($jobs as $job) { $cells = []; if(auth('admin')->check() && auth('admin')->user()->isSuperAdmin()) { $cells[] = ['content' => '', 'class' => '']; } $cells[] = ['content' => '

' . e($job->title) . '

' . e($job->required_specialty ?? 'General') . '

', 'class' => '']; $cells[] = ['content' => e($job->employer->company_name ?? 'N/A'), 'class' => 'text-sm']; $cells[] = ['content' => e($job->location_city . ', ' . $job->location_country), 'class' => 'text-sm']; $typeHtml = '
' . e(ucfirst($job->employment_type)) . '' . ($job->visa_sponsorship ? ' Visa' : '') . '
'; $cells[] = ['content' => $typeHtml, 'class' => '']; $cells[] = ['content' => '' . ($job->applications_count ?? ($job->applications->count() ?? 0)) . '', 'class' => 'text-sm font-semibold']; $cells[] = ['content' => '' . ($job->shortlisted_count ?? 0) . '', 'class' => 'text-center']; $cells[] = ['content' => '' . ($job->interview_count ?? 0) . '', 'class' => 'text-center']; $cells[] = ['content' => '' . ($job->rejected_count ?? 0) . '', 'class' => 'text-center']; $statusBadge = ''; if($job->status === 'active') { $statusBadge = 'Active'; } elseif($job->status === 'pending') { $statusBadge = 'Pending'; } elseif($job->status === 'closed') { $statusBadge = 'Closed'; } else { $statusBadge = '' . e(ucfirst($job->status)) . ''; } $cells[] = ['content' => $statusBadge, 'class' => '']; $actionsHtml = '
' . ''; if($job->status === 'pending') { $actionsHtml .= '
' . csrf_field() . method_field('PATCH') . '
'; } $actionsHtml .= '
' . csrf_field() . method_field('PATCH') . '
'; if(auth('admin')->check() && auth('admin')->user()->isSuperAdmin()) { $actionsHtml .= '
' . csrf_field() . method_field('DELETE') . '
'; } $actionsHtml .= '
'; $cells[] = ['content' => $actionsHtml, 'class' => 'text-right']; $rows[] = ['cells' => $cells]; } @endphp @include('admin.components.table_shell', [ 'headers' => $headers, 'rows' => $rows, 'emptyMessage' => 'No jobs found', 'pagination' => $jobs ])
@endsection @push('scripts') @endpush