salut,

j ai un formulaire php/mysql ou je lance ma requete et le resultat je l affiche dans un tableau ( ca c ok ), pour chaque ligne de mon tableau j ai 2 checkbox

en fait je voudrais :

quand je coche une checkbox dans une ligne l autre de la meme ligne soit coché donc j ai fait une condition mais ca fonctionne pas quand je submitte

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
 
$sql1="SELECT distinct `volume` FROM `volumeflow` WHERE 1 ".$find;
/*echo" sql1 : ".$sql1;
echo"<br><br>";*/
/*------------PAGINATION ------------------*/
 
		$result1 = $db->sql_query($sql1);
		$numrows = $db->sql_numrows($result1);
		/*echo"numrows : ".$numrows;
		echo"<br><br>";*/
 
		$maxrow=40;
		/*echo"maxrow : ".$maxrow;
		echo"<br><br>";*/
 
		$maxpage=ceil($numrows/$maxrow);
		/*echo"maxpage : ".$maxpage;
		echo"<br><br>";*/
 
		$limitesuivante = $pgno + $maxrow;
		$limiteprecedente = $pgno - $maxrow;
/*---------------------------------------------------------------------**/
	if ($orderby=="")
	{
	$order="";
	}
	else
	{
	$order="ORDER BY $orderby";
	}
 
 
 
	echo"<form name='formvol' action='testvol.php?checkboxBG=$checkboxBG&amp;checkboxRO=$checkboxRO'>";
	echo"<input type='submit'>";
 
	$result1 = $db->sql_query($sql1 .$order. " LIMIT ". $pgno*$maxrow . "," . ($maxrow+1));
 
	//echo $sql1 .$order. " LIMIT ". $pgno*$maxrow . "," . ($maxrow+1);
 
	while($row1 = $db->sql_fetchrow($result1)) 
	{
 
 
 
			$volume= $row1['volume'];
			/*echo "volume : ".$volume;
			echo"<br>";
			echo"<br>";*/
 
 
				$sql2="select status,lv from volumeflow where volumeflow.lv='BG' and volume='".$volume."'";
 
				$result2 = $db->sql_query($sql2 .$order. " LIMIT ". $pgno*$maxrow . "," . ($maxrow+1));
 
				while($row2 = $db->sql_fetchrow($result2)) 
				{
 
				$statusBG= $row2['status'];
				/*echo "status : ".$status;
				echo"<br>";
				echo"<br>";*/
 
				$lvBG= $row2['lv'];
				/*echo "lv : ".$lv;
				echo"<br>";
				echo"<br>";*/
 
						$sql3="select status,lv from volumeflow where volumeflow.lv='RO' and volume='".$volume."'";
 
						$result3 = $db->sql_query($sql3 .$order. " LIMIT ". $pgno*$maxrow . "," . ($maxrow+1));
 
						while($row3 = $db->sql_fetchrow($result3)) 
						{
 
						$statusRO= $row3['status'];
						/*echo "status : ".$status;
						echo"<br>";
						echo"<br>";*/
 
						$lvRO= $row3['lv'];
						/*echo "lv : ".$lv;
						echo"<br>";
						echo"<br>";*/
 
echo <<< myBlock
 
 
 
		<tr class="$row_class" onMouseover="this.className='highlight_a';" onMouseout="this.className='$row_class';">
 
			<td align="center">$volume</td>  
			<td align="center">$statusBG</td>
			<td align="center"><input type="checkbox" name="checkboxBG" value=$volume.$lvBG ></td>
			<td align="center">$statusRO</td>
			<td align="center"><input type="checkbox" name="checkboxRO" value=$volume.$lvRO ></td>
 
		</tr>\n
 
 
myBlock;
 
				}}
 
		}//fin du while
 
		$checkboxBG=$_GET['checkboxBG'];
 
 
		$checkboxRO=$_GET['checkboxRO'];      
		echo"</form>";
 
 
			if (document.formvol.checkboxBG.checked)
			{
			$volumeBG=substr($checkboxBG,0,12);
 
				if (document.formvol.checkboxRO.value==$volumeBG.$lvRO)
				{
				(document.formvol.checkboxRO.checked);
				}
 
			}

car avec le $_GET je recupere ce qui a ete coché


merci