Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_REQUEST["reponse"]))
- {
- $reponse = true;
- if ($_REQUEST["permis"] === "permisA")
- {
- $prixHeure = 45;
- }
- else
- {
- $prixHeure = 50;
- }
- $prixTotal = $prixHeure;
- if ($_REQUEST["jours"] === "Lundi" ||$_REQUEST["jours"] === "Samedi")
- {
- $prixTotal = $prixHeure;
- }
- else
- {
- if ($_REQUEST["jours"] == "Mercredi" || $_REQUEST["jours"] == "Vendredi")
- {
- $prixTotal = $prixTotal - ($prixHeure * 0.2);
- }
- else
- {
- if ($_REQUEST["jours"] == "Mardi") {
- $prixTotal = $prixTotal - ($prixHeure * 0.1);
- }
- else
- {
- if ($_REQUEST["jours"] == "Jeudi") {
- $prixTotal = $prixTotal - ($prixHeure * 0.05);
- }
- }
- }
- }
- if ($_REQUEST["check"] == "checked")
- {
- $prixTotal = $prixTotal - ($prixTotal*0.08);
- }
- }
- ?>
- <!DOCTYPE html>
- <html>
- <body class="container">
- <h1>Auto Ecole</h1>
- <form>
- <p>Quel type de permis ?</p>
- <input type="radio" name="permis" value="permisA">Permis A<br>
- <input type="radio" name="permis" value="permisB">Permis B<br>
- <br>
- <p>Quel jours comptes tu y aller ?</p>
- <input type="radio" name="jours" value="Lundi">Lundi<br>
- <input type="radio" name="jours" value="Mardi">Mardi<br>
- <input type="radio" name="jours" value="Mercredi">Mercredi<br>
- <input type="radio" name="jours" value="Jeudi">Jeudi<br>
- <input type="radio" name="jours" value="Vendrendi">Vendrendi<br>
- <input type="radio" name="jours" value="Samedi">Samedi<br>
- <br>
- <p>Etudiant ?</p>
- <input type="checkbox" name="check" value="checked"> Remise de 8% sur présentation de la carte jeune<br>
- <br>
- <input type="submit" name="reponse" value="Valider">
- </form>
- <?php
- if(isset($_REQUEST["reponse"]))
- {
- ?>
- <hr>
- <p>Le prix sera de <?php echo $prixTotal ?> euros</p>
- <?php
- }
- ?>
- </body>
- <head>
- <title></title>
- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
- </head>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement