@extends('layouts.guest') @section('title', 'PDCN - ' . $panneau->nom) @section('content') @php $viewType = $panneau->typeMiseEnForme == 1 ? 'pdcn_informations_type1' : 'pdcn_informations_type2'; function contrastColor($hexColor) { $hex = str_replace('#', '', $hexColor); $r = hexdec(substr($hex, 0, 2)); $g = hexdec(substr($hex, 2, 2)); $b = hexdec(substr($hex, 4, 2)); $brightness = ($r * 299 + $g * 587 + $b * 114) / 1000; return $brightness > 128 ? 'black' : 'white'; } @endphp @if($panneau->actif == false)
@include('panneaux.blocs.'.$viewType, ['panneau' => $panneau])
@else
@include('panneaux.blocs.pdcn_print', ['panneau' => $panneau])
@include('panneaux.blocs.'.$viewType, [ 'panneau' => $panneau ]) @php $lastUpdateIntervenant = $panneau->intervenants?->max('updated_at'); @endphp
Intervenants
Dernière modification : {{ $lastUpdateIntervenant ? \Carbon\Carbon::parse($lastUpdateIntervenant)->format('d/m/Y H:i') : 'Non disponible' }}
@if($panneau->intervenants->isEmpty())
Pour l'instant, aucun intervenant n'est renseigné.
À venir prochainement...
@else @foreach($panneau->intervenants->sortBy('numeroOrdre') as $intervenant)
{{ Str::upper(Str::ascii($intervenant->type)) }}
{{ $intervenant->libelleType }}
{{ $intervenant->adresse }}
{{ $intervenant->codePostal }} {{ $intervenant->ville }}
{{ preg_replace('/(\d{2})(?=\d)/', '$1 ', $intervenant->numeroTel) }}
@php $logos = []; if ($intervenant->logo) $logos[] = $intervenant->logo; if ($intervenant->logo2) $logos[] = $intervenant->logo2; @endphp @foreach($logos as $logo)
Logo {{ $intervenant->libelle }}
@endforeach
@if(!$loop->last)
@endif @endforeach @endif
@php $lastUpdateLot = $panneau->lots?->max('updated_at'); @endphp
Lots
Dernière modification : {{ $lastUpdateLot ? \Carbon\Carbon::parse($lastUpdateLot)->format('d/m/Y H:i') : 'Non disponible' }}
@php $lotsTries = $panneau->lots->sortBy(function($lot) { $lotParent = $lot->lotParent ?? null; if ($lotParent) { $ordrePrincipal = $lotParent->numeroOrdre ?? 9999; $suffixeParent = $lotParent->suffixeNumeroOrdre ?? ''; $ordreSecondaire = $lot->nom; return sprintf('%04d-%s-%s', $ordrePrincipal, $suffixeParent, $ordreSecondaire); } $ordrePrincipal = $lot->numeroOrdre ?? 9999; $suffixe = $lot->suffixeNumeroOrdre ?? ''; if (is_numeric($suffixe)) { $suffixe = sprintf('%04d', $suffixe); } return sprintf('%04d-%s', $ordrePrincipal, $suffixe); })->values(); @endphp @if($lotsTries->isEmpty())
Pour l'instant, aucun lot n'est renseigné.
À venir prochainement...
@else @php $coTraitantCounters = []; // stocke les index par numeroOrdre parent @endphp @foreach($lotsTries as $index => $lot) @php $isCoTraitant = $lot->lotParent !== null; $isLastItem = $loop->last; $showHr = true; $nextLot = !$isLastItem ? $lotsTries[$index + 1] : null; if (!$isLastItem) { if ($nextLot->lotParent) { $showHr = false; } } else { $showHr = false; } @endphp
@if($isCoTraitant) @php $parentOrdre = $lot->lotParent->numeroOrdre ?? '??'; $coTraitantCounters[$parentOrdre] = ($coTraitantCounters[$parentOrdre] ?? 0) + 1; $suffixe = $coTraitantCounters[$parentOrdre]; @endphp {{ $parentOrdre }}.{{ $suffixe }} Co-traitant @else Lot n° {{ $lot->numeroOrdre }} @if(!empty($lot->suffixeNumeroOrdre)) {{ $lot->suffixeNumeroOrdre }} @endif {{ Str::upper(Str::ascii($lot->designation)) }} @endif
@if($isCoTraitant)
@else
@endif {{ $lot->nom }}
{{ $lot->adresse }}
{{ $lot->codePostal }} {{ $lot->ville }}
{{ preg_replace('/(\d{2})(?=\d)/', '$1 ', $lot->numeroTel) }}
@if($showHr)
@endif @endforeach @endif
@php $lastUpdateSousTraitant = $panneau->sousTraitants?->max('updated_at'); @endphp
Sous traitants
Dernière modification : {{ $lastUpdateSousTraitant ? \Carbon\Carbon::parse($lastUpdateSousTraitant)->format('d/m/Y H:i') : 'Non disponible' }}
@if($panneau->sousTraitants->isEmpty())
Pour l'instant, aucun sous traitant n'est renseigné.
À venir prochainement...
@else @php // Grouper et trier les sous-traitants $sousTraitantsGroupes = $panneau->sousTraitants ->sortBy('numeroOrdre') ->groupBy('lot_id') ->sortBy(function($groupe, $lotId) { if (!$lotId) return 999999; // Sans lot à la fin $lot = $groupe->first()->lot; if (!$lot) return 999999; $ordrePrincipal = $lot->lotParent->numeroOrdre ?? $lot->numeroOrdre; return sprintf('%04d-%05d', $ordrePrincipal, $lot->lotParent ? $lot->id : 0); }) ->values(); @endphp @foreach($sousTraitantsGroupes as $sousTraitantsDuLot) @php $premierSousTraitant = $sousTraitantsDuLot->first(); $lot = $premierSousTraitant->lot; @endphp {{-- En-tête du lot --}}
@if($lot) Lot n° {{ $lot->numeroOrdre ?? 'N.C' }} - {{ $lot->nom }} @else Lot non renseigné @endif

{{-- Liste des sous-traitants --}} @foreach($sousTraitantsDuLot as $sousTraitant)
{{ $sousTraitant->nom }}
{{ $sousTraitant->designation }}
{{ $sousTraitant->adresse }}
{{ $sousTraitant->codePostal }} {{ $sousTraitant->ville }}
@if($sousTraitant->numeroTel) {{ preg_replace('/(\d{2})(?=\d)/', '$1 ', $sousTraitant->numeroTel) }} @endif
@endforeach {{-- Séparateur entre les groupes de lots --}} @if(!$loop->last)
@endif @endforeach @endif
@php $lastUpdatePermis = $panneau->permis?->max('updated_at'); @endphp
Permis
Dernière modification : {{ $lastUpdatePermis ? \Carbon\Carbon::parse($lastUpdatePermis)->format('d/m/Y H:i') : 'Non disponible' }}
@if(isset($panneau->permis))
{{ $panneau->permis->type }} N° {{ $panneau->permis->numero }} - {{ $panneau->permis->libelleType }} -
Date d'obtention : {{ $panneau->permis->dateObention ?: 'N.C' }} - Date de publication : {{ $panneau->permis->publieLe ?: 'N.C' }}
@else
Pour l'instant, aucun permis n'est renseigné.
À venir prochainement...
@endif
@if($panneau->partenaires->isNotEmpty())
Avec la participation de
@foreach($panneau->partenaires as $partenaire)
@if(!empty($partenaire->texte))
{{ $partenaire->texte }}
@endif
@endforeach
@endif
Chantier interdit au public
Casque obligatoire Danger Accès interdit

Affichage dématérialisé autorisé selon Art R8221-1

© GB Finances - Tous droits réservés
@endif @endsection