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
| <td>
<select type="text" class="form-control scope article_ref" style="width: 100%;" onchange="ref_to_rearticle(this.value)">
<option></option>
<?php $list = $bdd->query('SELECT * FROM produit WHERE produit_contact = "'.$_SESSION['Contact_id'].'" ORDER BY `produit_ref` ASC');
while ($data = $list->fetch()) { ?>
<option value="<?php echo $data['produit_ref']; ?>"><?php echo $data['produit_ref']; ?></option>
<?php } $list->closeCursor(); ?>
</select>
</td>
<td>
<div id="article_refarticle">
<?php
$article_ref = $_POST['article_ref'] ?? 'null';
$requete = $bdd->prepare('
SELECT * FROM produit
WHERE produit_ref = :ref
');
$stmt->bindValue(':ref', strtoupper($article_ref), PDO::PARAM_STR);
$stmt->execute();
while ($donnees = $stmt->fetch(PDO::FETCH_ASSOC)) {
echo "<input type=\"text\" value=\"{$donnees['produit_nom']}\" />";
}
?>
</div>
</td> |
Partager