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
| <p id="info" name="info"></p>
<table class="tableF" id="tableau">
<thead>
<tr>
<th width=20%>Fournisseur</th>
<th width=10%>N° de commande</th>
<th width=15%>Date de création</th>
<th width=15%>Date de livraison</th>
<th width=80%>Commentaires</th>
<th width=100%>Code article</th>
<th width=100%>Désignation</th>
<th width=100%>Quantité</th>
<th width=17%>......</th>
</tr>
</thead>
<tbody>
<!-- CONSTRUCTION TABLEAU DES CMD -->
<?php
require('../simag/inc/connect.ini.php');
$query = $bdd->prepare('SELECT CMD_LIBELLE,CMD_NUM,CMD_CREATE,CMD_DELIVERY,CMD_COMMENTS,LIG_ART_CODE,LIG_ART_LIBELLE,SUM(LIG_ART_QTY) FROM CMD,CMD_LIGNE WHERE CMD_NUM=LIG_NUM_CMD GROUP BY LIG_ART_CODE ORDER BY CMD_CREATE');
$query->execute();
while ($data = $query->fetch()) {
?>
<tr onclick="fctClick(this)">
<td><?php echo $data['CMD_LIBELLE']; ?></td>
<td><?php echo $data['CMD_NUM']; ?></td>
<td><?php echo $data['CMD_CREATE']; ?></td>
<td><?php echo $data['CMD_DELIVERY']; ?></td>
<td><?php echo $data['CMD_COMMENTS']; ?></td>
<td><?php echo $data['LIG_ART_CODE']; ?></td>
<td><?php echo $data['LIG_ART_LIBELLE']; ?></td>
<td><?php echo $data['SUM(LIG_ART_QTY)']; ?></td>
<td><button class="btnR" onClick="bascule('boite');">+</button></td>
</tr>
<?php
}
?>
</tbody>
</table>
</body>
<script>
tableau.onclick = e => {
if (!e.target.matches('td')) return
let eTD = e.target,
eTR = eTD.parentNode;
info.textContent = ` ${eTD.textContent}`
}
</script> |
Partager