query('SELECT article.title, article.created_at, article.slug, article.excerpt, employee.name AS author, employee.slug AS authorUrl FROM article JOIN employee ON article.author=employee.id ORDER BY created_at DESC;') as $row) { $articles[] = $row; } } else { $mode = "view"; $sth = $dbh->prepare("SELECT article.title, article.created_at, article.modified_at, article.slug, article.content, article.excerpt, employee.name AS author, employee.slug AS authorUrl FROM article JOIN employee ON article.author=employee.id AND article.slug = ?;"); $sth->execute([end($url)]); $article = $sth->fetch(PDO::FETCH_ASSOC); if (empty($article)) { http_response_code(404); $error = "notfound"; } $sth = null; } $dbh = null; } catch (PDOException $e) { http_response_code(503); $error = "db"; die($e->getMessage()); } ?> Blog - Elite Solar'; echo ''; echo ''; echo ''; echo ''; } elseif ($mode == 'view') { echo '' . $article['title'] . ' - Elite Solar'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } ?>
Menu
  1. Accueil
  2. Blog

Une erreur est survenue lors du chargement de la page.

'; } elseif ($error == "notfound") { echo '' . "

Article introuvable

L'article que vous cherchez à atteindre ne peut pas être trouvée. Il est possible qu'il ait été supprimé ou déplacé. Si vous avez saisi manuellement son adresse, veuillez vérifier une éventuelle erreur de saisie.


Retour à la page d'accueil

"; } else { if ($mode == 'list') { echo '' . "

Blog


"; echo '
'; } elseif ($mode == 'view') { $date = new DateTime($article['created_at']); echo '' . "

" . $article["title"] . "


Publié le " . $date->format('d/m/Y') . " par " . $article["author"] . "


" . $article["content"]; } } ?>