<?php

	error_reporting(0);
	
	$user = "root";
	$password = "";
	$host = "localhost";
	$db = "test";

	$db_connection = mysql_connect($host, $user, $password);
	mysql_select_db($db, $db_connection); 
	
	if(!$db_connection)
	{
		die('Could not connect: ' . mysql_error());
	}
	
	
	$liste_dates = $_GET['listing'];
	
	$table_id = explode(" ", $liste_dates);

/*	$liste_projet = str_replace(" ", ",", $liste_projet);
	
	$identifiant = $_SESSION['identifiant'];
			
	$connexion = mysql_connect($db_host,$db_user,$db_pass); 
  	mysql_select_db($db_name, $connexion);
  	
  	$sql = "UPDATE administration SET 
		projets = '$liste_projet' WHERE identifiant='$user' ";
						
	$requete = mysql_query( $sql, $connexion ) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error()); 
	
	*/
	/*$max = sizeof($table_id);*/
	$nb = count($table_id);
	for($i = 0; $i < $nb; $i++) 
    {
		$id = $table_id[$i];
		$sql = "UPDATE  reservation_2015 SET statut='reserver' WHERE id='$id'";
		$result = mysql_query($sql) ;
	
					
	}
	/*$id = 1;
	$val = $table_id[0];
	$sql = "UPDATE  reservation_2015 SET prenom='$val' WHERE id='$id'";
	$result = mysql_query($sql) ;
	
	/*echo $requete;*/
	echo "<script>alert(\"Les modifications ont été prises en compte.\")</script>"; 
  	
  	
  	
	
	
	
?>




 