File manager - Edit - /home/webapp69.cm.in.th/u69319090039/Shop39/public/assets/app/Views/home/index.php
Back
<div class="container py-4"> <!-- Hero Banners Carousel --> <div id="heroCarousel" class="carousel slide hero-banner shadow-sm mb-5" data-bs-ride="carousel"> <div class="carousel-inner"> <div class="carousel-item active"> <div class="bg-primary text-white p-5 text-center rounded-3"> <h1 class="display-4 fw-bold mb-3">ยินดีต้อนรับสู่ Multi-Vendor Marketplace</h1> <p class="lead mb-4">แหล่งรวมสินค้าคุณภาพจากผู้ขายที่ได้รับการรับรอง ราคาดี ส่งไว ปลอดภัย 100%</p> <a href="<?= APP_URL ?>/products" class="btn btn-light btn-lg text-primary fw-bold px-4 rounded-pill">ช้อปเลยตอนนี้</a> </div> </div> </div> </div> <!-- Featured Products Section --> <div class="mb-5"> <div class="d-flex justify-content-between align-items-center mb-4"> <h4 class="fw-bold m-0"><i class="bi bi-fire text-danger me-2"></i>สินค้าแนะนำ (Featured Products)</h4> <a href="<?= APP_URL ?>/products" class="btn btn-link text-decoration-none p-0 fw-semibold">ดูสินค้าทั้งหมด <i class="bi bi-arrow-right"></i></a> </div> <div class="row g-4"> <?php foreach ($featuredProducts as $prod): ?> <?php $imgSrc = !empty($prod['primary_image']) ? APP_URL . '/public/' . ltrim($prod['primary_image'], '/') : APP_URL . '/public/assets/images/sample-headphone.jpg'; ?> <div class="col-6 col-md-4 col-lg-3"> <div class="card border-0 shadow-sm h-100 product-card"> <div class="product-img-wrapper"> <?php if ($prod['sale_price']): ?> <span class="badge bg-danger badge-sale">ลดราคา</span> <?php endif; ?> <a href="<?= APP_URL ?>/product/<?= $prod['slug'] ?>"> <img src="<?= $imgSrc ?>" alt="<?= Security::e($prod['title']) ?>" class="card-img-top" onerror="this.src='https://images.unsplash.com/photo-1505740420928-5e560c06d30e?auto=format&fit=crop&w=400&q=80'"> </a> </div> <div class="card-body d-flex flex-column"> <span class="text-secondary small mb-1"><?= Security::e($prod['category_name']) ?></span> <h6 class="card-title fw-bold text-truncate mb-2"> <a href="<?= APP_URL ?>/product/<?= $prod['slug'] ?>" class="text-decoration-none text-dark"><?= Security::e($prod['title']) ?></a> </h6> <div class="small text-muted mb-2"> <i class="bi bi-shop me-1 text-primary"></i> <a href="<?= APP_URL ?>/store/<?= Security::e($prod['shop_slug']) ?>" class="text-decoration-none text-muted hover-primary fw-semibold"><?= Security::e($prod['shop_name']) ?></a> </div> <div class="mt-auto d-flex align-items-center justify-content-between"> <div> <?php if ($prod['sale_price']): ?> <span class="fw-bold text-danger fs-5">฿<?= number_format($prod['sale_price'], 2) ?></span> <span class="text-decoration-line-through text-muted small ms-1">฿<?= number_format($prod['price'], 2) ?></span> <?php else: ?> <span class="fw-bold text-primary fs-5">฿<?= number_format($prod['price'], 2) ?></span> <?php endif; ?> </div> <div class="d-flex gap-1"> <form action="<?= APP_URL ?>/cart/add" method="POST" class="d-inline ajax-cart-form"> <input type="hidden" name="csrf_token" value="<?= $csrf_token ?>"> <input type="hidden" name="product_id" value="<?= $prod['id'] ?>"> <input type="hidden" name="quantity" value="1"> <button type="submit" class="btn btn-outline-warning btn-sm rounded-circle" title="ใส่ตะกร้า"><i class="bi bi-cart-plus"></i></button> </form> <a href="<?= APP_URL ?>/product/<?= $prod['slug'] ?>" class="btn btn-primary btn-sm rounded-circle" title="ดูรายละเอียด / สั่งซื้อ"><i class="bi bi-bag-check"></i></a> </div> </div> </div> </div> </div> <?php endforeach; ?> </div> </div> <!-- Best Sellers Section --> <div class="mb-5"> <div class="d-flex justify-content-between align-items-center mb-4"> <h4 class="fw-bold m-0"><i class="bi bi-graph-up-arrow text-success me-2"></i>สินค้าขายดี (Best Sellers)</h4> <a href="<?= APP_URL ?>/products" class="btn btn-link text-decoration-none p-0 fw-semibold">ดูเพิ่มเติม <i class="bi bi-arrow-right"></i></a> </div> <div class="row g-4"> <?php $bestSellers = array_slice($featuredProducts, 0, 4); foreach ($bestSellers as $prod): $imgSrc = !empty($prod['primary_image']) ? APP_URL . '/public/' . ltrim($prod['primary_image'], '/') : APP_URL . '/public/assets/images/sample-headphone.jpg'; ?> <div class="col-6 col-md-4 col-lg-3"> <div class="card border-0 shadow-sm h-100 product-card"> <div class="product-img-wrapper"> <?php if ($prod['sale_price']): ?> <span class="badge bg-danger badge-sale">ลดราคา</span> <?php endif; ?> <a href="<?= APP_URL ?>/product/<?= $prod['slug'] ?>"> <img src="<?= $imgSrc ?>" alt="<?= Security::e($prod['title']) ?>" class="card-img-top" onerror="this.src='https://images.unsplash.com/photo-1505740420928-5e560c06d30e?auto=format&fit=crop&w=400&q=80'"> </a> </div> <div class="card-body d-flex flex-column"> <span class="text-secondary small mb-1"><?= Security::e($prod['category_name']) ?></span> <h6 class="card-title fw-bold text-truncate mb-2"> <a href="<?= APP_URL ?>/product/<?= $prod['slug'] ?>" class="text-decoration-none text-dark"><?= Security::e($prod['title']) ?></a> </h6> <div class="small text-muted mb-2"> <i class="bi bi-shop me-1 text-primary"></i> <a href="<?= APP_URL ?>/store/<?= Security::e($prod['shop_slug']) ?>" class="text-decoration-none text-muted hover-primary fw-semibold"><?= Security::e($prod['shop_name']) ?></a> </div> <div class="mt-auto d-flex align-items-center justify-content-between"> <div> <?php if ($prod['sale_price']): ?> <span class="fw-bold text-danger fs-5">฿<?= number_format($prod['sale_price'], 2) ?></span> <span class="text-decoration-line-through text-muted small ms-1">฿<?= number_format($prod['price'], 2) ?></span> <?php else: ?> <span class="fw-bold text-primary fs-5">฿<?= number_format($prod['price'], 2) ?></span> <?php endif; ?> </div> <div class="d-flex gap-1"> <form action="<?= APP_URL ?>/cart/add" method="POST" class="d-inline ajax-cart-form"> <input type="hidden" name="csrf_token" value="<?= $csrf_token ?>"> <input type="hidden" name="product_id" value="<?= $prod['id'] ?>"> <input type="hidden" name="quantity" value="1"> <button type="submit" class="btn btn-outline-warning btn-sm rounded-circle" title="ใส่ตะกร้า"><i class="bi bi-cart-plus"></i></button> </form> <a href="<?= APP_URL ?>/product/<?= $prod['slug'] ?>" class="btn btn-primary btn-sm rounded-circle" title="ดูรายละเอียด / สั่งซื้อ"><i class="bi bi-bag-check"></i></a> </div> </div> </div> </div> </div> <?php endforeach; ?> </div> </div> <!-- New Arrivals Section --> <div class="mb-5"> <div class="d-flex justify-content-between align-items-center mb-4"> <h4 class="fw-bold m-0"><i class="bi bi-sparkles text-warning me-2"></i>สินค้าใหม่ล่าสุด (New Arrivals)</h4> <a href="<?= APP_URL ?>/products" class="btn btn-link text-decoration-none p-0 fw-semibold">ดูเพิ่มเติม <i class="bi bi-arrow-right"></i></a> </div> <div class="row g-4"> <?php $newArrivals = array_slice($featuredProducts, 4, 4); foreach ($newArrivals as $prod): $imgSrc = !empty($prod['primary_image']) ? APP_URL . '/public/' . ltrim($prod['primary_image'], '/') : APP_URL . '/public/assets/images/sample-headphone.jpg'; ?> <div class="col-6 col-md-4 col-lg-3"> <div class="card border-0 shadow-sm h-100 product-card"> <div class="product-img-wrapper"> <?php if ($prod['sale_price']): ?> <span class="badge bg-danger badge-sale">ลดราคา</span> <?php endif; ?> <a href="<?= APP_URL ?>/product/<?= $prod['slug'] ?>"> <img src="<?= $imgSrc ?>" alt="<?= Security::e($prod['title']) ?>" class="card-img-top" onerror="this.src='https://images.unsplash.com/photo-1505740420928-5e560c06d30e?auto=format&fit=crop&w=400&q=80'"> </a> </div> <div class="card-body d-flex flex-column"> <span class="text-secondary small mb-1"><?= Security::e($prod['category_name']) ?></span> <h6 class="card-title fw-bold text-truncate mb-2"> <a href="<?= APP_URL ?>/product/<?= $prod['slug'] ?>" class="text-decoration-none text-dark"><?= Security::e($prod['title']) ?></a> </h6> <div class="small text-muted mb-2"> <i class="bi bi-shop me-1 text-primary"></i> <a href="<?= APP_URL ?>/store/<?= Security::e($prod['shop_slug']) ?>" class="text-decoration-none text-muted hover-primary fw-semibold"><?= Security::e($prod['shop_name']) ?></a> </div> <div class="mt-auto d-flex align-items-center justify-content-between"> <div> <?php if ($prod['sale_price']): ?> <span class="fw-bold text-danger fs-5">฿<?= number_format($prod['sale_price'], 2) ?></span> <span class="text-decoration-line-through text-muted small ms-1">฿<?= number_format($prod['price'], 2) ?></span> <?php else: ?> <span class="fw-bold text-primary fs-5">฿<?= number_format($prod['price'], 2) ?></span> <?php endif; ?> </div> <div class="d-flex gap-1"> <form action="<?= APP_URL ?>/cart/add" method="POST" class="d-inline ajax-cart-form"> <input type="hidden" name="csrf_token" value="<?= $csrf_token ?>"> <input type="hidden" name="product_id" value="<?= $prod['id'] ?>"> <input type="hidden" name="quantity" value="1"> <button type="submit" class="btn btn-outline-warning btn-sm rounded-circle" title="ใส่ตะกร้า"><i class="bi bi-cart-plus"></i></button> </form> <a href="<?= APP_URL ?>/product/<?= $prod['slug'] ?>" class="btn btn-primary btn-sm rounded-circle" title="ดูรายละเอียด / สั่งซื้อ"><i class="bi bi-bag-check"></i></a> </div> </div> </div> </div> </div> <?php endforeach; ?> </div> </div> <!-- Category Grid Section --> <div class="category-grid-wrapper position-relative mb-5"> <div class="d-flex justify-content-between align-items-center mb-3"> <h5 class="fw-bold m-0 text-dark"><i class="bi bi-grid-3x3-gap-fill text-primary me-2"></i>หมวดหมู่สินค้า</h5> <a href="<?= APP_URL ?>/products" class="btn btn-link text-decoration-none p-0 fw-semibold text-primary">ดูหมวดหมู่ทั้งหมด <i class="bi bi-chevron-right"></i></a> </div> <?php $categoryMeta = [ 'beauty-personal-care' => ['icon' => 'bi-heart-fill', 'color' => '#ec4899', 'bg' => '#fce7f3'], 'mens-clothes' => ['icon' => 'bi-person-badge-fill', 'color' => '#2563eb', 'bg' => '#dbeafe'], 'bags' => ['icon' => 'bi-bag-fill', 'color' => '#d97706', 'bg' => '#fef3c7'], 'womens-shoes' => ['icon' => 'bi-handbag-fill', 'color' => '#f43f5e', 'bg' => '#ffe4e6'], 'watches-glasses' => ['icon' => 'bi-stopwatch-fill', 'color' => '#4f46e5', 'bg' => '#e0e7ff'], 'electronics-accessories' => ['icon' => 'bi-headphones', 'color' => '#0891b2', 'bg' => '#cffaff'], 'home-appliances' => ['icon' => 'bi-tv-fill', 'color' => '#0d9488', 'bg' => '#ccfbf1'], 'cameras' => ['icon' => 'bi-camera-fill', 'color' => '#ea580c', 'bg' => '#ffedd5'], 'baby-toys' => ['icon' => 'bi-balloon-fill', 'color' => '#059669', 'bg' => '#d1fae5'], 'pets' => ['icon' => 'bi-emoji-smile-fill', 'color' => '#d97706', 'bg' => '#fef3c7'], 'health-wellness' => ['icon' => 'bi-capsule', 'color' => '#06b6d4', 'bg' => '#cffaff'], 'womens-clothes' => ['icon' => 'bi-gender-female', 'color' => '#e11d48', 'bg' => '#ffe4e6'], 'mens-shoes' => ['icon' => 'bi-boot-fill', 'color' => '#7c3aed', 'bg' => '#ede9fe'], 'fashion-accessories' => ['icon' => 'bi-gem', 'color' => '#9333ea', 'bg' => '#f3e8ff'], 'home-living' => ['icon' => 'bi-house-door-fill', 'color' => '#65a30d', 'bg' => '#ecfccb'], 'mobile-tablets' => ['icon' => 'bi-phone-fill', 'color' => '#2563eb', 'bg' => '#dbeafe'], 'computers-laptops' => ['icon' => 'bi-laptop-fill', 'color' => '#0284c7', 'bg' => '#e0f2fe'], 'food-beverages' => ['icon' => 'bi-cup-hot-fill', 'color' => '#d97706', 'bg' => '#fef3c7'], 'sports-outdoors' => ['icon' => 'bi-dribbble', 'color' => '#0284c7', 'bg' => '#e0f2fe'], 'gaming-accessories' => ['icon' => 'bi-controller', 'color' => '#4f46e5', 'bg' => '#e0e7ff'] ]; ?> <div class="category-grid-container"> <?php $limitedCategories = array_slice($categories, 0, 8); foreach ($limitedCategories as $cat): $meta = $categoryMeta[$cat['slug']] ?? ['icon' => 'bi-tag-fill', 'color' => '#0d6efd', 'bg' => '#e7f1ff']; ?> <a href="<?= APP_URL ?>/products?category=<?= $cat['id'] ?>" class="category-box-card"> <div class="category-box-icon" style="background-color: <?= $meta['bg'] ?>; color: <?= $meta['color'] ?>;"> <i class="<?= $meta['icon'] ?>"></i> </div> <span class="category-box-title" title="<?= Security::e($cat['name']) ?>"><?= Security::e($cat['name']) ?></span> </a> <?php endforeach; ?> </div> </div> </div>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.25 |
proxy
|
phpinfo
|
Settings