-
Notifications
You must be signed in to change notification settings - Fork 0
/
product_details.php
338 lines (312 loc) · 11 KB
/
product_details.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
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<!--connection file -->
<?php
include('includee/connection.php');
include('functions/common_function.php');
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>
ecommerce webisite</title>
<!-- bootstrap css link-->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<!-- fontsome link -->
<script src="https://kit.fontawesome.com/1320ab3d4e.js" crossorigin="anonymous"></script>
<!--css file -->
<link rel="stylesheet" href="style.css">
<style>
.card-img-top{
width:100%;
height:200px;
object-fit:contain;
}
</style>
</head>
<body>
<!--navbar-->
<div class="container-fluid p-0">
<!--first child -->
<nav class="navbar navbar-expand-lg navbar-light bg-info">
<div class="container-fluid">
<!--<img src="image/logo2.png" alt="" class="logo">--><h1 style="display:inline-flex;background:#fff"><span style="font-size:16px;"><i>F</i></span><span style="font-size:23px;color:#ff004f">Mart</span></h1>
<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">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="index.php">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="display_all.php">Products</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Register</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Contact</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#"><i class="fa-solid fa-cart-shopping"></i>
<sup>1</sup></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Total price:100/-</a>
</li>
</ul>
<form class="d-flex" action="search_product.php" method="get">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search" name="search_data">
<input type="submit" value="search" class="btn btn-outline-light" name="search_data_product">
</form>
</div>
</div>
</nav>
<!--second child -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<ul class="navbar-nav me-auto">
<!--- <li class="nav-item">
<a class="nav-link" href="#">Welcome Guest</a>
</li>-->
<?php
if(!isset($_SESSION['username'])){
echo "<li class='nav-item'>
<a class='nav-link' href='#'>Welcome Guest</a>
</li>";
}
else{
echo "<li class='nav-item'>
<a class='nav-link' href='#'>".$_SESSION['username']."</a>
</li>";
}
if(!isset($_SESSION['username'])){
echo "<li class='nav-item'>
<a class='nav-link' href='./user_area/user_login.php'>login</a>
</li>";
}
else{
echo "<li class='nav-item'>
<a class='nav-link' href='./user_area/user_logout.php'>Logout</a>
</li>";
}
?>
<!--
<li class="nav-item">
<a class="nav-link" href="#">login</a>
</li>-->
</ul >
</nav>
<!--third child -->
<div class="bg-light">
<h3 class="text-center">
Hidden store
</h3>
<p class="text-center">
communication is at the heart of e-commerce and community
</p>
</div>
<!--fourth child -->
<div class="row" >
<div class="col-md-10">
<!--product -->
<div class="row">
<!---------------------------fetching products---------------------------->
<?php
//calling functions
//getproducts();
getuniquecate();
getuniquebrands();
/*<$select_query="select * from `products` order by rand()";
$result_query=mysqli_query($con,$select_query);
$row=mysqli_fetch_assoc($result_query);
echo $row['product_title'];
while($row=mysqli_fetch_assoc($result_query)){
$product_id=$row['product_id'];
$product_title=$row['product_title'];
$product_description=$row['product_description'];
$product_keywords=$row['product_keywords'];
$product_image1=$row['product_image1'];
$product_price=$row['product_price'];
$category_id=$row['category_id'];
$brand_id=$row['brand_id'];
echo "<div class='col-md-4'>
<div class='card' style='width: 18rem;'>
<img src='./admin_area/product_images/$product_image1' class='card-img-top' alt='...'>
<div class='card-body'>
<h5 class='card-title'> $product_title</h5>
<p class='card-text'> $product_description</p>
<a href='#' class='btn btn-info'>Add to cart</a>
<a href='#' class='btn btn-secondary'>View more</a>
</div>
</div>
</div>";
}*/
?>
<!--<div class="col-md-4 ">
<div class="card" style="width: 18rem;">
<img src="image/strawberry.png" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-info">Add to cart</a>
<a href="#" class="btn btn-secondary">View more</a>
</div>
</div>
</div>-->
<!--
<div class="col-md-4">
<div class="card" style="width: 18rem">
<img src="image/tomato.png" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-info">Add to cart</a>
<a href="#" class="btn btn-secondary">View more</a>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card" style="width: 18rem;">
<img src="image/strawberry.png" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-info">Add to cart</a>
<a href="#" class="btn btn-secondary">View more</a>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card" style="width: 18rem;">
<img src="image/strawberry.png" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-info">Add to cart</a>
<a href="#" class="btn btn-secondary">View more</a>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card" style="width: 18rem;">
<img src="image/strawberry.png" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-info">Add to cart</a>
<a href="#" class="btn btn-secondary">View more</a>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card" style="width: 18rem;">
<img src="image/strawberry.png" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-info">Add to cart</a>
<a href="#" class="btn btn-secondary">View more</a>
</div>
</div>
</div>-->
<!------------------------row_ended div--------------------------------->
</div>
<!------------------------column_ended div--------------------------------->
</div>
<div class="col-md-2 bg-secondary p-0">
<!--sidenav -->
<ul class="navbar-nav me-auto text-center">
<li class="nav-item bg-info ">
<a href="#" class="nav-link text-light">Delivery brands</a>
</li>
<?php
// function calling
brands();
/*$select_brands="select * from `brands`";
$result=mysqli_query($con,$select_brands);
//$row_data=mysqli_fetch_assoc($result);
//echo $row_data['brand_title'];
while($row_data=mysqli_fetch_assoc($result)){
$brand_title=$row_data['brand_title'];
$brand_id=$row_data['brand_id'];
//echo $brand_title;
echo "<li class='nav-item '>
<a href='index.php?brand=$brand_id' class='nav-link text-light'>$brand_title</a>
</li>";
}*/
?>
<!--<li class="nav-item ">
<a href="#" class="nav-link text-light">Brand1</a>
</li>
<li class="nav-item ">
<a href="#" class="nav-link text-light">Brand2</a>
</li>
<li class="nav-item ">
<a href="#" class="nav-link text-light">Brand3</a>
</li>
<li class="nav-item ">
<a href="#" class="nav-link text-light">Brand4</a>
</li>
<li class="nav-item ">
<a href="#" class="nav-link text-light">Brand5</a>
</li>-->
</ul>
<!--catogries -->
<ul class="navbar-nav me-auto text-center">
<li class="nav-item bg-info ">
<a href="#" class="nav-link text-light">Categories
</a>
</li>
<?php
//function calling
categories();
/*$select_cats="select * from `categories`";
$result=mysqli_query($con,$select_cats);
//$row_data=mysqli_fetch_assoc($result);
//echo $row_data['category_title'];
while($row_data=mysqli_fetch_assoc($result)){
$cat_title=$row_data['category_title'];
$cat_id=$row_data['category_id'];
//echo $cat_title;
echo "<li class='nav-item '>
<a href='index.php?cat=$cat_id' class='nav-link text-light'>$cat_title</a>
</li>";
}*/
?>
<!--
<li class="nav-item ">
<a href="#" class="nav-link text-light">Categories1</a>
</li>
<li class="nav-item ">
<a href="#" class="nav-link text-light">Categories2</a>
</li>
<li class="nav-item ">
<a href="#" class="nav-link text-light">Categories3</a>
</li>
<li class="nav-item ">
<a href="#" class="nav-link text-light">Categories4</a>
</li>
<li class="nav-item ">
<a href="#" class="nav-link text-light">Categoreis5</a>
</li>
-->
</ul>
</div>
</div>
<!--last child -->
<!--include footer-->
<?php include("./includee/footer.php") ?>
<!--
<div class="bg-info p-0 text-center">
<p>
All right reserved 0- Designed by Anjali-2023
</p>
</div>-->
</div>
<!-- bootstrap js link -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
</body>
</html>