<?php

	session_start ();
	
	if (!isset($_SESSION['nom']) && !isset($_SESSION['password']))
	{  
			header("Location: login.php");   
	}

	header( 'content-type: text/html; charset=utf-8' );
	
?>

<html>
<head>
<script>
function script_selection(str)
 {
    if (str == "") {
        document.getElementById("txtHint").innerHTML = "";
        return;
    } else {
        if (window.XMLHttpRequest) {
            // code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp = new XMLHttpRequest();
        } else {
            // code for IE6, IE5
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange = function() {
            if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                document.getElementById("txtHint").innerHTML = xmlhttp.responseText;
            }
        }
        xmlhttp.open("GET","requete02.php?mois="+str,true);
        xmlhttp.send();
    }
}
</script>
</head>
<body>

<link rel="stylesheet" href="menu_style.css" type="text/css">

	<div id='cssmenu'>
	<ul>
		<li><a href='home.php'><span>Home</span></a></li>
		<li class="active"><a href='selection_mois.php'><span>Planning</span></a></li>
		<li><a href='selection_gestion_mois.php'><span>Gestion</span></a></li>
		<li><a href='selection_statistique_mois.php'><span>Statistiques</span></a></li>
<?php
		if($_SESSION['nom'] == "admin")
		{ 	
			echo '<li><a href="deplacer_un_rendezvous_admin.php"><span>Déplacer</span></a></li>';
			echo '<li><a href="configuration.php"><span>Configuration</span></a></li>';
		}
		else
		{
			echo '<li><a href="deplacer_un_rendezvous_user.php"><span>Déplacer</span></a></li>';
		}
?>
		<li><a href='change_password.php'><span>Changer password</span></a></li>
		<li><a href='logout.php'><span>Déconnexion</span></a></li>
		<li><a href='#'><span><?php echo $_SESSION['nom'] .' ' .$_SESSION['prenom'] .' connecté' ?></span></a></li>
	</ul>
	</div>
	<br>
	<br>

<form>
<select name="users" onchange="script_selection(this.value)">
	<option value="">Selection:</option>
	<option value="0">Janvier</option>
	<option value="1">Février</option>
	<option value="2">Mars</option>
	<option value="3">Avril</option>
	<option value="4">Mai</option>
	<option value="5">Juin</option>
	<option value="6">Juillet</option>
	<option value="7">Aôut</option>
	<option value="8">Septembre</option>
	<option value="9">Octobre</option>
	<option value="10">Novembre</option>
	<option value="11">Décembre</option>
  </select>
</form>
<br>
<div id="txtHint"><b>Faîtes votre choix...</b></div>

</body>
</html>