@php function formatNumerique($value, $nbreCaractereApresVirgule = 2) { // Conversion en chaîne si ce n'est pas déjà le cas $nombre = strval($value); // Vérifier si c'est un nombre if (is_numeric($nombre)) { $result = ''; // Vérifier si le nombre est négatif $isNegative = $value < 0; // Si le nombre est négatif, enlever le signe temporairement pour le formatage if ($isNegative) { $nombre = ltrim($nombre, '-'); } // Diviser la chaîne en parties entière et décimale $parties = explode('.', $nombre); // Vérifier si la partie décimale est égale à zéro ou est vide if (count($parties) == 1 || intval($parties[1]) == 0 || $nbreCaractereApresVirgule == 0) { // C'est un entier // Formater le nombre entier avec des séparateurs de milliers $result = number_format($parties[0], 0, '', ' '); } else { // C'est un décimal // Formater le nombre décimal avec des séparateurs de milliers $partieEntiere = number_format($parties[0], 0, '', ' '); $result = $partieEntiere . '.' . substr($parties[1], 0, $nbreCaractereApresVirgule); } return $result; } elseif ($nombre == '' || $nombre == null) { return 0; } else { // Si ce n'est ni un entier ni un décimal return "Erreur : Le nombre n'est ni entier ni décimal."; } } function returnTextFonction($value){ switch($value){ case 1: $textFonction = 'NOTAIRE'; break; case 2: $textFonction = 'COLLABORATEUR'; break; } return $textFonction; } $libTotalNotaire = 0; $libTotalCollaborateur = 0; $libTotalAccompagnateur = 0; switch($participant -> fonction){ case 1: $libTotalNotaire = '375000'; break; case 2: $libTotalCollaborateur = '150000'; break; } $libTotalAccompagnateur = count($accompagnant) * 150000; $montantSoireCloture = 30000; $montantExcursionDetente = 20000; $sousTotal1 = $libTotalNotaire + $libTotalCollaborateur + $libTotalAccompagnateur ; $soustotal2 = ($participant -> soire_cloture * $montantSoireCloture) + ($participant -> excursion_detente * $montantExcursionDetente); $urlLogo = asset("assets/img/pdf/inscription.png"); function getImageContent($url) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0'); $data = curl_exec($ch); curl_close($ch); return $data; } $imageContent = getImageContent($urlLogo); @endphp
| Dates | Heures | Compagnie | N° Vol | |
|---|---|---|---|---|
| ARRIVEE | {{ $participant -> date_arrivee != null ? date('d/m/Y', strtotime($participant -> date_arrivee)) : '' }} | {{ $participant -> heure_arrivee != null ? date('H:i', strtotime($participant -> heure_arrivee)) : '' }} | {{ $participant -> compagnie_arrivee }} | {{ $participant -> num_vol_arrivee }} |
| DEPART | {{ $participant -> date_depart != null ? date('d/m/Y', strtotime($participant -> date_depart)) : '' }} | {{ $participant -> heure_depart != null ? date('H:i', strtotime($participant -> heure_depart)) : '' }} | {{ $participant -> compagnie_depart }} | {{ $participant -> num_vol_depart }} |
| Université | Montant | Total |
|---|---|---|
| NOTAIRE | 375 000 F | {{ formatNumerique($libTotalNotaire).' F' }} |
| COLLABORATEUR | 150 000 F | {{ formatNumerique($libTotalCollaborateur).' F' }} |
| ACCOMPAGNATEUR(S) | 150 000 F | {{ formatNumerique($libTotalAccompagnateur).' F'}} |
| Activités | Montant | Total | |
|---|---|---|---|
| COCKTAIL DE BIENVENUE 22/04/2025 - COCODY |
{{ $participant -> cocktail_bienvenue }} |
OFFERT PAR LA CNCI |
|
| SOIRÉE DE CLÔTURE (RETRO) 25/04/2025 |
{{ $participant -> soire_cloture }} |
30 000 F | {{ formatNumerique($participant -> soire_cloture * $montantSoireCloture) }} F |
| EXCURSION DETENTE 26/04/2025 - ASSINIE MAFIA |
{{ $participant -> excursion_detente }} |
20 000 F | {{ formatNumerique($participant -> soire_cloture * $montantExcursionDetente) }} F |
Abidjan-Cocody Danga, près de l'Ambassade d'Espagne - 01 BP 8654 Abidjan 01