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
| <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../assets/css/panier.css">
<title>Document</title>
</head>
<body>
<form method="post" action="">
<?php
try {
$bdd = new PDO('mysql:host=localhost;dbname='';charset=utf8', '', '');
} catch (Exception $e) {
die('Erreur : ' . $e->getMessage());
}
$query = $bdd->prepare('SELECT SUP_CODE,SUP_NAME FROM SUPPLIER ORDER BY SUP_NAME ASC');
$query->execute();
echo '<label for="pet-select">Fournisseur :</label> ';
echo '<select class="selecteur" name="sup-select" id="togg2" value="Sélectionner le fournisseur">';
echo '<option value="">Sélectionner votre fournisseur</option>';
while ($data = $query->fetch()) {
echo '<option value="' . $data['SUP_CODE'] . '","' . $data['SUP_NAME'] . '">' . $data['SUP_NAME'] . '-' . $data['SUP_CODE'] . '</option>';
}
?>
<input type="submit" class="btn" name="envoi" id="envoi" value="Afficher"><br><br>
<?php
if (isset($_POST['envoi']) and $_POST['envoi'] == 'Afficher') {
try {
$bdd = new PDO('mysql:host=localhost;dbname='';charset=utf8', '', '');
} catch (Exception $e) {
die('Erreur : ' . $e->getMessage());
}
$query = $bdd->prepare('SELECT SUP_CODE,SUP_NAME,SUP_ADDR1,SUP_ADDR2,SUP_ZIP,SUP_VILLE,SUP_PAYS FROM SUPPLIER
WHERE SUP_CODE="' . $_POST['sup-select'] . '" ');
$query->execute();
while ($data = $query->fetch()) {
?><br><br>
<div>
<label for="">Code four.</label>
<input type="text" class="input-div2" name="codesup" value="<?php echo $data['SUP_CODE']; ?>">
<label for="">Raison sociale</label>
<input type="text" class="input-div2" name="namesup" value="<?php echo $data['SUP_NAME']; ?>"><br><br>
<label for="">Adresse</label>
<input type="text" class="input-div2" value="<?php echo $data['SUP_ADDR1']; ?>">
<label for="">Complément</label>
<input type="text" class="input-div2" value="<?php echo $data['SUP_ADDR2']; ?>"><br>
<label for="">Code postal</label>
<input type="text" class="input-div2" value="<?php echo $data['SUP_ZIP']; ?>"><br>
<label for="">Ville</label>
<input type="text" class="input-div2" value="<?php echo $data['SUP_VILLE']; ?>"><br>
<label for="">Pays</label>
<input type="text" class="input-div2" value="<?php echo $data['SUP_PAYS']; ?>">
</div>
<?php }
}
?>
<br><br><br><br><br><br><br><br><br><br><br><br>
<fieldset>
<legend><b>Grille de taille</b></legend>
<input type="radio" name="taille[]" onclick="this.form.submit()" value="S-XXXL" />S-XXXL<br />
<input type="radio" name="taille[]" onclick="this.form.submit()" value="34-48" />34-48<br />
<input type="radio" name="taille[]" onclick="this.form.submit()" value="50-64" />50-64<br />
<input type="radio" name="taille[]" onclick="this.form.submit()" value="TU" />T.U.<br />
<input type="radio" name="taille[]" onclick="this.form.submit()" value="KG" />KG<br />
<input type="submit" class="btn" name="submit" id="submit" value="Affichage">
</fieldset><br>
<?php
if (isset($_POST['submit']) and $_POST['submit'] == 'Affichage') {
foreach ($_POST['taille'] as $val) {
//Do something
echo 'Grille : ' . $val . '<br/>';
try {
$bdd = new PDO('mysql:host=localhost;dbname='';charset=utf8', '', '');
} catch (Exception $e) {
die('Erreur : ' . $e->getMessage());
}
$query = $bdd->prepare('SELECT TAILLE_CODE FROM TAILLES WHERE TAILLE_LIBELLE="' . $val . '" ');
$query->execute();
echo '<select multiple="multiple" class="selecColor" name="size[]" id="size">';
while ($data = $query->fetch()) {
echo '<option value="' . $data['TAILLE_CODE'] . '">' . $data['TAILLE_CODE'] . '</option>';
}
}
}
?>
</form>
</body>
</html> |
Partager