<!DOCTYPE html>
<html lang="fr">
<head>
	<meta charset="utf-8"/>
	<title>Choix du Parcours</title>
	<link rel="stylesheet" type="text/css" href="styles/parcours.css" />

	<script src="codeJS/javaParcours.js" type="text/javascript"></script>
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
	<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=true"></script>
	<script src="//google-maps-utility-library-v3.googlecode.com/svn/trunk/geolocationmarker/src/geolocationmarker-compiled.js"></script>


</head>
<body>
	  <h1>Affichage des Parcours</h1>
	  <section id="mapSection"></section>
	  <section id="details">
		<?php
		// connexion a la base
		$db = mysql_connect('localhost', 'root', 'm148r43a9Y@%Z') or die('Erreur de connexion '.mysql_error());
		// selection de la base 
		mysql_select_db('smartpassTest2',$db) or die('Erreur de selection '.mysql_error()); 

		//Requete SQL
		$strSQL = mysql_query("SELECT * FROM Parcours");
		
		//Executer la requete
		$result = mysql_query($strSQL); 

		if(mysql_num_rows($strSQL) == 0){
		  echo '<p>Aucun champ!</p>';
		}

		else{
		  echo "<form>";
		  echo "<select onchange='showParcours(this.value)'>";
		  echo "<option value = ''> Selectionner un parcours </option>";
		    while($resultat = mysql_fetch_array($strSQL)){
			echo "<option value = ". $resultat["id"] .">" . $resultat["Titre"] . "</option>";
		    } //while
		  echo "</select>";
		  echo "</form>";
		}//else
		mysqli_close($db);
		?>

	  <div id = "infosParcours"><h2>Les infos du parcours</h2></div>

	  </section>


</body>
</html>