-
Notifications
You must be signed in to change notification settings - Fork 3
/
category.php
146 lines (119 loc) · 4.23 KB
/
category.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
<!-- -->
<?php include_once('./includes/headerNav.php'); ?>
<?php require_once './includes/topheadactions.php'; ?>
<?php require_once './includes/mobilenav.php'; ?>
<?php
// work on getting string with spaces from url
$category_ID = "";
if (isset($_GET['category'])) {
$category_ID = $_GET['category'];
}
$items = get_items_by_category_items($category_ID);
?>
<div class="overlay" data-overlay></div>
<!--
- HEADER
-->
<header>
<!-- top head action, search etc in php -->
<!-- inc/topheadactions.php -->
<?php require_once './includes/topheadactions.php'; ?>
<!-- desktop navigation -->
<!-- inc/desktopnav.php -->
<?php require_once './includes/desktopnav.php' ?>
<!-- mobile nav in php -->
<!-- inc/mobilenav.php -->
<?php require_once './includes/mobilenav.php'; ?>
</header>
<!--
- MAIN
-->
<main>
<div class="product-container">
<div class="container">
<!--
- SIDEBAR
-->
<!-- CATEGORY SIDE BAR MOBILE MENU -->
<?php require_once 'includes/categorysidebar.php' ?>
<!-- ############################# -->
<div class="product-box">
<!-- get id and url for each category and display its dat from table her in this secton -->
<div class="product-main">
<div class="product-grid">
<!-- display data from table new products -->
<?php
$new_product_counter = 1;
while ($row = mysqli_fetch_assoc($items)) {
?>
<!-- display all category products -->
<div class="showcase">
<div class="showcase-banner">
<img src="./admin/upload/<?php
echo $row['product_img']
?>" alt="Mens Winter Leathers Jackets" width="300" class="product-img default" />
<img src="./admin/upload/<?php
echo $row['product_img']
?>" alt="Mens Winter Leathers Jackets" width="300" class="product-img hover" />
<!-- Applying coditions on dicount and sale tags -->
<!-- -->
<?php
if ($new_product_counter == 1) {
?>
<p class="showcase-badge">15%</p>
<?php
}
?>
<!-- -->
<?php
if ($new_product_counter == 3) {
?>
<p class="showcase-badge angle black">sale</p>
<?php
}
?>
</div>
<div class="showcase-content">
<a href="./viewdetail.php?id=<?php echo $row['product_id'] ?>&category=<?php $row['category_id'] ?>" class="showcase-category">
<?php echo $row['product_title'] ?>
</a>
<a href="./viewdetail.php?id=<?php echo $row['product_id'] ?>&category=<?php $row['category_id'] ?>">
<h3 class="showcase-title">
<?php echo $row['product_desc'] ?>
</h3>
</a>
<div class="showcase-rating">
<ion-icon name="star"></ion-icon>
<ion-icon name="star"></ion-icon>
<ion-icon name="star"></ion-icon>
<ion-icon name="star"></ion-icon>
<ion-icon name="star"></ion-icon>
</div>
<div class="price-box">
<p class="price">
$<?php echo $row['discounted_price'] ?>
</p>
<del>
$<?php echo $row['product_price'] ?>
</del>
</div>
</div>
</div>
<?php
$new_product_counter = $new_product_counter + 1;
}
?>
<!-- -->
</div>
</div>
</div>
</div>
</div>
<!--
- TESTIMONIALS, CTA & SERVICE
-->
<!--
- BLOG
-->
</main>
<?php require_once './includes/footer.php'; ?>