/** * Fonction permettant de modifier les articles */ public function changeArticle() { if (empty($_POST)) { require_once $_SERVER['DOCUMENT_ROOT'] . '/boutique/admin/views/modif_article.php'; } else { $imageURL = htmlspecialchars($_POST['imageURL']); $nom = htmlspecialchars($_POST['name']); $description = htmlspecialchars($_POST['description']); $prix = htmlspecialchars($_POST['price']); $quantite = htmlspecialchars($_POST['quantity']); $licence = htmlspecialchars($_POST['licence']); $categorie = htmlspecialchars($_POST['categorie']); $sous_categorie = htmlspecialchars($_POST['sous_categorie']); $article_info = new Model_Article(); $article_check = $article_info->getInfo(); if (empty($imageURL)) { $imageURL = $article_check[0]['imageURL']; } if (empty($nom)) { $nom = $article_check[0]['nom']; } if (empty($description)) { $description = $article_check[0]['description']; } if (empty($prix)) { $prix = $article_check[0]['prix']; } if (empty($quantite)) { $quantite = $article_check[0]['quantite']; } if (empty($licence)) { $licence = $article_check[0]['id_licence']; } if (empty($categorie)) { $categorie = $article_check[0]['id_categorie']; } if (empty($sous_categorie)) { $sous_categorie = $article_check[0]['id_sous_categorie']; } $articleChange = new Model_Article(); $article = $articleChange->changeInfo($imageURL, $nom, $description, $prix, $quantite, $licence, $categorie, $sous_categorie); //require_once($_SERVER['DOCUMENT_ROOT']).'/boutique/views/utilisateur/profil_reussite.php'; } }