Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
2.3 kB
3
Indexable
<!DOCTYPE html>
<html>
<head>
  <title>Tabla de Productos</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css">
</head>
<body>
  <div class="container">
    <h1>Productos</h1>
    <div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 g-3">
      <?php
          $products = array(
            array("OldSkool Shoe", 69.99, 5, "https://images.vans.com/is/image/Vans/VN0A4BV5_195_ALT1?wid=1600&hei=1984&fmt=jpeg&qlt=90&resMode=sharp2&op_usm=0.9,1.7,8,0"),
            array("Sk8-Hi Shoe", 79.99, 8, "https://images.vans.com/is/image/Vans/VN000D5I_B8C_ALT1?wid=1600&hei=1984&fmt=jpeg&qlt=90&resMode=sharp2&op_usm=0.9,1.7,8,0"),
            array("Slip-On Shoe", 59.99, 12, "https://images.vans.com/is/image/Vans/VN000EYE_BLK_ALT1?wid=1600&hei=1984&fmt=jpeg&qlt=90&resMode=sharp2&op_usm=0.9,1.7,8,0"),
            array("Authentic Shoe", 59.99, 3, "https://images.vans.com/is/image/Vans/VN000EE3_BKA_ALT1?wid=1600&hei=1984&fmt=jpeg&qlt=90&resMode=sharp2&op_usm=0.9,1.7,8,0"),
            array("Slip-On Sandal", 54.99, 10, "https://images.vans.com/is/image/Vans/VN0005V8_50K_ALT1?wid=1600&hei=1984&fmt=jpeg&qlt=90&resMode=sharp2&op_usm=0.9,1.7,8,0")
          );

          foreach ($products as $product) {
            $item_name = $product[0];
            $price = $product[1];
            $items_available = $product[2];
            $img_url = $product[3];
      ?>
            <div class="col">
              <div class="card" style="width: 18rem;">
                  <img src="<?php echo $img_url; ?>" class="card-img-top" alt="...">
                  <div class="card-body">
                    <h5 class="card-title"><?php echo $item_name; ?></h5>
                  </div>
                  <ul class="list-group list-group-flush">
                    <li class="list-group-item"><b>Precio:</b>  <?php echo $price; ?></li>
                    <li class="list-group-item"><b>Unidades:</b> <?php echo $items_available; ?></li>
                  </ul>
                  <div class="card-body">
                    <a href="#" class="card-link">Comprar</a>
                  </div>
              </div>
            </div> 
      <?php      
          }
      ?>
    </div>
      

  </div>  
</body>
</html>