Boarding Pass
<?php
include 'includes/db.php'; // adjust path as needed
// Pagination setup
$limit = 6;
$page = isset($_GET['page']) ? max(1, intval($_GET['page'])) : 1;
$offset = ($page - 1) * $limit;
// Total count
$totalResult = $conn->query("SELECT COUNT(*) as total FROM blogs");
$total = $totalResult->fetch_assoc()['total'];
$totalPages = ceil($total / $limit);
// Fetch current blogs
$stmt = $conn->prepare("SELECT * FROM blogs ORDER BY date DESC LIMIT ?, ?");
$stmt->bind_param("ii", $offset, $limit);
$stmt->execute();
$result = $stmt->get_result();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Blog - Petra Tissue Company</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<link rel="stylesheet" href="assets/styles.css">
<link rel="icon" type="image/png" href="assets/images/favicon.ico">
</head>
<body>
<!-- Header -->
<?php include 'includes/header.php'; ?>
<!-- Floating Elements -->
<div class="floating-element"></div>
<div class="floating-element"></div>
<!-- Page Header -->
<section class="page-header">
<div class="container">
<h1>Petra Tissue Blog</h1>
<ul class="breadcrumb">
<li><a href="index.php">Home</a></li>
<li>Blog</li>
</ul>
</div>
</section>
<!-- Blog Section -->
<section class="blog-section">
<div class="container">
<div class="section-title reveal fade-bottom">
<h2>Latest Articles</h2>
<p>Stay updated with the latest news, trends, and insights from the tissue industry</p>
</div>
<div class="blog-grid reveal fade-bottom">
<?php while ($row = $result->fetch_assoc()): ?>
<div class="blog-card">
<div class="blog-image">
<img src="uploads/<?= htmlspecialchars($row['image']) ?>" alt="<?= htmlspecialchars($row['title']) ?>">
</div>
<div class="blog-content">
<div class="blog-meta">
<span><i class="far fa-calendar-alt"></i> <?= date('F j, Y', strtotime($row['date'])) ?></span>
<span><i class="far fa-user"></i> By <?= htmlspecialchars($row['author']) ?></span>
</div>
<h3><?= htmlspecialchars($row['title']) ?></h3>
<p><?= htmlspecialchars(substr($row['content'], 0, 150)) ?>...</p>
<a href="blog-detail.php?title=<?= urlencode($row['title']) ?>" class="read-more">
Read More <i class="fas fa-arrow-right"></i></a>
</div>
</div>
<?php endwhile; ?>
</div>
<div class="pagination reveal fade-bottom">
<?php for ($i = 1; $i <= $totalPages; $i++): ?>
<a href="?page=<?= $i ?>" class="<?= $i == $page ? 'active' : '' ?>"><?= $i ?></a>
<?php endfor; ?>
<?php if ($page < $totalPages): ?>
<a href="?page=<?= $page + 1 ?>"><i class="fas fa-chevron-right"></i></a>
<?php endif; ?>
</div>
</div>
</section>
<!-- Newsletter -->
<section class="newsletter">
<div class="container">
<h3 class="reveal fade-bottom">Subscribe to Our Newsletter</h3>
<p class="reveal fade-bottom">Stay updated with the latest news, product launches, and industry insights from Petra Tissue Company.</p>
<form class="newsletter-form reveal fade-bottom">
<input type="email" placeholder="Your email address">
<button type="submit">Subscribe</button>
</form>
</div>
</section>
<!-- Footer -->
<?php include 'includes/footer.php' ?>
<script>
// Mobile Menu Toggle
const mobileMenuBtn = document.getElementById('mobileMenuBtn');
const mainNav = document.getElementById('mainNav');
mobileMenuBtn.addEventListener('click', () => {
mainNav.classList.toggle('active');
mobileMenuBtn.innerHTML = mainNav.classList.contains('active') ?
'<i class="fas fa-times"></i>' :
'<i class="fas fa-bars"></i>';
});
// Scroll Reveal Animation
function revealOnScroll() {
const reveals = document.querySelectorAll('.reveal');
for (let i = 0; i < reveals.length; i++) {
const windowHeight = window.innerHeight;
const revealTop = reveals[i].getBoundingClientRect().top;
const revealPoint = 150;
if (revealTop < windowHeight - revealPoint) {
reveals[i].classList.add('active');
}
}
}
window.addEventListener('scroll', revealOnScroll);
window.addEventListener('load', revealOnScroll);
// Newsletter form submission
const newsletterForm = document.querySelector('.newsletter-form');
newsletterForm.addEventListener('submit', (e) => {
e.preventDefault();
const emailInput = newsletterForm.querySelector('input');
alert('Thank you for subscribing to our newsletter!');
emailInput.value = '';
});
</script>
</body>
</html>
Sindabad File Uploader 1.0, Coded By Sindbad EG ~ The Terrorists