a
This commit is contained in:
parent
c1c560d561
commit
0953d2611a
|
|
@ -112,56 +112,59 @@
|
|||
}
|
||||
</style>
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="input-group input-group-lg">
|
||||
|
||||
<span class="input-group-text" style="font-size: 13pt;">Tag NFC</span>
|
||||
|
||||
<input type="text"
|
||||
id="tagCarteNfc"
|
||||
value="<?= htmlspecialchars($beneficiaire['tagCarteNfc']) ?>"
|
||||
readonly
|
||||
class="form-control text-center"
|
||||
style="letter-spacing: -1px; font-size:13pt;"
|
||||
>
|
||||
|
||||
<button type="button"
|
||||
class="btn btn-primary"
|
||||
onclick="copierTag()"
|
||||
title="Copier le tag NFC"
|
||||
style="font-size:13pt;">
|
||||
<i class="fas fa-copy"></i> Copier le tag NFC
|
||||
</button>
|
||||
<!-- DEBUT TAG -->
|
||||
<?php if ($carteAvecDonnees=="1") : ?>
|
||||
<div class="mb-3">
|
||||
<div class="input-group input-group-lg">
|
||||
|
||||
<span class="input-group-text" style="font-size: 13pt;">Tag NFC</span>
|
||||
|
||||
<input type="text"
|
||||
id="tagCarteNfc"
|
||||
value="<?= htmlspecialchars($beneficiaire['tagCarteNfc']) ?>"
|
||||
readonly
|
||||
class="form-control text-center"
|
||||
style="letter-spacing: -1px; font-size:13pt;"
|
||||
>
|
||||
|
||||
<button type="button"
|
||||
class="btn btn-primary"
|
||||
onclick="copierTag()"
|
||||
title="Copier le tag NFC"
|
||||
style="font-size:13pt;">
|
||||
<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>
|
||||
</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>
|
||||
<?php endif; ?>
|
||||
<!-- FIN TAG -->
|
||||
|
||||
<FORM name= "formfichebeneficiaire" id ="formfichebeneficiaire" method="POST">
|
||||
<fieldset>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user