Récupérer variable dans un While

schumi212 Messages postés 10 Statut Membre -  
schumi212 Messages postés 10 Statut Membre -
Bonjour,

Je développe une application en php dédiée au service après ventes de ma boite.
Mais j'arrive sur une impasse.

J'affiche le résultat d'une requete SQL dans un While, ceci me forme alors une liste.
Ce que je voudrais c'est que lorsque je clique sur une ligne de ma liste, je souhaiterais récupérer en php la valeur de la variable sur laquelle j'ai cliqué.

Voici mon code :

<table width='900px' height='600px'>
<tr>
<td width="900px" valign="top">
	<table border="1px" cellpadding="0px" cellspacing="0px">
<tr>
<td width="100px">Num SAV
</td>
<td width="100px">Code Client
</td>
<td width="320px">Raison Sociale
</td>
<td width="100px">Date ouverture
</td>
<td width="100px">type Client
</td>
<td width="60px">						
Reception
</td>
<td width="60px">						
Réparé
</td>

</tr>
</table>

<div style="overflow:auto; height:600px;width:900px;">
<?php 

Include('connexion.php') ;


$reqdossier="select * from vue_choix_cond where dateRenvoi_dossier is null order by num_dossier desc";
				$dossierex = mysql_query($reqdossier) or die('Erreur SQL !<br>'.$reqdossier.'<br>'.mysql_error());
   
				while ($resdossier = mysql_fetch_row($dossierex)) 
				{
				$reception=$resdossier[4];
				$repare=$resdossier[5];
				
				$type=$resdossier[7];
				
		
if ($reception == 0){
$ckbchecked = '';
}else{
$ckbchecked = 'checked="yes"';

} 
if ($repare == 0){
$ckb2checked = '';
}else{
$ckb2checked = 'checked="yes"';

} 

				
if ($type == null){
$typeCli= 'pro';
}else{
$typeCli= 'par';
}			
?>				


<table border="1px" cellpadding="0px" cellspacing="0px">
<tr>
<td width="100px"><?php echo $resdossier[0];?>
</td>
<td width="100px"><?php echo $resdossier[1]; ?>
</td>
<td width="320px"><?php echo $resdossier[2]; ?>
</td>
<td width="100px"><?php echo date("d/m/Y", strtotime($resdossier[3])); ?>
</td>
<td width="100px"><?php echo $typeCli; ?>
</td>
<td width="60px">						
<INPUT type="checkbox" name="reception" disabled <?php echo $ckbchecked; ?>>
</td>
<td width="60px">						
<INPUT type="checkbox" name="repare" disabled <?php echo $ckb2checked; ?>>
</td>


</tr>

</table>	


Merci pour toutes les réponses qui pourront m'aider

2 réponses

Alain_42 Messages postés 5413 Statut Membre 894
 
<table width='900px' height='600px'>
<tr>
<td width="900px" valign="top">
	<table border="1px" cellpadding="0px" cellspacing="0px">
<tr>
<td width="100px">Num SAV
</td>
<td width="100px">Code Client
</td>
<td width="320px">Raison Sociale
</td>
<td width="100px">Date ouverture
</td>
<td width="100px">type Client
</td>
<td width="60px">	Reception
</td>
<td width="60px">	Réparé
</td>

</tr>
</table>

<div style="overflow:auto; height:600px;width:900px;">
<?php 

Include('connexion.php') ;


$reqdossier="SELECT * FROM vue_choix_cond WHERE dateRenvoi_dossier is null ORDER BY num_dossier desc";
				$dossierex = mysql_query($reqdossier) or die('Erreur SQL !<br>'.$reqdossier.'<br>'.mysql_error());
   
				while ($resdossier = mysql_fetch_row($dossierex)) 
				{
				$reception=$resdossier[4];
				$repare=$resdossier[5];
				
				$type=$resdossier[7];
				
		
if ($reception == 0){
$ckbchecked = '';
}else{
$ckbchecked = 'checked="yes"';

} 
if ($repare == 0){
$ckb2checked = '';
}else{
$ckb2checked = 'checked="yes"';

} 

				
if ($type == null){
$typeCli= 'pro';
}else{
$typeCli= 'par';
}			
?>				


<table border="1px" cellpadding="0px" cellspacing="0px">
<tr>
<td width="100px"><?php echo $resdossier[0];?>
</td>
<td width="100px"><?php echo $resdossier[1]; ?>
</td>
<td width="320px"><?php echo $resdossier[2]; ?>
</td>
<td width="100px"><?php echo date("d/m/Y", strtotime($resdossier[3])); ?>
</td>
<td width="100px"><?php echo $typeCli; ?>
</td>
<td width="60px">						
<input type="checkbox" name="reception" disabled <?php echo $ckbchecked; ?> />
</td>
<td width="60px">						
<input type="checkbox" name="repare" disabled <?php echo $ckb2checked; ?> />
</td>
<td>
<a href="script_appele.php?var1=<?php echo $resdossier[0];?>">Détail</a>
</td>

</tr>

</table>	


et tu recuperes dans script_appele.php
<?php
$var1=$_GET['var1'];

?>
1
schumi212 Messages postés 10 Statut Membre
 
Parfait ! Un très très grand merci à toi !
0