@extends('layouts.admin') @section('title', 'Departments Report') @section('content')

Departments Report

Department-wise performance and activity analysis

Back to Reports
Total Departments
{{ $reportData['total_departments'] }}
Active Departments
{{ $reportData['departments_by_status']['active'] ?? 0 }}
Total Positions
{{ $reportData['department_statistics']->sum('total_positions') }}
Total Applications
{{ $reportData['department_statistics']->sum('total_applications') }}
Department Performance Overview
@if($reportData['department_statistics']->count() > 0)
@foreach($reportData['department_statistics'] as $stat) @endforeach
Department Total Positions Active Positions Total Applications Avg Applications/Position Performance
{{ $stat['department'] }} {{ $stat['total_positions'] }} {{ $stat['active_positions'] }} {{ $stat['total_applications'] }} {{ $stat['avg_applications_per_position'] }} @php $performance = 'Low'; $badgeClass = 'secondary'; if ($stat['avg_applications_per_position'] >= 10) { $performance = 'High'; $badgeClass = 'success'; } elseif ($stat['avg_applications_per_position'] >= 5) { $performance = 'Medium'; $badgeClass = 'warning'; } @endphp {{ $performance }}
@else

No department data available.

@endif
Most Active Departments
@if($reportData['most_active_departments']->count() > 0) @foreach($reportData['most_active_departments'] as $department) @php $totalApplications = $department->advertisements->sum(function($ad) { return $ad->applications->count(); }); @endphp
{{ $department->name }}
{{ $department->advertisements->count() }} positions
{{ $totalApplications }} applications
{{ $department->advertisements->where('status', 'published')->count() }} active
@endforeach @else

No active departments found.

@endif
Department Status Distribution
@if($reportData['departments_by_status']->count() > 0) @foreach($reportData['departments_by_status'] as $status => $count)
{{ str_replace('_', ' ', $status) }}
{{ $count }} ({{ $reportData['total_departments'] > 0 ? round(($count / $reportData['total_departments']) * 100, 1) : 0 }}%)
@endforeach @else

No status data available.

@endif
Detailed Department Analysis
@if($reportData['departments']->count() > 0)
@foreach($reportData['departments'] as $department) @php $totalApplications = $department->advertisements->sum(function($ad) { return $ad->applications->count(); }); $activePositions = $department->advertisements->where('status', 'published')->count(); $avgApplications = $department->advertisements->count() > 0 ? round($totalApplications / $department->advertisements->count(), 1) : 0; @endphp
{{ $department->name }}
{{ $department->advertisements->count() }}
Total Positions
{{ $activePositions }}
Active Positions

{{ $totalApplications }}
Total Applications
{{ $avgApplications }}
Avg per Position
@if($department->description)

{{ Str::limit($department->description, 100) }}

@endif
@endforeach
@else

No departments found.

@endif
@endsection