Compare commits
No commits in common. "ai-dev" and "master" have entirely different histories.
@ -1,307 +0,0 @@
|
||||
/*--------------------------------------------------------------
|
||||
# General
|
||||
--------------------------------------------------------------*/
|
||||
:root {
|
||||
--primary-color: #1a1a1a;
|
||||
--accent-color: #c5a47e;
|
||||
--background-color: #fdfdfd;
|
||||
--surface-color: #ffffff;
|
||||
--text-color: #333;
|
||||
--heading-font: 'Playfair Display', serif;
|
||||
--body-font: 'Inter', sans-serif;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: var(--body-font);
|
||||
color: var(--text-color);
|
||||
background-color: var(--background-color);
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
font-family: var(--heading-font);
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--accent-color);
|
||||
text-decoration: none;
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #a28664;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background-color: var(--accent-color);
|
||||
border-color: var(--accent-color);
|
||||
padding: 12px 30px;
|
||||
border-radius: 4px;
|
||||
font-family: var(--body-font);
|
||||
font-weight: 500;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background-color: #a28664;
|
||||
border-color: #a28664;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Header
|
||||
--------------------------------------------------------------*/
|
||||
.site-header {
|
||||
padding: 1.5rem 0;
|
||||
background-color: var(--surface-color) !important;
|
||||
border-bottom: 1px solid #efefef;
|
||||
}
|
||||
|
||||
.header-content {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
font-family: var(--heading-font);
|
||||
font-size: 1.75rem;
|
||||
font-weight: 700;
|
||||
color: var(--primary-color) !important;
|
||||
}
|
||||
|
||||
.main-nav ul {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.main-nav a {
|
||||
font-family: var(--body-font);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 500;
|
||||
color: var(--primary-color);
|
||||
padding-bottom: 0.5rem;
|
||||
border-bottom: 2px solid transparent;
|
||||
}
|
||||
|
||||
.main-nav a:hover, .main-nav a.active {
|
||||
color: var(--accent-color);
|
||||
border-bottom-color: var(--accent-color);
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Hero Section
|
||||
--------------------------------------------------------------*/
|
||||
.hero {
|
||||
height: 85vh;
|
||||
background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url('https://images.pexels.com/photos/298863/pexels-photo-298863.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2');
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.hero h1 {
|
||||
font-size: 4.5rem;
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.hero p {
|
||||
font-size: 1.2rem;
|
||||
color: #fff;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.hero-small {
|
||||
padding: 4rem 0;
|
||||
background-color: #f8f9fa;
|
||||
text-align: center;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
.hero-small h1 {
|
||||
font-size: 2.5rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.hero-small p {
|
||||
font-size: 1.1rem;
|
||||
color: #6c757d;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Product Section
|
||||
--------------------------------------------------------------*/
|
||||
.product-section {
|
||||
padding: 80px 0;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
text-align: center;
|
||||
margin-bottom: 60px;
|
||||
}
|
||||
|
||||
.section-title h2 {
|
||||
font-size: 3rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.product-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.product-card {
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
background-color: var(--surface-color);
|
||||
box-shadow: 0 10px 30px rgba(0,0,0,0.05);
|
||||
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
||||
}
|
||||
|
||||
.product-card:hover {
|
||||
transform: translateY(-10px);
|
||||
box-shadow: 0 15px 40px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.product-image-wrapper {
|
||||
height: 350px;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.product-image {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
object-fit: cover;
|
||||
transition: transform 0.4s ease;
|
||||
}
|
||||
|
||||
.product-card:hover .product-image {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
.product-info {
|
||||
padding: 25px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.product-name {
|
||||
font-size: 1.25rem;
|
||||
font-weight: 600;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.product-price {
|
||||
font-size: 1.3rem;
|
||||
font-weight: 700;
|
||||
color: var(--accent-color);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Footer
|
||||
--------------------------------------------------------------*/
|
||||
.site-footer {
|
||||
background-color: var(--primary-color);
|
||||
color: #a9a9a9;
|
||||
padding: 40px 0;
|
||||
font-size: 0.9rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.site-footer a {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.site-footer a:hover {
|
||||
color: var(--accent-color);
|
||||
}
|
||||
|
||||
.site-footer .social-links a {
|
||||
font-size: 1.2rem;
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Product Detail Page
|
||||
--------------------------------------------------------------*/
|
||||
.product-detail-layout {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 4rem;
|
||||
padding: 4rem 0;
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.product-detail-images .main-product-image {
|
||||
width: 100%;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 10px 30px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.product-title {
|
||||
font-size: 2.8rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.product-price-detail {
|
||||
font-size: 2rem;
|
||||
font-weight: 700;
|
||||
color: var(--accent-color);
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.product-description {
|
||||
font-size: 1rem;
|
||||
line-height: 1.8;
|
||||
color: #555;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.add-to-cart-form .quantity-selector {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.add-to-cart-form .quantity-input {
|
||||
width: 80px;
|
||||
padding: 0.5rem;
|
||||
text-align: center;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.add-to-cart-form .btn-primary {
|
||||
width: 100%;
|
||||
padding: 1rem;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
/* Notices */
|
||||
.notice {
|
||||
text-align: center;
|
||||
padding: 2rem;
|
||||
margin: 2rem auto;
|
||||
border-radius: 0.25rem;
|
||||
background-color: #f8f9fa;
|
||||
border: 1px solid #dee2e6;
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
.notice-error {
|
||||
background-color: #f8d7da;
|
||||
color: #721c24;
|
||||
border-color: #f5c6cb;
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
// Custom JS will go here
|
||||
@ -1,9 +0,0 @@
|
||||
CREATE TABLE IF NOT EXISTS products (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(255) NOT NULL,
|
||||
category VARCHAR(100) NOT NULL,
|
||||
price DECIMAL(10, 2) NOT NULL,
|
||||
image_url VARCHAR(255) NOT NULL,
|
||||
is_featured BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
@ -1,8 +0,0 @@
|
||||
TRUNCATE TABLE products;
|
||||
INSERT INTO products (name, category, price, image_url) VALUES
|
||||
('Classic Oxford Shoes', 'Footwear', 199.99, 'https://images.pexels.com/photos/267320/pexels-photo-267320.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1'),
|
||||
('Modern Charcoal Suit', 'Suits', 499.99, 'https://images.pexels.com/photos/1884584/pexels-photo-1884584.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1'),
|
||||
('Leather Loafers', 'Footwear', 149.99, 'https://images.pexels.com/photos/1619690/pexels-photo-1619690.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1'),
|
||||
('Navy Blue Tuxedo', 'Suits', 699.99, 'https://images.pexels.com/photos/325876/pexels-photo-325876.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1'),
|
||||
('Suede Derby Shoes', 'Footwear', 179.99, 'https://images.pexels.com/photos/4252950/pexels-photo-4252950.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1'),
|
||||
('Beige Linen Suit', 'Suits', 399.99, 'https://images.pexels.com/photos/6764033/pexels-photo-6764033.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1');
|
||||
272
index.php
272
index.php
@ -1,138 +1,150 @@
|
||||
<?php
|
||||
require_once 'db/config.php';
|
||||
declare(strict_types=1);
|
||||
@ini_set('display_errors', '1');
|
||||
@error_reporting(E_ALL);
|
||||
@date_default_timezone_set('UTC');
|
||||
|
||||
// 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.
|
||||
}
|
||||
$phpVersion = PHP_VERSION;
|
||||
$now = date('Y-m-d H:i:s');
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<!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(); ?>">
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>New Style</title>
|
||||
<?php
|
||||
// Read project preview data from environment
|
||||
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
|
||||
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
||||
?>
|
||||
<?php if ($projectDescription): ?>
|
||||
<!-- Meta description -->
|
||||
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
|
||||
<!-- Open Graph meta tags -->
|
||||
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||
<!-- Twitter meta tags -->
|
||||
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||
<?php endif; ?>
|
||||
<?php if ($projectImageUrl): ?>
|
||||
<!-- Open Graph image -->
|
||||
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||
<!-- Twitter image -->
|
||||
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||
<?php endif; ?>
|
||||
<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;700&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
:root {
|
||||
--bg-color-start: #6a11cb;
|
||||
--bg-color-end: #2575fc;
|
||||
--text-color: #ffffff;
|
||||
--card-bg-color: rgba(255, 255, 255, 0.01);
|
||||
--card-border-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Inter', sans-serif;
|
||||
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
||||
color: var(--text-color);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
body::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
|
||||
animation: bg-pan 20s linear infinite;
|
||||
z-index: -1;
|
||||
}
|
||||
@keyframes bg-pan {
|
||||
0% { background-position: 0% 0%; }
|
||||
100% { background-position: 100% 100%; }
|
||||
}
|
||||
main {
|
||||
padding: 2rem;
|
||||
}
|
||||
.card {
|
||||
background: var(--card-bg-color);
|
||||
border: 1px solid var(--card-border-color);
|
||||
border-radius: 16px;
|
||||
padding: 2rem;
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.loader {
|
||||
margin: 1.25rem auto 1.25rem;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border: 3px solid rgba(255, 255, 255, 0.25);
|
||||
border-top-color: #fff;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
@keyframes spin {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
.hint {
|
||||
opacity: 0.9;
|
||||
}
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px; height: 1px;
|
||||
padding: 0; margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap; border: 0;
|
||||
}
|
||||
h1 {
|
||||
font-size: 3rem;
|
||||
font-weight: 700;
|
||||
margin: 0 0 1rem;
|
||||
letter-spacing: -1px;
|
||||
}
|
||||
p {
|
||||
margin: 0.5rem 0;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
code {
|
||||
background: rgba(0,0,0,0.2);
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
}
|
||||
footer {
|
||||
position: absolute;
|
||||
bottom: 1rem;
|
||||
font-size: 0.8rem;
|
||||
opacity: 0.7;
|
||||
}
|
||||
</style>
|
||||
</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">© <?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>
|
||||
<main>
|
||||
<div class="card">
|
||||
<h1>Analyzing your requirements and generating your website…</h1>
|
||||
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
||||
<span class="sr-only">Loading…</span>
|
||||
</div>
|
||||
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
|
||||
<p class="hint">This page will update automatically as the plan is implemented.</p>
|
||||
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
|
||||
</div>
|
||||
</main>
|
||||
<footer>
|
||||
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
68
install.php
68
install.php
@ -1,68 +0,0 @@
|
||||
<?php
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
require_once 'db/config.php';
|
||||
|
||||
$message = '';
|
||||
|
||||
try {
|
||||
// 1. Connect to MySQL server without specifying a database
|
||||
$pdo_admin = new PDO('mysql:host='.DB_HOST.';charset=utf8mb4', DB_USER, DB_PASS, [
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
]);
|
||||
$message .= "MySQL server connection successful.<br>";
|
||||
|
||||
// 2. Create the database if it doesn't exist
|
||||
$pdo_admin->exec("CREATE DATABASE IF NOT EXISTS `".DB_NAME."`");
|
||||
$message .= "Database `".DB_NAME."` created or already exists.<br>";
|
||||
|
||||
// 3. Now, connect to the specific database using the existing db() function
|
||||
$pdo = db();
|
||||
$message .= "Database `".DB_NAME."` connection successful.<br>";
|
||||
|
||||
// 4. Execute 001_create_products_table.sql
|
||||
$sql_create = file_get_contents('db/migrations/001_create_products_table.sql');
|
||||
if ($sql_create === false) {
|
||||
throw new Exception("Could not read migration file: 001_create_products_table.sql");
|
||||
}
|
||||
$pdo->exec($sql_create);
|
||||
$message .= "`products` table created successfully.<br>";
|
||||
|
||||
// 5. Execute 002_seed_products.sql
|
||||
$sql_seed = file_get_contents('db/migrations/002_seed_products.sql');
|
||||
if ($sql_seed === false) {
|
||||
throw new Exception("Could not read migration file: 002_seed_products.sql");
|
||||
}
|
||||
$pdo->exec($sql_seed);
|
||||
$message .= "`products` table seeded with sample data.<br>";
|
||||
|
||||
$message .= "<br><strong>Installation complete!</strong> You can now <a href='index.php'>go to the homepage</a>.";
|
||||
|
||||
} catch (Exception $e) {
|
||||
http_response_code(500);
|
||||
$message = "An error occurred: " . $e->getMessage();
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Installation</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<style>
|
||||
body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background-color: #f8f9fa; }
|
||||
.card { max-width: 600px; width: 100%; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="card">
|
||||
<div class="card-header">Database Setup</div>
|
||||
<div class="card-body">
|
||||
<p class="card-text"><?php echo $message; ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,103 +0,0 @@
|
||||
<?php
|
||||
require_once 'db/config.php';
|
||||
|
||||
$product = null;
|
||||
$error_message = null;
|
||||
$slug = $_GET['slug'] ?? null;
|
||||
|
||||
if (!$slug) {
|
||||
header("Location: products.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
try {
|
||||
$pdo = db();
|
||||
$stmt = $pdo->prepare('SELECT * FROM products WHERE slug = :slug');
|
||||
$stmt->bindParam(':slug', $slug, PDO::PARAM_STR);
|
||||
$stmt->execute();
|
||||
$product = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if (!$product) {
|
||||
http_response_code(404);
|
||||
$error_message = "Product not found.";
|
||||
}
|
||||
|
||||
} catch (PDOException $e) {
|
||||
$error_message = "Database error: " . $e->getMessage();
|
||||
}
|
||||
|
||||
function format_price($price) {
|
||||
return 'đ' . number_format($price, 0, ',', '.');
|
||||
}
|
||||
|
||||
$page_title = $product ? $product['name'] : 'Product Not Found';
|
||||
$meta_description = $product ? htmlspecialchars($product['description']) : 'The requested product could not be found.';
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title><?php echo htmlspecialchars($page_title); ?> - bconcept</title>
|
||||
<meta name="description" content="<?php echo $meta_description; ?>">
|
||||
<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=Playfair+Display:wght@700&family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
</head>
|
||||
<body>
|
||||
<div class="site-container">
|
||||
<header class="site-header">
|
||||
<div class="container">
|
||||
<div class="header-content">
|
||||
<a href="index.php" class="logo">bconcept</a>
|
||||
<nav class="main-nav">
|
||||
<ul>
|
||||
<li><a href="index.php">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>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="site-content">
|
||||
<div class="container">
|
||||
<?php if ($error_message): ?>
|
||||
<div class="notice notice-error" style="margin-top: 2rem;"><?php echo $error_message; ?></div>
|
||||
<?php elseif ($product): ?>
|
||||
<div class="product-detail-layout">
|
||||
<div class="product-detail-images">
|
||||
<img src="<?php echo htmlspecialchars($product['image_url']); ?>" alt="<?php echo htmlspecialchars($product['name']); ?>" class="main-product-image">
|
||||
</div>
|
||||
<div class="product-detail-info">
|
||||
<h1 class="product-title"><?php echo htmlspecialchars($product['name']); ?></h1>
|
||||
<p class="product-price-detail"><?php echo format_price($product['price']); ?></p>
|
||||
<div class="product-description">
|
||||
<?php echo nl2br(htmlspecialchars($product['description'])); ?>
|
||||
</div>
|
||||
<form class="add-to-cart-form">
|
||||
<div class="quantity-selector">
|
||||
<label for="quantity">Quantity:</label>
|
||||
<input type="number" id="quantity" name="quantity" value="1" min="1" class="quantity-input">
|
||||
</div>
|
||||
<button type="submit" class="btn-primary">Add to Cart</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer class="site-footer">
|
||||
<div class="container">
|
||||
<p>© <?php echo date('Y'); ?> bconcept. All Rights Reserved.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
||||
</body>
|
||||
</html>
|
||||
99
products.php
99
products.php
@ -1,99 +0,0 @@
|
||||
<?php
|
||||
require_once 'db/config.php';
|
||||
|
||||
$products = [];
|
||||
$error_message = null;
|
||||
|
||||
try {
|
||||
$pdo = db();
|
||||
$stmt = $pdo->query('SELECT id, name, price, image_url, slug FROM products ORDER BY created_at DESC');
|
||||
if ($stmt) {
|
||||
$products = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
// If the table doesn't exist, it's not a fatal error for the page load.
|
||||
if ($e->getCode() === '42S02') {
|
||||
$error_message = "The products table is not available. Please run the installer.";
|
||||
} else {
|
||||
$error_message = "An error occurred: " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
function format_price($price) {
|
||||
return 'đ' . number_format($price, 0, ',', '.');
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>All Products - bconcept</title>
|
||||
<meta name="description" content="Browse our full collection of high-quality men's formal wear and footwear.">
|
||||
<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=Playfair+Display:wght@700&family=Inter:wght@400;500&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
</head>
|
||||
<body>
|
||||
<div class="site-container">
|
||||
<header class="site-header">
|
||||
<div class="container">
|
||||
<div class="header-content">
|
||||
<a href="index.php" class="logo">bconcept</a>
|
||||
<nav class="main-nav">
|
||||
<ul>
|
||||
<li><a href="index.php">Home</a></li>
|
||||
<li><a href="products.php" class="active">All Products</a></li>
|
||||
<li><a href="#">About</a></li>
|
||||
<li><a href="#">Contact</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="site-content">
|
||||
<section class="hero-small">
|
||||
<div class="container">
|
||||
<h1>All Products</h1>
|
||||
<p>Discover our curated collection of timeless pieces.</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="product-grid-section">
|
||||
<div class="container">
|
||||
<?php if ($error_message): ?>
|
||||
<div class="notice notice-error"><?php echo htmlspecialchars($error_message); ?></div>
|
||||
<?php elseif (empty($products)): ?>
|
||||
<div class="notice">No products are currently available.</div>
|
||||
<?php else: ?>
|
||||
<div class="product-grid">
|
||||
<?php foreach ($products as $product): ?>
|
||||
<div class="product-card">
|
||||
<a href="product-detail.php?slug=<?php echo htmlspecialchars($product['slug']); ?>" class="product-card-link">
|
||||
<div class="product-image-wrapper">
|
||||
<img src="<?php echo htmlspecialchars($product['image_url']); ?>" alt="<?php echo htmlspecialchars($product['name']); ?>" class="product-image">
|
||||
</div>
|
||||
<div class="product-info">
|
||||
<h3 class="product-name"><?php echo htmlspecialchars($product['name']); ?></h3>
|
||||
<p class="product-price"><?php echo format_price($product['price']); ?></p>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<footer class="site-footer">
|
||||
<div class="container">
|
||||
<p>© <?php echo date('Y'); ?> bconcept. All Rights Reserved.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user