prepare("SELECT ID, titre, date, auteur, image, resume FROM articles WHERE (titre LIKE :search OR ID LIKE :search OR auteur LIKE :search) AND classification <= :accreditation ORDER BY date DESC"); $req->bindParam(":search", $search); $req->bindParam(":accreditation", $_SESSION['accreditation']); $req->execute(); $resultat = $req->fetchAll(PDO::FETCH_ASSOC); echo "

Dernières infos du club

"; echo "
"; if ($resultat) { foreach($resultat as $row) { $date = strtotime($row['date']); echo '
'; echo '
'; echo ''; echo '
'; echo '
'; echo '
n° ' . $row['ID'] . ' | ' . date('d/m/Y', $date) . ' | '. $row['auteur'] . '
'; echo ''; echo '
' . $row['titre'] . '
'; echo '
'; echo '
' . $row['resume'] . '
'; echo '
'; echo '
'; } } else { echo "Aucun article trouvé"; } } else if (!isset($_GET['search']) && $article != "" && file_exists($wwwroot . '/content/journal/' . $article . '.md')) { $markdownContent = file_get_contents($wwwroot . '/content/journal/' . $article . '.md'); require_once '../include/parsedown.php'; $parsedown = new Parsedown(); $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 ""; echo "
"; echo $parsedown->text($markdownContent); echo "
"; } } ?>