@php use Mcamara\LaravelLocalization\Facades\LaravelLocalization; @endphp @vite(['resources/css/app.css', 'resources/js/app.js']) {{ isset($submission->name) ? Str::upper($submission->name) : Str::upper('Name Not Provided') }} @php $total_bilan_carbone = collect($submission->data['emission_items'] ?? [])->sum(function ($item) { return is_numeric($item['value'] ?? null) ? $item['value'] : 0; }); @endphp @php $version = $submission->data['version'] ?? 24; $allCards = [ [ 'title' => 'cosiri_html.strategy', 'dimensions' => [ ['key' => 'strategy_and_targets'], ['key' => 'esg_integration'], ['key' => 'green_business_modelling'], ['key' => 'capital_allocation'], ], ], [ 'title' => 'cosiri_html.risk_management', 'dimensions' => [ ['key' => 'physical_climate_risks'], ['key' => 'transition_climate_risks'], ['key' => 'compliance_risks'], ['key' => 'reputation_risks'], ], ], [ 'title' => 'cosiri_html.operations', 'dimensions' => [ ['key' => 'greenhouse_gas_emissions'], ['key' => 'resources_water_and_energy'], ['key' => 'material_waste'], ['key' => 'pollution'], ], ], [ 'title' => 'cosiri_html.procurement', 'dimensions' => [['key' => 'supplier_assessment'], ['key' => 'sustainable_procurement_process']], ], [ 'title' => 'cosiri_html.supply_chain', 'dimensions' => [['key' => 'transportation_and_distribution'], ['key' => 'supply_chain_planning']], ], [ 'title' => 'cosiri_html.product_lifecycle', 'dimensions' => [['key' => 'product_design'], ['key' => 'circular_process_management']], ], [ 'title' => 'cosiri_html.clean_technology', 'dimensions' => [['key' => 'adoption'], ['key' => 'transparency_and_optimization']], ], [ 'title' => 'cosiri_html.talent_readiness', 'dimensions' => [['key' => 'workforce_development'], ['key' => 'leadership_involvement']], ], [ 'title' => 'cosiri_html.structure_and_management', 'dimensions' => [['key' => 'external_communication_and_engagement'], ['key' => 'governance']], ], ]; if ($version == 24) { $esgEvaluation = $allCards; } elseif ($version == 10) { $esgEvaluation = array_filter($allCards, function ($card) { return in_array($card['title'], [ 'cosiri_html.operations', 'cosiri_html.procurement', 'cosiri_html.supply_chain', 'cosiri_html.product_lifecycle', ]); }); } else { $esgEvaluation = []; // Or set a default } // Function to get card color based on average score function getCardColorClasses($avgScore) { if ($avgScore < 2) { return [ 'bg' => 'bg-red-50', 'border' => 'border-red-200', 'text' => 'text-red-600', 'shadow' => 'hover:shadow-[0_4px_24px_0_rgba(220,38,38,0.25)]', ]; } elseif ($avgScore < 3) { return [ 'bg' => 'bg-orange-50', 'border' => 'border-orange-200', 'text' => 'text-orange-600', 'shadow' => 'hover:shadow-[0_4px_24px_0_rgba(255,165,0,0.25)]', ]; } elseif ($avgScore < 4) { return [ 'bg' => 'bg-yellow-50', 'border' => 'border-yellow-200', 'text' => 'text-yellow-600', 'shadow' => 'hover:shadow-[0_4px_24px_0_rgba(255,255,0,0.25)]', ]; } else { return [ 'bg' => 'bg-green-50', 'border' => 'border-green-200', 'text' => 'text-green-600', 'shadow' => 'hover:shadow-[0_4px_24px_0_rgba(34,197,94,0.25)]', ]; } } if (isset($submission->name)) { $locale = app()->getLocale(); if ($locale === 'fr') { $vowels = ['A', 'E', 'I', 'O', 'U', 'Y', 'a', 'e', 'i', 'o', 'u', 'y']; $firstLetter = mb_substr($submission->name, 0, 1); $de_name = (in_array($firstLetter, $vowels) ? "d'" : 'de ') . $submission->name; } else { $de_name = $submission->name; // For English, just the name } } else { $de_name = Str::upper('Name Not Provided'); } @endphp

{{ isset($submission->name) ? Str::upper($submission->name) : Str::upper('Name Not Provided') }}

{{ $submission->data['slogan'] ?? Str::upper('Slogan Not Provided') }}

{{ $submission->data['slogan'] ?? Str::upper('Slogan Not Provided') }}

{{ $submission->data['subtitle'] ?? Str::upper('Subtitle Not Provided') }}

{{ number_format($total_bilan_carbone, 0) ?? 0 }}
tCO₂e {{ trans('cosiri_html.totalEmissions') }}
{{ $submission->data['version'] ?? 24 }}
{{ trans('cosiri_html.greenInitiatives') }}
@php $cardAverages = []; foreach ($esgEvaluation as $card) { $scores = []; foreach ($card['dimensions'] as $dim) { $scores[] = $submission->data[$dim['key']] ?? 0; } $avgScore = count($scores) ? round(array_sum($scores) / count($scores), 1) : 0; $cardAverages[] = $avgScore; } $esg_score = count($cardAverages) ? round(array_sum($cardAverages) / count($cardAverages), 1) : 0; @endphp
{{ $esg_score }}/5
{{ trans('cosiri_html.esgMaturity') }}

{{ trans('cosiri_html.executiveSummary') }}

{{ trans('cosiri_html.overviewOfFindings') }}

1. {{ trans('cosiri_html.contextOfMission') }}

{{ trans('cosiri_html.sector') }} :

{{ $submission->data['sector'] ?? 'Sector Not Provided' }}

{{ trans('cosiri_html.organizationalScope') }}

{{ $submission->data['organizational_scope'] ?? 'Organizational Scope Not Provided' }}

{{ trans('cosiri_html.temporalScope') }}

{{ trans('cosiri_html.temporalScopeDescription', ['year' => $submission->data['year'] ?? '0000']) }}

{{ trans('cosiri_html.operationalScope') }}

@php $scopes = $submission->data['scopes'] ?? []; $scopeColors = ['bg-red-500','bg-yellow-500','bg-green-500','bg-blue-500','bg-purple-500']; @endphp @foreach($scopes as $i => $value) @if($value) @php $color = $scopeColors[$i % count($scopeColors)]; $num = $i + 1; @endphp
{{ trans('cosiri_html.scope') }} {{ $num }}: {{ trans('cosiri_html.' . $value) }}
@endif @endforeach

{{ trans('cosiri_html.objectives') }}

@php $translatableObjectives = [ 'assess_the_companys_current_level_of_ESG_maturity', 'identify_key_ESG_risks_and_opportunities', 'quantify_the_organizations_carbon_footprint', 'define_and_plan_a_roadmap_to_support_the_green_transition', ]; $visibleIndex = 0; $objectives = $submission->data['objectives'] ?? []; @endphp @foreach ($objectives as $objective) @php $text = is_array($objective) ? '' : trim((string) $objective); if ($text === '') { continue; // skip empty entries } $visibleIndex++; $label = in_array($text, $translatableObjectives, true) ? trans('cosiri_html.' . $text) : $text; @endphp
{{ $visibleIndex }}

{{ $label }}

@endforeach

2. {{ trans('cosiri_html.companyPresentation') }}

{{ trans('cosiri_html.activities') }}

{{ trans('cosiri_html.companyspecialising', ['name' => $submission->name ?? 'Name Not Provided', 'sector' => $submission->data['sector'] ?? 'sector Not Provided']) }}

{{ trans('cosiri_html.employees') }}

{{ $submission->data['employees'] ?? 0 }} {{ trans('cosiri_html.employees') }}

{{ trans('cosiri_html.locations') }}

{{ $submission->data['locations'] ?? 'Locations Not Provided' }}

3. {{ trans('cosiri_html.keyIssues') }}

{{ trans('cosiri_html.regulatoryIssues') }}

{{ trans('cosiri_html.regulatoryIssuesDescription') }}

{{ trans('cosiri_html.strategicIssues') }}

{{ trans('cosiri_html.strategicIssuesDescription') }}

4. {{ trans('cosiri_html.mainFindings') }}

{{ trans('cosiri_html.esgMaturity') }}

{{ $submission->data['esgMaturityDescription'] ?? 'Descripsdssdsdtion Not Provided' }}

{{ trans('cosiri_html.carbonBalance') }}

{{ $submission->data['carbonBalanceDescription'] ?? 'Description Not Provided' }}

{{ trans('cosiri_html.dataChallenges') }}

{{ $submission->data['dataChallengesDescription'] ?? 'Description Not Provided' }}

5. {{ trans('cosiri_html.roadmapDirections') }}

{{ isset($submission) ? trans('cosiri_html.roadmapDirectionsDescription', ['version' => ($submission->data['version'] ?? 24) / 2]) : trans('cosiri_html.roadmapDirectionsDescription', ['version' => 12]) }}

{{ trans('cosiri_html.axis') }} 1: {{ trans('cosiri_html.governance_and_strategy') }}

{{ trans('cosiri_html.governance_and_strategy_description') }}

{{ trans('cosiri_html.axis') }} 2: {{ trans('cosiri_html.operational_performance') }}

{{ trans('cosiri_html.operational_performance_description') }}

{{ trans('cosiri_html.axis') }} 3: {{ trans('cosiri_html.skills_and_culture') }}

{{ trans('cosiri_html.skills_and_culture_description') }}

{{ trans('cosiri_html.methodology') }}

{{ trans('cosiri_html.methodologyDescription') }}

{{ trans('cosiri_html.toolsAndReferences') }}

1. {{ trans('cosiri_html.maturityAssessment') }}

{{ trans('cosiri_html.cosiriFramework') }}

{{ trans('cosiri_html.cosiriFrameworkDescription') }}

{{ trans('cosiri_html.cosiriFrameworkUsage', ['version' => $submission->data['version'] ?? 24]) }}

{{ trans('cosiri_html.strategyAndRiskManagement') }}
{{ trans('cosiri_html.sustainableBusinessProcesses') }}
{{ trans('cosiri_html.technology') }}
{{ trans('cosiri_html.organizationAndGovernance') }} + GHG

2. {{ trans('cosiri_html.carbonBalance') }}

GHG {{ trans('cosiri_html.protocol') }}

{{ trans('cosiri_html.protocolDescription') }}

{{ trans('cosiri_html.bcPlatform') }}

{{ trans('cosiri_html.bcPlatformDescription') }}

{{ trans('cosiri_html.dataSources') }}

{{ trans('cosiri_html.quantitativeData') }}
  • • {{ trans('cosiri_html.energyInvoices') }}
  • • {{ trans('cosiri_html.consumptionStatements') }}
  • • {{ trans('cosiri_html.internalAudits') }}
{{ trans('cosiri_html.qualitativeData') }}
  • • {{ trans('cosiri_html.keyStaffInterviews') }}
  • • {{ trans('cosiri_html.supplierQuestionnaires') }}
  • • {{ trans('cosiri_html.internalDocumentation') }}

3. {{ trans('cosiri_html.transformationDurableRoadmap') }}

{{ trans('cosiri_html.transformationDurableRoadmapDescription') }}

{{ trans('cosiri_html.integrationDiagnosticCOSIRI') }}

{{ trans('cosiri_html.integrationDiagnosticCOSIRIDescription') }}

{{ trans('cosiri_html.utilisationBilanCarbone') }}

{{ trans('cosiri_html.utilisationBilanCarboneDescription') }}

{{ trans('cosiri_html.definitionKPI') }}

{{ trans('cosiri_html.definitionKPIDescription') }}

{{ trans('cosiri_html.benchmarkInternational') }}

{{ trans('cosiri_html.benchmarkInternationalDescription') }}

{{ trans('cosiri_html.priorisationKPI') }}

{{ trans('cosiri_html.priorisationKPIDescription') }}

{{ trans('cosiri_html.attenuerRisquesESG') }}

{{ trans('cosiri_html.depasserAttentesPartiesPrenantes') }}

{{ trans('cosiri_html.ameliorerOperationsDurables') }}

{{ trans('cosiri_html.accelererCroissanceChiffreAffaires') }}

{{ trans('cosiri_html.ameliorerProductiviteEngagement') }}

{{ trans('cosiri_html.etreUnCitoyenEntrepriseVert') }}

{{ trans('cosiri_html.analyseMaturity') }}

@php $first_name = explode(' ', $de_name)[0]; @endphp

{{ trans('cosiri_html.analyseMaturitySubtitle', ['de_name' => Str::upper($first_name), 'version' => $submission->data['version'] ?? 24]) }}

{{ trans('cosiri_html.analyseMaturityDescription', ['de_name' => Str::upper($first_name)]) }}

@foreach ($esgEvaluation as $card) @php // Calculate average score for this card $scores = []; foreach ($card['dimensions'] as $dim) { $scores[] = $submission->data[$dim['key']] ?? 0; } $avgScore = count($scores) ? round(array_sum($scores) / count($scores), 1) : 0; $cardAverages[] = $avgScore; // Get card color classes based on the average score $cardColors = getCardColorClasses($avgScore); @endphp

{{ trans($card['title']) }}

{{ $avgScore }}/5
@foreach ($card['dimensions'] as $dimension) @php $score = $submission->data[$dimension['key']] ?? 0; $dimColors = getCardColorClasses($score); @endphp
{{ $submission->data[$dimension['key'] . '_notes'] ?? 'Note not provided' }}
{{ trans('cosiri.dimensions.' . $dimension['key'] . '.name') }} {{ $score }}/5
@endforeach
@endforeach
@php $total_bilan_carbone = 0; foreach ($submission->data['emission_items'] ?? [] as $item) { $total_bilan_carbone += $item['value'] ?? 0; } @endphp

{{ trans('cosiri_html.bilan_carbone_et_ges_reglementaire', ['year' => $submission->data['year'] ?? '0000']) }}

{{ trans('cosiri_html.bilan_complet_des_emissions', ['year' => $submission->data['year'] ?? '0000' ,'de_name' => Str::upper($first_name ?? '')]) }}

{{ trans('cosiri_html.bilan_carbone', ['year' => $submission->data['year'] ?? '0000']) }}

{{ trans('cosiri_html.bilan_carbone_description') }}

{{ trans('cosiri_html.graphique_bilan_carbone') }}

{{ trans('cosiri_html.resume_des_emissions') }}

{{ trans('cosiri_html.total_bilan_carbone') }} {{ number_format($total_bilan_carbone, 0) }} tCO₂e
{{ trans('cosiri_html.nombre_de_postes') }} 10
{{ trans('cosiri_html.methodologie') }} {{ trans('cosiri_html.carbonFootprint') }}
{{ trans('cosiri_html.Uncertainty') }} @php @endphp {{ trans('cosiri_html.uncertainty.' . ($submission->data['footprint_uncertainty'] ?? 'very_good')) }}

{{ trans('cosiri_html.detail_postes_emissions') }}

@foreach ($submission->data['emission_items'] ?? [] as $i => $item) @endforeach
# {{ trans('cosiri_html.Transmitter station') }} {{ trans('cosiri_html.emissions') }} (tCO₂e) {{ trans('cosiri_html.Uncertainty') }}
{{ $i + 1 }} {{ trans('cosiri_html.EmissionFootPrint.' . $item['label']) }} {{ number_format($item['value'], 2) }} {{ trans('cosiri_html.uncertainty.' . ($item['uncertainty']) ?? 'very_good') }}
{{ trans('cosiri_html.total') }} {{ number_format($total_bilan_carbone, 2) }} {{ trans('cosiri_html.uncertainty.' . ($submission->data['footprint_uncertainty'] ?? 'very_good')) }}
@if (isset($submission->data['show_detailed_emissions']) && $submission->data['show_detailed_emissions'])

{{ trans('cosiri_html.ges_footPrint_title', ['year' => $submission->data['year'] ?? '0000']) }}

{{ trans('cosiri_html.ges_footPrint_description') }}

{{ trans('cosiri_html.ges_footPrint_detail_title') }}

@php // Adapt for new emissions_details structure $emissions_details = $submission->data['emissions_details'] ?? []; $grouped = []; foreach ($emissions_details as $cat => $catData) { $rows = []; foreach ($catData['subCat'] ?? [] as $post => $row) { $row['post'] = $post; $row['category'] = $cat; $rows[] = $row; } $grouped[$cat] = [ 'uncertainty' => $catData['uncertainty'] ?? '', 'rows' => $rows, ]; } // Get the first 3 category groups $firstThreeGroups = array_slice($grouped, 0, 3); // Flatten rows $firstThreeRows = []; foreach ($firstThreeGroups as $cat => $data) { $firstThreeRows = array_merge($firstThreeRows, $data['rows']); } // Sum total for the first 3 categories $total_ges_reglementaire = 0; foreach ($firstThreeRows as $row) { foreach (['co2', 'ch4', 'n2o', 'other_gases'] as $key) { $total_ges_reglementaire += is_numeric($row[$key] ?? null) ? $row[$key] : 0; } } // Helper to sum a column for a group function sumCol($rows, $col) { if ($col === 'total') { return array_reduce( $rows, function ($carry, $row) { $sum = 0; foreach (['co2', 'ch4', 'n2o', 'other_gases'] as $key) { $sum += is_numeric($row[$key] ?? null) ? $row[$key] : 0; } return $carry + $sum; }, 0, ); } return array_reduce( $rows, function ($carry, $row) use ($col) { return $carry + (is_numeric($row[$col] ?? null) ? $row[$col] : 0); }, 0, ); } @endphp @php $catIndex = 1; @endphp @foreach ($grouped as $cat => $data) @php $rowIndex = 1; @endphp @foreach ($data['rows'] as $row) @php $total = 0; foreach (['co2', 'ch4', 'n2o', 'other_gases'] as $key) { $total += is_numeric($row[$key] ?? null) ? $row[$key] : 0; } @endphp @php $rowIndex++; @endphp @endforeach {{-- Subtotal row for this category --}} @php $catIndex++; @endphp @endforeach {{-- Total row for everything --}} @php $allRows = []; foreach ($grouped as $cat => $data) { $allRows = array_merge($allRows, $data['rows']); } // Uncertainty as a standalone key from controller structure $uncertaintyLabel = $submission->data['emissions_details_uncertainty'] ?? 'very_good'; @endphp
{{ trans('cosiri_html.category') }} {{ trans('cosiri_html.emission_post') }} CO2 CH4 N2O {{ trans('cosiri_html.other_gases') }} {{ trans('cosiri_html.total') }} CO2b {{ trans('cosiri_html.Uncertainty') }}
{{ $catIndex }}. {{ trans('cosiri_html.GESFootPrint.' . $cat) }} {{ $catIndex }}.{{ $rowIndex }}. {{ trans('cosiri_html.GESFootPrint.' . $row['post']) }} {{ $row['co2'] ?? '-' }} {{ $row['ch4'] ?? '-' }} {{ $row['n2o'] ?? '-' }} {{ $row['other_gases'] ?? '-' }} {{ $total ? number_format($total, 2) : '-' }} {{ $row['co2b'] ?? '-' }} {{ trans('cosiri_html.uncertainty.' . ($row['uncertainty'] ?? 'very_good')) }}
{{ $catIndex }}. {{ trans('cosiri_html.GESFootPrint.' . $cat) }} {{ trans('cosiri_html.subtotal') }} {{ sumCol($data['rows'], 'co2') ?: '-' }} {{ sumCol($data['rows'], 'ch4') ?: '-' }} {{ sumCol($data['rows'], 'n2o') ?: '-' }} {{ sumCol($data['rows'], 'other_gases') ?: '-' }} {{ sumCol($data['rows'], 'total') ?: '-' }} {{ sumCol($data['rows'], 'co2b') ?: '-' }} {{ trans('cosiri_html.uncertainty.' . ($data['uncertainty'] ?? 'very_good')) }}
{{ trans('cosiri_html.total') }} {{ trans('cosiri_html.total') }} {{ sumCol($allRows, 'co2') ?: '-' }} {{ sumCol($allRows, 'ch4') ?: '-' }} {{ sumCol($allRows, 'n2o') ?: '-' }} {{ sumCol($allRows, 'other_gases') ?: '-' }} {{ sumCol($allRows, 'total') ?: '-' }} {{ sumCol($allRows, 'co2b') ?: '-' }} {{ trans('cosiri_html.uncertainty.' . ($uncertaintyLabel ?: trans('cosiri_html.uncertainty.very_good'))) }}
@endif

{{ trans('cosiri_html.comparaison_methodologies') }}

{{ trans('cosiri_html.carbonFootprint') }}

{{ trans('cosiri_html.carbonFootprint_description') }}

{{ number_format($submission->data['total_bilan_carbone'] ?? 0, 0) }} tCO₂e

{{ trans('cosiri_html.total_carbonFootprint') }}

{{ trans('cosiri_html.regulatory_ghg_balance') }}

{{ trans('cosiri_html.regulatory_ghg_balance_description') }}

{{ number_format($submission->data['total_ges_reglementaire'] ?? 0, 0) }} tCO₂e

{{ trans('cosiri_html.scopes_1_2_only') }}

{{ trans('cosiri_html.industrialBenchmark') }}

{{ trans('cosiri_html.industrialBenchmarkSubtitle') }}

{{ trans('cosiri_html.industrialBenchmarkExplanation_title') }}

{{ trans('cosiri_html.industrialBenchmarkExplanation_text', ['version' => $submission->data['version'] ?? 24,'SusOrDeg' => trans('siri.sustainability'),'dim1' => trans('cosiri.dimensions.greenhouse_gas_emissions.name'),'dim2' => trans(key: 'cosiri.dimensions.circular_process_management.name')]) }}

{{ trans('cosiri_html.industrialBenchmarkRed_curve_title') }}

{{ trans('cosiri_html.industrialBenchmarkRed_curve_text',['SusOrDeg' => trans('siri.sustainability')]) }}

{{ trans('cosiri_html.industrialBenchmarkPurple_curve_title') }}

{{ trans('cosiri_html.industrialBenchmarkPurple_curve_text',['SusOrDeg' => trans('siri.sustainability')]) }}

{{ trans('cosiri_html.industrialBenchmarkGreen_curve_title') }}

{{ trans('cosiri_html.industrialBenchmarkGreen_curve_text',['SusOrDeg' => trans('siri.sustainability')]) }}

{{ trans('cosiri_html.interpretation') }}

{{ trans('cosiri_html.sustainabilityMaturityAnalysis', ['de_name' => Str::upper($de_name ?? 'Name not provided'), 'SusOrDeg' => trans('siri.sustainability')]) }}

{{ $submission->data['sustainabilityMaturityAnalysis'] ?? 'Description not provided' }}

{{ trans('cosiri_html.globalPositioning') }}

{{ $submission->data['globalPositioning'] ?? 'Description not provided' }}

{{ trans('cosiri_html.strengthPoints') }}
@php $strengthColors = [ ['bg' => 'bg-green-50', 'text' => 'text-green-800'], ['bg' => 'bg-blue-50', 'text' => 'text-blue-800'], ['bg' => 'bg-purple-50', 'text' => 'text-purple-800'], ]; $strengthPoints = $submission->data['strengthPoints'] ?? []; $strengthPoints = is_array($strengthPoints) ? array_values($strengthPoints) : []; @endphp @foreach ($strengthPoints as $i => $point) @php $dimRaw = $point['dimension'] ?? ''; $note = $point['strengthPoint_note'] ?? ''; $color = $strengthColors[$i % count($strengthColors)]; @endphp
@if (!empty($dimRaw))
@php // Normalize to array if (is_array($dimRaw)) { $dimList = $dimRaw; } else { // Split comma-separated strings and normalize each part $parts = preg_split('/\s*,\s*/', trim((string)$dimRaw)); $dimList = []; foreach ($parts as $p) { $p = trim($p); // Remove any accidental translation key fragments like "cosiri.dimensions." or trailing ".name" $p = preg_replace('/^cosiri\.dimensions\./', '', $p); $p = preg_replace('/\.name$/', '', $p); if ($p !== '') { $dimList[] = $p; } } } $labels = []; foreach ($dimList as $dk) { $dk = trim($dk); $label = trans('cosiri.dimensions.' . $dk . '.name'); $scoreVal = $submission->data[$dk] ?? '-'; $labels[] = $label . ' (' . trans('cosiri_html.score') . ' : ' . $scoreVal . ')'; } @endphp {!! implode(' / ', $labels) !!}

{{ $note }}

@endif
@endforeach
{{ trans('cosiri_html.weaknessPoints') }}
@php $weaknessColors = [ ['bg' => 'bg-red-50', 'text' => 'text-red-800'], ['bg' => 'bg-orange-50', 'text' => 'text-orange-800'], ['bg' => 'bg-yellow-50', 'text' => 'text-yellow-800'], ]; $weaknessPoints = $submission->data['weaknessPoints'] ?? []; $weaknessPoints = is_array($weaknessPoints) ? array_values($weaknessPoints) : []; @endphp @foreach ($weaknessPoints as $i => $point) @php $dimRaw = $point['dimension'] ?? ''; $note = $point['weaknessPoint_note'] ?? ''; $color = $weaknessColors[$i % count($weaknessColors)]; @endphp
@if (!empty($dimRaw))
@php $dimRaw = $point['dimension'] ?? ''; // Normalize to array if (is_array($dimRaw)) { $dimList = $dimRaw; } else { // Split comma-separated strings and normalize each part $parts = preg_split('/\s*,\s*/', trim((string)$dimRaw)); $dimList = []; foreach ($parts as $p) { $p = trim($p); // Remove any accidental translation key fragments like "cosiri.dimensions." or trailing ".name" $p = preg_replace('/^cosiri\.dimensions\./', '', $p); $p = preg_replace('/\.name$/', '', $p); if ($p !== '') { $dimList[] = $p; } } } $labels = []; foreach ($dimList as $dk) { $dk = trim($dk); $label = trans('cosiri.dimensions.' . $dk . '.name'); $scoreVal = $submission->data[$dk] ?? '-'; $labels[] = $label . ' (' . trans('cosiri_html.score') . ' : ' . $scoreVal . ')'; } @endphp {!! implode(' / ', $labels) !!}

{{ $note }}

@endif
@endforeach
{{ trans('cosiri_html.conclusion') }}

{{ $submission->data['benchMarkconclusion'] ?? 'Conclusion Not provided' }}

{{ trans('cosiri_html.roadmap_title', ['version' => $submission->data['version'] ?? 24 / 2]) }}

{{ trans('cosiri_html.roadmap_description', ['version' => $submission->data['version'] ?? 24 / 2]) }}

{{ trans('cosiri_html.roadmap_table_legend') }}

{{ trans('cosiri_html.roadmap_table_project_title') }}
{{ trans('cosiri_html.roadmap_table_project_name') }}
{{ trans('cosiri_html.roadmap_table_impact_dimension') }}
{{ trans('cosiri_html.roadmap_table_cosiri_category') }}
{{ trans('cosiri_html.roadmap_table_description') }}
{{ trans('cosiri_html.roadmap_table_scope') }}
{{ trans('cosiri_html.roadmap_table_objective') }}
{{ trans('cosiri_html.roadmap_table_expected_result') }}
{{ trans('cosiri_html.roadmap_table_implementation_steps') }}
{{ trans('cosiri_html.roadmap_table_concrete_actions') }}
KPIs
{{ trans('cosiri_html.roadmap_table_performance_indicators') }}
@php $roadmap = $submission->data['roadmap'] ?? []; $numCards = intval(($submission->data['version'] ?? 24) / 2); @endphp @for($i = 0; $i < $numCards; $i++) @php $raw = $roadmap[$i] ?? []; // Determine if the project entry is effectively empty $fieldsToCheck = ['title', 'dimension', 'description', 'objective', 'steps', 'kpis']; $isEmptyProject = true; foreach ($fieldsToCheck as $f) { $v = $raw[$f] ?? null; if (is_array($v)) { $found = false; foreach ($v as $vv) { if (trim((string) $vv) !== '') { $found = true; break; } } if ($found) { $isEmptyProject = false; break; } } else { if (is_numeric($v) || (is_string($v) && trim($v) !== '')) { $isEmptyProject = false; break; } } } // Skip rendering this card if every checked field is empty if ($isEmptyProject) { continue; } // Normalized item for display (fallbacks for missing fields) $item = [ 'title' => $raw['title'] ?? 'Not provided', 'dimension' => $raw['dimension'] ?? '', 'description' => $raw['description'] ?? '', 'objective' => $raw['objective'] ?? '', 'steps' => $raw['steps'] ?? '', 'kpis' => $raw['kpis'] ?? '', ]; @endphp

{{ $i + 1 }}. {{ $item['title'] }}

{{ trans('cosiri_html.roadmap_table_impact_dimension') }}
@if(!empty($item['dimension'])) {{ trans('cosiri.dimensions.' . $item['dimension'] . '.name') }} @else {{ '-' }} @endif
{{ trans('cosiri_html.roadmap_table_description') }}
{{ $item['description'] }}
{{ trans('cosiri_html.roadmap_table_objective') }}
{{ $item['objective'] }}
{{ trans('cosiri_html.roadmap_table_implementation_steps') }}
@php $stepsText = $item['steps'] ?? ''; if (is_string($stepsText)) { $lines = preg_split('/\r\n|\r|\n/', trim($stepsText)); } elseif (is_array($stepsText)) { $lines = $stepsText; } else { $lines = []; } $lines = array_values(array_filter(array_map('trim', $lines), fn($l) => $l !== '')); @endphp @if(count($lines) > 0)
    @foreach($lines as $line) @php // Remove leading numeric indexes like "1.", "1)" if present $clean = preg_replace('/^\s*\d+[\.\)]\s*/u', '', $line); @endphp
  1. {{ $clean }}
  2. @endforeach
@else
{!! $item['steps'] !!}
@endif
KPIs
@php $rawKpis = $item['kpis'] ?? ''; $kpisList = []; if (is_array($rawKpis)) { $kpisList = array_values(array_filter(array_map('trim', $rawKpis), fn($v) => $v !== '')); } else { $text = trim(strip_tags((string)$rawKpis)); $text = str_replace(["\r\n", "\r"], "\n", $text); if (strpos($text, '•') !== false) { foreach (array_map('trim', explode('•', $text)) as $p) { if ($p !== '') $kpisList[] = $p; } } else { foreach (array_map('trim', explode("\n", $text)) as $p) { if ($p !== '') $kpisList[] = $p; } } } @endphp @if(count($kpisList))
    @foreach($kpisList as $kpi)
  • {{ $kpi }}
  • @endforeach
@else
{!! $item['kpis'] ?? '' !!}
@endif
@endfor