-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhome.php
More file actions
151 lines (147 loc) · 7.88 KB
/
home.php
File metadata and controls
151 lines (147 loc) · 7.88 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<!DOCTYPE html>
<html lang="en">
<?php
session_start();
include_once './database.php';
$_SESSION["active"] = false;
$database = new Database();
$db = $database->getConnection();
$clientId=$_GET['idclient'];
$value = $db->query("SELECT * FROM client where Id=".$clientId)->fetchAll(PDO::FETCH_OBJ);
$sizeclient=sizeof($value);
if($sizeclient>0){
$_SESSION["active"] = true;
$nameClient=$value[0]->nom;
$rec = $db->query("SELECT * FROM produit ")->fetchAll(PDO::FETCH_OBJ);
$totals = sizeof($rec);
}else{
$_SESSION["active"] = false;
}
?>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>E-commerce</title>
<!-- Favicon-->
<link rel="icon" type="image/x-icon" href="./assets/favicon.ico" />
<!-- Bootstrap icons-->
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" rel="stylesheet" />
<!-- Core theme CSS (includes Bootstrap)-->
<link href="./css/styles.css" rel="stylesheet" />
<!-- Google Font: Source Sans Pro -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
<!-- Font Awesome -->
<link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="dist/css/adminlte.min.css">
</head>
<body>
<!-- Navigation-->
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container px-4 px-lg-5">
<a class="navbar-brand" href="#!">Site E-commerce</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0 ms-lg-4">
<li class="nav-item"><a class="nav-link active" aria-current="page" href="#">Home</a></li>
<li class="nav-item"><a class="nav-link" aria-current="page" href="./monpannier.php">Mon pannier</a></li>
<li class="nav-item"><a class="nav-link" aria-current="page" href="#">profile</a></li>
<li class="nav-item"><a class="nav-link" href="./login.php">Déconnexion</a></li>
</ul>
<form class="d-flex">
<button class="btn btn-outline-dark" type="submit">
<i class="bi-cart-fill me-1"></i>
Cart
<span class="badge bg-dark text-white ms-1 rounded-pill">0</span>
</button>
<?php
echo('
<h3> '.$nameClient.'</h3>
');
?>
</form>
</div>
</div>
</nav>
<!-- Header-->
<header class="bg-dark py-5">
<div class="container px-4 px-lg-5 my-5">
<div class="text-center text-white">
<h1 class="display-4 fw-bolder">Shop in style</h1>
<p class="lead fw-normal text-white-50 mb-0">With this shop hompeage </p>
</div>
</div>
</header>
<!-- Section-->
<section class="py-5">
<div class="container px-4 px-lg-5 mt-5">
<div class="row gx-4 gx-lg-5 row-cols-2 row-cols-md-3 row-cols-xl-4 justify-content-center">
<?php
for($i = 0; $i <$totals; $i++ )
{
$image=base64_encode($rec[$i]->image);
echo('
<div class="col mb-5">
<div class="card h-100">
<!-- Product image-->
<center><a href="./productdetail.php?idclient='.$clientId.'&idproduit='.$rec[$i]->id.'&idvendeur='.$rec[$i]->vendeur.'" class="lien"><img class="card-img-top" src="data:image/jpg;charset=utf8;base64,'.$image.'"style="width: 200px; height: 200px; border-radius: 10px; margin-top:10px" alt="..." /></a> </center>
<!-- Product details-->
<div class="card-body p-4">
<div class="text-center">
<!-- Product name-->
<a href="./productdetail.php?idclient='.$clientId.'&idproduit='.$rec[$i]->id.'&idvendeur='.$rec[$i]->vendeur.'"><h5 class="fw-bolder">'.$rec[$i]->nom.'</h5></a>
<!-- Product price-->
'.$rec[$i]->prix.'XAF
</div>
<div class="text-center">
Quantity
</div>
<div class="text-center">
<input class="input100" type="number" name="number" placeholder="number">
</div>
</div>
<!-- Product actions-->
<div class="card-footer p-4 pt-0 border-top-0 bg-transparent">
<center>
<div class="card-footer">
<button type="submit" class="btn btn-primary">Add to Card</button>
</div>
</center>
</div>
</div>
</div>
');
}
?>
</div>
</div>
</section>
<!-- Footer-->
<footer class="py-5 bg-dark">
<div class="container"><p class="m-0 text-center text-white">Copyright © Your Website 2022</p></div>
</footer>
<!-- Bootstrap core JS-->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
<!-- Core theme JS-->
<script src="js/scripts.js"></script>
<script src="plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="dist/js/demo.js"></script>
<script>
$(document).ready(function() {
$('.product-image-thumb').on('click', function () {
var $image_element = $(this).find('img')
$('.product-image').prop('src', $image_element.attr('src'))
$('.product-image-thumb.active').removeClass('active')
$(this).addClass('active')
})
})
</script>
</body>
</html>