Sindbad~EG File Manager

Current Path : /home/u625735752/domains/floralwhite-woodpecker-723030.hostingersite.com/public_html/1.9/
Upload File :
Current File : /home/u625735752/domains/floralwhite-woodpecker-723030.hostingersite.com/public_html/1.9/blog.php

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  
  <title>JAM ON | Your Home For Urban Music</title>
  <meta name="description" content="Jam-On FM brings you the best in nonstop music, fresh hits, and smooth vibes. Tune in anytime, anywhere.">



<?php include 'head.php'?>
 
</head>
<body>
<?php include 'header.php'?>

<?php
include "conn.php";

function getBlogs($mysqli) {
    $q = "SELECT * FROM blogs ORDER BY created_at DESC";
    if ($res = $mysqli->query($q)) {
        return $res->fetch_all(MYSQLI_ASSOC);
    }
    return [];
}
 
$blogs = getBlogs($mysqli);
?>

<section class="blog-section py-5 text-white">
  <div class="container">
    <div class="row align-items-center mb-4 motion-features">
      <div class="col-lg-8" data-aos="fade-right">
        <h2 class="display-5 fw-bold mb-4">Blog</h2>
      </div>
      <div class="col-lg-4 text-lg-end text-start" data-aos="fade-left">
        <select class="form-select w-auto bg-dark text-white border-light ms-auto" aria-label="Sort news">
          <option selected>Sort by</option>
          <option value="latest">Latest</option>
          <option value="popular">Popular</option>
        </select>
      </div>
    </div>

    <div class="row g-4">
      <?php if (!empty($blogs)): ?>
        <?php foreach ($blogs as $blog): ?>
          <div class="col-md-4" data-aos="fade-up">
            <div class="blog-post position-relative">
              <div class="blog-image">
                <img src="images/<?= htmlspecialchars($blog['image']) ?>" alt="Blog Image" class="img-fluid">
                <span class="blog-date"><?= date('F j, Y', strtotime($blog['date'])) ?></span>
              </div>
              <div class="blog-content p-3">
                <h5 class="text-white">
                  <?= htmlspecialchars($blog['heading_normal']) ?>
                  <strong><?= htmlspecialchars($blog['heading_bold']) ?></strong>
                </h5>
                <p class="text-light"><?= htmlspecialchars($blog['intro']) ?></p>
              </div>
              <a href="blog-detail-page.php?id=<?= $blog['id'] ?>" class="stretched-link"></a>
            </div>
          </div>
        <?php endforeach; ?>
      <?php else: ?>
        <div class="col-12">
          <p class="text-light">No blogs available at the moment.</p>
        </div>
      <?php endif; ?>
    </div>
  </div>
</section>


<?php include 'footer.php'?>



</body>
</html>

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists