Пример #1
0
<?php

require_once 'dbutil.php';
$db = new DbUtil();
$articles = $db->getNews();
foreach ($articles as $article) {
    echo "<div class='container'>";
    echo "<table class='page-header col-md-6'>";
    echo "<thead>";
    echo "<tr>";
    echo "<th><h2>" . $article['articlename'] . "</h2></th>";
    echo "</tr>";
    echo "<thead>";
    echo "<tbody>";
    echo "<tr>";
    echo "<td><h3>" . $article['article'] . "</h3></td>";
    echo "</tr>";
    echo "<tr>";
    echo "<td><h5><i> By: " . $db->getUser($article['author']) . "<br><p id='p'>" . $article['timestamp'] . "</p>";
    if (isset($_SESSION['rank']) && $_SESSION['rank'] == 1) {
        echo "<div class='deletearticle text-right'> <a onclick='return confirmAction()' href='inc/deletearticle.php?art=" . $article['id'] . "'><i class='material-icons md-dark md-24'>delete</i></a></div>";
    }
    echo "</i></h5></td>";
    echo "</tr>";
    echo "</tbody>";
    echo "</table>";
    echo "</div>";
    echo "<br />";
}