diff --git a/Controleur/ControleurListeavenant.php b/Controleur/ControleurListeavenant.php index c291506..8df6876 100644 --- a/Controleur/ControleurListeavenant.php +++ b/Controleur/ControleurListeavenant.php @@ -22,7 +22,15 @@ class ControleurListeavenant extends Controleur { $police = $this->police->getPoliceId($idPolice); $avenants = $this->avenant->getAvenant($idPolice); + + $dj = date("Y-m-d"); - $this->genererVue(array('police' => $police, 'avenants' => $avenants)); + $sppoliceentete = $this->sppolice->getRapportSpPoliceEntete($idPolice, $dj); + + $this->genererVue(array( + 'police' => $police, + 'avenants' => $avenants, + 'sppoliceentete' => $sppoliceentete + )); } } \ No newline at end of file diff --git a/Js/fonctions.js b/Js/fonctions.js index 836434f..b040bef 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -366,7 +366,7 @@ function changer_langue_connexion() { * @param {string|jQuery} selector - Sélecteur du tableau (ex: '.tabliste' ou '#myTable') * @param {object} options - Options personnalisées (langue, boutons, ordre, etc.) */ -function appliquerDataTable(selector = '.tabliste', options = {}, titreDoc = "Rapport") { +function appliquerDataTable(selector = '.tabliste', options = {}, titreDoc = "Rapport", message = "") { const codeLangue = $("#codeLangue").val() || 'fr_FR'; const translations = { @@ -389,19 +389,29 @@ function appliquerDataTable(selector = '.tabliste', options = {}, titreDoc = "Ra $(selector).each(function() { const $table = $(this); - // Colonnes marquées comme 'data-hidden' const hiddenTargets = []; $table.find('thead th').each((idx, th) => { if ($(th).data('hidden')) hiddenTargets.push(idx); }); - // Configuration des boutons avec le titre dynamique + // Configuration des boutons avec Titre ET Message de haut de page const exportButtons = [ - { extend: 'copy', title: titreDoc }, - { extend: 'csv', title: titreDoc }, - { extend: 'excel', title: titreDoc }, - { extend: 'pdf', title: titreDoc }, - { extend: 'print', title: titreDoc } + { + extend: 'excel', + title: titreDoc, + messageTop: message // Ajoute les infos en haut de l'Excel + }, + { + extend: 'pdf', + title: titreDoc, + messageTop: message, // Ajoute les infos en haut du PDF + orientation: 'landscape' + }, + { + extend: 'print', + title: titreDoc, + messageTop: message // Ajoute les infos sur l'impression + } ]; const instance = $table.DataTable($.extend(true, { @@ -411,10 +421,9 @@ function appliquerDataTable(selector = '.tabliste', options = {}, titreDoc = "Ra language: translations[codeLangue] || translations.fr_FR, columnDefs: [{ targets: hiddenTargets, visible: false }], dom: 'Bfrtip', - buttons: exportButtons // Utilisation des boutons configurés + buttons: exportButtons }, options)); - // Ajustement après rendu $table.on('init.dt', function () { if (instance && instance.responsive) { instance.columns.adjust(); diff --git a/Vue/Listeavenant/index.php b/Vue/Listeavenant/index.php index 5cf5018..7fb8c54 100644 --- a/Vue/Listeavenant/index.php +++ b/Vue/Listeavenant/index.php @@ -1,7 +1,5 @@