Location: PHPKode > projects > EmploiNet : a timetable web manager > EmploiNet/v0.8.0/Liste/liste_periode.php
<?
	if (isset($id_promotion))
	{
		$request = "SELECT id_periode,numero FROM periode WHERE id_promotion = $id_promotion[0]";
		$result = mysql_query($request);
	    $index_max = mysql_num_rows($result); 
		$found=false;
		if ($index_max > 1)
		{
			print("          <select tabindex=-1 name=\"id_periode\" size=1 width=200 OnChange=\"choice.value = -3; submit();\">\n");
			for ($i=0;$i<$index_max;$i++)
    		{
				$a_record = mysql_fetch_array($result);
				if ($id_periode == $a_record["id_periode"]) { 
					$found=true;
					print("          <option selected value=".$a_record["id_periode"]." >");
				}
				else print("          <option value=".$a_record["id_periode"].">");
				print($a_record["numero"]);
				print("</option>\n");
				if ($i == 0) $prem=$a_record["id_periode"];
			}
			if (!$found) { $id_periode=$prem;}
			
		}
		else
		{
			$a_record = mysql_fetch_array($result);
			print($a_record["numero"]."\n");
			$id_periode = $a_record["id_periode"];
            print("      <input type=\"hidden\" name=\"id_periode\" value=\"$id_periode\">\n");
		}
		print("          </select>\n");
	}

?>
Return current item: EmploiNet : a timetable web manager