@php $layout = auth()->user()->role === 'super_admin' ? 'layouts.admin' : 'layouts.app'; @endphp @extends($layout) @section('title', 'Environmental and Social Safeguards') @section('content')

Environmental and Social Safeguards (ESS) Tracker

@php $statusColors = [ 'completed' => 'bg-success', 'ongoing' => 'bg-primary', 'delayed' => 'bg-warning', 'not_started' => 'bg-secondary', 'cancelled' => 'bg-danger', ]; $statusLabels = [ 'completed' => 'Completed', 'ongoing' => 'Ongoing', 'delayed' => 'Delayed', 'not_started' => 'Not Started', 'cancelled' => 'Cancelled', ]; @endphp @foreach ($stats ?? [] as $essCode => $counts)
@php switch ($essCode) { case 'ESS1': $essDisplayText = 'ESS1: Assessment and Management of Environmental and Social Risks and Impacts'; break; case 'ESS2': $essDisplayText = 'ESS2: Labor and Working Conditions'; break; case 'ESS3': $essDisplayText = 'ESS3: Resource Efficiency and Pollution Prevention and Management'; break; case 'ESS4': $essDisplayText = 'ESS4: Community Health and Safety'; break; case 'ESS5': $essDisplayText = 'ESS5: Land Acquisition, restrictions on land use and Involuntary Resettlement'; break; case 'ESS6': $essDisplayText = 'ESS6: Biodiversity Conservation and Sustainable Management of Living Natural Resources'; break; case 'ESS7': $essDisplayText = 'ESS7: Indigenous Peoples/sub-Saharan African, Historically Underserved traditional local Communities'; break; case 'ESS8': $essDisplayText = 'ESS8: Cultural Heritage'; break; case 'ESS10': $essDisplayText = 'ESS10: Stakeholders Engagement and Information Disclosure'; break; default: $essDisplayText = $essCode; // fallback } @endphp {{--
{{ $essDisplayText }} - Summary
--}}

{{ $essDisplayText }} - Summary

@foreach ($counts as $status => $count)
{{ $statusLabels[$status] ?? ucfirst(str_replace('_', ' ', $status)) }} {{ $count }}
@endforeach
@endforeach
@if ($entries->count())
All ESS Entries
@php $entriesGrouped = $entries->groupBy('ess_code'); @endphp @foreach ($entriesGrouped as $essCode => $essEntries) @foreach ($essEntries as $entry) @endforeach @endforeach
# ESS Standard Activity Organization Sub-location Status Updated
{{ $loop->parent->iteration }}.{{ $loop->iteration }} {{ $entry->ess_code }} {{ $entry->activity_key }} {{ ucfirst($entry->organization) }} {{ strtoupper($entry->sub_org) }} {{ $statusLabels[$entry->status] ?? ucfirst(str_replace('_', ' ', $entry->status)) }} {{ $entry->updated_at->format('d M Y') }}
@else
No ESS entries found yet. Create one now.
@endif
ESS Tracker Visualizations
Overall Status Distribution
Status Breakdown by Organization
Status Distribution per ESS Standard
Progress Trend Over Time (Placeholder)
(Add timestamp/version tracking to enable real historical trends)
Activity Heatmap (Color Intensity = Status)
Green = Completed | Blue = Ongoing | Yellow = Delayed | Gray = Not Started | Red = Cancelled
@endsection