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
   |  
<html>
<table id="Table" border="1" bgcolor="" width="">
   <tr>
	<td width="">
<form method="post" id="mainForm">
<Div ID=saisies>
<select name="liste1" onchange="document.getElementById('mainForm').submit();">
<?php
while($aTab=mysql_fetch_array($reqSanteExe))
 {
 extract($aTab);
 $selected=(isset($_POST['liste1']) && $_POST['liste1'] ==    $lib_action)?'selected="selected"':'';
 echo '<option value="',$lib_action,'" ',$selected,'>',$lib_action,'</option>';
}
?>
</select>
<?php
 
if (isset ($_POST['liste1']) && !empty ($_POST['liste1']))
{
 
$test=mysql_num_rows($rq2_exe);
 
        if($test<=0)
        {
        echo"<textarea rows='2' name='tnom' cols='20'></textarea>";
        }
                else
                {
 
                $val=$_POST['liste1'];
                $rq2="select * from t_action_accompagnement,t_action_contrat  WHERE T_code_action=code_action and lib_action='".$val."' order by Code_action_accompagnement";
                $rq2_exe=mysql_query("$rq2") or die (mysql_error());
 
                echo '<select name="liste2">';
                while($RS2=mysql_fetch_array($rq2_exe))
                {
                         extract($RS2);
                        echo"<option value='$Lib_action_accompagnement'>$Lib_action_accompagnement";
                        }
                echo '</select>';               
                }
}
 
?>
</div>
<input type=button value="Ajouter une ligne" OnClick=Ajouter()>
</form>
</td>
</tr>
</table>
</html>
 
</script> | 
Partager