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 {