474 lines
		
	
	
		
			20 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
		
		
			
		
	
	
			474 lines
		
	
	
		
			20 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">
							 | 
						||
| 
								 | 
							
								        <!-- Logo pour retourner à l'accueil -->
							 | 
						||
| 
								 | 
							
								        <div class="logo-container">
							 | 
						||
| 
								 | 
							
								            <img src="../../media/img/logoWhite.png" alt="Logo Accueil">
							 | 
						||
| 
								 | 
							
								        </div>
							 | 
						||
| 
								 | 
							
								        
							 | 
						||
| 
								 | 
							
								        <!-- Catégories dans le header -->
							 | 
						||
| 
								 | 
							
								        <div class="categories">
							 | 
						||
| 
								 | 
							
								            <a href="./vacataire.html">Accueil</a>
							 | 
						||
| 
								 | 
							
								            <a href="./mes-heures.html">Heures</a>
							 | 
						||
| 
								 | 
							
								            <a href="./paiements.html">Paiements</a>
							 | 
						||
| 
								 | 
							
								            <a href="./mes-informations.html">Mes informations et documents</a>
							 | 
						||
| 
								 | 
							
								        </div>
							 | 
						||
| 
								 | 
							
								    
							 | 
						||
| 
								 | 
							
								        <!-- Section utilisateur avec déconnexion -->
							 | 
						||
| 
								 | 
							
								        <div class="user-section">
							 | 
						||
| 
								 | 
							
								            <div class="user-name">
							 | 
						||
| 
								 | 
							
								                Maxime MENAULT
							 | 
						||
| 
								 | 
							
								            </div>
							 | 
						||
| 
								 | 
							
								            <div class="logout-container">
							 | 
						||
| 
								 | 
							
								                <a href="../../index.html" title="Se déconnecter">
							 | 
						||
| 
								 | 
							
								                    <img src="../../media/img/LogOutWhite.png" alt="Logo Déconnexion">
							 | 
						||
| 
								 | 
							
								                </a>
							 | 
						||
| 
								 | 
							
								            </div>
							 | 
						||
| 
								 | 
							
								        </div>
							 | 
						||
| 
								 | 
							
								    </div>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    <div class="dashboard-container">
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        <div class="section-header">
							 | 
						||
| 
								 | 
							
								            <h2>Offres de vacation</h2>
							 | 
						||
| 
								 | 
							
								        </div>
							 | 
						||
| 
								 | 
							
								        <div class="proposition-container">
							 | 
						||
| 
								 | 
							
								            <table class="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="accept-button" onclick="acceptProposal(this)">Postuler</button>
							 | 
						||
| 
								 | 
							
								                            <button class="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="accept-button" onclick="acceptProposal(this)">Postuler</button>
							 | 
						||
| 
								 | 
							
								                            <button class="refuse-button" onclick="confirmRefusal(this)">Refuser</button>
							 | 
						||
| 
								 | 
							
								                        </td>
							 | 
						||
| 
								 | 
							
								                    </tr>
							 | 
						||
| 
								 | 
							
								                </tbody>
							 | 
						||
| 
								 | 
							
								            </table>
							 | 
						||
| 
								 | 
							
								        </div>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        <!-- Popup pour pièces justificatives -->
							 | 
						||
| 
								 | 
							
								        <div id="justificatifForm" class="justificatif-form popup">
							 | 
						||
| 
								 | 
							
								            <h3>Téléchargez vos pièces justificatives</h3>
							 | 
						||
| 
								 | 
							
								            <p>Veuillez télécharger le document suivant :</p>
							 | 
						||
| 
								 | 
							
								            <ul>
							 | 
						||
| 
								 | 
							
								                <li>Contrat de travail actuel</li>
							 | 
						||
| 
								 | 
							
								            </ul>
							 | 
						||
| 
								 | 
							
								            <input type="file" id="justificatif" name="justificatif" required>
							 | 
						||
| 
								 | 
							
								            <button id="submitJustificatif" onclick="submitJustificatif()">Soumettre</button>
							 | 
						||
| 
								 | 
							
								            <button onclick="closeJustificatifPopup()">Annuler</button>
							 | 
						||
| 
								 | 
							
								        </div>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        <div class="section-header">
							 | 
						||
| 
								 | 
							
								            <h2>Prochaines heures</h2>
							 | 
						||
| 
								 | 
							
								        </div>
							 | 
						||
| 
								 | 
							
								        <div class="validated-hours-container card">
							 | 
						||
| 
								 | 
							
								            <table class="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> <!-- Nouvelle colonne pour le statut -->
							 | 
						||
| 
								 | 
							
								                    </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> <!-- Statut -->
							 | 
						||
| 
								 | 
							
								                    </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> <!-- Statut -->
							 | 
						||
| 
								 | 
							
								                    </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> <!-- Statut -->
							 | 
						||
| 
								 | 
							
								                    </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> <!-- Statut en attente -->
							 | 
						||
| 
								 | 
							
								                    </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> <!-- Statut en attente -->
							 | 
						||
| 
								 | 
							
								                    </tr>
							 | 
						||
| 
								 | 
							
								                </tbody>
							 | 
						||
| 
								 | 
							
								            </table>
							 | 
						||
| 
								 | 
							
								        </div>
							 | 
						||
| 
								 | 
							
								        <div class="section-header">
							 | 
						||
| 
								 | 
							
								            <h2>Historique des Heures Travaillées</h2>
							 | 
						||
| 
								 | 
							
								        </div>
							 | 
						||
| 
								 | 
							
								    
							 | 
						||
| 
								 | 
							
								        <div class="card">
							 | 
						||
| 
								 | 
							
								            <div class="table-container">
							 | 
						||
| 
								 | 
							
								                <table id="hoursTable">
							 | 
						||
| 
								 | 
							
								                    <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">
							 | 
						||
| 
								 | 
							
								                        <!-- Rows will be generated dynamically with JavaScript -->
							 | 
						||
| 
								 | 
							
								                    </tbody>
							 | 
						||
| 
								 | 
							
								                </table>
							 | 
						||
| 
								 | 
							
								            </div>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								                
							 | 
						||
| 
								 | 
							
								        <!-- Pagination Buttons -->
							 | 
						||
| 
								 | 
							
								        <div id="pagination">
							 | 
						||
| 
								 | 
							
								            <button onclick="prevPage()">Précédent</button>
							 | 
						||
| 
								 | 
							
								            <span id="pageNumber"></span>
							 | 
						||
| 
								 | 
							
								            <button onclick="nextPage()">Suivant</button>
							 | 
						||
| 
								 | 
							
								        </div>
							 | 
						||
| 
								 | 
							
								        </div>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        <div class="section-header">
							 | 
						||
| 
								 | 
							
								            <h2>Graphique des Heures Travaillées</h2>
							 | 
						||
| 
								 | 
							
								        </div>
							 | 
						||
| 
								 | 
							
								        <div class="chart-container">
							 | 
						||
| 
								 | 
							
								            <canvas id="hoursChart"></canvas>
							 | 
						||
| 
								 | 
							
								        </div>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        <div class="section-header">
							 | 
						||
| 
								 | 
							
								            <h2>Signalement de problèmes d'heures</h2>
							 | 
						||
| 
								 | 
							
								        </div>
							 | 
						||
| 
								 | 
							
								        <div class="contact-form">
							 | 
						||
| 
								 | 
							
								            <form id="contactForm">
							 | 
						||
| 
								 | 
							
								                <label for="probleme">Type de problème :</label>
							 | 
						||
| 
								 | 
							
								                <select id="probleme" name="probleme" 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</option>
							 | 
						||
| 
								 | 
							
								                    <option value="autre">Autre</option>
							 | 
						||
| 
								 | 
							
								                </select>
							 | 
						||
| 
								 | 
							
								                
							 | 
						||
| 
								 | 
							
								                <label for="commentaire">Commentaires :</label>
							 | 
						||
| 
								 | 
							
								                <input type="text" id="commentaire" name="commentaire" placeholder="Décrivez votre problème" required>
							 | 
						||
| 
								 | 
							
								                
							 | 
						||
| 
								 | 
							
								                <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: ['Semaine 1', 'Semaine 2', 'Semaine 3', 'Semaine 4'],
							 | 
						||
| 
								 | 
							
								                datasets: [{
							 | 
						||
| 
								 | 
							
								                    label: 'Heures Travaillées',
							 | 
						||
| 
								 | 
							
								                    data: [5, 10, 7, 8],
							 | 
						||
| 
								 | 
							
								                    backgroundColor: 'rgba(75, 192, 192, 0.2)',
							 | 
						||
| 
								 | 
							
								                    borderColor: 'rgba(75, 192, 192, 1)',
							 | 
						||
| 
								 | 
							
								                    borderWidth: 1
							 | 
						||
| 
								 | 
							
								                }]
							 | 
						||
| 
								 | 
							
								            },
							 | 
						||
| 
								 | 
							
								            options: {
							 | 
						||
| 
								 | 
							
								                responsive: true,
							 | 
						||
| 
								 | 
							
								                scales: {
							 | 
						||
| 
								 | 
							
								                    y: {
							 | 
						||
| 
								 | 
							
								                        beginAtZero: true,
							 | 
						||
| 
								 | 
							
								                        title: {
							 | 
						||
| 
								 | 
							
								                            display: true,
							 | 
						||
| 
								 | 
							
								                            text: 'Heures'
							 | 
						||
| 
								 | 
							
								                        }
							 | 
						||
| 
								 | 
							
								                    },
							 | 
						||
| 
								 | 
							
								                    x: {
							 | 
						||
| 
								 | 
							
								                        title: {
							 | 
						||
| 
								 | 
							
								                            display: true,
							 | 
						||
| 
								 | 
							
								                            text: 'Semaines'
							 | 
						||
| 
								 | 
							
								                        }
							 | 
						||
| 
								 | 
							
								                    }
							 | 
						||
| 
								 | 
							
								                }
							 | 
						||
| 
								 | 
							
								            }
							 | 
						||
| 
								 | 
							
								        });
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        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>
							 | 
						||
| 
								 | 
							
								</body>
							 | 
						||
| 
								 | 
							
								</html>
							 |