/** * Fonction permettant d'ajouter des articles */ public function addArticle() { if (empty($_POST)) { require_once $_SERVER['DOCUMENT_ROOT'] . 'boutique/admin/views/ajout_article.php'; } else { $nom = htmlspecialchars($_POST['name']); $imageURL = htmlspecialchars($_POST['imageURL']); $description = htmlspecialchars($_POST['description']); $prix = htmlspecialchars($_POST['price']); $quantite = htmlspecialchars($_POST['quantity']); $id_licence = htmlspecialchars($_POST['licence']); $id_categorie = htmlspecialchars($_POST['categorie']); $id_sous_categorie = htmlspecialchars($_POST['sous_categorie']); $article = new Model_Article(); $new_article = $article->ajoutArticle($nom, $imageURL, $description, $prix, $quantite, $id_licence, $id_categorie, $id_sous_categorie); $message = 'Nouvel article ajouté !'; require_once $_SERVER['DOCUMENT_ROOT'] . 'boutique/admin/views/ajout_article.php'; } }