<?php 
$bdd = new PDO('mysql:host=localhost;dbname=bibliotheque;charset=utf8','root','');
$req1 = $bdd->prepare('SELECT * FROM articles WHERE idArticle = ?');

$req1->execute(array($_GET['billet']));

?>

<!DOCTYPE html>
<html>
    <head>
        <title>A propos</title>
        <meta charset="utf-8" />
		<link rel="stylesheet" href="bibliotheque.css" />	
    </head>
    <body>

		<div class="fond" id="fond_article">
	
			<div class="barre_nav" id="barre_nav_article">
				<ul>
					<div>
						<li>
							<a href="page_accueil.php">Home</a>
						</li>
						<li>
							<a href="a_propos.php">A propos</a>
						</li>
						<li>
							<a href="fiches.php">Fiches</a>
						</li>
						<li>
							<a href="rechercher.php">Rechercher</a>
						</li>
						<li>
							<form method="post" action="barre_recherche.php" class="barre_recherche">
								<input type="text" name="requete" placeholder="votre recherche..." class="barre_recherche_texte" /><input type="submit" value="go" class="go" />
							</form>	
						</li>
					</div>
				</ul>
			</div>	
			
			<div class="sous_fond" id="sous_fond_article">
				<div class="arborescence">
					<a href="a_propos.php">
						A propos
					</a>
					>
					<a href="articles.php?cat=<?php foreach($req1->fetchAll() as $ligne){echo $ligne['idCategorie'];} ?>">
						<?php 
							$bdd = new PDO('mysql:host=localhost;dbname=bibliotheque;charset=utf8','root','');
							$req2 = $bdd->prepare('SELECT Categorie FROM articles join categorie using(idCategorie) WHERE idArticle = ?');
							$req2->execute(array($_GET['billet']));

							foreach($req2->fetchAll() as $ligne){echo $ligne['Categorie'];}
						?>
					</a>
					>					
					<span>
						<?php 
						$bdd = new PDO('mysql:host=localhost;dbname=bibliotheque;charset=utf8','root','');
						$req3 = $bdd->prepare('SELECT * FROM articles WHERE idArticle = ?');

						$req3->execute(array($_GET['billet']));
						foreach($req3->fetchAll() as $ligne){
							echo $ligne['Titre'];
						?>				
					</span>
				</div>					
			
				<h2 id="titre_article">
					<?php echo $ligne['Titre']; ?>
				</h2>
				
				<div class="article_image">
					<img src="<?php echo $ligne['image6']; ?>" />
				</div>

				<p class="texte">
					<?php echo nl2br($ligne['Contenu']); } ?>
				</p>
			
			</div>

			
    </body>
</html>
