<?
$requete="select g.id_groupe,g.nom from groupe g,associer a where a.id_groupe =g.id_groupe and a.id_promotion=$id_promotion";
$result=mysql_query($requete);
$nb=mysql_num_rows($result);
if($nb>0)
{
print("<td valign=top width=100 nowrap><font size=3><i>Groupe :</i></font></td>\n");
print("<td valign=top width=250>\n");
print("<select tabindex=-1 name=\"id_groupe\" size=1 width=200 OnChange=\"submit();\">\n");
for($i=0;$i<$nb;$i++)
{
$groupe=mysql_fetch_array($result);
echo "<option value='$groupe[0]'>$groupe[1]\n";
}
echo "<option value=-1 selected>\n";
print("</select>\n");
}
else
{
print("<input type=\"hidden\" name=\"id_groupe\" value=\"-1\">\n");
print("<script language=\"JavaScript\">\n");
print("document.form2.submit();\n");
print("</script>\n");
}
?>