From b637631a558297caff173718ec4043e7c2dabc2e Mon Sep 17 00:00:00 2001 From: Jan BELLON Date: Fri, 8 Mar 2024 15:44:28 +0000 Subject: [PATCH] Update file news.php --- html/news.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/html/news.php b/html/news.php index 5f9b87fb..4932eba7 100644 --- a/html/news.php +++ b/html/news.php @@ -50,7 +50,26 @@ if (filter_var($_GET['article'], FILTER_VALIDATE_INT)) { require_once '../include/parsedown.php'; $parsedown = new Parsedown(); - echo "
"; + echo "
"; + bdd = connect($dbhost, $dbname, $dbuser, $dbpass); + $req = $bdd->prepare("SELECT ID, titre, date, auteur, classification FROM articles WHERE classification <= :accreditation ORDER BY date DESC"); + $req->bindParam(":accreditation", $_SESSION['accreditation']); + $req->execute(); + $resultat = $req->fetchAll(PDO::FETCH_ASSOC); + + $date = new Datetime($row['date']); + + if ($resultat) { + foreach($resultat as $row) { + echo "

"; + echo "
" . $row['ID'] . "
"; + echo "
" . $row['titre'] . "
"; + echo ""; + echo "
" . $row['auteur'] . "
"; + echo "
" . $row['classification'] . "
"; + } + } + echo "
"; echo $parsedown->text($markdownContent); echo "
"; } else {