<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

// blog.php
require_once __DIR__ . '/config.php';
require_once __DIR__ . '/inc_functions.php';
$config = require __DIR__ . '/config.php';
$latest = get_latest_blogs($pdo, 6);
$popular = get_popular_blogs($pdo, 4);
function esc($s){ return htmlspecialchars($s, ENT_QUOTES, 'UTF-8'); }
?>
<!DOCTYPE html>
<html lang="en">
 <head>
 <meta charset="UTF-8" />
 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
 <title>Stay Updated with Latest Digital Marketing and Web Development
Trends</title>
 <link rel="preconnect" href="https://fonts.googleapis.com" />
 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
 <link rel="shortcut icon" href="Images/favicon.png" type="image/png" />
 <link href="https://fonts.googleapis.com/css2?
family=Manrope:wght@400;500;600;700&display=swap" rel="stylesheet" />
 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fontawesome/6.5.1/css/all.min.css" />
 <link href="https://cdn.jsdelivr.net/npm/remixicon@4.5.0/fonts/
remixicon.css" rel="stylesheet" />
 <link rel="stylesheet" href="footer.css" />
 <link rel="stylesheet" href="style.css" />
 <meta name="description" content="The latest industry news, technologies,
and resources from Manak Analytics" />
 </head>
 <body>
 <!-- Top Banner -->
 <div class="top-banner">
 <div class="top-banner-container">
 <div class="top-left">
 <div class="contact-info">
 <!-- phone svg -->
4
 <svg xmlns="http://www.w3.org/2000/svg" class="icon" fill="none"
viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path strokelinecap="round" stroke-linejoin="round" d="M3 5a2 2 0 012-2h3.28a1 1 0
01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516
5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2
2h-1C9.716 21 3 14.284 3 6V5z"/></svg>
 <span class="phone-text">+91 9118840109</span>
 </div>
 <div class="contact-info">
 <i class="fa-regular fa-envelope"></i>
 <span class="phone-text">sales@manakanalytics.com</span>
 </div>
 </div>
 <div class="social-links-top">
 <a href="https://www.facebook.com/manakanalyticsdevelopment/"
class="social-icon">
 <!-- facebook svg -->
 <svg class="icon" fill="currentColor" viewBox="0 0 24 24"><path
fill-rule="evenodd" d="M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12c0 4.991
3.657 9.128 8.438 9.878v-6.987h-2.54V12h2.54V9.797c0-2.506 1.492-3.89
3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63
1.562V12h2.773l-.443 2.89h-2.33v6.988C18.343 21.128 22 16.991 22 12z" cliprule="evenodd"/></svg>
 </a>
 <a href="https://in.linkedin.com/company/manakanalyticsdevelopment"
class="social-icon">
 <svg class="icon" fill="currentColor" viewBox="0 0 24 24"><path
d="M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239
5-5v-14c0-2.761-2.238-5-5-5zm-11 19h-3v-11h3v11zm-1.5-12.268c-.966 0-1.75-.
79-1.75-1.764s.784-1.764 1.75-1.764 1.75.79 1.75 1.764-.783 1.764-1.75
1.764zm13.5 12.268h-3v-5.604c0-3.368-4-3.113-4
0v5.604h-3v-11h3v1.765c1.396-2.586 7-2.777 7 2.476v6.759z"/></svg>
 </a>
 </div>
 </div>
 </div>
 <!-- Header -->
 <header class="header">
 <div class="header-container">
 <a class="logo-link" href="index.html">
 <img src="./Images/manak-logo.png" alt="Manak Analytics Logo" />
 </a>
 <ul class="nav-links">
 <li><a href="index.html" class="nav-link">Home</a></li>
 <li><a href="about-us.html" class="nav-link">About Us</a></li>
 <li class="nav-item-dropdown" data-menu-id="products-menu">
 <button type="button" class="menu-trigger">
 <span>Services</span>
 <i class="fa-solid fa-caret-down"></i>
5
 </button>
 </li>
 <li>
 <a href="hotel-management-software.html" class="navlink">Products</a>
 </li>
 <li><a href="hire-us.html" class="nav-link">Hire Us</a></li>
 <li><a href="blog.php" class="nav-link nav-active">Blog</a></li>
 <li><a href="contact-us.html" class="nav-link">Contact Us</a></li>
 </ul>
 <div class="auth-buttons">
 <a class="btn" href="#">Get Quote</a>
 </div>
 <div class="mobile-menu-trigger">
 <button id="mobile-menu-button">
 <svg class="icon" fill="none" stroke="currentColor" viewBox="0 0
24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M4 6h16M4 12h16m-7 6h7"/></svg>
 </button>
 </div>
 </div>
 <!-- Mega Menu -->
 <div id="products-menu" class="mega-menu hidden">
 <div class="mega-menu-content">
 <!-- left columns kept static as in your original HTML -->
 <div class="mega-menu-column">
 <h3 class="mega-menu-heading">Design & Development</h3>
 <ul class="mega-menu-list">
 <li><a href="software-development.html" class="mega-menuitem"><p class="mega-menu-item-title">Software Development</p></a></li>
 <li><a href="website-development.html" class="mega-menuitem"><p class="mega-menu-item-title">Website Development</p></a></li>
 <li><a href="game-development.html" class="mega-menu-item"><p
class="mega-menu-item-title">Game Development</p></a></li>
 <li><a href="web-application-development.html" class="megamenu-item"><p class="mega-menu-item-title">Web Application Development</p></
a></li>
 <li><a href="mobile-application-development.html" class="megamenu-item"><p class="mega-menu-item-title">Mobile Application Development</
p></a></li>
 <li><a href="ecommerce-development.html" class="mega-menuitem"><p class="mega-menu-item-title">E-commerce Development</p></a></li>
 <li><a href="wordPress-development.html" class="mega-menuitem"><p class="mega-menu-item-title">WordPress Development</p></a></li>
 </ul>
 </div>
 <div class="mega-menu-column">
 <h3 class="mega-menu-heading">Marketing</h3>
6
 <ul class="mega-menu-list">
 <li><a href="seo.html" class="mega-menu-item"><p class="megamenu-item-title">SEO</p></a></li>
 <li><a href="digital-marketing.html" class="mega-menu-item"><p
class="mega-menu-item-title">Digital Marketing</p></a></li>
 <li><a href="smm-services.html" class="mega-menu-item"><p
class="mega-menu-item-title">SMM Services</p></a></li>
 <li><a href="pay-per-click.html" class="mega-menu-item"><p
class="mega-menu-item-title">Pay Per Click</p></a></li>
 <li><a href="graphics-designing.html" class="mega-menu-item"><p
class="mega-menu-item-title">Graphics Designing</p></a></li>
 <li><a href="email-marketing.html" class="mega-menu-item"><p
class="mega-menu-item-title">Email Marketing</p></a></li>
 <li><a href="video-marketing.html" class="mega-menu-item"><p
class="mega-menu-item-title">Video Marketing</p></a></li>
 </ul>
 </div>
 <div class="mega-menu-column">
 <h3 class="mega-menu-heading">Data</h3>
 <ul class="mega-menu-list">
 <li><a href="data-science.html" class="mega-menu-item"><p
class="mega-menu-item-title">Data Science</p></a></li>
 <li><a href="data-analytics.html" class="mega-menu-item"><p
class="mega-menu-item-title">Data Analytics</p></a></li>
 </ul>
 </div>
 <div class="mega-menu-promo">
 <img src="./Images/get-started.png" class="get-started-img"
alt="Get Started" />
 <h3 class="mega-menu-promo-title">Get Started with Scalable IT
Solutions</h3>
 <p class="mega-menu-promo-text">Get started with our product, or
contact us for a demo.</p>
 </div>
 </div>
 </div>
 </header>
 <!-- Mobile Menu -->
 <div id="mobile-menu-overlay" class="mobile-menu-overlay"></div>
 <div id="mobile-menu" class="mobile-menu">
 <div class="mobile-menu-inner">
 <div class="mobile-menu-header">
 <a class="logo-link"><img src="./Images/manak-logo.png" alt="Manak
Analytics Logo" /></a>
 <button id="close-mobile-menu" class="close-menu-button">
 <svg class="icon" fill="none" stroke="currentColor" viewBox="0 0
24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M6 18L18 6M6 6l12 12"/></svg>
 </button>
 </div>
7
 <nav class="mobile-nav">
 <ul class="mobile-nav-list">
 <li><a href="index.html" class="mobile-nav-link">Home</a></li>
 <li><a href="about-us.html" class="mobile-nav-link">About Us</
a></li>
 <li><a href="software-development.html" class="mobile-navlink">Services</a></li>
 <li><a href="hotel-management-software.html" class="mobile-navlink">Products</a></li>
 <li><a href="hire-us.html" class="mobile-nav-link">Hire Us</a></
li>
 <li><a href="blog.php" class="mobile-nav-link">Blog</a></li>
 <li><a href="contact-us.html" class="mobile-nav-link">Contact
Us</a></li>
 </ul>
 </nav>
 </div>
 </div>
 <!-- blog-page -->
 <section class="blog-page-section">
 <div class="blog-page-container">
 <div class="blog-content">
 <h4 class="intro-text">Latest</h4>
 <h2 class="main-headline">From the blog</h2>
 <p class="description">The latest industry news, technologies, and
resources.</p>
 </div>
 <div class="blog-posts-wrapper">
<?php foreach ($latest as $post): ?>
 <article class="blog-card">
<?php if (!empty($post['image_path'])): ?>
 <img src="<?= esc($post['image_path']) ?>" alt="<?=
esc($post['title']) ?>" />
<?php else: ?>
 <img src="./Images/blogs/blog-1.png" alt="Blog" />
<?php endif; ?>
 <div class="card-content">
 <div class="tags">
 <span class="tag category"><?= esc($post['category'] ?:
'General') ?></span>
 <span class="tag read-time"><?= date('M d, Y',
strtotime($post['published_at'])) ?></span>
 </div>
 <h3>
 <a href="blog-detail-view.php?slug=<?=
urlencode($post['slug']) ?>"><?= esc($post['title']) ?></a>
 <i class="ri-arrow-right-up-line"></i>
 </h3>
 <p class="description"><?= esc($post['excerpt']) ?></p>
 </div>
8
 </article>
<?php endforeach; ?>
 </div>
 </div>
 </section>
 <section class="blog-page-section">
 <div class="blog-page-container">
 <div class="blog-content">
 <h2 class="main-headline popular-text">Most Popular</h2>
 </div>
 <div class="blog-posts-wrapper blog-popular-wrap">
<?php foreach ($popular as $post): ?>
 <article class="blog-card">
 <div class="card-content">
 <div class="tags">
 <span class="tag category"><?= esc($post['category'] ?:
'General') ?></span>
 <span class="tag read-time"><?= date('M d, Y',
strtotime($post['published_at'])) ?></span>
 </div>
 <h3>
 <a href="blog-detail-view.php?slug=<?=
urlencode($post['slug']) ?>"><?= esc($post['title']) ?></a>
 <i class="ri-arrow-right-up-line"></i>
 </h3>
 <p class="description"><?= esc($post['excerpt']) ?></p>
 </div>
 </article>
<?php endforeach; ?>
 </div>
 </div>
 </section>
 <section class="contact-section">
 <div class="contact-container">
 <div class="content-grid">
 <div class="info-section">
 <div class="info-section-header">
 <p>Get in touch</p>
 <h2 class="main-headline">We are Here to Help You <br />& Your
Business</h2>
 </div>
 </div>
 <div class="contact-form-section">
<?php
// show status from url
$status = $_GET['status'] ?? null;
$msg = $_GET['msg'] ?? null;
if ($status): ?>
9
 <p id="form-message" class="form-message <?= $status ===
'success' ? 'success' : 'error' ?>"><?= esc($msg) ?></p>
<?php endif; ?>
 <form id="contactForm" action="contact-handler.php" method="post"
novalidate>
 <div class="form-fields-grid">
 <input type="text" id="name" name="name" placeholder="Your
Name" class="form-input" required />
 <input type="email" id="email" name="email"
placeholder="Email Address" class="form-input" required />
 <input type="tel" id="phone" name="phone" placeholder="Phone
Number" class="form-input" required />
 <select id="subject" name="subject" class="form-input"
required>
 <option value="" disabled selected>Select a Service</
option>
 <option value="Web Development">Web Development</option>
 <option value="App Development">App Development</option>
 <option value="Digital Marketing">Digital Marketing</
option>
 <option value="IT Consulting">IT Consulting</option>
 </select>
 </div>
 <textarea id="message" name="message" placeholder="Write a
Message" rows="6" class="form-input" required></textarea>
 <button type="submit" class="btn btn-red">Send a message</
button>
 </form>
 </div>
 </div>
 </div>
 </section>
 <!-- back to top button -->
 <button id="backToTop" onclick="window.scrollTo({top: 0, behavior:
'smooth'})">↑</button>
 <!-- footer-section -->
 <footer class="footer">
 <div class="footer-section main-links-section">
 <div class="company-info">
 <a class="logo-link"><img src="./Images/manak-logo.png" /></a>
 <p class="footer-desc">We specialize in delivering cutting-edge
digital solutions. From analytics to development, we ensure your business
grows with us.</p>
 <div class="rating">
 <div class="stars">
 <i class="fa-solid fa-star"></i>
 <i class="fa-solid fa-star"></i>
 <i class="fa-solid fa-star"></i>
10
 <i class="fa-solid fa-star"></i>
 <i class="fa-solid fa-star"></i>
 </div>
 <p>Google Review<br/>30+ customers</p>
 </div>
 <div class="footer-contact">
 <svg xmlns="http://www.w3.org/2000/svg" class="icon" fill="none"
viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path strokelinecap="round" stroke-linejoin="round" d="M3 5a2 2 0 012-2h3.28a1 1 0
01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516
5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2
2h-1C9.716 21 3 14.284 3 6V5z"/></svg>
 <span>+91 91188 40109, +91 83033 65218</span>
 </div>
 <div class="footer-contact"><i class="fa-regular fa-envelope"></
i><span>sales@manakanalytics.com</span></div>
 <div class="footer-contact"><span>606, Grandslam Ithum Tower, Plot
A-4,<br/>Sector 62, Noida – 201309</span></div>
 </div>
 <nav class="footer-nav-columns">
 <div class="nav-column">
 <h4>Design & Development</h4>
 <ul>
 <li><a href="software-development.html">Software Development</
a></li>
 <li><a href="website-development.html">Website Development</
a></li>
 <li><a href="game-development.html">Game Development</a></li>
 <li><a href="web-application-development.html">Web Application
Development</a></li>
 <li><a href="mobile-application-development.html">Mobile
Application Development</a></li>
 <li><a href="ecommerce-development.html">E-commerce
Development</a></li>
 <li><a href="wordPress-development.html">WordPress
Development</a></li>
 </ul>
 </div>
 <div class="nav-column">
 <h4>Marketing</h4>
 <ul>
 <li><a href="seo.html">SEO</a></li>
 <li><a href="digital-marketing.html">Digital Marketing</a></li>
 <li><a href="smm-services.html">SMM Services</a></li>
 <li><a href="pay-per-click.html">Pay Per Click</a></li>
 <li><a href="graphics-designing.html">Graphics Designing</a></
li>
 <li><a href="email-marketing.html">Email Marketing</a></li>
 <li><a href="video-marketing.html">Video Marketing</a></li>
 </ul>
 </div>
11
 <div class="nav-column">
 <h4>Data</h4>
 <ul>
 <li><a href="data-science.html">Data Science</a></li>
 <li><a href="data-analytics.html">Data Analytics</a></li>
 </ul>
 </div>
 </nav>
 </div>
 <div class="divider"></div>
 <div class="footer-section copyright-section">
 <p>&copy; <?= date('Y') ?> <a href="https://www.manakanalytics.com/"
class="copyright-text">Manak Analytics</a>. All rights reserved.</p>
 <div class="footer-icon-wrap">
 <a class="policy-text" href="privacy-policy.html">Privacy Policy</
a>
 <div class="social-icons">
 <a href="https://in.linkedin.com/company/
manakanalyticsdevelopment"><i class="fa-brands fa-linkedin"></i></a>
 <a href="https://www.facebook.com/manakanalyticsdevelopment/"><i
class="fa-brands fa-facebook"></i></a>
 <a href="https://www.youtube.com/
@manakanalyticsdevelopment766"><i class="fa-brands fa-youtube"></i></a>
 </div>
 </div>
 </div>
 </footer>
 <script src="script.js"></script>
 </body>
</html>
