Exemplo n.º 1
0
 $pdf->AddPage();
 $pdf->SetTitle('Votre derniere commande: ');
 $pdf->SetFont('Arial', 'B', 16);
 $pdf->SetFillColor(255, 0, 0);
 $pdf->SetTextColor(255);
 $pdf->SetDrawColor(128, 0, 0);
 $pdf->SetLineWidth(0.3);
 $pdf->Cell(80, 10, 'Objet', 1, 0, 'L', 1);
 $pdf->Cell(80, 10, 'Prix', 1, 1, 'L', 1);
 $pdf->SetFont('Arial', '', 10);
 $pdf->SetFillColor(224, 235, 255);
 $pdf->SetTextColor(0);
 $total = 0;
 foreach ($panier as $a) {
     if ($a->getIdordinateur() != null) {
         $ordinateur = $ordinateurmanager->get($a->getIdordinateur());
         $nom = $ordinateur->getNom();
         $prix = $ordinateur->getPrix();
         if (strlen($nom) > 50) {
             $nom = substr($nom, 0, 40) . '...';
         }
         $pdf->Cell(80, 10, $nom, 1, 0, 'L', false);
         $pdf->Cell(80, 10, $prix . chr(128), 1, 0, 'L', false);
         $total += $prix;
         $pdf->Ln();
     } else {
         $piece = $piecemanager->get($a->getIdpiece());
         $nom = $piece->getNom();
         $prix = $piece->getPrix();
         if (strlen($nom) > 50) {
             $nom = substr($nom, 0, 40) . '...';
Exemplo n.º 2
0
<div class="row row-offcanvas row-offcanvas-right">

    <div class="col-xs-12">

        <div class="jumbotron">
            <div class="row">
            <?php 
if ($_GET['type'] == 'ordinateur') {
    $ordinateur = new OrdinateurDB();
    $ordinateurmanager = new OrdinateurManager($_SESSION['connexion']);
    $ordipiecmanager = new OrdiPiecManager($_SESSION['connexion']);
    $piecemanager = new PieceManager($_SESSION['connexion']);
    $ordinateur = $ordinateurmanager->get($_GET['item']);
    $title = $ordinateur->getNom();
    $pieces = $ordipiecmanager->getList($ordinateur->getId());
    $paniermanager = new PanierManager($_SESSION['connexion']);
    echo '<h1>' . $title . '</h1>';
    echo '<div class="container col-xs-12">';
    foreach ($pieces as $a) {
        $piece = $piecemanager->get($a);
        echo '<h2>' . $piece->getNom() . '</h2>';
        echo '<div>' . $piece->getDescriptif() . '</div>';
    }
    echo '
                    <h1>' . $ordinateur->getPrix() . '€</h1>';
    if (isset($_SESSION['utilisateur'])) {
        echo '<p><input class="btn btn-primary" href="?page=panier" attrordinateur="' . $ordinateur->getId() . '" attrpersonne="' . $_SESSION['utilisateur']->getId() . '" value="Ajouter au panier" id="validitemordinateur" role="button"></p>';
    }
} else {
    $piece = new PieceDB();
    $piecemanager = new PieceManager($_SESSION['connexion']);