@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') }}
Delete
@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
Company Name
{{ $employer->company_name }}
Contact Name
{{ $employer->contact_name ?? 'N/A' }}
Email
{{ $employer->user->email ?? 'N/A' }}
Phone
{{ $employer->phone ?? 'N/A' }}
Industry
{{ $employer->industry ?? 'N/A' }}
Type
{{ ucfirst($employer->type ?? 'N/A') }}
Location
{{ $employer->city }}, {{ $employer->country }}
About
{{ $employer->about ?? 'No description provided' }}
Reputation Score
{{ number_format($employer->reputation_score ?? 0, 1) }}/100
Risk Score
{{ 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