newdesigngestionnaire/Vue/Ajaxtrancheage/affichertrancheage.php
2026-03-16 20:41:04 +00:00

93 lines
4.9 KiB
PHP
Executable File

<div class="card border-0 shadow-sm animate__animated animate__fadeIn">
<div class="table-responsive">
<table class="table table-hover align-middle mb-0" style="font-size: 9.5pt;">
<thead class="bg-light">
<tr class="bg-primary-ghost-light">
<th class="py-3 ps-3 text-center" width="7%"><i class="fas fa-hashtag text-muted"></i></th>
<th class="text-center" width="12%"><?= _("Code") ?></th>
<th class="text-center" width="30%"><?= _("Âge Minimum") ?></th>
<th class="text-center" width="30%">
<div class="d-flex align-items-center justify-content-center">
<span class="me-2"><?= _("Âge Maximum") ?></span>
<input type="text" id="ageMax" name="ageMax" value="0"
class="form-control form-control-sm text-center border-2 fw-bold"
style="width: 80px;" onkeyup="controle_numerique(this);">
</div>
</th>
<th class="text-center pe-3">
<div class="btn-group shadow-xs">
<button type="button" class="btn btn-primary btn-sm px-3" title="<?= _("Ajouter la tranche") ?>" onClick="ajouter_une_trancheage();">
<i class="fa fa-plus"></i>
</button>
<button type="button" class="btn btn-danger-light btn-sm" title="<?= _("Vider") ?>" onClick="vider_entete_trancheage();">
<i class="fa fa-times"></i>
</button>
</div>
</th>
</tr>
<?php if (isset($_SESSION['messageTrancheAge']) && trim($_SESSION['messageTrancheAge']) != ''): ?>
<tr>
<th colspan="5" class="p-0">
<div class="alert alert-info border-0 rounded-0 m-0 py-2 small text-center animate__animated animate__headShake">
<i class="fas fa-info-circle me-2"></i><?= $_SESSION['messageTrancheAge'] ?>
</div>
</th>
</tr>
<?php endif; ?>
<tr class="small text-muted text-uppercase">
<th class="py-2 text-center border-bottom"><?= _("N°") ?></th>
<th class="py-2 text-center border-bottom"><?= _("Code") ?></th>
<th class="py-2 text-center border-bottom"><?= _("Âge Min") ?></th>
<th class="py-2 text-center border-bottom"><?= _("Âge Max") ?></th>
<th class="py-2 text-center border-bottom pe-3"><?= _("Action") ?></th>
</tr>
</thead>
<tbody>
<?php
$i = 0;
foreach ($tranhesage as $tranheage):
$idTrancheage = $tranheage['idTrancheage'];
$maxAgeMax = $tranheage['maxAgeMax'];
$ageMax = $tranheage['ageMax'];
$i++;
?>
<tr>
<td class="text-center fw-bold text-muted"><?= $i; ?></td>
<td class="text-center fw-bold text-primary"><?= $this->nettoyer($tranheage['codeTrancheAge']) ?></td>
<td class="text-center"><?= $this->nettoyer($tranheage['ageMin']) ?> <?= _("ans") ?></td>
<td class="text-center"><?= $this->nettoyer($tranheage['ageMax']) ?> <?= _("ans") ?></td>
<td class="text-center pe-3">
<?php if($ageMax == $maxAgeMax): ?>
<button type="button" class="btn btn-danger-light btn-sm rounded-circle action-icon"
title="<?= _("Supprimer la dernière tranche") ?>"
onClick="supprimer_derniere_tranche_age('<?=$idTrancheage?>');">
<i class="fa fa-minus"></i>
</button>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
<?php $_SESSION['messageTrancheAge'] = ''; ?>
<style>
.bg-primary-ghost-light { background-color: rgba(33, 46, 83, 0.04) !important; }
.btn-danger-light {
color: #dc3545;
background-color: rgba(220, 53, 69, 0.1);
border: none;
transition: all 0.2s;
}
.btn-danger-light:hover {
background-color: rgba(220, 53, 69, 0.2);
transform: scale(1.1);
}
.action-icon { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
</style>