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
| <!--*********************** Titre tableau produit *****************************-->
<table width="508" border="0" cellspacing="0" cellpadding="0" align="center" style="margin-top: 20px; margin-bottom: 20px; padding: 0px 0px 0px 0px;">
<tr style="background-image: url(images/produitsBg.gif); height: 23px;">
<td width="250" class="titreP" style="padding-left: 20px;">Libellé</td>
<td width="75" class="titreP">Code article</td>
<td width="76" align="center" class="titreP">Prix</td>
<td width="85" align="center" class="titreP">Fournisseur</td>
<td width="85" align="center" class="titreP">Détails</td>
<td width="85" align="center" class="titreP">Quantité</td>
<td width="85" align="center" class="titreP">Ajouter</td>
</tr>
<!--*********************** Recherche de la famille sélectionnée *****************************-->
<?php
$debut=0;
$page = isset($_GET['page']) ? $_GET['page'] : '';
$req_produit = "SELECT code_art, libellé FROM produit where famille='$famille' order by libellé";
$aff_produit = mysql_query($req_produit);
// Variable nombre d'enreg par page
$limit=20;
if($debut=="")
{
$debut=0;
}
$debut=$page*$limit;
// Compte le nombre de champ
$nb_total = mysql_num_rows($aff_produit);
// Requete
$limite = mysql_query("$req_produit limit $debut,$limit");
//Affiche le contenu de la table avec la limite
$limit_str = "LIMIT ". $page * $limit .",$limit";
if (mysql_fetch_array($aff_produit) == 0)
{
echo 'Aucun produit n\'est répertorié dans cette famille';
}
else
{
$req_produit2 = mysql_query("SELECT * FROM produit where famille='$famille' order by libellé ASC $limit_str");
while ($res_req_produit = mysql_fetch_array($req_produit2))
{
?>
<tr style="background-image: url(images/elementsBg.gif); height: 35px;">
<form action="panier.php" method="POST">
<?php
//--*********************** Remplissage du tableau par les produits *****************************
$req_remise = mysql_query("SELECT * FROM `connection` where login='$login'");
$req_aff_remise = mysql_fetch_array($req_remise);
$prix_net = $res_req_produit["Prix_net"];
$prix_remise = $res_req_produit["Prix_net"] * ((100 - $req_aff_remise["remise"]) / 100);
$prix_remise = round($prix_remise,2);
$code_art = $res_req_produit["code_art"];
echo '<td width="1500" class="descriptionP" style="padding-left: 5px;">'.$res_req_produit["libellé"];echo '</a></td>';
echo '<td class="descriptionP" style="padding-left: 0px;">'.$res_req_produit["code_art"];echo '</td>';
echo '<td class="prixP" style="padding-left: 10px;">' .$prix_remise.'€</td>';
echo '<td class="descriptionP" style="padding-left: 20px;">'.$res_req_produit["fournisseur"];echo '</td>';
echo '<td class="descriptionP" style="padding-left: 10px;">';
echo "<a href=bois1.php?code_prod=$code_art&famille=$famille&fournisseur=$fournisseur&libellé=$libellé&gencod=$gencod&ref_frs=$ref_frs&ABC=$ABC&cmd_mini=$cmd_mini&Prix_net=$Prix_net&Prix_brut=$Prix_brut&TTC=$TTC&prec=2&page=$page> Détails </a>";
echo '</td>';
echo '<td class="descriptionP" style="padding-left: 15px;">';
echo '<input type="text" name="quantite" value="'.$res_req_produit["cmd_mini"]; echo ' " size=1>';
echo '</td>';
//--*********************** Recup des variables *****************************
$gencod = $res_req_produit["gencod"];
$ref_frs = $res_req_produit["ref_frs"];
$ABC = $res_req_produit["ABC"];
$cmd_mini = $res_req_produit["cmd_mini"];
$TTC = $res_req_produit["TTC"];
$fournisseur = $res_req_produit["fournisseur"];
$Prix_net = $res_req_produit["Prix_net"];
$Prix_brut = round($prix_remise,2);
$LIBELLEPRODUIT = $res_req_produit["libellé"];
$PRIXPRODUIT = round($prix_remise,2);
$QUANTITEPRODUIT= $_POST['quantite'];
?>
<?
?>
<td align="center"><img href="panier.php?action=ajout&l=<?php echo $LIBELLEPRODUIT;?>&q=<?php echo $QUANTITEPRODUIT;?>&p=<?php echo $PRIXPRODUIT;?>" onclick="window.open(this.href, '', 'toolbar=no, location=no, directories=no, status=yes, scrollbars=yes, resizable=yes, copyhistory=no, width=600, height=350'); return false;" src="images/addpanier.gif" alt="panier" width="35" height="20" border="0" /></td>
</tr>
</form>
<?php
}
}
?>
</table> |
Partager