@extends('admin.layouts.app') @section('title', 'Employer Details') @section('content')

{{ $employer->company_name }} @if($employer->verified) @endif

Joined {{ $employer->created_at->format('M d, Y') }}

@csrf @method('PATCH')
@csrf @method('PATCH')
@if($employer->status === 'verified') Verified @elseif($employer->status === 'active') Active @elseif($employer->status === 'pending') Pending @else {{ ucfirst($employer->status) }} @endif @php $risk = $employer->risk_score ?? 0; if($risk >= 70) { $riskClass = 'bg-red-100 text-red-800'; $riskLabel = 'High Risk'; } elseif($risk >= 40) { $riskClass = 'bg-amber-100 text-amber-800'; $riskLabel = 'Medium Risk'; } else { $riskClass = 'bg-green-100 text-green-800'; $riskLabel = 'Low Risk'; } @endphp @php $riskClass = str_replace(['text-red-800','text-amber-800','text-green-800'], 'text-black', $riskClass); @endphp {{ $riskLabel }} ({{ number_format($risk, 1) }})

Total Jobs

{{ $stats['total_jobs'] }}

Active Jobs

{{ $stats['active_jobs'] }}

Avg Rating

{{ number_format($stats['avg_rating'], 1) }}

Reports

{{ $stats['active_reports'] }}

Company Information

{{ $employer->company_name }}

{{ $employer->contact_name ?? 'N/A' }}

{{ $employer->user->email ?? 'N/A' }}

{{ $employer->phone ?? 'N/A' }}

{{ $employer->industry ?? 'N/A' }}

{{ ucfirst($employer->type ?? 'N/A') }}

{{ $employer->city }}, {{ $employer->country }}

@if($employer->website) {{ $employer->website }} @else N/A @endif

{{ $employer->about ?? 'No description provided' }}

{{ number_format($employer->reputation_score ?? 0, 1) }}/100

{{ number_format($employer->risk_score ?? 0, 1) }}/100

@php $headers = [ ['label' => 'Job Title', 'class' => ''], ['label' => 'Location', 'class' => ''], ['label' => 'Posted', 'class' => 'w-36'], ['label' => 'Status', 'class' => 'w-28'], ]; $rows = []; foreach($employer->jobPostings as $job) { $cells = []; $cells[] = ['content' => '
' . e($job->title) . '
', 'class' => '']; $cells[] = ['content' => '
' . e($job->city) . ', ' . e($job->country) . '
', 'class' => '']; $cells[] = ['content' => '
' . e($job->created_at->format('M d, Y')) . '
', 'class' => '']; $statusClass = $job->status === 'active' ? 'bg-green-100 text-green-800' : ($job->status === 'closed' ? 'bg-slate-100 text-slate-800' : 'bg-amber-100 text-amber-800'); $cells[] = ['content' => '' . e(ucfirst($job->status)) . '', 'class' => '']; $rows[] = ['cells' => $cells]; } @endphp @if(empty($rows))
No jobs posted yet
@else @include('admin.components.table_shell', [ 'title' => 'Posted Jobs', 'headers' => $headers, 'rows' => $rows, ]) @endif @if($stats['total_reports'] > 0)

Reports

@php $headers = [ ['label' => 'Reason', 'class' => ''], ['label' => 'Reported By', 'class' => ''], ['label' => 'Date', 'class' => 'w-36'], ['label' => 'Status', 'class' => 'w-28'], ]; $rows = []; foreach($employer->reports as $report) { $cells = []; $cells[] = ['content' => '
' . e(ucfirst(str_replace('_', ' ', $report->reason))) . '
', 'class' => '']; $cells[] = ['content' => '
' . e($report->reporter->name ?? 'Anonymous') . '
', 'class' => '']; $cells[] = ['content' => '
' . e($report->created_at->format('M d, Y')) . '
', 'class' => '']; $statusClass = $report->status === 'open' ? 'bg-red-100 text-red-800' : ($report->status === 'resolved' ? 'bg-green-100 text-green-800' : 'bg-amber-100 text-amber-800'); $cells[] = ['content' => '' . e(ucfirst($report->status)) . '', 'class' => '']; $rows[] = ['cells' => $cells]; } @endphp @include('admin.components.table_shell', [ 'title' => 'Reports', 'headers' => $headers, 'rows' => $rows, ])
@endif
@endsection