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
|
<form id="idaffichage" method="post" action="modifproduit.php">
<?php
$query_aff="select Reference, produit.NumDepart, produit.NumCategorie, Designation, LibelleDepart, LibelleCategorie, CoeffMarge, Prixunit, QuantiteStock
from produit ,departement , categorie
where produit.NumDepart = departement.NumDepart
and produit.NumCategorie=categorie.NumCategorie";
if(!empty($_POST['listedepart']) && $_POST['listedepart']!="c1")
{
$query_aff=$query_aff." and produit.Numdepart='".$_POST['listedepart']."'";
}
if(!empty($_POST['listecategorie']) && $_POST['listecategorie']!="c1")
{
$query_aff=$query_aff." and produit.NumCategorie='".$_POST['listecategorie']."'";
}
if(!empty($_POST['designation']))
{
$query_aff=$query_aff." and Designation like '%".$_POST['designation']."%'";
}
$query_aff=$query_aff." order by Designation";
$result_aff=mysql_query($query_aff) or die("La requète aff a échouée");
?>
<table>
<?php
if(mysql_num_rows($result_aff)==0)
{
?><span class="erreur"> ERREUR : Il n y a aucun produit correspondant à votre recherche !</span><?php
}
else
{
?>
<tr><th>Désignation</th><th>Libelle Département</th><th>Libelle Catégorie</th><th>CoeffMarge</th>
<th>Prix unitaire</th><th>Quantité en Stock</th><th>Choix</th></tr>
<?php
for($i=0; $i<mysql_num_rows($result_aff); $i++)
{
$line_aff=mysql_fetch_array($result_aff);
echo "<tr><td>".$line_aff["Designation"]."</td><td>".$line_aff["LibelleDepart"]."</td>
<td>".$line_aff["LibelleCategorie"]."</td><td>".$line_aff["CoeffMarge"]."</td><td>".$line_aff["Prixunit"]."</td>
<td >".$line_aff["QuantiteStock"]."</td>";
?>
<td>
<input type='radio' name='modifproduit' id='id_modif' value='<?php echo($line_aff["Reference"]) ?>'></td>
</tr>
<?php
}
}
?>
</table>
</form> |
Partager