Location: PHPKode > projects > EmploiNet : a timetable web manager > EmploiNet/v0.8.0/Liste/liste_promotionb.php
<?
	$result = mysql_query("SELECT id_promotion,diplome.libelle as L1,promotion.libelle as L2 FROM promotion,diplome WHERE promotion.id_diplome=diplome.id_diplome ORDER BY diplome.libelle");
	$index_max = mysql_num_rows($result); 
	if ($user_type==3 && $index_max == 1)
	{
		$a_record = mysql_fetch_array($result);
		print("          <input type=\"hidden\" name=\"id_promotion[0]\" value=".$a_record["id_promotion"].">\n");
  		print($a_record["L1"]." ".$a_record["L2"]);
  		print("\n");
	}
	else
	{
		print("          <select name=\"id_promotion\" size=5 OnChange=\"submit();\">\n");
		for ($i=0;$i<$index_max;$i++)
		{
		 $a_record = mysql_fetch_array($result);
		 if(isset($id_promotion))
		 {
		  if($a_record[0]==$id_promotion)
		  {		
       	           print("<option value=".$a_record["id_promotion"]." selected>");
	           print($a_record["L1"]." ".$a_record["L2"]);
	           print("</option>\n");
	          }
	          else
	          {
	           print("<option value=".$a_record["id_promotion"].">");
	           print($a_record["L1"]." ".$a_record["L2"]);
	           print("\n");
	          }
	         }
	         else
	         {
	          print("<option value=".$a_record["id_promotion"].">");
	          print($a_record["L1"]." ".$a_record["L2"]);
	          print("\n");
	         }
	        }
	       
		print("</select>\n");
	}
?>
Return current item: EmploiNet : a timetable web manager