Exemple #1
0
     $ajoutPanier = new Panier();
     if ($_SESSION['numcom']) {
         $ajoutPanier->numcom = $_SESSION['numcom'];
     }
     for ($i = 0; $i < 1; $i++) {
         $ajoutPanier->ajouterArticle($numdoc, "Achat documentation", $textQte, $laDoc->reference, $laDoc->tarif, 0);
     }
     if (!$_SESSION['numcom']) {
         $_SESSION['numcom'] = $ajoutPanier->numcom;
     }
 } else {
     if ($supArt) {
         // On supprime un article du panier
         $supPanier = new Panier();
         $supPanier->numdetail = $supArt;
         $supPanier->supprimerArticle();
     } else {
         if ($action == "maj") {
             //on met à jour la quantité d'articles dans le panier
             $modifPanier = new Panier();
             $modifPanier->numcom = $_SESSION['numcom'];
             $list_art = $modifPanier->listerArticles();
             for ($i = 0; $i < count($list_art); $i++) {
                 $article = $list_art[$i];
                 $modifQte = "textQte" . $article["numdetail"];
                 $modifPanier->numdetail = $article["numdetail"];
                 $modifPanier->miseAJourQteArticle(${$modifQte});
             }
             $mes = "Votre panier a été mis à jour";
         } else {
             if ($action == "confirmerCom") {