    	<?php 
			$id_etablissement = $_SESSION['id_etablissement'];
			
			if (!empty($_POST['thermo'])) {
				$sqlUpdateThermo = "UPDATE parametre SET thermo = '".$_POST['thermo']."' WHERE id_etablissement = '" . $id_etablissement . "'";
				$req = cleanPDOQuery($sqlUpdateThermo);
			}
			
			if (!empty($_POST['barre'])) {
				$sqlUpdateTaille = "UPDATE parametre SET taille = '".$_POST['barre']."' WHERE id_etablissement = '" . $id_etablissement . "'";
				$req = cleanPDOQuery($sqlUpdateTaille);
			}
			
			$sql = "SELECT * FROM parametre WHERE id_etablissement = '" . $id_etablissement . "'";
			$req = cleanPDOQuery($sql);
			$res = $req->fetch();
			
			

		?>
		
		<div id = "etablissement">
        	<div id = "logo">
                	<img src="image/design/logo.png" />
             </div>
            <div class = "libelle">
            		<h1>ETABLISSEMENT</h1>
            </div>
            <div id = "infos">
                	<h1>?</h1>
            </div>
             
        </div>
        
		<h2 id = "liste_grilles">PARAMETRES</h2> 
            
            
        <section>    
            <form id = "blocparamadmin" name = "form" method = "POST" action = "admin.php">
				<br /><h2>Thermomètre</h2><br />
				<label for="label1"><input type = "radio" name = "thermo" <?php if ($res['thermo'] == 1) {?> checked="checked" <?php  }?> value="1" id="label1"><img class="imgradio" src="image/design/thermo/thermo1.jpg" alt="thermo1" /></label><br />
				<label for="label2"><input type = "radio" name = "thermo" <?php if ($res['thermo'] == 2) {?> checked="checked" <?php  }?> value="2" id="label2"><img class="imgradio" src="image/design/thermo/thermo2.jpg" alt="thermo2" /></label><br />
				<label for="label3"><input type = "radio" name = "thermo" <?php if ($res['thermo'] == 3) {?> checked="checked" <?php  }?> value="3" id="label3"><img class="imgradio" src="image/design/thermo/thermo3.jpg" alt="thermo2" /></label><br />
				<label for="label4"><input type = "radio" name = "thermo" <?php if ($res['thermo'] == 4) {?> checked="checked" <?php  }?> value="4" id="label4"><img class="imgradio" src="image/design/thermo/thermo4.jpg" alt="thermo2" /></label><br /><br />
				<h2>Dimensions</h2><br />
				<label for="label5"><input type = "radio" name = "barre" <?php if ($res['taille'] == 1) {?> checked="checked" <?php  }?> value="1" id="label5">Petit</label><br />
				<label for="label6"><input type = "radio" name = "barre" <?php if ($res['taille'] == 2) {?> checked="checked" <?php  }?> value="2" id="label6">Moyen</label><br />
				<label for="label7"><input type = "radio" name = "barre" <?php if ($res['taille'] == 3) {?> checked="checked" <?php  }?> value="3" id="label7">Grand</label><br />
				<input id="submitbutton" type = "submit" value = "ENREGISTRER">
					
			</form>

	</section>