<?php
// Création des variables pour conserver les cases cochées
$choix1_1 = 'checked="checked"' ;
$choix1_2 = "" ;
$choix1_3 = "" ;
$choix1_4 = "" ;
$choix1_5 = "" ;
$choix2_1 = 'checked="checked"' ;
$choix2_2 = "" ;
$choix3_1 = 'checked="checked"' ;
$choix3_2 = "" ;
$choix3_3 = "" ;
$choix3_4 = "" ;
$choix4_1 = 'checked="checked"' ;
$choix4_2 = "" ;
$choix4_3 = "" ;
$choix4_4 = "" ;
$choix4_5 = "" ;
$choix5_1 = "" ;
$choix5_2 = "" ;
$choix5_3 = "" ;
$choix5_4 = "" ;
$choix5_5 = 'checked="checked"' ;
$choix6_1 = "" ;
$choix6_2 = 'checked="checked"' ;
$avert = false ;
$total = 0 ;
// Test si le formulaire a été validé afin d'être recalculé
if (isset($_POST["calcul"])) {
// Choix 1 - Nombre d epages statiques
$choix1 = $_POST["choix1"] ;
if ($choix1 == "1") {
$choix1_1 = 'checked="checked"' ;
$choix1_2 = "" ;
$choix1_3 = "" ;
$choix1_4 = "" ;
$choix1_5 = "" ;
$total = $total + 39 ;
}
else if ($choix1 == "2") {
$choix1_2 = 'checked="checked"' ;
$choix1_1 = "" ;
$choix1_3 = "" ;
$choix1_4 = "" ;
$choix1_5 = "" ;
$total = $total + 69 ;
}
else if ($choix1 == "3") {
$choix1_3 = 'checked="checked"' ;
$choix1_1 = "" ;
$choix1_2 = "" ;
$choix1_4 = "" ;
$choix1_5 = "" ;
$total = $total + 179 ;
}
else if ($choix1 == "4") {
$choix1_4 = 'checked="checked"' ;
$choix1_1 = "" ;
$choix1_2 = "" ;
$choix1_3 = "" ;
$choix1_5 = "" ;
$total = $total + 379 ;
}
else if ($choix1 == "5") {
$choix1_5 = 'checked="checked"' ;
$choix1_1 = "" ;
$choix1_2 = "" ;
$choix1_3 = "" ;
$choix1_4 = "" ;
$avert = true ;
}
// Choix 2 - Page de contact
$choix2 = $_POST["choix2"] ;
if ($choix2 == "1") {
$choix2_1 = 'checked="checked"' ;
$choix2_2 = "" ;
$total = $total + 49 ;
}
else if ($choix2 == "2") {
$choix2_2 = 'checked="checked"' ;
$choix2_1 = "" ;
}
// Choix 3 - Domaine
$choix3 = $_POST["choix3"] ;
if ($choix3 == "1") {
$choix3_1 = 'checked="checked"' ;
$choix3_2 = "" ;
$choix3_3 = "" ;
$choix3_4 = "" ;
$total = $total + 19 ;
}
else if ($choix3 == "2") {
$choix3_2 = 'checked="checked"' ;
$choix3_1 = "" ;
$choix3_3 = "" ;
$choix3_4 = "" ;
$total = $total + 24 ;
}
else if ($choix3 == "3") {
$choix3_3 = 'checked="checked"' ;
$choix3_1 = "" ;
$choix3_2 = "" ;
$choix3_4 = "" ;
$total = $total + 34 ;
}
else if ($choix3 == "4") {
$choix3_4 = 'checked="checked"' ;
$choix3_1 = "" ;
$choix3_2 = "" ;
$choix3_3 = "" ;
}
// Choix 4 - Hébergement
$choix4 = $_POST["choix4"] ;
if ($choix4 == "1") {
$choix4_1 = 'checked="checked"' ;
$choix4_2 = "" ;
$choix4_3 = "" ;
$choix4_4 = "" ;
$choix4_5 = "" ;
$total = $total + 29 ;
}
else if ($choix4 == "2") {
$choix4_2 = 'checked="checked"' ;
$choix4_1 = "" ;
$choix4_3 = "" ;
$choix4_4 = "" ;
$choix4_5 = "" ;
$total = $total + 79 ;
}
else if ($choix4 == "3") {
$choix4_3 = 'checked="checked"' ;
$choix4_1 = "" ;
$choix4_2 = "" ;
$choix4_4 = "" ;
$choix4_5 = "" ;
$total = $total + 266 ;
}
else if ($choix4 == "4") {
$choix4_4 = 'checked="checked"' ;
$choix4_1 = "" ;
$choix4_2 = "" ;
$choix4_3 = "" ;
$choix4_5 = "" ;
$avert = true ;
}
else if ($choix4 == "5") {
$choix4_5 = 'checked="checked"' ;
$choix4_1 = "" ;
$choix4_2 = "" ;
$choix4_3 = "" ;
$choix4_4 = "" ;
}
// Choix 5 - Scripts dynamiques
$choix5 = $_POST["choix5"] ;
if ($choix5 == "1") {
$choix5_1 = 'checked="checked"' ;
$choix5_2 = "" ;
$choix5_3 = "" ;
$choix5_4 = "" ;
$choix5_5 = "" ;
$total = $total + 56 ;
}
else if ($choix5 == "2") {
$choix5_2 = 'checked="checked"' ;
$choix5_1 = "" ;
$choix5_3 = "" ;
$choix5_4 = "" ;
$choix5_5 = "" ;
$total = $total + 109 ;
}
else if ($choix5 == "3") {
$choix5_3 = 'checked="checked"' ;
$choix5_1 = "" ;
$choix5_2 = "" ;
$choix5_4 = "" ;
$choix5_5 = "" ;
$total = $total + 159 ;
}
else if ($choix5 == "4") {
$choix5_4 = 'checked="checked"' ;
$choix5_1 = "" ;
$choix5_2 = "" ;
$choix5_3 = "" ;
$choix5_5 = "" ;
$avert = true ;
}
else if ($choix5 == "5") {
$choix5_5 = 'checked="checked"' ;
$choix5_1 = "" ;
$choix5_2 = "" ;
$choix5_3 = "" ;
$choix5_4 = "" ;
}
// Choix 6 - Script d'upload
$choix6 = $_POST["choix6"] ;
if ($choix6 == "1") {
$choix6_1 = 'checked="checked"' ;
$choix6_2 = "" ;
$total = $total + 29 ;
}
else if ($choix6 == "2") {
$choix6_1 = "" ;
$choix6_2 = 'checked="checked"' ;
}
// Mise en ligne, configuration : + 20%
$total = $total + (($total * 20) / 100) ;
}
else if (!isset($_POST["calcul"]))
$total = "163.2" ;
?>
Partager