function validerCommande($cnn, $idCommande) { $mntCommande = sumMntCommande($cnn, $idCommande); $req = " \n UPDATE `commande` \n SET `STATUT_COMMANDE`= 'En cours'\n , MONTANT_COMMANDE=:mntCommande\n WHERE ID_COMMANDE=:idCommande"; $stmt = $cnn->prepare($req); $stmt->bindParam(':idCommande', $idCommande); $stmt->bindParam(':mntCommande', $mntCommande); $stmt->execute(); }
<section id="content"> <div class="container_12"> <div class="grid_12"> <div class="box-shadow"> <div class="wrap block-2"> <div class="col-4"> <h2 class="p3"><span class="color-1">Paiement</span></h2> <div class="wrap box-1 top-4"> <div class="extra-wrap"> <p>Montant total à payer: <?php $idCommande = recupIdPanier($connexion, $_SESSION['idUtilisateur']); echo sumMntCommande($connexion, $idCommande); ?> € </p> </div> </div> <?php $idCommande = recupIdPanier($connexion, $_SESSION['idUtilisateur']); echo '<div class="btns"><a href="validation_commande.php?idCommande=' . $idCommande . '" class="button" >Valider la commande</a></div>'; ?> </div> </div> </div>