541 lines
		
	
	
		
			24 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			541 lines
		
	
	
		
			24 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<!DOCTYPE html>
 | 
						|
<html lang="fr">
 | 
						|
<head>
 | 
						|
    <meta charset="UTF-8">
 | 
						|
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
 | 
						|
    <title>Suivi des Heures</title>
 | 
						|
    <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
 | 
						|
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
 | 
						|
    <link rel="stylesheet" href="../../css/VACATAIRE/mes-heures.css">
 | 
						|
</head>
 | 
						|
<body>
 | 
						|
 | 
						|
 | 
						|
    <div class="header w3-bar w3-card-4 w3-dark-blue">
 | 
						|
        <!-- Logo pour retourner à l'accueil -->
 | 
						|
        <div class="logo-container w3-bar-item">
 | 
						|
            <img src="../../media/img/logoWhite.png" alt="Logo Accueil" class="w3-image" style="width:200px; height:50px;">
 | 
						|
        </div>
 | 
						|
 | 
						|
        <!-- Bouton burger pour petit écran -->
 | 
						|
        <a href="javascript:void(0)" class="w3-bar-item w3-button w3-hide-large w3-right w3-padding-16" onclick="toggleMenu()">☰</a>
 | 
						|
 | 
						|
        <!-- Catégories dans le header -->
 | 
						|
        <div id="menu" class="categories w3-hide-small w3-bar-item">
 | 
						|
            <a href="./vacataire.html" class="w3-bar-item w3-button">Accueil</a>
 | 
						|
            <a href="./mes-heures.html" class="w3-bar-item w3-button">Heures</a>
 | 
						|
            <a href="./paiements.html" class="w3-bar-item w3-button">Paiements</a>
 | 
						|
            <a href="./mon-contrat.html" class="w3-bar-item w3-button">Contrat</a>
 | 
						|
            <a href="./mes-informations.html" class="w3-bar-item w3-button">Mes informations et documents</a>
 | 
						|
        </div>
 | 
						|
    
 | 
						|
        <!-- Section utilisateur avec déconnexion -->
 | 
						|
        <div class="user-section w3-bar-item w3-right">
 | 
						|
            <div class="user-name">
 | 
						|
                Maxime MENAULT
 | 
						|
            </div>
 | 
						|
            <div class="logout-container w3-bar-item">
 | 
						|
                <a href="./notifications.html" title="Notifications">
 | 
						|
                    <img src="../../media/img/notifs.png" alt="Logo notification">
 | 
						|
                </a>
 | 
						|
                <a href="./settings.html" title="Paramètres">
 | 
						|
                    <img src="../../media/img/settings.png" alt="Logo paramètres">
 | 
						|
                </a>
 | 
						|
                <a href="../../index.html" title="Se déconnecter">
 | 
						|
                    <img src="../../media/img/LogOutWhite.png" alt="Logo Déconnexion">
 | 
						|
                </a>
 | 
						|
            </div>
 | 
						|
        </div>
 | 
						|
    </div>
 | 
						|
    <div class="w3-container dashboard-container">
 | 
						|
        <div class="section-header w3-border-bottom w3-padding">
 | 
						|
            <h2>Offres de vacation</h2>
 | 
						|
        </div>
 | 
						|
        <div class="proposition-container w3-responsive">
 | 
						|
            <table class="w3-table w3-bordered w3-striped proposition-table" id="proposalTable">
 | 
						|
                <thead>
 | 
						|
                    <tr>
 | 
						|
                        <th>Période</th>
 | 
						|
                        <th>Formation</th>
 | 
						|
                        <th>Nom du Cours</th>
 | 
						|
                        <th>Semestre</th>
 | 
						|
                        <th>Type d'intervention</th>
 | 
						|
                        <th>Volume Prévisionnel</th>
 | 
						|
                        <th>Actions</th>
 | 
						|
                    </tr>
 | 
						|
                </thead>
 | 
						|
                <tbody>
 | 
						|
                    <tr>
 | 
						|
                        <td>Décembre 2024</td>
 | 
						|
                        <td>BUT1</td>
 | 
						|
                        <td>Développement Web</td>
 | 
						|
                        <td>1</td>
 | 
						|
                        <td>CM, TD</td>
 | 
						|
                        <td>8h</td>
 | 
						|
                        <td>
 | 
						|
                            <button class="w3-button w3-blue accept-button" onclick="acceptProposal(this)">Postuler</button>
 | 
						|
                            <button class="w3-button w3-red refuse-button" onclick="confirmRefusal(this)">Refuser</button>
 | 
						|
                        </td>
 | 
						|
                    </tr>
 | 
						|
                    <tr>
 | 
						|
                        <td>Janvier 2025</td>
 | 
						|
                        <td>BUT2</td>
 | 
						|
                        <td>SCR</td>
 | 
						|
                        <td>3</td>
 | 
						|
                        <td>TD, TP</td>
 | 
						|
                        <td>6h</td>
 | 
						|
                        <td>
 | 
						|
                            <button class="w3-button w3-blue accept-button" onclick="acceptProposal(this)">Postuler</button>
 | 
						|
                            <button class="w3-button w3-red refuse-button" onclick="confirmRefusal(this)">Refuser</button>
 | 
						|
                        </td>
 | 
						|
                    </tr>
 | 
						|
                </tbody>
 | 
						|
            </table>
 | 
						|
        </div>
 | 
						|
    </div>
 | 
						|
 | 
						|
        <!-- Popup pour pièces justificatives -->
 | 
						|
        <div id="justificatifForm" class="w3-modal">
 | 
						|
            <div class="w3-modal-content w3-card-4">
 | 
						|
                <header class="w3-container w3-purple">
 | 
						|
                    <h3>Téléchargez vos pièces justificatives</h3>
 | 
						|
                </header>
 | 
						|
                <div class="w3-container">
 | 
						|
                    <p>Veuillez télécharger votre contrat de travail pour la candidature :</p>
 | 
						|
                    <input type="file" id="justificatif" name="justificatif" class="w3-input w3-border" required>
 | 
						|
                </div>
 | 
						|
                <footer class="w3-container">
 | 
						|
                    <button id="submitJustificatif" class="w3-button w3-green w3-margin-top w3-margin-bottom" onclick="submitJustificatif()">Soumettre</button>
 | 
						|
                    <button class="w3-button w3-red w3-margin-top w3-margin-bottom" onclick="closeJustificatifPopup()">Annuler</button>
 | 
						|
                </footer>
 | 
						|
            </div>
 | 
						|
        </div>
 | 
						|
 | 
						|
        <div class="w3-container dashboard-container">
 | 
						|
            <div class="section-header w3-border-bottom w3-padding">
 | 
						|
                <h2>Prochaines heures</h2>
 | 
						|
            </div>
 | 
						|
            <div class="validated-hours-container w3-responsive card">
 | 
						|
                <table class="w3-table w3-bordered w3-striped validated-hours-table" id="validatedTable">
 | 
						|
                    <thead>
 | 
						|
                        <tr>
 | 
						|
                            <th>Période</th>
 | 
						|
                            <th>Formation</th>
 | 
						|
                            <th>Nom du Cours</th>
 | 
						|
                            <th>Semestre</th>
 | 
						|
                            <th>Type d'intervention</th>
 | 
						|
                            <th>Volume Prévisionnel</th>
 | 
						|
                            <th>Statut</th>
 | 
						|
                        </tr>
 | 
						|
                    </thead>
 | 
						|
                    <tbody id="validatedTableBody">
 | 
						|
                        <tr>
 | 
						|
                            <td>Décembre 2024</td>
 | 
						|
                            <td>BUT1</td>
 | 
						|
                            <td>Développement Web</td>
 | 
						|
                            <td>1</td>
 | 
						|
                            <td>CM, TD</td>
 | 
						|
                            <td>8h</td>
 | 
						|
                            <td class="status-valide">Validé</td>
 | 
						|
                        </tr>
 | 
						|
                        <tr>
 | 
						|
                            <td>Janvier 2025</td>
 | 
						|
                            <td>BUT2</td>
 | 
						|
                            <td>SCR</td>
 | 
						|
                            <td>3</td>
 | 
						|
                            <td>TD, TP</td>
 | 
						|
                            <td>6h</td>
 | 
						|
                            <td class="status-valide">Validé</td>
 | 
						|
                        </tr>
 | 
						|
                        <tr>
 | 
						|
                            <td>Février 2025</td>
 | 
						|
                            <td>BUT3</td>
 | 
						|
                            <td>Base de données</td>
 | 
						|
                            <td>5</td>
 | 
						|
                            <td>CM</td>
 | 
						|
                            <td>10h</td>
 | 
						|
                            <td class="status-valide">Validé</td>
 | 
						|
                        </tr>
 | 
						|
                        <tr>
 | 
						|
                            <td>Mars 2025</td>
 | 
						|
                            <td>BUT3</td>
 | 
						|
                            <td>IA et Machine Learning</td>
 | 
						|
                            <td>6</td>
 | 
						|
                            <td>TD, TP</td>
 | 
						|
                            <td>12h</td>
 | 
						|
                            <td class="status-attente">En attente de traitement</td>
 | 
						|
                        </tr>
 | 
						|
                        <tr>
 | 
						|
                            <td>Avril 2025</td>
 | 
						|
                            <td>BUT2</td>
 | 
						|
                            <td>Réseaux</td>
 | 
						|
                            <td>4</td>
 | 
						|
                            <td>CM, TD</td>
 | 
						|
                            <td>4h</td>
 | 
						|
                            <td class="status-attente">En attente de traitement</td>
 | 
						|
                        </tr>
 | 
						|
                    </tbody>
 | 
						|
                </table>
 | 
						|
            </div>
 | 
						|
        </div>
 | 
						|
 | 
						|
        <div class="w3-container dashboard-container">
 | 
						|
    <div class="section-header w3-border-bottom w3-padding">
 | 
						|
        <h2>Historique des Heures Travaillées</h2>
 | 
						|
    </div>
 | 
						|
    
 | 
						|
    <div class="card w3-responsive">
 | 
						|
        <div class="table-container">
 | 
						|
            <table id="hoursTable" class="w3-table w3-bordered w3-striped">
 | 
						|
                <thead>
 | 
						|
                    <tr>
 | 
						|
                        <th onclick="sortTable(0)">Date ▲</th> <!-- Triable -->
 | 
						|
                        <th>Matière</th>
 | 
						|
                        <th>Type d'Intervention</th>
 | 
						|
                        <th onclick="sortTable(3)">Volume Horaire ▲</th> <!-- Triable -->
 | 
						|
                        <th onclick="sortTable(4)">Heures Travaillées ▲</th> <!-- Triable -->
 | 
						|
                        <th>Actions</th>
 | 
						|
                    </tr>
 | 
						|
                </thead>
 | 
						|
                <tbody id="hoursTableBody">
 | 
						|
                    <!-- Les lignes seront générées dynamiquement avec JavaScript -->
 | 
						|
                </tbody>
 | 
						|
            </table>
 | 
						|
        </div>
 | 
						|
        
 | 
						|
        <!-- Pagination Buttons -->
 | 
						|
        <div id="pagination" class="w3-center">
 | 
						|
            <button class="w3-button w3-purple" onclick="prevPage()">Précédent</button>
 | 
						|
            <span id="pageNumber"></span>
 | 
						|
            <button class="w3-button w3-purple" onclick="nextPage()">Suivant</button>
 | 
						|
        </div>
 | 
						|
    </div>
 | 
						|
</div> 
 | 
						|
 | 
						|
        <div class="section-header dashboard-container">
 | 
						|
            <h2>Graphique des Heures Travaillées</h2>
 | 
						|
        </div>
 | 
						|
        <div class="dashboard-container">
 | 
						|
            <canvas id="hoursChart"></canvas>
 | 
						|
        </div>
 | 
						|
 | 
						|
 
 | 
						|
        <div class="section-header dashboard-container">
 | 
						|
            <h2>Signalement de problèmes d'heures</h2>
 | 
						|
        </div>
 | 
						|
        <div class="contact-form dashboard-container">
 | 
						|
            <form id="contactForm">
 | 
						|
                <label for="probleme">Type de problème :</label>
 | 
						|
                <select id="probleme" name="probleme" class="w3-select" required>
 | 
						|
                    <option value="" disabled selected>Choisir un problème</option>
 | 
						|
                    <option value="non_paye">Il manque des heures dans mon historique</option>
 | 
						|
                    <option value="montant_incorrect">Il y a des heures en trop dans mon historique</option>
 | 
						|
                    <option value="erreur_formation">Erreur dans la formation associée</option>
 | 
						|
                    <option value="erreur_type_intervention">Erreur dans le type d'intervention</option>
 | 
						|
                    <option value="autre">Autre</option>
 | 
						|
                </select>
 | 
						|
                
 | 
						|
                <label for="mois">Mois concerné :</label>
 | 
						|
                <select id="mois" name="mois" class="w3-select" required>
 | 
						|
                    <option value="" disabled selected>Choisir un mois</option>
 | 
						|
                    <option value="janvier">Janvier</option>
 | 
						|
                    <option value="fevrier">Février</option>
 | 
						|
                    <option value="mars">Mars</option>
 | 
						|
                    <option value="avril">Avril</option>
 | 
						|
                    <option value="mai">Mai</option>
 | 
						|
                    <option value="juin">Juin</option>
 | 
						|
                    <option value="juillet">Juillet</option>
 | 
						|
                    <option value="aout">Août</option>
 | 
						|
                    <option value="septembre">Septembre</option>
 | 
						|
                    <option value="octobre">Octobre</option>
 | 
						|
                    <option value="novembre">Novembre</option>
 | 
						|
                    <option value="decembre">Décembre</option>
 | 
						|
                </select>
 | 
						|
    
 | 
						|
                <label for="heures">Heures concernées :</label>
 | 
						|
                <select id="heures" name="heures" class="w3-select" required>
 | 
						|
                    <option value="" disabled selected>Choisir un nombre d'heures</option>
 | 
						|
                    <option value="1">1 heure</option>
 | 
						|
                    <option value="2">2 heures</option>
 | 
						|
                    <option value="3">3 heures</option>
 | 
						|
                    <option value="4">4 heures</option>
 | 
						|
                    <option value="5">5 heures</option>
 | 
						|
                    <option value="6">6 heures</option>
 | 
						|
                    <option value="7">7 heures</option>
 | 
						|
                    <option value="8">8 heures</option>
 | 
						|
                    <option value="9">9 heures</option>
 | 
						|
                    <option value="10">10 heures</option>
 | 
						|
                    <option value="autre">Plus de 10 heures</option>
 | 
						|
                </select>
 | 
						|
                
 | 
						|
                <label for="commentaire">Commentaires (facultatif) :</label>
 | 
						|
                <input type="text" id="commentaire" name="commentaire" placeholder="Ajoutez des détails supplémentaires" class="w3-input">
 | 
						|
                
 | 
						|
                <button type="submit">Soumettre</button>
 | 
						|
            </form>
 | 
						|
        </div>
 | 
						|
    </div>
 | 
						|
 | 
						|
    <!-- Popup pour les détails du cours -->
 | 
						|
    <div id="infoPopup" class="popup">
 | 
						|
        <h4>Détails du la journée</h4>
 | 
						|
        <p><strong>Promotion :</strong> <span id="promotion"></span></p>
 | 
						|
        <p><strong>Groupe(s) :</strong> <span id="groupe"></span></p>
 | 
						|
        <p><strong>Salle :</strong> <span id="salle"></span></p>
 | 
						|
        <button onclick="closeInfoPopup()">Fermer</button>
 | 
						|
    </div>
 | 
						|
 | 
						|
    <!-- Popup pour succès de l'envoi du formulaire -->
 | 
						|
    <div id="popup" class="popup">
 | 
						|
        <img src="https://img.icons8.com/ios-filled/50/155724/checkmark.png" alt="Success Icon">
 | 
						|
        <h4>Signalement Envoyé !</h4>
 | 
						|
        <p>Merci pour votre signalement. Nous allons traiter votre demande dans les plus brefs délais.</p>
 | 
						|
        <button onclick="closePopup()">Fermer</button>
 | 
						|
    </div>
 | 
						|
 | 
						|
    <!-- Popup de confirmation de refus -->
 | 
						|
    <div id="confirmationPopup" class="confirmation-popup">
 | 
						|
        <div class="confirmation-content">
 | 
						|
            <h4>Confirmer le Refus</h4>
 | 
						|
            <p>Êtes-vous sûr de vouloir refuser cette proposition d'heure ?</p>
 | 
						|
            <button id="confirmRefusalButton" onclick="confirmRefusalAction()">Confirmer</button>
 | 
						|
            <button onclick="closeConfirmationPopup()">Annuler</button>
 | 
						|
        </div>
 | 
						|
    </div>
 | 
						|
 | 
						|
    <div id="infoPopup" class="popup">
 | 
						|
        <h4>Détails de l'intervention</h4>
 | 
						|
        <p><strong>Promotion :</strong> <span id="popupPromotion"></span></p>
 | 
						|
        <p><strong>Type de Cours :</strong> <span id="popupTypeCours"></span></p>
 | 
						|
        <p><strong>ETD :</strong> <span id="popupETD"></span></p>
 | 
						|
        <p><strong>Montant :</strong> <span id="popupMontant"></span></p>
 | 
						|
        <p><strong>Matière :</strong> <span id="popupMatiere"></span></p>
 | 
						|
        <button onclick="closeInfoPopup()">Fermer</button>
 | 
						|
    </div>
 | 
						|
 | 
						|
    <div class="footer">
 | 
						|
        <p>© 2024 IUT de Fontainebleau. Tous droits réservés | <a href="html/mentions_legales.html" style="color: white;">Mentions légales</a></p>
 | 
						|
    </div>
 | 
						|
 | 
						|
    <script>
 | 
						|
        // Données du graphique
 | 
						|
        const ctx = document.getElementById('hoursChart').getContext('2d');
 | 
						|
        const hoursChart = new Chart(ctx, {
 | 
						|
            type: 'bar',
 | 
						|
            data: {
 | 
						|
                labels: ['Semestre 1 - 2023', 'Semestre 2 - 2023', 'Semestre 1 - 2024', 'Semestre 2 - 2024'],
 | 
						|
                datasets: [{
 | 
						|
                    label: 'Heures Travaillées',
 | 
						|
                    data: [25, 18, 21, 32],
 | 
						|
                    backgroundColor: 'rgba(128, 0, 128, 0.6)', // Couleur de fond violet foncé moins transparente
 | 
						|
                    borderColor: 'rgba(128, 0, 128, 1)',      // Couleur de bord violet foncé
 | 
						|
                    borderWidth: 1
 | 
						|
                }]
 | 
						|
            },
 | 
						|
            options: {
 | 
						|
                responsive: true,
 | 
						|
                scales: {
 | 
						|
                    y: {
 | 
						|
                        beginAtZero: true,
 | 
						|
                        title: {
 | 
						|
                            display: true,
 | 
						|
                            text: 'Heures'
 | 
						|
                        }
 | 
						|
                    },
 | 
						|
                    x: {
 | 
						|
                        title: {
 | 
						|
                            display: true,
 | 
						|
                            text: 'Semestres'
 | 
						|
                        }
 | 
						|
                    }
 | 
						|
                }
 | 
						|
            }
 | 
						|
        });
 | 
						|
 | 
						|
        let proposalToRemove; // Variable pour stocker la proposition à supprimer
 | 
						|
 | 
						|
        // Fonctions pour gérer l'acceptation et le refus
 | 
						|
        function acceptProposal(button) {
 | 
						|
            document.getElementById("justificatifForm").style.display = "block";
 | 
						|
            proposalToRemove = button.closest('tr'); // Stocker la proposition à supprimer
 | 
						|
        }
 | 
						|
 | 
						|
        function confirmRefusal(button) {
 | 
						|
            proposalToRemove = button.closest('tr');
 | 
						|
            document.getElementById("confirmationPopup").style.display = "flex";
 | 
						|
        }
 | 
						|
 | 
						|
        function confirmRefusalAction() {
 | 
						|
            proposalToRemove.remove();
 | 
						|
            closeConfirmationPopup();
 | 
						|
        }
 | 
						|
 | 
						|
        function closeConfirmationPopup() {
 | 
						|
            document.getElementById("confirmationPopup").style.display = "none";
 | 
						|
        }
 | 
						|
 | 
						|
        function submitJustificatif() {
 | 
						|
            alert("Vos pièces justificatives ont été soumises avec succès.");
 | 
						|
            closeJustificatifPopup(); // Cacher le formulaire
 | 
						|
 | 
						|
            // Ajouter l'heure validée à la section des heures validées
 | 
						|
            const validatedTableBody = document.getElementById("validatedTableBody");
 | 
						|
            const newRow = document.createElement("tr");
 | 
						|
            const periode = proposalToRemove.cells[0].innerText; // Récupérer la période
 | 
						|
            const formation = proposalToRemove.cells[1].innerText; // Récupérer la formation
 | 
						|
            const nomCours = proposalToRemove.cells[2].innerText; // Récupérer le nom du cours
 | 
						|
            const semestre = proposalToRemove.cells[3].innerText; // Récupérer le semestre
 | 
						|
            const typeIntervention = proposalToRemove.cells[4].innerText; // Récupérer le type d'intervention
 | 
						|
            const volumePrevisionnel = proposalToRemove.cells[5].innerText; // Récupérer le volume prévisionnel
 | 
						|
 | 
						|
            newRow.innerHTML = `<td>${periode}</td><td>${formation}</td><td>${nomCours}</td><td>${semestre}</td><td>${typeIntervention}</td><td>${volumePrevisionnel}</td><td class="status-attente">En attente de traitement</td> `;
 | 
						|
            validatedTableBody.appendChild(newRow);
 | 
						|
            proposalToRemove.remove(); // Supprimer la proposition de l'affichage
 | 
						|
        }
 | 
						|
 | 
						|
        function closeJustificatifPopup() {
 | 
						|
            document.getElementById("justificatifForm").style.display = "none";
 | 
						|
        }
 | 
						|
 | 
						|
        function getRandomBUT() {
 | 
						|
            return "BUT" + Math.floor(Math.random() * 3 + 1);  // Génère un nombre aléatoire entre 1 et 3
 | 
						|
        }
 | 
						|
 | 
						|
        // Gestion des popups
 | 
						|
        function showDetails(promotion, groupes, salle) {
 | 
						|
            document.getElementById("promotion").innerText = promotion;
 | 
						|
            document.getElementById("groupe").innerText = groupes;
 | 
						|
            document.getElementById("salle").innerText = salle;
 | 
						|
            document.getElementById("infoPopup").style.display = "block";
 | 
						|
        }
 | 
						|
 | 
						|
        function closeInfoPopup() {
 | 
						|
            document.getElementById("infoPopup").style.display = "none";
 | 
						|
        }
 | 
						|
 | 
						|
        function closePopup() {
 | 
						|
            document.getElementById("popup").style.display = "none";
 | 
						|
        }
 | 
						|
 | 
						|
        // Gestion de l'envoi du formulaire de contact
 | 
						|
        document.getElementById('contactForm').addEventListener('submit', function(event) {
 | 
						|
            event.preventDefault();
 | 
						|
            document.getElementById("popup").style.display = "block";
 | 
						|
        });
 | 
						|
    </script>
 | 
						|
     <script>
 | 
						|
        // Exemple d'un grand nombre d'heures pour l'historique
 | 
						|
        const hoursData = [
 | 
						|
            { date: '01/02/2024', matiere: 'SCR', type: 'CM', volume: '3 ETD', worked: '4h' },
 | 
						|
            { date: '05/02/2024', matiere: 'Web Dev', type: 'TP', volume: '2 ETD', worked: '3h' },
 | 
						|
            { date: '10/02/2024', matiere: 'Mathématiques', type: 'TD', volume: '4 ETD', worked: '5h' },
 | 
						|
            { date: '15/02/2024', matiere: 'IA', type: 'CM', volume: '2 ETD', worked: '2h' },
 | 
						|
            { date: '20/02/2024', matiere: 'Python', type: 'TP', volume: '5 ETD', worked: '7h' },
 | 
						|
            // Ajoutez ici un grand nombre de données...
 | 
						|
            { date: '01/03/2024', matiere: 'Réseaux', type: 'TD', volume: '3 ETD', worked: '4h' },
 | 
						|
            { date: '10/03/2024', matiere: 'Big Data', type: 'CM', volume: '5 ETD', worked: '6h' },
 | 
						|
            // Plusieurs lignes (simulons jusqu'à 50 lignes ou plus)...
 | 
						|
            { date: '01/04/2024', matiere: 'Dev Mobile', type: 'TP', volume: '2 ETD', worked: '3h' },
 | 
						|
            { date: '10/04/2024', matiere: 'Sécurité', type: 'CM', volume: '3 ETD', worked: '5h' },
 | 
						|
        ];
 | 
						|
 | 
						|
        // Variables pour la pagination
 | 
						|
        const rowsPerPage = 5;
 | 
						|
        let currentPage = 1;
 | 
						|
        const totalRows = hoursData.length;
 | 
						|
        const totalPages = Math.ceil(totalRows / rowsPerPage);
 | 
						|
 | 
						|
        // Fonction pour afficher la table avec pagination
 | 
						|
        function displayTable(page) {
 | 
						|
            const start = (page - 1) * rowsPerPage;
 | 
						|
            const end = start + rowsPerPage;
 | 
						|
            const tableBody = document.getElementById('hoursTableBody');
 | 
						|
            tableBody.innerHTML = ''; // Clear existing rows
 | 
						|
 | 
						|
            const pageData = hoursData.slice(start, end);
 | 
						|
            pageData.forEach(row => {
 | 
						|
                const tr = document.createElement('tr');
 | 
						|
                tr.innerHTML = `<td>${row.date}</td>
 | 
						|
                                <td>${row.matiere}</td>
 | 
						|
                                <td>${row.type}</td>
 | 
						|
                                <td>${row.volume}</td>
 | 
						|
                                <td>${row.worked}</td>
 | 
						|
                                <td><span class="details-button" onclick="showDetails('BUT2', '1,2,3', '140')">Plus d'infos</span></td>`;
 | 
						|
                tableBody.appendChild(tr);
 | 
						|
            });
 | 
						|
 | 
						|
            document.getElementById('pageNumber').innerText = `Page ${page} sur ${totalPages}`;
 | 
						|
        }
 | 
						|
 | 
						|
        // Fonctions pour naviguer dans la pagination
 | 
						|
        function nextPage() {
 | 
						|
            if (currentPage < totalPages) {
 | 
						|
                currentPage++;
 | 
						|
                displayTable(currentPage);
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
        function prevPage() {
 | 
						|
            if (currentPage > 1) {
 | 
						|
                currentPage--;
 | 
						|
                displayTable(currentPage);
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
        // Fonction de tri pour les colonnes
 | 
						|
        function sortTable(n) {
 | 
						|
            const table = document.getElementById('hoursTable');
 | 
						|
            let rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0;
 | 
						|
            switching = true;
 | 
						|
            dir = "asc"; // Set the sorting direction to ascending
 | 
						|
            while (switching) {
 | 
						|
                switching = false;
 | 
						|
                rows = table.rows;
 | 
						|
                for (i = 1; i < (rows.length - 1); i++) {
 | 
						|
                    shouldSwitch = false;
 | 
						|
                    x = rows[i].getElementsByTagName("TD")[n];
 | 
						|
                    y = rows[i + 1].getElementsByTagName("TD")[n];
 | 
						|
                    if (dir === "asc") {
 | 
						|
                        if (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase()) {
 | 
						|
                            shouldSwitch = true;
 | 
						|
                            break;
 | 
						|
                        }
 | 
						|
                    } else if (dir === "desc") {
 | 
						|
                        if (x.innerHTML.toLowerCase() < y.innerHTML.toLowerCase()) {
 | 
						|
                            shouldSwitch = true;
 | 
						|
                            break;
 | 
						|
                        }
 | 
						|
                    }
 | 
						|
                }
 | 
						|
                if (shouldSwitch) {
 | 
						|
                    rows[i].parentNode.insertBefore(rows[i + 1], rows[i]);
 | 
						|
                    switching = true;
 | 
						|
                    switchcount++;
 | 
						|
                } else {
 | 
						|
                    if (switchcount === 0 && dir === "asc") {
 | 
						|
                        dir = "desc";
 | 
						|
                        switching = true;
 | 
						|
                    }
 | 
						|
                }
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
        // Initial load
 | 
						|
        displayTable(currentPage);
 | 
						|
 | 
						|
    </script>
 | 
						|
 | 
						|
    <script>
 | 
						|
        function toggleMenu() {
 | 
						|
            var menu = document.getElementById('menu');
 | 
						|
            var nom = document.getElementById('user-section');
 | 
						|
            if (menu.classList.contains('w3-hide-small')) {
 | 
						|
                menu.classList.remove('w3-hide-small');
 | 
						|
                menu.classList.remove('user-section');
 | 
						|
            } else {
 | 
						|
                menu.classList.add('w3-hide-small');
 | 
						|
            }
 | 
						|
        }
 | 
						|
    </script>
 | 
						|
</body>
 | 
						|
</html> |