35410-vm/index.php
2025-11-02 05:34:28 +00:00

138 lines
6.3 KiB
PHP

<?php
require_once 'db/config.php';
// Fetch featured products
$products = [];
try {
$pdo = db();
$stmt = $pdo->query("SELECT id, name, category, price, image_url FROM products WHERE is_featured = TRUE LIMIT 6");
$products = $stmt->fetchAll();
} catch (PDOException $e) {
// If the table doesn't exist, it might be because install.php hasn't been run.
// We can fail silently and just show an empty product list.
// In a real app, this should be logged.
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- SEO & Meta Tags -->
<title>bconcept</title>
<meta name="description" content="A secure, scalable e-commerce platform for men's formal wear and footwear. Built with Flatlogic Generator.">
<meta name="keywords" content="men's formal wear, dress shoes, suits, vietnamese market, bconcept, custom tailoring, luxury menswear, online shopping, Built with Flatlogic Generator">
<meta property="og:title" content="bconcept">
<meta property="og:description" content="A secure, scalable e-commerce platform for men's formal wear and footwear. Built with Flatlogic Generator.">
<meta property="og:image" content="<?php echo htmlspecialchars($_SERVER['PROJECT_IMAGE_URL'] ?? ''); ?>">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="<?php echo htmlspecialchars($_SERVER['PROJECT_IMAGE_URL'] ?? ''); ?>">
<!-- Fonts & Icons -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&family=Playfair+Display:wght@700&display=swap" rel="stylesheet">
<script src="https://unpkg.com/feather-icons"></script>
<!-- Stylesheets -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
</head>
<body>
<!-- Header -->
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container">
<a class="navbar-brand" href="#">bconcept</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<nav class="main-nav">
<ul>
<li><a href="index.php" class="active">Home</a></li>
<li><a href="products.php">All Products</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
<div class="d-flex">
<a href="#" class="nav-link"><i data-feather="shopping-cart"></i></a>
</div>
</div>
</div>
</nav>
<!-- Hero Section -->
<section class="hero">
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto">
<h1>Elegance Redefined</h1>
<p>Discover our curated collection of men's formal wear and footwear.</p>
<a href="#featured-products" class="btn btn-primary">Shop Now</a>
</div>
</div>
</div>
</section>
<!-- Featured Products Section -->
<section id="featured-products" class="featured-products">
<div class="container">
<div class="section-title">
<h2>Featured Products</h2>
</div>
<?php if (empty($products)): ?>
<div class="alert alert-info text-center">
<p>Our products are being prepared. Please <a href="install.php">run the installation script</a> to see sample products.</p>
</div>
<?php else: ?>
<div class="row g-4">
<?php foreach ($products as $product): ?>
<div class="col-lg-4 col-md-6">
<div class="product-card">
<a href="#"><img src="<?php echo htmlspecialchars($product['image_url']); ?>" class="product-img" alt="<?php echo htmlspecialchars($product['name']); ?>"></a>
<div class="card-body">
<div class="d-flex justify-content-between align-items-start">
<div>
<h5 class="card-title"><a href="#"><?php echo htmlspecialchars($product['name']); ?></a></h5>
<p class="card-category"><?php echo htmlspecialchars($product['category']); ?></p>
</div>
<p class="card-price">$<?php echo htmlspecialchars($product['price']); ?></p>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
</section>
<!-- Footer -->
<footer class="footer">
<div class="container">
<div class="row align-items-center">
<div class="col-md-6">
<p class="mb-0">&copy; <?php echo date('Y'); ?> bconcept. All Rights Reserved.</p>
</div>
<div class="col-md-6 text-md-end social-links">
<a href="#"><i data-feather="twitter"></i></a>
<a href="#"><i data-feather="facebook"></i></a>
<a href="#"><i data-feather="instagram"></i></a>
</div>
</div>
</div>
</footer>
<!-- Scripts -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
<script>
feather.replace()
</script>
</body>
</html>