<?php
include "classes/class.loader.php";
$html = new html();
$html->bacground_emoji();
$calls = new functions();
$db = new db();
$html->header();
?>
<style>
    body {
        background-color: #bebebee7;
        color: white;
    }
</style>


<div class="home_container">
    <?php
    $db = new db();
    $news_res = $db->query("SELECT * FROM news WHERE 1 ORDER BY record_id DESC");
    while ($news = $news_res->fetch_assoc()) {
        ?>
        <div class="news_container">
            <span class="time_stamp"><?php echo $news['date_time']; ?></span>
            <div class="news_heading">
                <h2><?php echo $news['heading']; ?></h2>
            </div>
            <div class="news_body">
                <div class="news_image">
                    <img src="news_upload/<?php echo $news['file_name']; ?>" class="news_img" />
                </div>
                <div class="news_description">
                    <textarea class="news_text" readonly><?php echo $news['description']; ?></textarea>
                </div>
            </div>
        </div>
    <?php } ?>
</div>

<?php $html->html_end(); ?>