✎ new 📝 Afficher la page 🕒 Anciennes révisions 🔗 Liens de retour Vous affichez une ancienne révision du document ! Si vous l'enregistrez, vous créerez une nouvelle version avec ce contenu. Sélection de fichiers<html> <style> /* Styles spécifiques pour l'intégration DokuWiki */ .dw-html-content { padding-top: 20px; } .card { box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); padding: 1.5rem; background: #fff; } .btn-copy { font-size: 0.8em; margin-left: 5px; padding: 0px 5px; } .flash-msg { color: #198754; font-weight: bold; margin-left: 5px; opacity: 0; transition: opacity 0.5s; } </style> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> <script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js"></script> <div class="dw-html-content"> <div class="card"> <h2 class="mb-4 text-primary">Migration Tool v3.3 (Compatible Firefox)</h2> <input type="file" id="file-picker" webkitdirectory directory multiple class="d-none"> <button onclick="document.getElementById('file-picker').click()" class="btn btn-outline-primary mb-3">Charger le dossier des Waves</button> <div id="statut-global" class="fw-bold mb-3"></div> <div class="row g-2 mb-4"> <div class="col-md-3"><input type="text" id="id-in" class="form-control" placeholder="ID"></div> <div class="col-md-3"><input type="text" id="prenom-in" class="form-control" placeholder="Prénom"></div> <div class="col-md-3"><input type="text" id="nom-in" class="form-control" placeholder="Nom"></div> <div class="col-md-3"> <button onclick="rechercher()" class="btn btn-primary">Rechercher</button> <button onclick="effacer()" class="btn btn-secondary">Effacer</button> </div> </div> <table class="table table-striped table-bordered align-middle"> <thead class="table-dark"> <tr> <th>Fichier</th> <th>ID</th> <th>Nom Complet</th> <th>Email</th> </tr> </thead> <tbody id="result-body"></tbody> </table> </div> </div> <script> let filesData = []; document.getElementById('file-picker').addEventListener('change', async (event) => { filesData = Array.from(event.target.files).filter(f => f.name.match(/^Wave [1-4] - SIM - HRA - NTT\.xlsx$/)); document.getElementById('statut-global').innerText = `✔ ${filesData.length} fichiers chargés.`; }); function creerCellule(texte) { const td = document.createElement('td'); td.innerHTML = `<div class="d-flex align-items-center"><span class="text-truncate">${texte}</span><button class="btn btn-sm btn-outline-info btn-copy" onclick="copyToClipboard('${texte}', this)">📋</button><span class="flash-msg">✓</span></div>`; return td; } function copyToClipboard(text, element) { navigator.clipboard.writeText(text); const flash = element.parentElement.querySelector('.flash-msg'); flash.style.opacity = "1"; setTimeout(() => { flash.style.opacity = "0"; }, 2000); } function effacer() { document.getElementById('result-body').innerHTML = ""; } async function rechercher() { const tbody = document.getElementById('result-body'); tbody.innerHTML = ""; const idQ = document.getElementById('id-in').value.toLowerCase(); const prenomQ = document.getElementById('prenom-in').value.toLowerCase(); const nomQ = document.getElementById('nom-in').value.toLowerCase(); for (let file of filesData) { const data = await file.arrayBuffer(); const wb = XLSX.read(data, { type: 'array' }); const json = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]); json.forEach(row => { const email = String(row['Email address'] || '').toLowerCase(); const parts = email.split('@')[0].split('.'); const prenom = parts[0] || ""; const nom = parts[1] || ""; if (String(row.ID || '').toLowerCase().includes(idQ) && prenom.toLowerCase().includes(prenomQ) && nom.toLowerCase().includes(nomQ)) { const tr = document.createElement('tr'); tr.appendChild(creerCellule(file.name)); tr.appendChild(creerCellule(String(row.ID))); tr.appendChild(creerCellule(row.Name || (nom.toUpperCase() + ' ' + prenom))); tr.appendChild(creerCellule(row['Email address'] || '')); tbody.appendChild(tr); } }); } } </script> </html>EnregistrerAperçuAnnuler Résumé Note : En modifiant cette page, vous acceptez que le contenu soit placé sous les termes de la licence suivante : CC Attribution-Share Alike 4.0 International