<?php
require_once('lib/entete.php');
require_once('lib/connexion.php');

$page = 'categorie';

if(isset($_GET['categorie']) && !empty($_GET['categorie'])) { $SEO_url = $_GET['categorie']; } else { $SEO_url = 'NULL'; }
$req_categorie = "SELECT * FROM categorie c, contenu_categorie cc WHERE c.nom_cat = cc.categorie AND c.SEO_url_$lg = '$SEO_url' AND c.affiche_site = 1";
$res_categorie = $mysqli->query($req_categorie);
if(mysqli_num_rows($res_categorie) == 0) { header('location: '.URL_HOMEPAGE[$lg]); }
$cat = mysqli_fetch_array($res_categorie);

$id_categorie = $cat['categorie'];
$titre_categorie = $cat['titre_'.$lg];
$SEO_description = $cat['SEO_desc_'.$lg];
$SEO_keywords = $cat['SEO_mots_'.$lg];
$libelle_categorie = $cat['libelle_'.$lg];
$accroche_categorie = $cat['accroche_'.$lg];

foreach($tab_lg as $index => $langue) {
	$tab_param_href_lang[$langue] = $langue.'/'.$cat['SEO_url_'.$langue].'.html';
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo strtolower($lg); ?>" lang="<?php echo strtolower($lg); ?>">

<head>

<?php include('includes/gtag_manager_head.php'); ?>

<title><?php echo $titre_categorie; ?></title>

<meta name="description" content="<?php echo $SEO_description; ?>" />
<meta name="keywords" content="<?php echo $SEO_keywords; ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="robots" content="index,follow"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!-- FAVICON -->
<link rel="icon" href="<?php echo URL_SITE; ?>images/favicon.png" type="image/x-icon">

<!-- HREF LANGUE -->
<link rel="canonical" href="<?php echo URL_SITE.$tab_param_href_lang[$lg]; ?>">
<link rel="alternate" href="<?php echo URL_SITE.$tab_param_href_lang['FR']; ?>" hreflang="fr">
<link rel="alternate" href="<?php echo URL_SITE.$tab_param_href_lang['EN']; ?>" hreflang="en">
<link rel="alternate" href="<?php echo URL_SITE.$tab_param_href_lang['EN']; ?>" hreflang="x-default">

<?php include('includes/inclusion_header.php'); ?>

<!-- CSS -->
<link href="<?php echo URL_SITE; ?>css/categorie.css" rel="stylesheet" type="text/css">

</head>


<body id="page_categorie">

<?php include('includes/gtag_manager_body.php'); ?>

<!-- BANDEAU -->
<?php include('includes/bandeau.php'); ?>

<div id="contenu">
	
	<div class="conteneur_centre responsive">
		<div id="bloc_haut_categorie" class="centreur">
			<!-- ID CATEGORIE : <?php echo $id_categorie; ?> -->
			<h1 class="titre_page titre_categorie titre_deco light"><?php echo $libelle_categorie; ?></h1>
			
			<p class="accroche"><?php echo $accroche_categorie; ?></p>
			
			<?php include('includes/demande_contact.php'); ?>
		</div>
		
		<!-- BLOC AFF LISTE PRODUITS -->
		<?php include('includes/affichage_items.php'); ?>
		
		<!-- BLOC SERVICES -->
		<?php include('includes/services.php'); ?>
		
		<!-- BLOC BAS PAGE -->
		<?php include('includes/bas_page.php'); ?>
	</div>
	
</div>

<!-- FOOTER -->
<?php include('includes/footer.php'); ?>

</body>

</html>