-
Notifications
You must be signed in to change notification settings - Fork 0
/
edison.php
478 lines (445 loc) · 23.8 KB
/
edison.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
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
<?php
session_start();
require_once('config.php');
include("function.php");
?>
<?php
//$brand = strtolower($_GET["brand"]);
//$cmd_extra = "AND lower(b.name)='".$brand."'";
$cmd = "SELECT product_warna_id, concat(m.nama_merk,' ',p.nama_product,' ',warna) as 'judul_barang',harga_jual as 'harga_barang', stok
FROM product_warna pw, product p,warna w,merk m
WHERE pw.product_id=p.product_id and pw.warna_id=w.warna_id and p.merk_id=m.merk_id and m.nama_merk='Edison'";
$all_result = mysqli_query($con,$cmd) or die(mysqli_error($con));
$count_all_item = mysqli_num_rows($all_result);
$max_item = 12; //Max item in one page
$page = isset($_GET['page'])? (int)$_GET["page"]:1; //contoh IF INLINE
//echo $page;
$start = ($page>1) ? (($page * $max_item) - $max_item) : 0; //contoh IF INLINE
//echo $start;
$cmd = $cmd." LIMIT $start, $max_item";
//echo $cmd;
$limit_result = mysqli_query($con,$cmd) or die(mysqli_error($con));
$count_pages = ceil($count_all_item / $max_item);
$products = null;
if ($count_all_item >= 1){
while($row = mysqli_fetch_assoc($limit_result)) {
$products[] = $row;
}
}
//True Type
//$brand_truetype = "";
//$cmd2 = "SELECT m.nama_merk FROM merk m WHERE lower(m.nama_merk) = '$brand'";
//$cmd2 = "SELECT m.nama_merk FROM merk m WHERE lower(m.nama_merk) = '$brand'";
//$temp_result = mysqli_query($con,$cmd2) or die(mysqli_error($con));
// $total_item = mysqli_num_rows($temp_result);
/*if ($total_item ==1){
//BACA: https://stackoverflow.com/questions/10605456/selecting-one-row-from-mysql-query-php
$item = mysqli_fetch_assoc($temp_result);
//$brand_truetype = $item['name'];
}*/
?>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<!-- Bootstrap core CSS -->
<link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/FONTAWESOME/css/all.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="assets/css/simple-sidebar.css" rel="stylesheet">
<link href="assets/css/shop-homepage.css" rel="stylesheet">
<link href="assets/css/headerfooter.css" rel="stylesheet">
<link href="assets/css/itemcard.css" rel="stylesheet">
<link href="assets/css/products.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<title> Toko JamQ Products </title>
</head>
<body>
<div class="d-flex" id="wrapper">
<!-- Sidebar -->
<div class="bg-light border-right" id="sidebar-wrapper">
<div class="sidebar-heading"> <img src="assets/img/q hitam.png"> </div>
<div class="list-group list-group-flush">
<!--<a href="#" class="list-group-item list-group-item-action bg-light">Products</a>-->
<button class="dropdown-btn list-group-item list-group-item-action bg-light"
style="background-color: transparent; border: 0;">
<a href="product.php">Products</a>
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-container">
<ul class="link-list">
<li><a href="pioneer.php">Pioneer</a></li><br>
<li><a href="estiloren.php">Esti Loren</a></li><br>
<li><a href="asako.php">Asako</a></li><br>
<li><a href="pagol.php">Pagol</a></li><br>
<li><a href="edison.php">Edison</a></li><br>
</ul>
</div>
<a href="privacy policy.php" class="list-group-item list-group-item-action bg-light">Privacy Policy</a>
<a href="tnc.php" class="list-group-item list-group-item-action bg-light">Terms and Condition</a>
<a href="faq.php" class="list-group-item list-group-item-action bg-light">FAQ</a>
<a href="contact.php" class="list-group-item list-group-item-action bg-light">Contact Us</a>
</div>
</div>
<!-- /#sidebar-wrapper -->
<!-- Page Content -->
<div id="page-content-wrapper">
<nav class="navbar navbar-expand-lg navbar-light border-bottom">
<!--button sidebar-->
<button class="btn btn-primary" id="menu-toggle"
style="background-color: transparent; color: white; border: none; font-size: 150%;">
<i class="fas fa-bars"></i></button>
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<!--logo-->
<a href="index.php" class="col-md-3"><img src="assets/img/logo.png" style="width: 100%;"></a>
<!--SEARCH BAR-->
<!-- Load icon library -->
<!--<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">-->
<!-- The form 2-->
<form class="example col-md-6" action="product.php" method="GET">
<input type="text" placeholder="Search.." name="search">
<button type="submit"><i class="fa fa-search" style="font-size: 130%;"></i></button>
</form>
<!--SEARCH BAR-->
<!--header-->
<div class="collapse navbar-collapse" id="navbarSupportedContent" style="flex-grow: 0;">
<ul class="navbar-nav ml-auto mt-2 mt-lg-0">
<li class="nav-item">
<a class="nav-link" href="cart.php" style="color: white; font-size: 150%;"><i
class="fas fa-shopping-cart"></i></a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
style="color: white;font-size: 150%;">
<i class="fas fa-user"></i>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown"
style="text-align: center;">
<?php
isloggedin($con);
?>
</div>
</li>
</ul>
</div>
</nav>
<!--<!- -products woee-->
<div class="container"
style="padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto;">
<div class='row col-md-12'>
<h1>Products > Edison</h1>
</div>
<!--PRODUK CARD-->
<div class='row' style='margin:0px auto;'>
<?php
foreach($products as $product){
$id = $product['product_warna_id'];
?>
<div class="col-lg-3 col-md-3 mb-4">
<div class="card h-100">
<a href= "detail product.php?id=<?php echo $id; ?>"><img class="card-img-top" src="assets/img/products/<?php echo $id; ?>.jpg"
alt=""></a>
<div class="card-body">
<h4 class="card-title">
<a href="detail product.php?id=<?php echo $id; ?>"><?php echo $product['judul_barang']; ?> </a>
</h4>
<h5>Rp. <?php
$price = $product['harga_barang'];
echo number_format($price,2);
?></h5>
</div>
<div class="card-footer middle" style="background-color: white;">
<form action="action_cart.php" method="GET">
<input type="number" name="qty" value="1" min="1" max="<?=$product['stok']?>" placeholder="stok" required>
<!-- <a href="cart.php"><button type="button" class="item-card-button"><i class="fas fa-cart-plus"></i></button></a>
<button type="submit" class="item-card-button"><i class="fas fa-cart-plus"></i></button> -->
<input type="hidden" name="id" value="<?php echo $id ?>">
<button type="submit" class="item-card-button"><i class="fas fa-cart-plus"></i></button>
</form>
</div>
</div>
</div>
<?php } ?>
</div>
<div class='row text-center'>
<div class="btn-group">
<?php
if ($page>1){
$prev_page = $page-1;
//echo "Prev: ".$prev_page;
?>
<a href='edison.php?page=<?php echo $prev_page; ?>' class="btn btn-default" title='Previous'>
<i class='glyphicon glyphicon-chevron-left'></i>
Previous
</a>
<?php } ?>
<?php
for ($i=1; $i<=$count_pages; $i++){
$flag_class = "";
if ($page==$i){
$flag_class = "active";
}
/*if($i==1){
echo "<a href='product.php?brand=$brand&page=$i' class='btn btn-default $flag_class' title='First'>$i</a>";
} else if($i==$count_pages) {
echo "<a href='product.php?brand=$brand&page=$i' class='btn btn-default $flag_class' title='Last'>$i</a>";
} else {
echo "<a href='product.php?brand=$brand&page=$i' class='btn btn-default $flag_class' title='Page $i'>$i</a>";
}*/
if($i==1){
echo "<a href='edison.php?page=$i' class='btn btn-default $flag_class' title='First'>$i</a>";
} else if($i==$count_pages) {
echo "<a href='edison.php?page=$i' class='btn btn-default $flag_class' title='Last'>$i</a>";
} else {
echo "<a href='edison.php?page=$i' class='btn btn-default $flag_class' title='Page $i'>$i</a>";
}
}
?>
<?php
if ($page<$count_pages){
$next_page = $page+1;
//echo "Next: ".$next_page;
echo "<a href='edison.php?page=$next_page' class='btn btn-default' title='Next'>
Next
<i class='glyphicon glyphicon-chevron-right'></i>
</a>";
}
?>
</div>
<?php
echo "<p> </p>";
// echo "Brand = ".$brand_truetype."<br/>";
/*echo "Current Page = ".$page."<br/>";
echo "Next Page = ".$next_page."<br/>";
echo "Prev Page = ".$prev_page."<br/>";*/
?>
</div>
</div>
<script>
$(document).ready(function () {
//alert('ready');
});
/*extra*/
</script>
<!-- <h1>Products > Pioneer</h1>
<div class="row">
<div class="col-lg-3 col-md-3 mb-4">
<div class="card h-100">
<a href="#"><img class="card-img-top" src="assets/img/pioneer/2110.png" alt=""></a>
<div class="card-body">
<h4 class="card-title">
<a href="detail product.html">Pioneer 2110 Wood Motif</a>
</h4>
<h5>Rp 65.000</h5>
</div>
<div class="card-footer middle">
<button class="item-card-button" href><i class="fas fa-heart"></i></button>
<span class="vertical-line"></span>
<button class="item-card-button"><i class="fas fa-cart-plus"></i></button>
</div>
</div>
</div> -->
<!--<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" />
<div class="container">
<h3 class="h3">shopping Demo-1 </h3>
<div class="row">
<div class="col-md-3 col-sm-6">
<div class="product-grid">
<div class="product-image">
<a href="#">
<img class="pic-1" src="http://bestjquery.com/tutorial/product-grid/demo9/images/img-1.jpg">
<img class="pic-2" src="http://bestjquery.com/tutorial/product-grid/demo9/images/img-2.jpg">
</a>
<ul class="social">
<li><a href="" data-tip="Quick View"><i class="fa fa-search"></i></a></li>
<li><a href="" data-tip="Add to Wishlist"><i class="fa fa-shopping-bag"></i></a></li>
<li><a href="" data-tip="Add to Cart"><i class="fa fa-shopping-cart"></i></a></li>
</ul>
<span class="product-new-label">Sale</span>
<span class="product-discount-label">20%</span>
</div>
<ul class="rating">
<li class="fa fa-star"></li>
<li class="fa fa-star"></li>
<li class="fa fa-star"></li>
<li class="fa fa-star"></li>
<li class="fa fa-star disable"></li>
</ul>
<div class="product-content">
<h3 class="title"><a href="#">Women's Blouse</a></h3>
<div class="price">$16.00
<span>$20.00</span>
</div>
<a class="add-to-cart" href="">+ Add To Cart</a>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="product-grid">
<div class="product-image">
<a href="#">
<img class="pic-1" src="http://bestjquery.com/tutorial/product-grid/demo9/images/img-3.jpg">
<img class="pic-2" src="http://bestjquery.com/tutorial/product-grid/demo9/images/img-4.jpg">
</a>
<ul class="social">
<li><a href="" data-tip="Quick View"><i class="fa fa-search"></i></a></li>
<li><a href="" data-tip="Add to Wishlist"><i class="fa fa-shopping-bag"></i></a></li>
<li><a href="" data-tip="Add to Cart"><i class="fa fa-shopping-cart"></i></a></li>
</ul>
<span class="product-new-label">Sale</span>
<span class="product-discount-label">50%</span>
</div>
<ul class="rating">
<li class="fa fa-star"></li>
<li class="fa fa-star"></li>
<li class="fa fa-star"></li>
<li class="fa fa-star"></li>
<li class="fa fa-star"></li>
</ul>
<div class="product-content">
<h3 class="title"><a href="#">Men's Plain Tshirt</a></h3>
<div class="price">$5.00
<span>$10.00</span>
</div>
<a class="add-to-cart" href="">+ Add To Cart</a>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="product-grid">
<div class="product-image">
<a href="#">
<img class="pic-1" src="http://bestjquery.com/tutorial/product-grid/demo9/images/img-5.jpg">
<img class="pic-2" src="http://bestjquery.com/tutorial/product-grid/demo9/images/img-6.jpg">
</a>
<ul class="social">
<li><a href="" data-tip="Quick View"><i class="fa fa-search"></i></a></li>
<li><a href="" data-tip="Add to Wishlist"><i class="fa fa-shopping-bag"></i></a></li>
<li><a href="" data-tip="Add to Cart"><i class="fa fa-shopping-cart"></i></a></li>
</ul>
<span class="product-new-label">Sale</span>
<span class="product-discount-label">50%</span>
</div>
<ul class="rating">
<li class="fa fa-star"></li>
<li class="fa fa-star"></li>
<li class="fa fa-star"></li>
<li class="fa fa-star"></li>
<li class="fa fa-star"></li>
</ul>
<div class="product-content">
<h3 class="title"><a href="#">Men's Plain Tshirt</a></h3>
<div class="price">$5.00
<span>$10.00</span>
</div>
<a class="add-to-cart" href="">+ Add To Cart</a>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="product-grid">
<div class="product-image">
<a href="#">
<img class="pic-1" src="http://bestjquery.com/tutorial/product-grid/demo9/images/img-7.jpg">
<img class="pic-2" src="http://bestjquery.com/tutorial/product-grid/demo9/images/img-8.jpg">
</a>
<ul class="social">
<li><a href="" data-tip="Quick View"><i class="fa fa-search"></i></a></li>
<li><a href="" data-tip="Add to Wishlist"><i class="fa fa-shopping-bag"></i></a></li>
<li><a href="" data-tip="Add to Cart"><i class="fa fa-shopping-cart"></i></a></li>
</ul>
<span class="product-new-label">Sale</span>
<span class="product-discount-label">50%</span>
</div>
<ul class="rating">
<li class="fa fa-star"></li>
<li class="fa fa-star"></li>
<li class="fa fa-star"></li>
<li class="fa fa-star"></li>
<li class="fa fa-star"></li>
</ul>
<div class="product-content">
<h3 class="title"><a href="#">Men's Plain Tshirt</a></h3>
<div class="price">$5.00
<span>$10.00</span>
</div>
<a class="add-to-cart" href="">+ Add To Cart</a>
</div>
</div>
</div>
</div>
</div>
<hr> -->
<!--footer kita-->
<div class="footer">
<div class="container">
<div class="row">
<div class="col-lg-2">
<p class="mb-4"><img src="assets/img/q putih.png" alt="Image" class="img-fluid"></p>
</div>
<div class="col-lg-3">
<h3 class="footer-heading"><span><a href="product.php">Our Products</a></span></h3>
<ul class="list-unstyled">
<li><a href="pioneer.php">Pioneer</a></li>
<li><a href="estiloren.php">Esti Loren</a></li>
<li><a href="asako.php">Asako</a></li>
<li><a href="pagol.php">Pagol</a></li>
<li><a href="edison.php">Edison</a></li>
</ul>
</div>
<div class="col-lg-3">
<h3 class="footer-heading"><span>Contact</span></h3>
<ul class="list-unstyled">
<li><a href="contact.php">Contact Us</a></li>
<li><a href="privacy policy.php">Privacy Policy</a></li>
<li><a href="tnc.php">Terms and Condition</a></li>
<li><a href="faq.php">FAQ</a></li>
</ul>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="copyright">
<p style="text-align:center; color:white; font-weight: 500;">Copyright TokoJamQ ©2019
All rights reserved </p>
</div>
</div>
</div>
</div>
<!-- Bootstrap core JavaScript -->
<script src="assets/vendor/jquery/jquery.min.js"></script>
<script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Menu Toggle Script -->
<script>
$("#menu-toggle").click(function (e) {
e.preventDefault();
$("#wrapper").toggleClass("toggled");
});
</script>
<script>
/* buat dropdown products
/* Loop through all dropdown buttons to toggle between hiding and showing its dropdown content - This allows the user to have multiple dropdowns without any conflict */
var dropdown = document.getElementsByClassName("dropdown-btn");
var i;
for (i = 0; i < dropdown.length; i++) {
dropdown[i].addEventListener("click", function () {
this.classList.toggle("active");
var dropdownContent = this.nextElementSibling;
if (dropdownContent.style.display === "block") {
dropdownContent.style.display = "none";
} else {
dropdownContent.style.display = "block";
}
});
}
</script>
</style>
</body>
</html>