-
Notifications
You must be signed in to change notification settings - Fork 0
/
catalogue_db.php
51 lines (41 loc) · 1.8 KB
/
catalogue_db.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
include('templates/header.php');
include('functions/my-functions.php');
$products_stmt = $db->prepare('SELECT * FROM products');
$products_stmt->execute();
$products = $products_stmt->fetchAll();
?>
<h1>Ma boutique</h1>
<ul class="products">
<?php foreach($products as $product): ?>
<li class="product">
<h2 class="product-title"><?php echo $product['name']; ?></h2>
<img class="img_product" src="<?php echo $product['imageUrl'] ?>" alt="emoji amex">
<p class="price_ttc">
Prix TTC :
<?php echo formatPrice($product['price']) ?>
</p>
<p class="price_ht">
Prix HT :
<?php echo formatPrice(priceExcludingTVA($product['price'])); ?>
</p>
<form action="cart.php" method="POST">
<div class="select">
<label for="quantity">Choisissez votre quantité :</label>
<select type='hidden' name="quantity" id="quantity">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
</select>
</div>
<input type="hidden" name="id" value="<?php echo $product['id']?>">
<button class="cta">Commander</button>
</form>
</li>
<?php endforeach; ?>
</ul>
<?php include('templates/footer.php'); ?>