production/Vue/Ajaxfiltretabproduit/index.php
2025-12-01 16:12:12 +00:00

82 lines
3.5 KiB
PHP
Executable File

<?php
$superUser = $_SESSION['superUser'];
$nbreTotal = count($produits);
if($nbreTotal < 10){
$nbreTotal = '0'.$nbreTotal;
}else{
$nbreTotal = format_N($nbreTotal);
}
?>
<table style="margin: auto" class="table-responsive">
<tbody>
<td><input class="form-control" style="text-align: center; font-size:10pt;" type="text" id="nbreTotal" name="nbreTotal" value="Total enregistré : <?= $nbreTotal; ?>" readonly> </td>
</tbody>
</table>
<input type="hidden" id="total" value="<?= $nbreTotal; ?>">
<table class="table table-striped table-bordered table-hover table-condensed table-responsive tabliste compact" style="font-size:10pt;">
<thead>
<tr>
<th style="text-align:center" > <?= _("Code") ?> </th>
<th style="text-align:center" > <?= _("Produit") ?> </th>
<th style="text-align:center" > <?= _("Mode Calcul Prime") ?> </th>
<th style="text-align:center" > <?= _("Action") ?> </th>
<th style="text-align:center" > <?= _("Archivage") ?> </th>
<th style="text-align:center" > <?= _("Garanties") ?> </th>
</tr>
</thead>
<tbody>
<?php foreach ($produits as $produit):
$idProduit = $this->nettoyer($produit['id']);
$codeModecalculPrime = $this->nettoyer($produit['codeModecalculPrime']);
$libelleProduit = $this->nettoyer($produit['libelle']);
$modeprime = $this->nettoyer($produit['modeprime']);
if (est_anglophone()){
$libelleProduit = $this->nettoyer($produit['libelleEng']);
$modeprime = $this->nettoyer($produit['modeprimeEng']);
}
$produitArchive = $this->nettoyer($produit['produitArchive']);
$dansBareme = $this->nettoyer($produit['dansBareme']);
$aGarantie = $this->nettoyer($produit['aGarantie']);
?>
<?php if($codeModecalculPrime=='TA'): ?>
<tr valign="top" style="background-color: #ffefd5;">
<?php else: ?>
<tr valign="top">
<?php endif; ?>
<td align="center" width="10%"> <?= $this->nettoyer($produit['codeProduit']) ?> </td>
<td> <?= $libelleProduit ?> </td>
<td style='text-align:center' width="20%"> <?= $modeprime ?> </td>
<?php if($produitArchive =='1'): ?>
<td width="8%"> <input class = "form-control btn btn-info" style="font-size:10pt;" type="button" value="<?= _("Consulter") ?>" onClick="javascript:consulter_produit(<?= $idProduit ?>);"> </td>
<?php if ($superUser=="1"): ?>
<td width="8%"> <input style="font-size:10pt;" class = "form-control btn btn-danger" type="button" value="<?= _("Désarchiver") ?>" onClick="javascript:de_archiver_produit('<?= $idProduit ?>', '<?= $dansBareme ?>');"></td>
<?php else : ?>
<td width="8%"> </td>
<?php endif; ?>
<?php else: ?>
<td width="8%"> <input class = "form-control btn btn-primary" style="font-size:10pt;" type="button" value="<?= _("Modifier") ?>" onClick="javascript:modifier_produit(<?= $idProduit ?>);"> </td>
<?php if($aGarantie =='1'): ?>
<td width="8%"> <input style="font-size:10pt; color: white; background-color: orange;" class = "form-control btn" type="button" value="<?= _("Archiver") ?>" onClick="javascript:archiver_produit('<?= $idProduit ?>');"></td>
<?php else : ?>
<td width="8%"> </td>
<?php endif; ?>
<?php endif; ?>
<td width="8%" align="center"> <input class = "form-control btn btn-success" style="font-size:10pt;" type="button" value="<?= _("Garanties") ?>" onClick="javascript:garanties_produit(<?= $idProduit ?>);"> </td>
</tr>
<?php endforeach; ?>
</tbody>
</table>