Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
Massage_v3_debug
/
New folder
:
test001.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php // Liste des jours fériés à exclure (exemple simplifié) $jours_feries = [ '2025-01-01', '2025-04-06', '2025-05-01', '2025-05-08', '2025-05-29', '2025-06-08', '2025-07-14', '2025-08-15', '2025-11-01', '2025-12-25' ]; // Générer les dates de janvier à décembre 2025 $startDate = strtotime("2025-01-01"); $endDate = strtotime("2025-12-31"); $dates = []; for ($date = $startDate; $date <= $endDate; $date = strtotime("+1 day", $date)) { $dateStr = date("Y-m-d", $date); if (!in_array($dateStr, $jours_feries)) { $dates[] = $dateStr; } } // Diviser les dates par mois pour appliquer une couleur de fond différente $dates_par_mois = []; foreach ($dates as $date) { $mois = date("m", strtotime($date)); $dates_par_mois[$mois][] = $date; } // Affichage du tableau ?> <!DOCTYPE html> <html lang="fr"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Tableau des dates de 2025</title> <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"> <style> .month-color-1 { background-color: #f0f8ff; } .month-color-2 { background-color: #faebd7; } .month-color-3 { background-color: #f5f5dc; } /* Ajoutez plus de couleurs si nécessaire pour chaque mois */ </style> </head> <body> <div class="container mt-5"> <table class="table table-bordered"> <thead> <tr> <th>Titre</th> <?php foreach ($dates_par_mois as $mois => $mois_dates): ?> <?php foreach ($mois_dates as $date): ?> <th><?= date("d/m/Y", strtotime($date)) ?></th> <?php endforeach; ?> <?php endforeach; ?> </tr> </thead> <tbody> <tr> <td>Jours</td> <?php foreach ($dates_par_mois as $mois => $mois_dates): ?> <?php foreach ($mois_dates as $date): ?> <td class="table_date month-color-<?= $mois ?>" data-date="<?= $date ?>" data-value="0" style="cursor: pointer;">0</td> <?php endforeach; ?> <?php endforeach; ?> </tr> </tbody> </table> </div> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script> $(document).ready(function(){ $(".table_date").click(function(){ var currentValue = $(this).data("value"); if (currentValue == "0") { $(this).data("value", "1"); $(this).text("1"); $(this).css("background-color", "#90EE90"); // Couleur pour '1' } else { $(this).data("value", "0"); $(this).text("0"); $(this).css("background-color", ""); // Réinitialiser la couleur de fond } }); }); </script> </body> </html>