a
This commit is contained in:
parent
a21a080db1
commit
a8cd87fda3
|
|
@ -412,3 +412,44 @@
|
||||||
<?php if($faceActif=='1') : ?>
|
<?php if($faceActif=='1') : ?>
|
||||||
<?php include 'faceebene/ebenetraitementimage.php'; ?>
|
<?php include 'faceebene/ebenetraitementimage.php'; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<!-- champ pour copier le tag NFC -->
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="text"
|
||||||
|
id="tagCarteNfc"
|
||||||
|
value="<?= htmlspecialchars($beneficiaire['tagCarteNfc']) ?>"
|
||||||
|
readonly
|
||||||
|
class="form-control">
|
||||||
|
<button type="button"
|
||||||
|
class="btn btn-secondary"
|
||||||
|
onclick="copierTag()"
|
||||||
|
title="Copier le tag NFC">
|
||||||
|
<i class="fas fa-copy"></i>
|
||||||
|
</button>
|
||||||
|
</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