Problème pour récupérer une valeur saisie

Fermé
walter_man Messages postés 2 Date d'inscription jeudi 2 avril 2009 Statut Membre Dernière intervention 2 avril 2009 - 2 avril 2009 à 15:00
 Cisco - 2 avril 2009 à 15:56
Bonjour à tous,

J'ai une page ou s'affiche via un tableau une liste de produit appartenant à une famille. En face de chaque produit il y a un champ text ou est chargé (via le tableau) la quantité minimum de commande. L'utilisateur modifie la quantité dans le champs text et valide via un petit logo de cadie (voir piece jointe)

Une fois validé une fenetre s'ouvre avec le libellé, la qté et le prix(calcul). Pour le libellé et le prix aucun soucis mais impossible de recup la valeur saisie dans le champs text. Quelqu'un pourrais m'aider ?

<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&eacute;</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.'&euro;</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&amp;famille=$famille&amp;fournisseur=$fournisseur&amp;libellé=$libellé&amp;gencod=$gencod&amp;ref_frs=$ref_frs&amp;ABC=$ABC&amp;cmd_mini=$cmd_mini&amp;Prix_net=$Prix_net&amp;Prix_brut=$Prix_brut&amp;TTC=$TTC&amp;prec=2&amp;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&amp;l=<?php echo $LIBELLEPRODUIT;?>&amp;q=<?php echo $QUANTITEPRODUIT;?>&amp;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>

3 réponses

Salut,

Bon j'ai la cagne de lire ton code mais à mon avis, tu perd la valeur car tu ne la stocke pas dans un cookie.

A+
0
walter_man Messages postés 2 Date d'inscription jeudi 2 avril 2009 Statut Membre Dernière intervention 2 avril 2009
2 avril 2009 à 15:12
Et je fais comment pour la stoker ?
0
En utilisant un cookie
0