Esempio n. 1
0
 /**
  * Fonction permettant de créer des articles
  */
 public function addArticle()
 {
     if (!empty($_POST['title']) and !empty($_POST['description']) and !empty($_POST['url']) and !empty($_POST['prix']) and !empty($_POST['quantite']) and !empty($_POST['id_admin'])) {
         $errors = array();
         $nom = $_POST['title'];
         $description = $_POST['description'];
         $url = $_POST['url'];
         $prix = floatval($_POST['prix']);
         $quantite = $_POST['quantite'];
         $id_admin = $_POST['id_admin'];
         $articles = new Model_Article();
         $addArticle = $articles->createArticle($nom, $description, $url, $prix, $quantite, $id_admin, $errors);
         //header('Location: /ecommerce/admin/article/list');
     }
     require_once $_SERVER['DOCUMENT_ROOT'] . "/ecommerce/views/admin/articles/create_article.php";
 }