	<?php include('partie1.php'); ?>
	<link href="css/detaya.css" rel='stylesheet' type='text/css' />

	<?php if(isset($_GET['article']) && isset($_GET['mark']) && isset($_GET['type_mark']))

	{$_GET['article'] =htmlspecialchars($_GET['article']);
	$_GET['mark'] =htmlspecialchars($_GET['mark']);
	$type_mark = htmlspecialchars($_GET['type_mark']);

	if($type_mark=="type")
	{$type_mark="id_type";}
	else
	{$type_mark="id_article";}

	include('connexion_mysql.php');

	$retour = 'SELECT * FROM artcle WHERE '.$type_mark.'= "'.$_GET['mark'].'" ORDER BY id_article DESC LIMIT 0,1';
	$res = $conn->query($retour);
	$donnees = mysqli_fetch_array($res);
	$titre = stripslashes($donnees['titre']);
	$contenu = stripslashes($donnees['contenu']);
	$date = stripslashes($donnees['date']);
	$image = stripslashes($donnees['image']);

	$id_type = stripslashes($donnees['id_type']);
	$id_grpe = stripslashes($donnees['id_grpe']);
	$id_article = stripslashes($donnees['id_type']);

	$desc_image = stripslashes($donnees['desc_image']);
	$resume = stripslashes($donnees['resume']);
	$lien_utile = stripslashes($donnees['lien_utile']);
	$libelle_lien = stripslashes($donnees['libelle_lien']);
	$video = stripslashes($donnees['video']);
	$document = stripslashes($donnees['document']);
	$date_article = stripslashes($donnees['date']);


	$retour1 = 'SELECT * FROM type_article WHERE id_type = "'.$id_type.'"';
	$res = $conn->query($retour1);
	$donnees = mysqli_fetch_array($res);
	// On place le titre et le contenu dans des variables simples.
	$libelle_type = stripslashes($donnees['libelle_type']);

	$retour1 = 'SELECT libelle_grpe FROM grpe_article WHERE id_grpe = "'.$id_grpe.'"';
	$res = $conn->query($retour1);
	$donnees = mysqli_fetch_array($res);
	// On place le titre et le contenu dans des variables simples.
	$libelle_grpe = stripslashes($donnees['libelle_grpe']);
	// On place le titre et le contenu dans des variables simples.
	$libelle_grpe = stripslashes($donnees['libelle_grpe']);

	?>


		<div class="row detayam2019_header" style=" background: linear-gradient(
	 rgba(0, 0, 0, 0.45), 
	 rgba(0, 0, 0, 0.45)
	 ),url(uploads/fond_header1.png); 
	 background-size:cover;
	 background-repeat:no-repeat;height:120px; margin-top:-30px;">

	<div class="container">
			<h1><?php echo $libelle_type; ?></h1>
	</div>

	</div>

	
	
	<?php
include('connexion_mysql.php');				 
$retourcompt = 'SELECT COUNT(id_article) AS nb_article FROM artcle WHERE id_type= "'.$id_type.'"';
$resc = $conn->query($retourcompt);
$donneesc= mysqli_fetch_array($resc);
	 
 
if($donneesc['nb_article']< 2)
{echo '';}

else
{
	?>
	
	
	
	
	<!-- debut liste des articles -->
	
	<div class="row detayam2019_liste" style="padding-top:0px; margin-top:-30px;">

	    <div class="container">
	        <h2><?php /*echo $libelle_type;*/?></h2>
			
			<?php  


$id_type=htmlspecialchars($_GET['mark']);	
$retour = 'SELECT * FROM artcle WHERE id_type = "'.$id_type.'" ORDER BY id_article DESC';
$res = $conn->query($retour);
while($donnees = mysqli_fetch_array($res))
{

?>


            <div class="col-md-4 col-sm-6 col-xs-12 detayam2019_col">
			<a href="detail.php?article=
<?php echo stripslashes($donnees['titre']);  ?>&amp;mark=<?php echo stripslashes($donnees['id_article']);  ?>&amp;type_mark=article">
	<picture><img alt="" style="max-height:300px;" src="uploads/<?php echo stripslashes($donnees['image']); ?>"></picture>
			<h3><?php echo stripslashes($donnees['titre']);?></h3>
			</a>
			</div>
			
			
           <?php }  ?>
			
			 
			
			
			
			
			
			
	    </div>
		
		
		
	
	
	</div>
	
	
	<!-- fin liste des articles -->
	<?php } ?>
	

	<?php } ?>

	<?php include('partie3.php'); ?>