@extends('layouts.app') @section('title', 'Reports | DYSON LATAM') @section('content') @php $totalProjects = $projects->count(); $totalCertifications = $projects->sum(function ($project) { return $project->certifications->count(); }); $completedCertifications = $projects->sum(function ($project) { return $project->certifications->where('status', 'certified')->count(); }); $totalStages = $projects->sum(function ($project) { return $project->stages->count(); }); $completedStages = $projects->sum(function ($project) { return $project->stages->where('status', 'completed')->count(); }); $overallCertificationProgress = $totalCertifications > 0 ? round(($completedCertifications / $totalCertifications) * 100) : 0; $overallStageProgress = $totalStages > 0 ? round(($completedStages / $totalStages) * 100) : 0; $countries = $projects ->groupBy(function ($project) { return $project->country?->name ?? 'N/A'; }) ->sortKeys(); $categories = $projects ->groupBy(function ($project) { return $project->category?->name ?? 'N/A'; }) ->sortKeys(); $projectRows = $projects->map(function ($project) { $stages = $project->stages; $completedStages = $stages->where('status', 'completed')->count(); $totalStages = $stages->count(); $stageProgress = $totalStages > 0 ? round(($completedStages / $totalStages) * 100) : 0; $certifications = $project->certifications; $completedCertifications = $certifications->where('status', 'certified')->count(); $totalCertifications = $certifications->count(); $certificationProgress = $totalCertifications > 0 ? round(($completedCertifications / $totalCertifications) * 100) : 0; if ($stages->contains('status', 'blocked')) { $status = 'Blocked'; } elseif ($stages->contains('status', 'overdue')) { $status = 'Overdue'; } elseif ($totalStages > 0 && $completedStages === $totalStages) { $status = 'Completed'; } elseif ($stages->contains('status', 'in_progress')) { $status = 'In Progress'; } else { $status = 'Pending'; } return [ 'project' => $project, 'stage_progress' => $stageProgress, 'certification_progress' => $certificationProgress, 'status' => $status, ]; }); @endphp
Project management and certification reporting
Distribution of registered projects
Distribution of projects by category
Current stage and certification progress by project
| Project | Country | Category | Status | Stages | Certifications | Launch Date |
|---|---|---|---|---|---|---|
|
{{ $project->name }}
@if ($project->model)
{{ $project->model }}
@endif
|
{{ $project->country?->name ?? 'N/A' }} | {{ $project->category?->name ?? 'N/A' }} | {{ $row['status'] }} |
{{ $completedStages }} / {{ $totalStages }}
{{ $row['stage_progress'] }}%
|
{{ $completedCertifications }} / {{ $totalCertifications }}
{{ $row['certification_progress'] }}%
|
{{ $project->launch_date?->format('d M Y') ?? 'N/A' }} |
|
No projects available.
|
||||||