<?php
include_once('include/header.php');

$segments = explode('/', trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/'));
$slug = end($segments);

$stmt = $con->prepare("SELECT * FROM blog WHERE slug=? LIMIT 1");
$stmt->bind_param("s", $slug);
$stmt->execute();
$solution = $stmt->get_result()->fetch_assoc();

if (!$solution) {
    include '404.php';
    exit;
}
?> 

<div class="page-header parallaxie">
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <div class="page-header-box">
                    <h1 class="text-anime">
                        <?php echo htmlspecialchars($solution['title']); ?>
                    </h1>

                    <nav class="wow fadeInUp" data-wow-delay="0.25s">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item"><a href="<?php path() ?>">Home ></a></li>
                            <li class="breadcrumb-item">
                                <a href="<?php echo htmlspecialchars($solution['slug']); ?>">
                                    <?php echo htmlspecialchars($solution['title']); ?>
                                </a>
                            </li>
                        </ol>
                    </nav>
                </div>
            </div>
        </div>
    </div>
</div>


<div class="container py-5">
    <div class="row">

        <!-- Images -->
        <div class="col-lg-5 mb-4">

            <img src="<?php path(); ?>admin/assets/images/blog/<?php echo $solution['Image']; ?>"
                 class="img-fluid product-main-img mb-3"
                 alt="<?php echo htmlspecialchars($solution['title']); ?>">
 

        </div>

        <!-- Product Info -->
        <div class="col-lg-7">

            <h2><?php echo htmlspecialchars($solution['title']); ?></h2>
 
            <?php if (!empty($solution['short_des'])): ?>
                <p class="">
                    <?php echo html_entity_decode($solution['short_des']); ?>
                </p>
            <?php endif; ?>

            
        </div>
    </div>
</div>


<div class="container pb-5">
        <?php if (!empty($solution['description'])): ?>
        <div class="tab-pane fade show active" id="desc">
            <?php echo html_entity_decode($solution['description']); ?>
        </div>
        <?php endif; ?>
    </div>
</div>


 

<?php include_once('include/footer.php'); ?>
