'>
"; $bdd = connect($dbhost, $dbname, $dbuser, $dbpass); $req = $bdd->prepare("SELECT ID, titre, date, auteur, classification FROM articles WHERE ID = :article AND classification <= :accreditation"); $req->bindParam(":article", $article); $req->bindParam(":accreditation", $_SESSION['accreditation']); $req->execute(); $resultat = $req->fetchAll(PDO::FETCH_ASSOC);; if ($resultat) { $date = strtotime($resultat[0]['date']); echo "
" . $resultat[0]['titre'] . "
"; echo ""; echo "
" . $resultat[0]['auteur'] . "
"; echo "
" . $classifications[$resultat[0]['classification']] . "
"; echo "
"; echo $parsedown->text($markdownContent); echo "
"; } } else { $bdd = connect($dbhost, $dbname, $dbuser, $dbpass); $search = isset($_GET['search']) ? "'%" . htmlspecialchars($_GET['search']) . "%'" : "'%'"; $req = $bdd->prepare("SELECT ID, titre, date FROM articles WHERE classification <= :accreditation AND titre LIKE :search ORDER BY date DESC"); $req->bindParam(":search", $search); $req->bindParam(":accreditation", $_SESSION['accreditation']); $req->execute(); $resultat = $req->fetchAll(PDO::FETCH_ASSOC); echo "

Dernières news du Club

"; echo "
"; if ($resultat) { foreach($resultat as $row) { $date = strtotime($row['date']); echo "
"; echo ""; echo "
" . $row['titre'] . "
"; echo "
"; } } } ?>