-
Notifications
You must be signed in to change notification settings - Fork 0
/
products.php
131 lines (106 loc) · 5.73 KB
/
products.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
<?php
include_once "template/header.php";
include_once "system/function.php";
$sql = "SELECT items.*, brand.name as bn FROM items INNER JOIN brand ON brand.id=items.brand_id";
$items = itemsAll($sql);
?>
<!-- background image -->
<div class="bg_image">
<!-- Breadcrumb -->
<div class="bd_crumb text-center my-crumb">
<h3 class="breadcrumb-item bc-item">All Products</h3>
</div>
</div>
<!-- Products -->
<section id="product">
<div class="product-container">
<div class="row mb-3">
<?php foreach($items as $item){
$ai_id=$item['id'];
$ai_codeno=$item['codeno'];
$ai_name=$item['name'];
$ai_photo=$item['photo'];
$ai_price=$item['price'];
$ai_discount=$item['discount'];
$ai_description=$item['description'];
$brand_id = $item['brand_id'];
$brand_name=$item['bn'];
?>
<div class="col-md-4 col-lg-3 col-xl-2 my-3 p-0 set-p">
<div class="product_card">
<div class="buy">
<button type="button" title="Add to wishlist">
<i class="far fa-heart"></i>
</button>
</div>
<div class="img-frame">
<a href="product_details.php?id=<?= $ai_id?>" class="img-frame" type="button">
<img src="admin/uploads/<?= $ai_photo ?>" class="card-img p-3" height=160 alt="...">
</a>
</div>
<div class="card-body">
<h5 class="card-title"><?= $ai_name ?><a href="brand.php?bid=<?= $brand_id ?>" class="badge bg-info logo-brand"><?php echo $brand_name; ?></a></h5>
<p class="card-text"><?= substr($ai_description, 0, 50) ?> <a href="#" class="view_btn" data-id="<?= $ai_id ?>" data-name="<?= $ai_name ?>" data-photo="<?= $ai_photo ?>" data-description="<?= $ai_description ?>"
data-price="<?= $ai_price ?>" data-discount="<?= $ai_discount ?>" data-photo="<?= $ai_photo ?>" data-codeno="<?= $ai_codeno ?>" data-bs-toggle="modal" data-bs-target="#cartModal">more...</a></p>
<div class="price">
<?php if($ai_discount) {?>
<span class="current_price"><?= $ai_discount ?> MMK</span><br>
<span class="old_price"><del><?= $ai_price ?> MMK</del></span>
<?php }else{?>
<span class="current_price"><?= $ai_price ?> MMK</span><br>
<?php } ?>
</div>
</div>
<div class="product_btn">
<button class="btn btn-danger btn-sm cart_btn addtocart" data-id="<?= $ai_id ?>" data-name="<?= $ai_name ?>" data-price="<?= $ai_price ?>" data-discount="<?= $ai_discount ?>" data-photo="<?= $ai_photo ?>" data-codeno="<?= $ai_codeno ?>" data-brand="<?= $brand_name ?>"><i class="fa fa-cart-arrow-down"></i></button>
<button class="btn btn-primary btn-sm cart_btn view_btn" data-id="<?= $ai_id ?>" data-name="<?= $ai_name ?>" data-photo="<?= $ai_photo ?>" data-description="<?= $ai_description ?>" data-price="<?= $ai_price ?>" data-discount="<?= $ai_discount ?>" data-photo="<?= $ai_photo ?>" data-codeno="<?= $ai_codeno ?>" data-brand="<?= $brand_name ?>" data-bs-toggle="modal" data-bs-target="#cartModal"><i class="fas fa-eye"></i></button>
</button>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
</section>
<!-- View Cart Modal -->
<div class="modal fade" id="cartModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered my-model">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title modal-codeno" id="exampleModalLabel"></h3>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" id="modal-div">
<div class="wrapper row">
<div class="preview col-lg-6">
<div class="image-box modal-photo"></div>
</div>
<div class="details col-lg-6">
<h3 class="product-title modal-name"></h3>
<div class="rating">
<div class="stars">
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star"></span>
<span class="fa fa-star"></span>
</div>
<span class="review-no">41 reviews</span>
</div>
<p class="product-description modal-description"></p>
<div class="price-tab"></div>
<div class="action mb-3">
<button type="button" id="addtocart" class="btn btn-primary add-to-cart addtocart"><i class="fas fa-cart-arrow-down"></i> add to cart</button>
<button type="button" id="buynow" class="btn btn-success add-to-cart buynow"><i class="fas fa-credit-card"></i> Buy now</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
include_once "template/footer.php";
?>