- <html>
- <head>
- <title>Total de la commande</title>
- </head>
- <body>
- <h1>Commande</h1>
- <h2>Résultat</h2>
- <?
- //Creation des variables
- $harddisk= $HTTP_POST_VARS['harddisk'];
- $memocard= $HTTP_POST_VARS['memocard'];
- $proces= $HTTP_POST_VARS['proces'];
- $totalqty = 0; // Total des objets
- $totalqty = $harddisk + $memocard + $proces;
- // Si totalqty = 0 message d'erreur '
- if( $totalqty == 0 )
- {
- echo '<font color=red>';
- echo 'Vous avez rien remplis revenez à la page précédente';
- echo '</fond>';
- }
- else
- {
- if( $harddisk>0 )
- echo $harddisk.' Disque(s)<br />';
- if( $memocard>0 )
- echo $memocard.' Memoire(s) RAM<br />';
- if( $proces>0 )
- echo $proces.' Processeur(s)<br />';
-
- echo 'Produits commandés '.$totalqty.'<br />';
- }
-
- $totalamount = 0.00;
- // Definit les variables
- define('HDPRICE', 75);
- define('MEMOPRICE', 85);
- define('PROCESPRICE', 200);
- // là c'est des maths
- $totalamount = $harddisk * HDPRICE
- + $memocard * MEMOPRICE
- + $proces * PROCESPRICE;
- // number format va definir les format approprié au resultat
- echo 'Total HT '.number_format($totalamount,3).'? <br />';
-
- $taxerate = 0.196; // Taxe 19.6%
- $totalamount = $totalamount * (1 + $taxerate);
- echo 'Montant TTC '.number_format($totalamount,2).'? <br />';
- ?>
- </body>
- </html>
<html>
<head>
<title>Total de la commande</title>
</head>
<body>
<h1>Commande</h1>
<h2>Résultat</h2>
<?
//Creation des variables
$harddisk= $HTTP_POST_VARS['harddisk'];
$memocard= $HTTP_POST_VARS['memocard'];
$proces= $HTTP_POST_VARS['proces'];
$totalqty = 0; // Total des objets
$totalqty = $harddisk + $memocard + $proces;
// Si totalqty = 0 message d'erreur '
if( $totalqty == 0 )
{
echo '<font color=red>';
echo 'Vous avez rien remplis revenez à la page précédente';
echo '</fond>';
}
else
{
if( $harddisk>0 )
echo $harddisk.' Disque(s)<br />';
if( $memocard>0 )
echo $memocard.' Memoire(s) RAM<br />';
if( $proces>0 )
echo $proces.' Processeur(s)<br />';
echo 'Produits commandés '.$totalqty.'<br />';
}
$totalamount = 0.00;
// Definit les variables
define('HDPRICE', 75);
define('MEMOPRICE', 85);
define('PROCESPRICE', 200);
// là c'est des maths
$totalamount = $harddisk * HDPRICE
+ $memocard * MEMOPRICE
+ $proces * PROCESPRICE;
// number format va definir les format approprié au resultat
echo 'Total HT '.number_format($totalamount,3).'? <br />';
$taxerate = 0.196; // Taxe 19.6%
$totalamount = $totalamount * (1 + $taxerate);
echo 'Montant TTC '.number_format($totalamount,2).'? <br />';
?>
</body>
</html>