Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
3.1 kB
3
Indexable
<?php require("inc/top.php") ?>

<h3 class="text-info">Tất cả sản phẩm</h3>
<div class="row gx-4 gx-lg-5 row-cols-2 row-cols-md-3 row-cols-xl-4 justify-content-center">
    <?php foreach ($mathang as $mh): ?>
        <div class="col mb-5">
        <div class="card h-100">
            <!-- Sale badge-->
            <div class="badge bg-danger text-white position-absolute" style="top: 0.5rem; right: 0.5rem">Giảm giá</div>
            <!-- Product image-->
            <!-- <img class="card-img-top" src="../images/products/m1.jpg" alt="..." /> -->
            <img class="card-img-top" src="<?php echo "../" . $mh["hinhanh"]; ?>" alt="..." />
            <!-- Product details-->
            <div class="card-body p-4">
                <div class="text-center">
                    <!-- Product name-->
                    <h5 class="fw-bolder text-info"><?php echo $mh["tenmathang"]; ?></h5>
                    <!-- Product reviews-->
                    <div class="d-flex justify-content-center small text-warning mb-2">
                        <div class="bi-star-fill"></div>
                        <div class="bi-star-fill"></div>
                        <div class="bi-star-fill"></div>
                        <div class="bi-star-fill"></div>
                        <div class="bi-star-fill"></div>
                    </div>
                    <!-- Product price-->

                    <?php
                        if($mh["giagoc"] == $mh["giaban"]) {
                            echo "<span class='text-danger fw-bolder'>";
                                echo number_format($mh["giagoc"]);
                            echo "</span>";
                        }
                        else {
                            echo "<span class='text-muted text-decoration-line-through'>";
                                echo number_format($mh["giagoc"]);
                            echo "</span>";

                            echo "<span class='text-danger fw-bolder'>";
                                echo " " . number_format($mh["giaban"]);
                            echo "</span>";
                        }
                    ?>
                </div>
            </div>
            <!-- Product actions-->
            <div class="card-footer p-4 pt-0 border-top-0 bg-transparent">
                <div class="text-center"><a class="btn btn-outline-info mt-auto" href="?action=group&id=<?php echo $d["id"]; ?>">Chọn mua</a></div>
            </div>
        </div>
        </div>
    <?php endforeach; ?>    
</div>
<ul class="pagination justify-content-center" style="margin:20px 0">
    <li class="page-item"><a class="page-link" href="#"><i class="bi bi-caret-left-fill"></i></a></li>
    <li class="page-item"><a class="page-link" href="#">1</a></li>
    <li class="page-item"><a class="page-link" href="#">2</a></li>
    <li class="page-item"><a class="page-link" href="#">3</a></li>
    <li class="page-item"><a class="page-link" href="#"><i class="bi bi-caret-right-fill"></i></a></li>
</ul>

<?php require("inc/bottom.php") ?>