This commit is contained in:
KONE SOREL 2026-03-16 17:30:07 +00:00
parent b1978e06ad
commit 4982eaade1

View File

@ -1,17 +1,11 @@
<?php
$isEditable = ($produit['produitArchive'] == "0");
?>
<div class="row g-2">
<div class="col-lg-5">
<div class="card border-0 shadow-sm h-100">
<div class="card-header bg-light py-3 d-flex justify-content-between align-items-center">
<h6 class="mb-0 fw-bold text-primary text-uppercase"><i class="fas fa-list me-2"></i><?= _("Garanties Disponibles") ?></h6>
<?php if ($isEditable): ?>
<button class="btn btn-xs btn-outline-primary rounded-pill fw-bold" onclick="ajouter_tous_garantie_produit();">
<?= _("Tout ajouter") ?> <i class="fas fa-angle-double-right ms-1"></i>
</button>
<?php endif; ?>
<button class="btn btn-xs btn-outline-primary rounded-pill fw-bold" onclick="ajouter_tous_garantie_produit();">
<?= _("Tout ajouter") ?> <i class="fas fa-angle-double-right ms-1"></i>
</button>
</div>
<div class="card-body p-0">
<div class="table-responsive" style="max-height: 600px; overflow-y: auto;">
@ -19,20 +13,18 @@
<thead class="bg-white sticky-top">
<tr>
<th class="ps-3 py-2 border-bottom"><?= _("Libellé Garantie") ?></th>
<?php if ($isEditable): ?><th class="text-center border-bottom" width="15%"><?= _("Action") ?></th><?php endif; ?>
<th class="text-center border-bottom" width="15%"><?= _("Action") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($garanties_sans_seuils as $v): $code = $v['codeGarantie']; ?>
<tr>
<td class="ps-3"><?= $this->nettoyer($v['garantie']) ?></td>
<?php if ($isEditable): ?>
<td class="text-center">
<button class="btn btn-sm btn-primary-ghost rounded-circle action-btn" onclick="ajouter_un_garantie_produit('<?=$code?>');" title="<?= _("Ajouter") ?>">
<i class="fas fa-chevron-right"></i>
</button>
</td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
@ -45,21 +37,19 @@
<div class="col-lg-7">
<div class="card border-0 shadow-sm h-100 border-start border-primary border-4">
<div class="card-header bg-white py-3 d-flex justify-content-between align-items-center border-bottom border-2">
<?php if ($isEditable): ?>
<h6 class="mb-0 fw-bold text-danger text-uppercase"><i class="fas fa-check-circle me-2"></i><?= _("Garanties affectées au Produit Santé") ?></h6>
<button class="btn btn-xs btn-outline-danger rounded-pill fw-bold" onclick="retirer_tous_garantie_produit();">
<i class="fas fa-angle-double-left me-1"></i> <?= _("Tout retirer") ?>
</button>
<?php else: ?>
<h6 class="mb-0 fw-bold text-success text-uppercase"><i class="fas fa-check-circle me-2"></i><?= _("Garanties affectées au Produit Santé") ?></h6>
<?php endif; ?>
<h6 class="mb-0 fw-bold text-danger text-uppercase"><i class="fas fa-check-circle me-2"></i><?= _("Garanties affectées au Produit Santé") ?></h6>
<button class="btn btn-xs btn-outline-danger rounded-pill fw-bold" onclick="retirer_tous_garantie_produit();">
<i class="fas fa-angle-double-left me-1"></i> <?= _("Tout retirer") ?>
</button>
</div>
<div class="card-body p-0">
<div class="table-responsive" style="max-height: 600px; overflow-y: auto;">
<table class="table table-hover align-middle mb-0" style="font-size: 9pt;">
<thead class="bg-primary-ghost text-primary sticky-top">
<tr>
<?php if ($isEditable): ?><th class="ps-3 py-2 border-bottom" width="10%"><?= _("Retirer") ?></th><?php endif; ?>
<th class="ps-3 py-2 border-bottom" width="10%"><?= _("Retirer") ?></th>
<th class="py-2 border-bottom"><?= _("Libellé") ?></th>
<th class="text-center border-bottom" width="20%"><?= _("Seuil Taux (%)") ?></th>
<th class="text-center border-bottom" width="25%"><?= _("Seuil Valeur") ?></th>
@ -79,18 +69,16 @@
<td>
<div class="input-group input-group-sm">
<input class="form-control text-center border-2 fw-bold <?= $isEditable ? 'input-editable' : 'bg-light' ?>"
type="number" value="<?= $v['tauxSeuilAlerte'] ?>"
<?= $isEditable ? '' : 'disabled' ?>
<input class="form-control text-center border-2 fw-bold input-editable"
type="number" value="<?= $v['tauxSeuilAlerte'] ?>"
onchange="this.value=supprimer_espace_nombre(this.value); if(controle_numerique(this)){maj_taux_seuil_alerte_garantie('<?=$id?>', this.value);}">
<span class="input-group-text bg-white border-2 border-start-0">%</span>
</div>
</td>
<td class="pe-3">
<input class="form-control form-control-sm text-center border-2 fw-bold text-primary <?= $isEditable ? 'input-editable' : 'bg-light' ?>"
type="text" value="<?= format_N($v['seuilAlerte']) ?>"
<?= $isEditable ? '' : 'disabled' ?>
<input class="form-control form-control-sm text-center border-2 fw-bold text-primary input-editable"
type="text" value="<?= format_N($v['seuilAlerte']) ?>"
onfocus="formatNumerique(this);" onkeyup="controle_numerique(this);"
onblur="formatMonetaire(this); maj_seuil_alerte_garantie('<?=$id?>', supprimer_espace_string(this.value));">
</td>