1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
<?php
// Formulaire envoye ? Champs Vides ?
foreach($_POST as $champs => $valeur) {
if($champs != 'cartons_vin1' AND $champs != 'cartons_vin2' AND $champs != 'cartons_vin3') {
if(!isset($valeur) OR empty($valeur)) {
echo '<script type="text/javascript">// <![CDATA[',"\n",'alert("Veuillez remplir tous les champs.");',"\n",'window.location="form.html";',"\n",'// ]]>',"\n",'</script>';
}
}
}
// Declaration des variables
$Nom = trim(strip_tags($_POST['Nom']));
$Prenom = trim(strip_tags($_POST['Prenom']));
$Email = trim(strip_tags($_POST['Email']));
$Adresse = trim(strip_tags($_POST['Adresse']));
$NbreCartons['vin1'] = trim(strip_tags($_POST['cartons_vin1']));
$NbreCartons['vin2'] = trim(strip_tags($_POST['cartons_vin2']));
$NbreCartons['vin3'] = trim(strip_tags($_POST['cartons_vin3']));
$SousTotal['vin1'] = $NbreCartons['vin1'] * 4.5;
$SousTotal['vin2'] = $NbreCartons['vin2'] * 4.5;
$SousTotal['vin3'] = $NbreCartons['vin3'] * 4.5;
$Total = $SousTotal['vin1'] + $SousTotal['vin2'] + $SousTotal['vin3'];
?>
<?php echo '<','?xml version="1.0" encoding="ISO-8859-1" ?','>',"\n"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr-FR" dir="ltr">
<head xml:lang="fr-FR" dir="ltr">
<title>
Achat de Cartons de Vin - Récapitulatif de votre Commande
</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<div id="contenu_principal">
<h3>Récapitulatif de vos Informations :</h3>
<p>Votre Nom : <strong><?php echo $Nom; ?></strong></p>
<p>Votre Prénom : <strong><?php echo $Prenom; ?></strong></p>
<p>Votre Adresse Email : <strong><?php echo $Email; ?></strong></p>
<p>Votre Adresse Postale : <strong><?php echo $Adresse; ?></strong></p>
<h3>Récapitulatif de votre Commande</h3>
<p>Vous avez commandé <?php echo ($NbreCartons['vin1'] == 1) ? "<strong>{$NbreCartons['vin1']}</strong> carton " : "{$NbreCartons['vin1']} cartons "; ?>du vin n°1, soit un total de <strong><?php echo $SousTotal['vin1']; ?></strong> €.</p>
<p>Vous avez commandé <?php echo ($NbreCartons['vin1'] == 1) ? "<strong>{$NbreCartons['vin2']}</strong> carton " : "{$NbreCartons['vin2']} cartons "; ?>du vin n°2, soit un total de <strong><?php echo $SousTotal['vin2']; ?></strong> €.</p>
<p>Vous avez commandé <?php echo ($NbreCartons['vin1'] == 1) ? "<strong>{$NbreCartons['vin3']}</strong> carton " : "{$NbreCartons['vin3']} cartons "; ?>du vin n°3, soit un total de <strong><?php echo $SousTotal['vin3']; ?></strong> €.</p>
<p style="font-weight: bold; color: #c00000;">Le total de votre commande s'élève donc à <strong><?php echo $Total; ?></strong> €.</p>
<p><a href="form.html">Modifier vos Informations</a> | <a href="javascript:print()">Imprimer cette Page</a>
</div>
</body>
</html> |
Partager