<?php $pdo = new Mypdo(); $manager = new FactureManager($pdo); $clientManager = new ClientManager($pdo); if (isset($_GET['idCommande'])) { $articleManager = new ArticleManager($pdo); $resu = $manager->get($_GET['idCommande']); ?> <div class="container"> <div class="row"> <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1"> <p> Commande <?php echo $resu['commande']->getIdCommande(); ?> du <?php echo $resu['commande']->getDateCommande() . ' par ' . $clientManager->getClient($resu['commande']->getIdClient(), false)->getNom(); ?> <br/> Montant : <?php echo $resu['total']; ?> € </p> <table> <tr> <th>Nom Article</th> <th>Prix Unitaire</th> <th>Quantite</th> <th>Commentaire</th>
$db = new PDO('mysql:host=127.0.0.1; port=3307;dbname=atelier_garage', 'root', 'toor'); } catch (Exception $e) { die('Erreur : ' . $e->getMessage()); } $facture = new Facture(['prixTotal' => '']); print_r($facture); //on cree le manager $factureManager = new FactureManager($db); //print_r($factureManager); //on rajoute un facture en bdd //$factureManager->add($facture); print_r($facture); //on compte, doit retourner 1 //echo $factureManager->count(); //on test le get $facture = $factureManager->get(3); if (empty($facture)) { echo "c'est vide"; } else { print_r($facture); } //on supprime la facture //$factureManager->delete($facture); //on verifie si elle existe en bdd (doit retourner 1 si oui, 0 si non) //echo $factureManager->exists($facture); //echo $factureManager->exists($facture); //on test update $facture->setPrixTotal(150); $resultat = $factureManager->update($facture); echo (string) $resultat; ?>