rhsaas/Vue/Ajaxfactureconspop/verres.php
2026-01-21 02:57:26 +00:00

74 lines
3.8 KiB
PHP

<div id="div_facture_detail" class="mt-3">
<?php
$actVisible = "0"; // Force à 0 selon votre code, ou utiliser $_SESSION['actVisible']
?>
<div class="d-flex align-items-center bg-info text-white p-2 rounded-top shadow-sm" style="background: linear-gradient(45deg, #0dcaf0, #0aa2c0);">
<i class="fa-solid fa-glasses me-2 ms-1"></i>
<span class="fw-bold text-uppercase small"><?= _("Équipements Optiques / Verres") ?></span>
</div>
<div class="table-responsive shadow-sm border rounded-bottom bg-white">
<table class="table table-hover align-middle mb-0" style="font-size: 0.85rem;">
<thead class="table-light">
<tr class="text-uppercase small text-muted">
<th width="20%" class="ps-3 text-center"><?= _("Date de livraison") ?></th>
<th><?= _("Description des verres") ?></th>
<th width="15%" class="text-end pe-3"><?= _("Valeur (Tarif)") ?></th>
</tr>
</thead>
<tbody>
<?php if (empty($verres)): ?>
<tr>
<td colspan="3" class="text-center py-4 text-muted small italic">
<i class="fa-solid fa-circle-info me-2"></i><?= _("Aucun verre enregistré sur cette facture.") ?>
</td>
</tr>
<?php else: ?>
<?php foreach ($verres as $verre):
$libelleVerre = $this->nettoyer($verre['libelleVerre']);
$codeOptique = $this->nettoyer($verre['codeOptique']);
// Gestion de la confidentialité (Masquage du libellé si actVisible != 1)
if($actVisible != "1") {
$displayTitle = $codeOptique;
$subTitle = "";
} else {
$displayTitle = $libelleVerre;
$subTitle = '<div class="extra-small text-muted italic">Code: '.$codeOptique.'</div>';
}
?>
<tr>
<td class="ps-3 text-center">
<div class="small fw-bold"><?= dateLang($this->nettoyer($verre['dateSysteme']), $_SESSION['lang']) ?></div>
<div class="extra-small text-muted"><?= date('H:i', strtotime($verre['dateSysteme'])) ?></div>
</td>
<td>
<div class="d-flex align-items-center">
<div class="bg-info bg-opacity-10 p-2 rounded me-3">
<i class="fa-solid fa-eye text-info"></i>
</div>
<div>
<span class="fw-bold d-block"><?= $displayTitle ?></span>
<?= $subTitle ?>
</div>
</div>
</td>
<td class="text-end pe-3 text-monospace fw-bold text-primary">
<?= format_N($this->nettoyer($verre['valeurActe'])) ?>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
<style>
.extra-small { font-size: 0.7rem; }
.text-monospace { font-family: 'Courier New', Courier, monospace; }
.italic { font-style: italic; }
/* Animation légère au survol */
.table-hover tbody tr:hover { background-color: rgba(13, 202, 240, 0.05) !important; transition: 0.2s; }
</style>