<?php
			session_start();
			include("corps_html.php");
			include('database.php');
			DB_connexion(); 
			
			$bloc = $_GET['bloc'];
			$projet = $_GET['projet'];
			
			if(isset($_POST['sauvegarder']) && $_POST['sauvegarder'] == "Sauvegarder")
			{
				echo "on sauve ...";
				/*
				nom_bloc
				famille_projet
				nom_projet
				date_dispo_schema
				date_debut_layout
				duree_jours
				date_fin
				owner
				recommandations
				infos
				*/
			}	
	
?>	

<link rel="stylesheet" type="text/css" href="style.css">
<link href="http://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>

<body>

	<div class="layout">

<?php
	include("header.php");
?>	
		
<!-- Main -->
		<div class="main">
			<div class="container">
				<div class="row">
				
				<div class="col-md-12">
						<!-- Content -->
						<div class="content">
							<div class="page-header">
								<!--<h3>Interface du gestionnaire de projets</h3> -->
								<h2><i class="icon-bullhorn"></i> <span>Edition du bloc: <?php echo $bloc; ?></span></h2>
							</div>
								
							<!-- Single Page -->
							<div class="page">
								
							<div class="examples">
							
							<!------>
<?php
							$table = $projet ."_data";
							$sql = "SELECT * FROM $table WHERE nom_bloc = '$bloc' ";
							$retour = mysql_query($sql);   
  
							while($data=mysql_fetch_assoc($retour)) 
							{	
										$nom_bloc = $data["nom_bloc"];
										$owner = $data["owner"];
										$recommandations = $data["recommandations"];
										$infos = $data["infos"];
							}			
?>
							
							<form action="" method="post" id="edition_bloc" name="edition_bloc" >
							
							<table cellspacing="1" cellpadding="5" border="1" bgcolor="#D5D5D5" width="100%">
						
							<tr bgcolor="#FFFFFF">
							<td>Nom :</td>
							<td>
							<input type="text" id="nom_bloc" name="nom_bloc" size="30" maxlength="30" disabled value="<?php echo $nom_bloc; ?>" ></td>
							</tr>
							
							<tr bgcolor="#FFFFFF">
							<td>Projet :</td>
							<td>
							<select id="selection_projet" name="selection_projet" disabled size="1" >
<?php
							echo '<option value="'.$projet.'">'.$projet .'</option>'; 
							echo '</select>'; 
?>							
							</td>
							</tr>
							
							<tr bgcolor="#FFFFFF">
							<td>Schéma disponible :</td>
							<td>
							<input type="text" size="12" id="date_schema" name="date_schema" READONLY name="date_schema" value="" > 
							</td>
							</tr>
							
							<tr bgcolor="#FFFFFF">
							<td>Début Layout :</td>
							<td>
							<input type="text" size="12" id="date_debut" name="date_debut" READONLY name="date_debut" value="" > 
							</td>
							</tr>
							
							<tr bgcolor="#FFFFFF">
							<td>Durée prévue:</td>
							<td>
							<input type="text" size="12" id="duree_jours" name="duree_jours" value="" > en jours
							<input type="submit" name="calculer" value="Calculer" />
							</td>
							</tr>

							<tr bgcolor="#FFFFFF">
							<td>Estimation:</td>
							<td>
							<input type="text" size="12" id="date_fin" name="date_fin"  READONLY name="date_fin" value="" > 
							</td>
							</tr>

							<tr bgcolor="#FFFFFF">
							<td>Owner :</td>
							<td>
							<input type="text" id="owner" name="owner" size="30" maxlength="30" disabled value="<?php echo $owner; ?>" ></td>
							</tr>

							<tr bgcolor="#FFFFFF">
							<td>Recommandations :</td>
							<td>
							<textarea id="recommandations" name="recommandations" rows="12" cols="50" ><?php echo $recommandations; ?>
							</textarea></td>
							</tr>
							
							</table>
							
							<br><br><br>
							<input class="btn btn-primary" type="submit" value="Sauvegarder" name="sauvegarder" /> <!-- onclick="sauvegarder_bloc()" -->

							</form>
						
							<!------->
							
							</div>	
								
							<div class="clear"></div>
							<div class="clear"></div>
							</div>
							<!-- End Single Page -->
						</div>
						<!-- End Content -->
				</div>
					
				</div>
			</div>
		</div>
<!-- End Main -->
		
<?php
	include("footer.php");
?>		

	</div>

</body>
</html>
