<!DOCTYPE html>
<html>
    <head>
        <title>page d'accueil</title>
        <meta charset="utf-8" />
		<link rel="stylesheet" href="bibliotheque.css" />	
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
		<script type="text/javascript" src="js/nav_fixe.js"></script>
		<script type="text/javascript" src="js/descendre.js"></script>
    </head>
    <body>
	
    <div id="fond_entete">
	
		<div class="administration">
			<a href="connexion.php">
				<img src="images/connection.png" />
			</a>
		</div>	
	
		<div id="entete">	
			<ul>
				<li>
					<a href="page_accueil.php">Home</a>
				</li>	 
				<li>
					<a href="a_propos.php">A propos</a>
				</li>	 
				<li id="titre1">Essential</li>
				<li>
					<a href="fiches.php">Fiches</a>
				</li>	 
				<li>
					<a href="rechercher.php">Rechercher</a>
				</li>			 
			</ul>	
		</div>
	
		<div id="titre">	
			<h1 class="titre2">
				Huiles	
			</h1>
			<h1 class="titre2" id="titre2">			
				Essentielles
			</h1>	
			<h2 id="sous_titre">Bibliothèque des</h2>	
			<div id="icone">
				<a class="icone" href="#fond_home">
					<img src="images/icone.png" alt="icone" />
				</a>
			</div>
		</div>
		
	</div>

	
	<div class="fond" id="fond_home">
	
		<div class="barre_nav" id="barre_nav_accueil">
			<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="bloc">
					<?php 
					$bdd = new PDO('mysql:host=localhost;dbname=bibliotheque;charset=utf8','root','');
					$req = $bdd->query('SELECT * FROM articles join categorie using(idCategorie) WHERE idArticle = 2');
						foreach($req->fetchAll() as $ligne){ 
					?>
						<div class="home_infos" style="background : url('<?php echo $ligne['Image4'];?>');">
							<div class="cacher" style="background : url('<?php echo $ligne['Image5'];?>');">
								<h2><?php echo $ligne['Titre']; ?> </h2>
								<p>
									<?php echo nl2br($ligne['Resume']); ?>
									<br />
									<a href="article.php?billet=<?php echo $ligne['idArticle']; ?>">voir</a>
								</p>
							</div>
						</div>
					<?php
						}
					?>
					<?php 
					$bdd = new PDO('mysql:host=localhost;dbname=bibliotheque;charset=utf8','root','');
					$req = $bdd->query('SELECT * FROM articles join categorie using(idCategorie) WHERE idArticle = 3');
						foreach($req->fetchAll() as $ligne){ 
					?>
						<div class="home_infos" style="background : url('<?php echo $ligne['Image4'];?>');">
							<div class="cacher" style="background : url('<?php echo $ligne['Image5'];?>');">
								<h2><?php echo $ligne['Titre']; ?> </h2>
								<p>
									<?php echo nl2br($ligne['Resume']); ?>
									<br />
									<a href="article.php?billet=<?php echo $ligne['idArticle']; ?>">voir</a>
								</p>
							</div>
						</div>
					<?php
						}
					?>
					<?php 
					$bdd = new PDO('mysql:host=localhost;dbname=bibliotheque;charset=utf8','root','');
					$req = $bdd->query('SELECT * FROM articles join categorie using(idCategorie) WHERE idArticle = 4');
						foreach($req->fetchAll() as $ligne){ 
					?>
						<div class="home_infos" style="background : url('<?php echo $ligne['Image4'];?>');">
							<div class="cacher" style="background : url('<?php echo $ligne['Image5'];?>');">
								<h2><?php echo $ligne['Titre']; ?> </h2>
								<p>
									<?php echo nl2br($ligne['Resume']); ?>
									<br />
									<a href="article.php?billet=<?php echo $ligne['idArticle']; ?>">voir</a>
								</p>
							</div>
						</div>
					<?php
						}
					?>			
		</div>
		
		<div id="copyright">copyright - Maude Picot</div>
	</div>	
	
	
    </body>
</html>