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

ça y'est!

parent 525182a5
Branches
No related tags found
No related merge requests found
<?php
class Item{
private $name;
private $label;
private $price;
private $css;
private $type;
......@@ -13,15 +13,15 @@ public function __construct($item){
}else{
$this->id=$item;
}
$query = Connexion::pdo()->prepare("SELECT * FROM site_itemsAssoc WHERE name=?");
$query = Connexion::pdo()->prepare("SELECT * FROM site_itemsAssoc WHERE label=?");
$query->execute(array($this->id));
$result= $query->fetch(PDO::FETCH_ASSOC);
$this->name = $result['name'];
$this->label = $result['label'];
$this->css = $result['css'];
}
public function getName(){
return $this->name;
public function getLabel(){
return $this->label;
}
public function getPrice(){
......
......@@ -13,7 +13,6 @@ public static function getAllProducts(){
$return = array();
foreach($itemsConfig as $itemConfig){
$item = yaml_parse($itemConfig['itemConfig']);
print_r($items);
$itemAleadyEntered = false;
foreach($return as $checkItem){
......
......@@ -35,7 +35,7 @@
<?php
$items = Shop::getAllProducts();
foreach($items as $item) {
echo '<option value="'.$item->getId().'">'.$item->getName().'</option>';
echo '<option value="'.$item->getId().'">'.$item->getLabel().'</option>';
}
?>
</select>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment