get(); ?> Affectation @if(session('error'))
{{ session('error') }}
@endif @if(session('success'))
{{ session('success') }}
@endif
Chantier N° {{ $chantier->id }} : {{ ucfirst($chantier->nom) }}
En cours

Localisation:  {{ ucfirst($chantier->localisation) }}
Nom de projet:  {{ ucfirst($chantier->nom) }}
Nom client:  {{ ucfirst($chantier->nom_client) }}
Date debut:  {{ $chantier->date_debut }}
Duree:   @php $start_date = new DateTime($chantier->date_debut); $now = new DateTime(); $interval = $start_date->diff($now); echo $interval->format('%a Jours'); @endphp
@php $data = []; $pricet = 0; $total_prix_estime = 0; // Calculate the total budget from articles and ouvrier data foreach ($articles_chantiers as $art) { foreach ($ch_ar_mt_fr as $row) { if ($row->article_chantier_id == $art->id && $art->chantier_id == $chantier->id) { $pricet += $row->prix * $row->qte; // price * quantity from a different dataset } } } // Adding salaries for workers based on days worked foreach ($ouvrier_chantiers as $ouvrier_chantier) { $startDate = \Carbon\Carbon::parse($ouvrier_chantier->pivot->date_debut); $endDate = \Carbon\Carbon::parse($ouvrier_chantier->pivot->date_fin); $daysWorked = $endDate->diffInDays($startDate); $totalPrice = $daysWorked * $ouvrier_chantier->salaire_journalier; $pricet += $totalPrice; } // Calculate the total estimated price for articles in the current chantier foreach ($articles_chantiers as $art) { if ($art->chantier_id == $chantier->id) { $total_prix_estime += $art->prix_estime; } } @endphp
{{$pricet}} DH


@foreach($articles_chantiers as $article_chantier) @if($article_chantier->chantier_id==$chantier->id) @foreach($articles as $art) @if($article_chantier->article_id==$art->id) @endif @endforeach @endif @endforeach     
Reference Designation Unité Action
{{ $art->ref }} {{ $art->designation }} {{ $art->unites }}
@csrf @method('DELETE')