Esempio n. 1
0
    }
});
// Get Specific Item Category
$rest->get('/category/:id', function ($id) use($rest) {
    include_once API_ROOT . "/category.inc";
    category_get($id);
});
// Add Item Category
$rest->post('/category/', function () use($rest) {
    include_once API_ROOT . "/category.inc";
    category_add();
});
// Edit Item Category
$rest->put('/category/:id', function ($id) use($rest) {
    include_once API_ROOT . "/category.inc";
    category_edit($id);
});
// Delete Item Category
$rest->delete('/category/:id', function ($id) use($rest) {
    include_once API_ROOT . "/category.inc";
    category_delete($id);
});
// ------------------------------- Item Categories -------------------------------
// ------------------------------- Tax Types -------------------------------
// Tax Types
// Get All Item Tax Types
$rest->get('/taxtypes/', function () use($rest) {
    global $req;
    include_once API_ROOT . "/taxtypes.inc";
    $page = $req->get("page");
    if ($page == null) {
Esempio n. 2
0
    $statement->execute();
    $level = $statement->fetch();
    $maxLevel = $level["max"];
    category_children(0, 1, $db_connexion);
    // niveau de départ
} catch (PDOException $e) {
    echo $e->getMessage();
}
echo "</ul>\r\n        </div>";
echo "<div class='col-md-9'>";
if (isset($_GET["id"])) {
    $categorie = category_edit($_GET["id"], $db_connexion);
    echo "<p>" . utf8_encode($categorie["nom"]) . "</p> ";
}
$statement = $db_connexion->query("SELECT * FROM produit {$where};");
$produits = $statement->fetchAll();
foreach ($produits as $produit) {
    echo "<div >\r\n          <p>" . $produit["nom"] . "</p> \r\n          <p>" . $produit["reference"] . "</p> \r\n          <p>" . $produit["prix"] . "</p> \r\n          <p>" . $produit["prixht"] . "</p> ";
    $category = category_edit($produit["id_categorie"], $db_connexion);
    echo "<p>" . utf8_encode($category["nom"]) . "</p> \r\n         <p><a href='produit.php?id=" . $produit["id_produit"] . "'>Plus d'info</a></p>\r\n         </div>";
}
echo "\r\n      ";
echo "</div>";
?>
        </div>

    </body>
</html>