<?php
require_once "common/header.php";
require_once "include/db_handler.php";

if (isset($_GET['id'])) {
    $id = $_GET['id'];
    $article = $db->getSingleArticle($id);
}
?>

<body>

<div class="container-fluid">
    <div class="row">
        <?php
        require_once "common/sidebar.php";
        ?>
        <div class="right-column">
            <?php
            require_once "common/navbar.php";
            ?>
            <main class="main-content p-5" role="main">

                <div class="row mb-4">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-mailbox">
                                <div class="row mx-0">

                                    <img src="assets/img/post_pic/<?php echo $article[0]['image']; ?>">

                                    <div class="col-lg-12">
                                        <div class="mailbox-container mailbox-message-compose">
                                            <p>
                                                <?php echo $article[0]['body']; ?>
                                            </p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

            </main>
        </div>
    </div>
</div>

<?php
require_once "modals/add_article.php";
require_once "modals/logout.php";
require_once "modals/add_category.php";
require_once "common/footer.php";
?>

