generated from TheMaxium69/TyroSiteFrameWork
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproducts.php
184 lines (152 loc) · 7.96 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
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
<?php include "app/app.php";
$page = 2;
head($page); ?>
<body>
<header> <?php navbar($page); ?> </header>
<?php
require_once 'panel/init.php';
require_once 'api/whmcs/connect.php';
require_once 'api/more/get.php';
$productAll = product();
$productGroupAll = productGroup();
$sizeList = [];
$productMax = 40;
$productMin = 40;
foreach ($productAll['product'] as $product) {
$sizeLisible = substr(getSize($product['pid'])['size'], 2, -2);
$sizeListProd = explode('", "', $sizeLisible);
foreach ($sizeListProd as $size) {
if (!in_array($size, $sizeList)) {
array_push($sizeList, $size);
}
}
if ($productMax < $product['pricing']['EUR']['monthly']) {
$productMax = $product['pricing']['EUR']['monthly'];
}
}
sort($sizeList);
$productMax = intval($productMax + 10);
?>
<?php if (!empty($_GET['p'])) {
$id = $_GET['p'];
productOne($id);
} else { ?>
<main>
<h1 class="text-center mt-5" id="title">Trouvez votre paire préférée</h1>
<!-- FILTRE SEARCH -->
<div class="container w-100" id="search">
<div class="cover">
<form class="flex-form">
<label for="from">
<i class="ion-location"></i>
</label>
<input class="w-100 pe-4" id="searchInput" type="search" placeholder="Recherchez un produit ...">
<div id="btn-filter" onclick="activeFilter()"><i class="fas fa-sliders-h"></i></div>
</form>
</div>
</div>
<!-- FILTRE SEARCH -->
<div>
<div id="filter" style="display: none" data-display="0">
<div class="allFilter">
<select class="form-select size" aria-label="Default select example">
<option selected>Taille</option>
<?php
foreach ($sizeList as $size) {
echo "<option value='$size'>$size</option>";
}
?>
</select>
<!-- FILTRE PRICE -->
<div class="filtrePrix">
<div class="wrapperPrice">
<div class="price-inputPrice">
<div class="fieldPrice">
<input type="number" class="input-min" value="0">
</div>
<div class="fieldPrice">
<input type="number" class="input-max" value="<?= $productMax ?>">
</div>
</div>
<div class="sliderPrice">
<div class="progress"></div>
</div>
<div class="range-inputPrice">
<input type="range" class="range-min" min="0" max="<?= $productMax ?>" value="0" step="10">
<input type="range" class="range-max" min="0" max="<?= $productMax ?>" value="<?= $productMax ?>" step="10">
</div>
</div>
</div>
<!-- / FILTRE PRICE -->
<!-- FILTRE MARQUE -->
<div class="dropdown" data-control="checkbox-dropdown">
<label class="dropdown-label">Choix des marques</label>
<div class="dropdown-list">
<a href="#" data-toggle="check-all" class="dropdown-option">
Check All
</a>
<?php foreach ($productGroupAll as $productGroup) { ?>
<label class="dropdown-option">
<input type="checkbox" name="dropdown-group" value="<?= $productGroup['name'] ?>" />
<?= $productGroup['name'] ?>
</label>
<?php } ?>
</div>
</div>
</div>
<!-- / FILTRE MARQUE -->
<!-- <div class="mt-2 w-100">
<select onchange="selectGroup(this.value)" class="form-select w-75 mx-auto" aria-label="Default select example">
<option value="0" selected>Marque</option>
<?php foreach ($productGroupAll as $productGroup) {
?>
<option value="<?= $productGroup['id'] ?>"><?= $productGroup['name'] ?></option>
<?php } ?>
</select>
</div> -->
</div>
<!-- CARD -->
<div id="cardProductAll" style="border-top-left-radius: 10px; border-top-right-radius: 10px; background: #F8F9FA; box-shadow: -2px 1px 23px -8px rgb(32, 32, 32);">
<div class="row justify-content-center" id="tableTEST" style="margin-bottom: 60px;">
<?php foreach ($productAll['product'] as $product) {
$productPicture = getPicture($product['pid']);
$productGroupName = getGroupByGid($product['gid']);
if ($product['pricing']['EUR']['monthly'] < 40) {
} else {
?>
<div <?php if ($product['paytype'] !== 'onetime') {
echo "style='display: none;'";
} ?> class="card card__one" onclick="window.location.href = '?p=<?= $product['pid'] ?>';">
<div class="product-image">
<!-- <img src="app/assets/sneakersLV.png" alt="OFF-white Red Edition" draggable="false" /> -->
<img class="card-img-top" src="api/more/uploads/<?= $productPicture['picture1'] ?>" alt="Card image cap">
</div>
<div class="product-info">
<?php
$sizeLisible = substr(getSize($product['pid'])['size'], 2, -2);
$sizeListProd = explode('", "', $sizeLisible);
foreach ($sizeListProd as $size) {
echo "<p class='sizeProdAll' style='display: none;'>$size</p>";
}
?>
<h2 class="nameSneakers"><?= $product['name'] ?></h2>
<h6 class="nameMarque marqueSneakAll"><?= $productGroupName ?></h6>
<div class="price"><span class="priceSneakAll"><?= $product['pricing']['EUR']['monthly'] ?></span> €</div>
</div>
</div>
<?php
}
} ?>
<p id="noProduct" style="display: none;">Aucun élément trouvé</p>
</div>
</div>
</section>
<!-- / CARD -->
</div>
</main>
<script src="js/filtre.js"></script>
<script src="js/products.js"></script>
<?php } ?>
<footer> <?php footer($page); ?> </footer>
</body>
</html>