if (!empty($_POST[$key])) { array_push($quantites, $value); } } } } } $prixFinal = 0; for ($i = 0; $i < sizeof($quantites); $i++) { $requeteTypes->execute(array($types[$i][1])); $type = $requeteTypes->fetchAll(); foreach ($type as $t) { $t = $t['libTypeBillet']; } $requeteMatchs->execute(array($types[$i][0])); $match = $requeteMatchs->fetchAll(); foreach ($match as $m) { $m = $m['day']; } $requetePrix->execute(array($types[$i][0], $types[$i][1])); $prix = $requetePrix->fetchAll(); foreach ($prix as $p) { $p = $p['prix']; } $total = $p * $quantites[$i]; $page->appendContent("<p>{$quantites[$i]} billet(s) {$t} pour le match du {$m}. Prix : " . number_format($total, 2, ",", ".") . " €</p>"); $prixFinal += $total; } $page->appendContent("<hr>\n\t\t\t\t\t<div id='codePromo'>\n\t\t\t\t\t\t<input type='text' placeholder='Code Promo'/>\n\t\t\t\t\t\t<input type='button' value='Valider'/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div id='codeLicence'>\n\t\t\t\t\t\t<input type='text' placeholder='Code Licence'/>\n\t\t\t\t\t\t<input type='button' value='Valider'/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<hr>\n\t\t\t\t\t<p>Total : " . number_format($prixFinal, 2, ',', '.') . " €</p>"); echo $page->toHTML();