Bonjour,

cela fait plusieurs jours que je galère pour afficher une liste de champ propriete d'un adherent du club que je choisi par une liste deroulante.

Nom : Snap 2023-04-02 at 10.21.53.jpg
Affichages : 208
Taille : 67,5 Ko

j'ai trouvé un code tres similaire à ce que je voulais faire mais je n'arrive pas à l'adapter completement à mon probleme car les champs proprieté de mon adherent ne s'affichent pas (voir image ci-dessus.
je vous joins le code
Formulaire principale "gestion.php"
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?php
    include("commun/entete.php");
	//calcul de la saison
	$mois=date('m');
 
	if ($mois<8) 
	{ 
    $fin=date("y");
    $debut=date("Y")-1;
  	}
  	else 
	{
    $debut=date("Y");
    $fin=date("y")+1;
  	}
	$dateS=''.$debut.'/'.$fin.'';
?>
	<div class="div_conteneur_page" style= "width:50% ;height:820px">
 
			<div id="GTitre" style="width:100%;">
				<h1 style="font-size:24px">Informations du compte :    Saison <?php echo  $dateS ; ?></h1>
			</div>
			<br>
			<form id="formulaire" name="formulaire" method="post" action="recup_adherent.php">
				<table style="width: 90%; margin-left:40px;font-size:12px" >
					<td>  
                                               <select id="num_adh" name="num_adh" style="width:90%; font-size:14px" onchange="document.getElementById('param').value ='recup_adh';recolter();">
							<option value="0">Tout adhérent</option>
							<?php
							$requete = "SELECT * FROM inscr ORDER BY inscr_nomprenom ;";
							$retours = mysqli_query($liaison, $requete) or die ("problème avec la requète ".$requete);
							while($retour = mysqli_fetch_array($retours))
							{
								echo "<option value='".$retour["inscr_num"]."' > ".$retour["inscr_nomprenom"]." </option>";
							}
							?>	
 
						</select>
					<td>
                                                <select id="num_adh" name="num_adh" style="width:90%; font-size:14px" onchange="document.getElementById('param').value ='recup_adh';recolter();">           
							<option value="0">JUDO de la saison</option>
							<?php
							$requete = 'SELECT inscr_num,inscr_nomprenom, histo_saison,inscr_section FROM inscr inner join historique ON inscr.inscr_num = historique.histo_inscr  
								WHERE histo_saison = "'.$dateS.'" and  inscr_section = 1 ORDER BY inscr_nomprenom ;';
							$retours = mysqli_query($liaison, $requete) or die ("problème avec la requète ".$requete);
							while($retour = mysqli_fetch_array($retours))
							{
								echo "<option value='".$retour["inscr_num"]."' > ".$retour["inscr_nomprenom"]." </option>";
							}
							?>
						</select>
					</td>
					<td>   
                                                 <select id="num_adh" name="num_adh" style="width:90%; font-size:14px" onchange="document.getElementById('param').value ='recup_adh';recolter();">           
							<option value="0">AIKIDO de la saison</option>
							<?php
							$requete = 'SELECT inscr_num,inscr_nomprenom, histo_saison,inscr_section FROM inscr inner join historique ON inscr.inscr_num = historique.histo_inscr  
							WHERE histo_saison = "'.$dateS.'" and  (inscr_section = 3) ORDER BY inscr_nomprenom ;';
							$retours = mysqli_query($liaison, $requete) or die ("problème avec la requète ".$requete);
							while($retour = mysqli_fetch_array($retours))
							{
								echo "<option value='".$retour["inscr_num"]."' > ".$retour["inscr_nomprenom"]." </option>";
							}
							?>
						</select>
					</td>
				</table>
 
				<br><br>
				<table style="width: 80%; margin-left:40px;font-size:12px" >
 
					<tr>
						<td style="height: 4px; width: 40%;"><strong>Nom prénom</strong></td>
						<td style="height: 4px;width:50%">
							<input type="text" id="nomprenom" name="nomprenom"  style="width:110%; height:25px" readonly>
						</td>
					</tr>
					<tr>
						<td style="height: 4px; width: 40%;"><strong>Section</strong></td>
						<td style="height: 4px;width:50%">
							<input type="text" id="section" name="section" style="width:110%; height:25px" readonly>
						</td>
					</tr>
					<tr>
						<td style="height: 4px; width: 40%;"><strong>Adresse</strong></td>
						<td style="height: 4px;width:50%">
							<input type="text" id="adresse" name="adresse" style="width:110%; height:25px" readonly>
						</td>
					</tr>
					<tr>
						<td style="height: 4px; width: 40%;"><strong>Code postal</strong></td>
						<td style="height: 4px">
							<input type="text" name="codepostal" id="codepostal" style="width:110%; height:25px" readonly>
						</td>
					</tr>
					<tr>
						<td style="height: 4px; width: 40%;"><strong>Ville<strong></td>
						<td style="height: 4px">
							<input type="text" name="ville" id="ville"  style="width:110%;height: 25px" readonly>
						</td>
					</tr>
					<tr>
						<td style="height: 4px; width: 40%;"><strong>Date de naissance</strong></td>
						<td style="height: 4px">
							<input type="date" name="date_n" id="date_n" style="width:110%; height:25px" readonly>
							<?php
							//calcul de l'age
							//$age = date('Y') - date('Y',strtotime($la_naissance));
							?>
						</td>
					</tr>
					<tr>
						<td style=" height: 4px; width: 40%;"><strong>Votre Email</strong></td>
						<td style="height: 4px">
							<input type="text" name="mail" id="mail" style="width:110%;height: 25px" readonly>
						</td>
					</tr>
					<tr>
						<td style="height: 4px; width: 40%;"><strong>Votre Téléphone (Ex: 0123456789)</strong></td>
						<td style="height: 4px">
							<input type="text" name="tel_adh" id="tel_adh" size="14" maxlength="14" style="width:110%;height: 25px" readonly>
 
						</td>
					</tr>
					<tr>
						<td style="height: 4px; width: 40%;"><strong>Sexe (Garçon / Fille)</strong></td>	
						<td style="height: 4px">
							<input type="text" name="sexe" id="sexe"  size="14" maxlength="14" style="width:110%;height: 25px" readonly>	
						</td>							
					</tr>
					<tr>
						<td style="height: 4px; width: 40%;"><strong>Passeport JUDO déja délivré ?</strong></td>
						<td style="height: 4px">
							<input type="text" name="passeport" id="passeport" size="14" maxlength="14" style="width:110%;height: 25px" readonly>
 
						</td>
					</tr>
					<tr>
						<td style="height: 4px; width: 40%;"></td>
						<td style="height: 4px">
							<input type="text" id="param" name="param" style="width:110%; height: 25px; ">
						</td>
					</tr>
				</table>
			</form>
la fonction javascript appeler est "function recolter()"

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
<script type="text/javascript" language="javascript">
 
function recolter()
{
	document.getElementById("formulaire").request
	({
		onComplete:function(transport)
		{
			switch(document.getElementById('param').value)
			{
				case 'recup_adh':
					var tab_info = transport.responseText.split('|'); 
 
					document.getElementById('numero').value = tab_info[0];      
					document.getElementById('section').value = tab_info[1];
					document.getElementById('adresse').value = tab_info[2];     
					document.getElementById('codepostal').value = tab_info[3];
					document.getElementById('ville').value = tab_info[4];
					document.getElementById('date_n').value = tab_info[5];
					document.getElementById('mail').value = tab_info[6];     
					document.getElementById('tel_adh').value = tab_info[7];
					document.getElementById('sexe').value = tab_info[8];
					document.getElementById('passeport').value = tab_info[9];
					document.getElementById('num_adh').value = tab_info[0];
				break;
			}
		}
	})
}
</script>
et le sous programme php est "recup_adherent.php"

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
 
$liaison2 = mysqli_connect('localhost', 'root', '');
mysqli_select_db($liaison2, 'judoclub');
 
if(isset($_POST["param"]))
{
	switch($_POST["param"])
	{
		case "recup_adh":
			$requete = "SELECT * from inscr WHERE inscr_num = ".$_POST["num_adh"].";"; 
			$retours = mysqli_query($liaison2, $requete) or die ("problème avec la requète ".$requete);
			$retour = mysqli_fetch_array($retours);
			$chaine=$retour["inscr_num"]."|".$retour["inscr_nomprenom"]."|".$retour["inscr_adresse"]."|".$retour["inscr_codepostal"]."|"
			.$retour["inscr_ville"]."|".$retour["inscr_date"]."|".$retour["inscr_mail"]."|".$retour["inscr_tel_adh"]."|".$retour["inscr_sexe"]."|".$retour["inscr_passeport"];
			print($chaine); 
		break;
 
    }
}
mysqli_close($liaison2);
?>
je ne vois pas non plus comment recuperer le champ "inscr_num" de l'adherent choisi dans la liste déroulante.

Si quelqu'un pouvait m'aider ce serais super. Merci d'avance