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
@foreach($articles_chantiers as $article_chantier)
@if($article_chantier->chantier_id==$chantier->id)
@foreach($articles as $art)
@if($article_chantier->article_id==$art->id)
{{ $art->ref }}
{{ $art->designation }}
{{ $art->unites }}
@endif
@endforeach
@endif
@endforeach
×
Ajouter un nouvel article
Matière Première de l'Article
Designation
Fournisseur
Numero du bon
Quantite
Unité
Prix/unite
Action
Nom
Prénom
Date de début
Date de fin
Action
@foreach($ouvrier_chantiers as $ouvrier_chantier)
{{ $ouvrier_chantier->nom }}
{{ $ouvrier_chantier->prenom }}
{{ $ouvrier_chantier->pivot->date_debut }}
{{ $ouvrier_chantier->pivot->date_fin }}
@endforeach
Distribution d'Articles
Distribution Salaire Ouvriers
Analyse Fornisseurs
Analyse Matières
Analyse Fourisseur
Reseau social
Nom contact
Email
Télephone
Adresse
Download
@foreach($fournisseurs_affected as $fournisseur)
{{ $fournisseur->reseau_social }}
{{ $fournisseur->nom_contact }}
{{ $fournisseur->email }}
{{ $fournisseur->telephone }}
{{ $fournisseur->adresse }}
@endforeach
×
Ajouter un nouvel ouvrier
Details
Ste:
Chantier ID: 123 Fournisseur ID: 456
détails du budget
'; // Set the width and alignment for the first td
$i = 0;
$result=$total_prix_estime-$pricet;
foreach ($articles_chantiers as $art) {
if ($art->chantier_id == $chantier->id) {
if($i == 0) {
$table .= '
' . $art->prix_estime . '
'; // Align left for the second td
} else {
$table .= '
+
' . $art->prix_estime . '
'; // Apply styles to both tds
}
$i++;
}
}
$table .= '