1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
| <table class="table table-bordered table-hover text-size-small table datatable-scroll-y" width="100%">
<thead>
<tr class="bg-blue">
<th>#</th>
<th>Article</th>
<th>Quantité</th>
<th>Description</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$n = 0;
$sql = "SELECT id_article, lib_article, description
FROM article
WHERE id_ecole = '$idecl'
ORDER BY lib_article";
$req = $DB->query($sql);
while ($d = $req->fetch())
{
$n = $n + 1;
$id = $d['id_article'];
$qte = NBentre($id, $DB)-NBsortie($id, $DB);
// Alerte quantité
if($qte >= 200)
{
$cls = "text-bold text-success text-center";
}
if($qte >= 100 && $d['qte_article'] < 200)
{
$cls = "text-bold text-warning text-center";
}
if($qte < 100)
{
$cls = "text-bold text-danger text-center";
}
?>
<tr>
<td><?php echo $n; ?></td>
<td><?php echo $d['lib_article']; ?></td>
<td class="<?php echo $cls; ?>"><?php echo $qte; ?></td>
<td><?php echo $d['description']; ?></td>
<td class="text-center">
<ul class="icons-list">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="icon-menu9"></i>
</a>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="ErgEntre.php?art=<?php echo $id; ?>&libart=<?php echo $d['lib_article']; ?>"><i class="icon-database-add"></i> Entrée article</a>
</li>
<?php
if($qte <> 0) {
?>
<li>
<a href="StockEntre.php?art=<?php echo $id; ?>&libart=<?php echo $d['lib_article']; ?>"><i
class="icon-database-export"></i> Sortie article</a>
</li>
<?php
}
?>
<li><a href="ModArticle.php?art=<?php echo $id; ?>&libart=<?php echo $d['lib_article']; ?>&dc=<?php echo $d['description']; ?>"><i class="icon-database-refresh"></i> Modifier</a>
</li>
<li><a href="SupArticle.php?art=<?php echo $id; ?>"><i class="icon-cancel-circle2" onclick="return confirm('Confirmer la suppression !')"></i> Supprimer</a>
</li>
</ul>
</li>
</ul>
</td>
</tr>
<?php
}
?>
</tbody>
</table> |
Partager