chiro-canto/public/articles/list.php

53 lines
1.5 KiB
PHP

<?php
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Articles | Chiro - Canto</title>
<link rel="stylesheet" type="text/css" href="/styles/style.css">
</head>
<?php
include("$root/analytics/matomo.php");
?>
<body>
<?php include("$root/menu.php");?>
<?php include("$root/header.php");?>
<section>
<h2>All Articles</h2>
<?php if (isset($results['error'])) { ?>
<div class="error"><?php echo $results['error'] ?></div>
<?php }
if (isset($results['status'])) {?>
<div class="status"><?php echo $results['status'] ?></div>
<?php } ?>
<table>
<tr>
<th>Publication Date</th>
<th>Article</th>
</tr>
<?php foreach($results['articles'] as $article) { ?>
<tr>
<td><?php echo date('j M Y', $article->publication_date)?></td>
<td>
<?php echo $article->title?>
</td>
</tr>
<?php } ?>
</table>
<p><a href="admin.php?action=new">New article</a></p>
<p><a href="./">Return to Homepage</a></p>
</section>
<?php include("$root/footer.php");?>
</body>
<script src="/scripts/script.js"></script>
</html>