<?php 
	include('connexion.php');
?>

<?php		
		if( isset ($_POST['filiere']) and isset ($_POST['annee']) and isset ($_POST['semestre']) and isset ($_POST['niveau']) 
			and isset ($_POST['academique'])){	
				
				$rep=$bdd->prepare('SELECT DISTINCT intituleEcu FROM ecu  WHERE niveauFormation=:niv AND code_unite IN (SELECT code_unite FROM unites 
				WHERE (idFiliere=:fil AND annee=:an AND semestre =:sem AND niveauFormation=:niv AND annee_acad=:acad))');
				
				$rep->execute(array (
					'fil'=>$_POST['filiere'],
					'an'=>$_POST['annee'],
					'sem'=>$_POST['semestre'],
					'niv'=>$_POST['niveau'],
					'acad'=>$_POST['academique']));
				
				 while($donnees=$rep->fetch())
				 {
					 $utf8_encode = stripslashes(utf8_encode($donnees["intituleEcu"]));
					 echo '<input type="checkbox" name="matiere[]" value="'.$utf8_encode.'" />'.$utf8_encode.'<hr/>';
				 }

		}
?>
