Skip to content
Snippets Groups Projects
Commit b3ca3e83 authored by Sofiane Lasri's avatar Sofiane Lasri
Browse files

selected

parent 12eae94e
No related branches found
No related tags found
No related merge requests found
...@@ -34,8 +34,13 @@ ...@@ -34,8 +34,13 @@
<select multiple class="form-control" name="blocs[]"> <select multiple class="form-control" name="blocs[]">
<?php <?php
$items = Shop::getAllProducts(); $items = Shop::getAllProducts();
if(isset($_GET["blocs"]) && in_array($item->getId(), $_GET["blocs"])){
$selected = "selected";
}else{
$selected = "";
}
foreach($items as $item) { foreach($items as $item) {
echo '<option value="'.$item->getId().'"><i class="icon-minecraft '.$item->getCss().'"></i> '.$item->getLabel().'</option>'; echo '<option value="'.$item->getId().'" '.$selected.'><i class="icon-minecraft '.$item->getCss().'"></i> '.$item->getLabel().'</option>';
} }
?> ?>
</select> </select>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment