Gestion des Bons d’Achat

Portail de Validation GreenPower :root { –brand-blue: #00334C; –brand-green: #3BCD5E; –input-bg: #eff1f3; –text-dark: #00334C; } body { font-family: ‘Helvetica Neue’, Helvetica, Arial, sans-serif; background-color: #ffffff; margin: 0; padding: 20px; color: var(–brand-blue); display: flex; justify-content: center; align-items: flex-start; min-height: 100vh; } .container { width: 100%; max-width: 700px; margin: 0 auto; } h1.main-title { color: var(–brand-blue); font-size: 28px; font-weight: 600; margin-bottom: 30px; text-align: center; text-transform: uppercase; letter-spacing: 0.5px; } .search-box { background: white; padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.08); margin-bottom: 30px; border: 1px solid #eee; } .section-header { color: var(–brand-green); font-weight: 700; font-size: 16px; text-transform: uppercase; margin-bottom: 20px; margin-top: 30px; padding-bottom: 10px; border-bottom: 1px solid #eee; } .form-row { display: flex; gap: 20px; margin-bottom: 20px; } .form-group { flex: 1; display: flex; flex-direction: column; } .form-group.full-width { width: 100%; } label { color: var(–brand-blue); font-weight: 700; font-size: 14px; margin-bottom: 8px; } input[type= »text »], input[type= »email »], input[type= »tel »], select { background-color: var(–input-bg); border: 1px solid #ced4da; border-radius: 6px; padding: 12px 15px; font-size: 15px; color: #333; outline: none; transition: border-color 0.2s; width: 100%; box-sizing: border-box; } input:focus, select:focus { border-color: var(–brand-blue); background-color: #fff; } .btn { background-color: var(–brand-blue); color: white; padding: 14px 24px; border: none; border-radius: 6px; font-size: 16px; font-weight: 600; cursor: pointer; width: 100%; transition: background-color 0.3s; } .btn:hover { background-color: var(–brand-green); } .result-box { padding: 20px; border-radius: 6px; margin-top: 20px; display: none; text-align: center; } .result-valid { background-color: #e6ffec; border: 1px solid var(–brand-green); color: #2e7d32; } .result-invalid { background-color: #ffebee; border: 1px solid #ef5350; color: #c62828; } /* Conditions Box at the bottom */ .conditions-box { background-color: #f8f9fa; border-left: 4px solid var(–brand-blue); padding: 20px; margin-top: 30px; border-radius: 4px; font-size: 13px; line-height: 1.6; color: #555; } .conditions-box h3 { margin-top: 0; color: var(–brand-blue); font-size: 15px; text-transform: uppercase; } .conditions-box ul { padding-left: 20px; margin-bottom: 0; } .conditions-box a { color: var(–brand-blue); font-weight: bold; text-decoration: none; } /* Modal Styles */ .modal { display: none; position: fixed; z-index: 100; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); overflow-y: auto; } .modal-content { background-color: #fff; margin: 5% auto; padding: 40px; border-radius: 8px; width: 90%; max-width: 700px; position: relative; box-shadow: 0 5px 20px rgba(0,0,0,0.2); } .close { position: absolute; right: 20px; top: 15px; font-size: 30px; cursor: pointer; color: #aaa; } .loader { border: 4px solid #f3f3f3; border-top: 4px solid var(–brand-green); border-radius: 50%; width: 30px; height: 30px; animation: spin 1s linear infinite; margin: 20px auto; display: none; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } @media (max-width: 600px) { .form-row { flex-direction: column; gap: 0; } .form-group { margin-bottom: 15px; } }

Portail de Validation GreenPower

Conditions & Support Distributeur

  • Validité : Vous pouvez accepter les bons valides jusqu’au 30/06/2026 inclus.
  • Règlement : Le bon est non échangeable et non remboursable. Pas remboursement de la différence si le montant de l’achat est inférieur à la valeur du bon.
  • Restriction : Le bon est strictement personnel au client final.
  • Support : Pour toute question : Fanny Hanrion – 06 59 45 64 97 – fanny.hanrion@GREENPOWER-TECHNOLOGIE.COM
// ——————————————————— // APP SCRIPT URL // ——————————————————— const SCRIPT_URL = « https://script.google.com/macros/s/AKfycbxI1yFlbzK-9XYvELwBxGdvPpCog-CTy42pKaB07BNbHf5ZhWFlEVIl0wiBkglosKuK/exec »; let currentCode = «  »; function checkCode() { const codeInput = document.getElementById(‘searchCode’).value.trim(); const resultArea = document.getElementById(‘resultArea’); const loader = document.getElementById(‘mainLoader’); if (!codeInput) return; // UI Reset resultArea.style.display = ‘none’; resultArea.className = ‘result-box’; loader.style.display = ‘block’; fetch(`${SCRIPT_URL}?action=search&code=${encodeURIComponent(codeInput)}`) .then(response => response.json()) .then(data => { loader.style.display = ‘none’; resultArea.style.display = ‘block’; if (data.status === ‘valid’) { currentCode = codeInput; resultArea.className = ‘result-box result-valid’; resultArea.innerHTML = `

${data.data.amount} € DE REMISE

Type : ${data.data.type}

`; } else if (data.status === ‘used’) { resultArea.className = ‘result-box result-invalid’; resultArea.innerHTML = `Ce code a déjà été utilisé.
Il n’est plus valide.`; } else { resultArea.className = ‘result-box result-invalid’; resultArea.innerHTML = `Code introuvable.
Vérifiez la saisie.`; } }) .catch(err => { loader.style.display = ‘none’; alert(« Erreur de connexion au serveur. »); console.error(err); }); } function openModal() { document.getElementById(‘modalCodeDisplay’).innerText = currentCode.toUpperCase(); document.getElementById(‘redeemModal’).style.display = « block »; } function closeModal() { document.getElementById(‘redeemModal’).style.display = « none »; } function redeemCode(e) { e.preventDefault(); const submitBtn = document.querySelector(‘#redemptionForm .btn’); const loader = document.getElementById(‘modalLoader’); const payload = { code: currentCode, distributor: document.getElementById(‘distSelect’).value, distEmail: document.getElementById(‘distEmail’).value, clientName: document.getElementById(‘clientName’).value, clientSurname: document.getElementById(‘clientSurname’).value, clientCompany: document.getElementById(‘clientCompany’).value, clientEmail: document.getElementById(‘clientEmail’).value }; submitBtn.style.display = ‘none’; loader.style.display = ‘block’; fetch(SCRIPT_URL, { method: ‘POST’, body: JSON.stringify(payload) }) .then(response => response.json()) .then(data => { loader.style.display = ‘none’; if (data.success) { alert(« Succès ! Le bon d’achat a été validé et enregistré. »); closeModal(); location.reload(); } else { alert(« Erreur:  » + data.message); submitBtn.style.display = ‘block’; } }) .catch(err => { loader.style.display = ‘none’; submitBtn.style.display = ‘block’; alert(« Erreur de connexion. »); console.error(err); }); } window.onclick = function(event) { if (event.target == document.getElementById(‘redeemModal’)) { closeModal(); } }