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 "
" . date('d/m/Y', $date) . "
";
+ }
+ }
+ } else if (!isset($_GET['search']) && $article != "" && file_exists('/var/www/e59/content/journal/' . $article . '.md')) {
$markdownContent = file_get_contents('/var/www/e59/content/journal/' . $article . '.md');
require_once '../include/parsedown.php';
@@ -68,27 +89,6 @@ if (filter_var($_GET['article'], FILTER_VALIDATE_INT)) {
echo $parsedown->text($markdownContent);
echo "