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 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
| <!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>Commandes clients</title>
<style>
td {
border: 1px solid grey;
width: 2em;
text-align: center;
cursor: pointer;
}
td:hover {
background-color: cadetblue;
}
</style>
</head>
<body>
<section>
<form action="" method="post">
<table class="tableF" id="tableau">
<thead>
<tr>
<th width=10%>Code article</th>
<th width=10%>Désignation</th>
<th width=10%>Quantité</th>
<th width=10%>N° commande</th>
<th width=10%>Date création</th>
<th width=10%>Date livraison</th>
<th width=60%>Commentaires</th>
<th width=100%>Libellé</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['LIG_ART_CODE']; ?></td>
<td><?php echo $data['LIG_ART_LIBELLE']; ?></td>
<td><?php echo $data['SUM(LIG_ART_QTY)']; ?></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['CMD_LIBELLE']; ?></td>
<td><button class="btnR" onClick="bascule('boite');">+</button></td>
</tr>
<?php
}
?>
</tbody>
</table>
<p style="display:none" id="info" name="info"></p>
<input type="text" name="artcode" id="artcode">
<script>
tableau.onclick = e => {
if (!e.target.matches('td')) return
let eTD = e.target,
eTR = eTD.parentNode;
var myvalue = info.textContent = ` ${eTD.textContent}`;
document.getElementById('artcode').setAttribute('value', myvalue);
}
</script>
<div name="boite" id="boite" style="visibility: hidden">
<table class="tableF" id="ligneCmd">
<thead>
<tr>
<th width=20%>N° de commande</th>
<th width=10%>Code article</th>
<th width=15%>Désignation</th>
<th width=15%>Coloris</th>
<th width=80%>UVC</th>
<th width=100%>Taille</th>
<th width=100%>Quantité</th>
<th width=17%>......</th>
</tr>
</thead>
<tbody>
<!-- CONSTRUCTION TABLEAU DES CMD -->
<?php
require('../simag/inc/connect.ini.php');
$query1 = $bdd->prepare('SELECT LIG_NUM_CMD,LIG_ART_CODE,LIG_ART_LIBELLE,LIG_ART_COLOR,LIG_UVC,LIG_ART_TAILLE,LIG_ART_QTY FROM CMD_LIGNE WHERE LIG_ART_CODE="' . $_POST['artcode'] . '" ORDER BY LIG_ART_COLOR');
$query1->execute();
var_dump($query1);
while ($data = $query1->fetch()) {
?>
<tr onclick="fctClick(this)">
<td><?php echo $data['LIG_NUM_CMD']; ?></td>
<td><?php echo $data['LIG_ART_CODE']; ?></td>
<td><?php echo $data['LIG_ART_LIBELLE']; ?></td>
<td><?php echo $data['LIG_ART_COLOR']; ?></td>
<td><?php echo $data['LIG_UVC']; ?></td>
<td><?php echo $data['LIG_ART_TAILLE']; ?></td>
<td><?php echo $data['LIG_ART_QTY']; ?></td>
<td><button class="btnR" name="envoi" onClick="bascule('boite');">+</button></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</form>
<?php
if (isset($_POST['envoi'])) {
echo $_POST['artcode'];
}
?>
</section>
</body>
<script src="../js/userlist.js"></script>
<script src="../js/artRecherche.js"></script>
</html> |
Partager