diff --git a/Bootstrap_new/images/new/README.md b/Bootstrap_new/images/new/README.md new file mode 100644 index 0000000..c685924 --- /dev/null +++ b/Bootstrap_new/images/new/README.md @@ -0,0 +1,40 @@ +# PWA Assets + +Generated by PWA Icon Generator + +## Contents + +- `/icons/` - All PWA icons in various sizes +- `/splash/` - iOS splash screens (if generated) +- `manifest.json` - Web app manifest file +- `meta-tags.html` - HTML meta tags to include in your index.html +- `favicon.png` - Favicon for your site + +## Installation + +1. Copy the `icons` folder to your project's public directory +2. Copy the `splash` folder to your project's public directory (if using splash screens) +3. Copy `manifest.json` to your project's root/public directory +4. Add the contents of `meta-tags.html` to your `index.html` `` section + +## Icon Sizes Included + +- 16x16 +- 32x32 +- 48x48 +- 64x64 +- 96x96 +- 128x128 +- 144x144 +- 152x152 +- 180x180 +- 192x192 +- 384x384 +- 512x512 +- 192x192 (maskable) +- 512x512 (maskable) + + + +--- +Generated with PWA Icon Generator diff --git a/Bootstrap_new/images/new/favicon.png b/Bootstrap_new/images/new/favicon.png old mode 100755 new mode 100644 index 190435a..e684fe3 Binary files a/Bootstrap_new/images/new/favicon.png and b/Bootstrap_new/images/new/favicon.png differ diff --git a/Bootstrap_new/images/new/icons/icon-128x128.png b/Bootstrap_new/images/new/icons/icon-128x128.png new file mode 100644 index 0000000..ade76e9 Binary files /dev/null and b/Bootstrap_new/images/new/icons/icon-128x128.png differ diff --git a/Bootstrap_new/images/new/icons/icon-144x144.png b/Bootstrap_new/images/new/icons/icon-144x144.png new file mode 100644 index 0000000..5d7df29 Binary files /dev/null and b/Bootstrap_new/images/new/icons/icon-144x144.png differ diff --git a/Bootstrap_new/images/new/icons/icon-152x152.png b/Bootstrap_new/images/new/icons/icon-152x152.png new file mode 100644 index 0000000..2e01bd8 Binary files /dev/null and b/Bootstrap_new/images/new/icons/icon-152x152.png differ diff --git a/Bootstrap_new/images/new/icons/icon-16x16.png b/Bootstrap_new/images/new/icons/icon-16x16.png new file mode 100644 index 0000000..2fefe20 Binary files /dev/null and b/Bootstrap_new/images/new/icons/icon-16x16.png differ diff --git a/Bootstrap_new/images/new/icons/icon-180x180.png b/Bootstrap_new/images/new/icons/icon-180x180.png new file mode 100644 index 0000000..6c0bd8c Binary files /dev/null and b/Bootstrap_new/images/new/icons/icon-180x180.png differ diff --git a/Bootstrap_new/images/new/icons/icon-192x192-maskable.png b/Bootstrap_new/images/new/icons/icon-192x192-maskable.png new file mode 100644 index 0000000..3e9b78a Binary files /dev/null and b/Bootstrap_new/images/new/icons/icon-192x192-maskable.png differ diff --git a/Bootstrap_new/images/new/icons/icon-192x192.png b/Bootstrap_new/images/new/icons/icon-192x192.png new file mode 100644 index 0000000..3e9b78a Binary files /dev/null and b/Bootstrap_new/images/new/icons/icon-192x192.png differ diff --git a/Bootstrap_new/images/new/icons/icon-32x32.png b/Bootstrap_new/images/new/icons/icon-32x32.png new file mode 100644 index 0000000..46a1c4c Binary files /dev/null and b/Bootstrap_new/images/new/icons/icon-32x32.png differ diff --git a/Bootstrap_new/images/new/icons/icon-384x384.png b/Bootstrap_new/images/new/icons/icon-384x384.png new file mode 100644 index 0000000..6e2f6fd Binary files /dev/null and b/Bootstrap_new/images/new/icons/icon-384x384.png differ diff --git a/Bootstrap_new/images/new/icons/icon-48x48.png b/Bootstrap_new/images/new/icons/icon-48x48.png new file mode 100644 index 0000000..e684fe3 Binary files /dev/null and b/Bootstrap_new/images/new/icons/icon-48x48.png differ diff --git a/Bootstrap_new/images/new/icons/icon-512x512-maskable.png b/Bootstrap_new/images/new/icons/icon-512x512-maskable.png new file mode 100644 index 0000000..eadab92 Binary files /dev/null and b/Bootstrap_new/images/new/icons/icon-512x512-maskable.png differ diff --git a/Bootstrap_new/images/new/icons/icon-512x512.png b/Bootstrap_new/images/new/icons/icon-512x512.png new file mode 100644 index 0000000..eadab92 Binary files /dev/null and b/Bootstrap_new/images/new/icons/icon-512x512.png differ diff --git a/Bootstrap_new/images/new/icons/icon-64x64.png b/Bootstrap_new/images/new/icons/icon-64x64.png new file mode 100644 index 0000000..9caa2a5 Binary files /dev/null and b/Bootstrap_new/images/new/icons/icon-64x64.png differ diff --git a/Bootstrap_new/images/new/icons/icon-96x96.png b/Bootstrap_new/images/new/icons/icon-96x96.png new file mode 100644 index 0000000..bcd8a24 Binary files /dev/null and b/Bootstrap_new/images/new/icons/icon-96x96.png differ diff --git a/Bootstrap_new/images/new/manifest.json b/Bootstrap_new/images/new/manifest.json new file mode 100644 index 0000000..d911d1b --- /dev/null +++ b/Bootstrap_new/images/new/manifest.json @@ -0,0 +1,41 @@ +{ + "name": "My PWA App", + "short_name": "App", + "description": "A Progressive Web App", + "start_url": "/", + "display": "standalone", + "background_color": "#ffffff", + "theme_color": "#3b82f6", + "icons": [ + { + "src": "/icons/icon-192x192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "any" + }, + { + "src": "/icons/icon-384x384.png", + "sizes": "384x384", + "type": "image/png", + "purpose": "any" + }, + { + "src": "/icons/icon-512x512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "any" + }, + { + "src": "/icons/icon-192x192-maskable.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "/icons/icon-512x512-maskable.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +} \ No newline at end of file diff --git a/Bootstrap_new/images/new/meta-tags.html b/Bootstrap_new/images/new/meta-tags.html new file mode 100644 index 0000000..6c1a3c5 --- /dev/null +++ b/Bootstrap_new/images/new/meta-tags.html @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/Controleur/ControleurAccueil.php b/Controleur/ControleurAccueil.php index a269058..687cb5f 100755 --- a/Controleur/ControleurAccueil.php +++ b/Controleur/ControleurAccueil.php @@ -42,7 +42,17 @@ class ControleurAccueil extends Controleur { $dataTabClaims = json_encode($tabclaims, JSON_NUMERIC_CHECK); - // SINISTRALITÉ (manquante jusqu’ici) + // Evolution des sinistres par mois + $claimsMonth = $this->synthese->getClaimsMonth(); + + $tabclaimsMonth = [ + 'months' => array_column($claimsMonth, 'months'), + 'monthlyClaims' => array_column($claimsMonth, 'monthlyClaims') + ]; + + $dataTabClaimsMonth = json_encode($tabclaimsMonth, JSON_NUMERIC_CHECK); + + // SINISTRALITÉ $lossRatioLabels = ["Jan", "Fév", "Mar", "Avr", "Mai", "Juin"]; $lossRatioValues = [62, 68, 71, 65, 73, 69]; // % @@ -58,6 +68,7 @@ class ControleurAccueil extends Controleur { 'lossRatioLabels' => $lossRatioLabels, 'lossRatioValues' => $lossRatioValues, 'dataTabClaims' => $dataTabClaims, + 'dataTabClaimsMonth' => $dataTabClaimsMonth, 'polices' => $polices ) ); diff --git a/Js/fonctions.js b/Js/fonctions.js index 325ec7c..16e2131 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -1,3 +1,239 @@ + +$(function(){ + + appliquerDataTable(); + +}); + + +// Gestion du menu burger - Version simplifiée +document.addEventListener('DOMContentLoaded', function() { + const burgerToggle = document.getElementById('burgerMenuToggle'); + const burgerDropdown = document.getElementById('burgerDropdown'); + + if (burgerToggle && burgerDropdown) { + // Ouvrir/fermer le menu burger + burgerToggle.addEventListener('click', function(e) { + e.preventDefault(); + e.stopPropagation(); + burgerDropdown.classList.toggle('show'); + }); + + // Fermer le menu quand on clique ailleurs sur la page + document.addEventListener('click', function(e) { + if (!e.target.closest('.burger-menu-container')) { + burgerDropdown.classList.remove('show'); + } + }); + + // Empêcher la fermeture quand on clique dans le menu dropdown + burgerDropdown.addEventListener('click', function(e) { + e.stopPropagation(); + }); + } +}); + + +// Fonction pour formater les messages avec retours à la ligne automatiques +function formatMessageForSwal(message) { + if (!message) return ''; + + // Définir la longueur maximale par ligne selon la largeur de l'écran + const screenWidth = window.innerWidth; + let maxLineLength; + + if (screenWidth < 576) { // Mobile + maxLineLength = 40; + } else if (screenWidth < 768) { // Tablet + maxLineLength = 60; + } else { // Desktop + maxLineLength = 80; + } + + // Si le message est déjà court, ne pas le modifier + if (message.length <= maxLineLength && !message.includes('\n')) { + return message; + } + + // Diviser le message en mots + const words = message.split(' '); + let lines = []; + let currentLine = ''; + + words.forEach(word => { + // Si ajouter ce mot dépasse la limite, créer une nouvelle ligne + if ((currentLine + ' ' + word).length > maxLineLength && currentLine !== '') { + lines.push(currentLine); + currentLine = word; + } else { + // Ajouter le mot à la ligne courante + currentLine = currentLine ? currentLine + ' ' + word : word; + } + }); + + // Ajouter la dernière ligne + if (currentLine) { + lines.push(currentLine); + } + + return lines.join('
'); +} + +// Fonction pour ajuster dynamiquement le contenu SweetAlert +function adjustSwalContent() { + const popup = Swal.getPopup(); + const title = Swal.getTitle(); + const htmlContainer = Swal.getHtmlContainer(); + + if (popup && title) { + // Ajuster la largeur maximale selon l'écran + const screenWidth = window.innerWidth; + if (screenWidth < 576) { + popup.style.maxWidth = '95vw'; + popup.style.width = '95vw'; + popup.style.margin = '10px'; + } else if (screenWidth < 768) { + popup.style.maxWidth = '85vw'; + popup.style.width = '85vw'; + } else { + popup.style.maxWidth = '500px'; + popup.style.width = '500px'; + } + + // Gérer le défilement si nécessaire + const titleHeight = title.scrollHeight; + const maxTitleHeight = Math.min(window.innerHeight * 0.6, 400); + + if (titleHeight > maxTitleHeight) { + title.style.overflowY = 'auto'; + title.style.maxHeight = maxTitleHeight + 'px'; + title.style.paddingRight = '10px'; + } + + // Ajuster également le conteneur HTML si présent + if (htmlContainer) { + const containerHeight = htmlContainer.scrollHeight; + const maxContainerHeight = Math.min(window.innerHeight * 0.4, 300); + + if (containerHeight > maxContainerHeight) { + htmlContainer.style.overflowY = 'auto'; + htmlContainer.style.maxHeight = maxContainerHeight + 'px'; + htmlContainer.style.paddingRight = '10px'; + } + } + } +} + +// Fonction d'alerte principale +function alert_ebene(p_msg, p_msg_eng) { + let codeLangue = $("#codeLangue").val(); + let message = (codeLangue === "en_US") ? p_msg_eng : p_msg; + + // Formater le message pour les retours à la ligne + let formattedMessage = formatMessageForSwal(message); + + Swal.fire({ + title: formattedMessage, + icon: 'info', + confirmButtonText: codeLangue === "en_US" ? 'OK' : 'D\'accord', + customClass: { + popup: 'responsive-swal-popup', + title: 'responsive-swal-title', + htmlContainer: 'responsive-swal-html' + }, + didOpen: () => { + adjustSwalContent(); + }, + willOpen: () => { + // Ajustement avant l'ouverture + document.body.style.overflow = 'hidden'; + }, + willClose: () => { + document.body.style.overflow = 'auto'; + } + }); +} + +// Fonction de confirmation +function confirm_ebene(p_msg, p_msg_eng) { + let codeLangue = $("#codeLangue").val(); + let message = (codeLangue === "en_US") ? p_msg_eng : p_msg; + + // Formater le message pour les retours à la ligne + let formattedMessage = formatMessageForSwal(message); + + return Swal.fire({ + title: formattedMessage, + icon: 'warning', + showCancelButton: true, + confirmButtonText: codeLangue === "en_US" ? 'Yes' : 'Oui', + cancelButtonText: codeLangue === "en_US" ? 'No' : 'Non', + customClass: { + popup: 'responsive-swal-popup', + title: 'responsive-swal-title', + htmlContainer: 'responsive-swal-html' + }, + didOpen: () => { + adjustSwalContent(); + }, + willOpen: () => { + document.body.style.overflow = 'hidden'; + }, + willClose: () => { + document.body.style.overflow = 'auto'; + } + }).then((result) => { + return result.isConfirmed; + }); +} + +// Fonction de prompt +function prompt_ebene(p_msg, p_msg_eng, p_retour, callback) { + let codeLangue = $("#codeLangue").val(); + let message = (codeLangue === "en_US") ? p_msg_eng : p_msg; + + // Formater le message pour les retours à la ligne + let formattedMessage = formatMessageForSwal(message); + + Swal.fire({ + title: formattedMessage, + input: 'text', + inputValue: p_retour, + showCancelButton: true, + confirmButtonText: 'OK', + cancelButtonText: 'Annuler', + customClass: { + popup: 'responsive-swal-popup', + title: 'responsive-swal-title', + htmlContainer: 'responsive-swal-html' + }, + didOpen: () => { + adjustSwalContent(); + }, + willOpen: () => { + document.body.style.overflow = 'hidden'; + }, + willClose: () => { + document.body.style.overflow = 'auto'; + } + }).then((result) => { + if (result.isConfirmed) { + callback(result.value); + } else { + callback(null); + } + }); +} + +// Écouter les changements de taille de fenêtre +window.addEventListener('resize', () => { + // Réajuster si une alerte est ouverte + if (Swal.isVisible()) { + setTimeout(adjustSwalContent, 100); + } +}); + + function change_password() { @@ -137,3 +373,139 @@ function connexion_cookie() } }); } + +// Applique la librairie DataBase sur les tableaux +function appliquerDataTable() { + const $table = $('.tabliste'); + const codeLangue = $("#codeLangue").val(); + + // Détruire l'instance existante si elle existe + if ($.fn.DataTable.isDataTable($table)) { + $table.DataTable().destroy(); + $table.empty(); // Optionnel + } + + try { + // Dictionnaire des traductions + const translations = { + en_US: { + lengthMenu: "Display _MENU_ records per page", + zeroRecords: "Nothing found - sorry", + info: "Showing page _PAGE_ of _PAGES_", + infoEmpty: "No records available", + search: "Search:", + paginate: { + next: "►", + previous: "◄", + first: "|◄", + last: "►|" + }, + infoFiltered: "(filtered from _MAX_ total records)" + }, + fr_FR: { + lengthMenu: "Affiche _MENU_ par page", + zeroRecords: "Désolé - Aucune donnée trouvée", + info: "_PAGE_ sur _PAGES_ pages", + infoEmpty: "Pas d'enregistrement", + search: "Recherche:", + paginate: { + next: "►", + previous: "◄", + first: "|◄", + last: "►|" + }, + infoFiltered: "(filtré de _MAX_ total enregistrements)" + } + // ➕ Tu peux ajouter d'autres langues ici (ex: es_ES, de_DE, etc.) + }; + + // Options communes + const options = { + destroy: true, + responsive: true, + order: [[0, "desc"]], + lengthMenu: [50, 100, 150], + scrollX: true, + scrollY: "75vh", + pagingType: "full_numbers", + autoWidth: false, + language: translations[codeLangue] || translations.fr_FR + }; + + // Initialisation du DataTable + $table.DataTable(options); + + } catch (err) { + console.error("Erreur lors de l'application du DataTable :", err); + return false; + } +} + +function raffraichier_gabarit() +{ + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgabarit/", + success: function(data) + { + $("#div_ajaxgabarit").html(data); + + //codeSociete = $("#codeSociete").val(); + //codeLangue = $("#codeLangue").val(); + + fusionConsOrd = $("#fusionConsOrd").val(); + vue = $("#vue").val(); + + if(fusionConsOrd != "1" && vue !="Connexion"){ + + window.location.assign($("#racineWeb" ).val()+"Connexion/"); + } + + }, + error: function(errorData) + { + }, + complete: function() + { + $(".datepicker" ).datepicker(); + + raffraichier_messagerie(); + } + }); +} + +function raffraichier_messagerie() +{ + deconnexion='0'; + if(navigator.onLine) + { + c_html = ""; + $.ajax({ + url: $("#racineWeb").val()+"Ajaxmessagerie/", + success: function(data) { + c_html = data; + }, + error: function(errorData) { + }, + complete: function() { + $("#nbMessagesNonLus").html(c_html); + msgNonLus=$("#msgNonLus").val(); + $("#span_notification").text(msgNonLus); + // Ajout du 27/10/2024 => déconnecter si session expirée + deconnexion=$("#deconnexion").val(); + + // alert("deconnexion => "+deconnexion); + + if(deconnexion=='1') + { + window.location.assign($("#racineWeb" ).val()+"Connexion/deconnecter/"); + } + } + }); + } + else + { + $("#test_connexion").css('background-color', 'red'); + return; + } +} \ No newline at end of file diff --git a/Modele/Synthese.php b/Modele/Synthese.php index 78e39d0..0badb73 100755 --- a/Modele/Synthese.php +++ b/Modele/Synthese.php @@ -41,6 +41,17 @@ class Synthese extends Modele { $resultat = $this->executerRequete($sql, array($idClient)); + return $resultat->fetchAll(); + } + + public function getClaimsMonth() + { + $idClient = $_SESSION['idClient_C']; + + $sql = 'call sp_c_evolution_sinistres_mois(?)'; + + $resultat = $this->executerRequete($sql, array($idClient)); + return $resultat->fetchAll(); } } \ No newline at end of file diff --git a/Vue/Accueil/index.php b/Vue/Accueil/index.php index 81421eb..e3e78d5 100644 --- a/Vue/Accueil/index.php +++ b/Vue/Accueil/index.php @@ -160,16 +160,25 @@ --> +
+
+

+
+ +
+
+
+
-

+

-

+

@@ -182,7 +191,7 @@ - - @@ -613,6 +569,19 @@ console.groupEnd();
+ + +