-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreview.php
40 lines (38 loc) · 1.27 KB
/
preview.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
<div class="preview">
<div class="container">
<div class="row">
<div class="col-xs-12">
<?php
$con = new mysqli('localhost', 'root', '.....', 'nanocommerce');
$sql = "SELECT * FROM products WHERE id_pro={$_GET['p']}";
$res = $con->query($sql);
$row = $res->fetch_assoc();
$img = $row['vignette_pro'];
$nom = $row['nom_pro'];
echo "
<img src='$img'><br><span class=title>$nom</span>
";
?>
<br>
<?php
if($row['promo_pro'] == 0){
echo "<span class='price'>".$row['prix_pro']." DH</span>";
}
else{
$newprice = ceil($row['prix_pro'] - ($row['prix_pro'] * $row['promo_pro']/100));
echo "<span class='price'>".$newprice." DH</span>
<span class='price-promo'><s>".$row['prix_pro']." DH</s></span>
";
}
?>
<div class="controller">
<a href="index.php?addtocart=<?php echo $row['id_pro'];?>&q=1" class="btn-action promo-action" style='text-decoration: none;'><i class="fa fa-shopping-cart"></i> Ajouter</a>
<a href="details.php?p=<?php echo $row['id_pro'];?>" class="btn-action promo-action" style='margin-left: 10px;text-decoration: none;'><i class="fa fa-file-text"></i> Voir Plus</a>
</div>
</div>
</div>
</div>
</div>
<dir class="profile">
hello world
</dir>