<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<link rel="stylesheet" type="text/css" href="style.css">
	</head>

	<body>
		<div>
		<br>
		<?php
			error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
			if (isset($_GET['id'])){
				$id = $_GET['id'];
				Include('../database.params.inc.php');
				$link = pg_connect("host=$machine user=$user password=$pwd dbname=$db")or die("Erreur de Connection !<br />".pg_last_error()) ;
				
				$query = "SELECT texte, nom, type FROM INFO, PRODUIT WHERE conso = $id AND conso = id_produit";
				$result = pg_query($link, $query) or die("Erreur SQL !<br />$query<br />".pg_last_error()) ;
				$num = pg_num_rows($result) - 1;
				echo "<div id='conso'>".pg_fetch_result($result, $num, "type")." : ";
				echo pg_fetch_result($result, $num, "nom")."</div><br>";
				echo "<div id='info'>".pg_fetch_result($result, $num, "texte")."</div>";
			} 
			else
				echo "<p id='titre'>Bienvenue</p>";
		?>
		</div>
	</body>

	<footer>
		<div id="pied">
			<p>Développé par Benjamin Lefort et Kévin Colautti IMA5</p>
		</div>
	</footer>
</html>