a
This commit is contained in:
parent
917322f921
commit
dcdd9ce9aa
|
|
@ -105,6 +105,52 @@
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<div class="input-group input-group-lg">
|
||||||
|
<span class="input-group-text">Tag NFC</span>
|
||||||
|
<input type="text"
|
||||||
|
id="tagCarteNfc"
|
||||||
|
value="<?= htmlspecialchars($beneficiaire['tagCarteNfc']) ?>"
|
||||||
|
readonly
|
||||||
|
class="form-control text-center"
|
||||||
|
style="letter-spacing: 1px;"
|
||||||
|
>
|
||||||
|
<button type="button"
|
||||||
|
class="btn btn-primary"
|
||||||
|
onclick="copierTag()"
|
||||||
|
title="Copier le tag NFC">
|
||||||
|
<i class="fas fa-copy"></i> Copier le tag NFC
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function copierTag() {
|
||||||
|
const valeur = document.getElementById('tagCarteNfc').value;
|
||||||
|
|
||||||
|
navigator.clipboard.writeText(valeur).then(() => {
|
||||||
|
// Feedback visuel
|
||||||
|
const btn = event.currentTarget;
|
||||||
|
const iconeOriginale = btn.innerHTML;
|
||||||
|
btn.innerHTML = '<i class="fas fa-check"></i>';
|
||||||
|
btn.classList.replace('btn-secondary', 'btn-success');
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
btn.innerHTML = iconeOriginale;
|
||||||
|
btn.classList.replace('btn-success', 'btn-secondary');
|
||||||
|
}, 2000);
|
||||||
|
|
||||||
|
}).catch(() => {
|
||||||
|
// Fallback pour anciens navigateurs
|
||||||
|
const input = document.getElementById('tagCarteNfc');
|
||||||
|
input.select();
|
||||||
|
document.execCommand('copy');
|
||||||
|
alert('Tag copié !');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<FORM name= "formfichebeneficiaire" id ="formfichebeneficiaire" method="POST">
|
<FORM name= "formfichebeneficiaire" id ="formfichebeneficiaire" method="POST">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
|
||||||
|
|
@ -1085,47 +1131,3 @@ endif; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<div class="input-group input-group-lg">
|
|
||||||
<span class="input-group-text">Tag NFC</span>
|
|
||||||
<input type="text"
|
|
||||||
id="tagCarteNfc"
|
|
||||||
value="<?= htmlspecialchars($beneficiaire['tagCarteNfc']) ?>"
|
|
||||||
readonly
|
|
||||||
class="form-control text-center"
|
|
||||||
style="letter-spacing: 1px;"
|
|
||||||
>
|
|
||||||
<button type="button"
|
|
||||||
class="btn btn-primary"
|
|
||||||
onclick="copierTag()"
|
|
||||||
title="Copier le tag NFC">
|
|
||||||
<i class="fas fa-copy"></i> Copier le tag NFC
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function copierTag() {
|
|
||||||
const valeur = document.getElementById('tagCarteNfc').value;
|
|
||||||
|
|
||||||
navigator.clipboard.writeText(valeur).then(() => {
|
|
||||||
// Feedback visuel
|
|
||||||
const btn = event.currentTarget;
|
|
||||||
const iconeOriginale = btn.innerHTML;
|
|
||||||
btn.innerHTML = '<i class="fas fa-check"></i>';
|
|
||||||
btn.classList.replace('btn-secondary', 'btn-success');
|
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
btn.innerHTML = iconeOriginale;
|
|
||||||
btn.classList.replace('btn-success', 'btn-secondary');
|
|
||||||
}, 2000);
|
|
||||||
|
|
||||||
}).catch(() => {
|
|
||||||
// Fallback pour anciens navigateurs
|
|
||||||
const input = document.getElementById('tagCarteNfc');
|
|
||||||
input.select();
|
|
||||||
document.execCommand('copy');
|
|
||||||
alert('Tag copié !');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
Loading…
Reference in New Issue
Block a user