Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_REQUEST["reponse"])) {
- if ($_REQUEST["tarifs"] == "tarifPlein")
- {
- $prixTotal = 8.70;
- }
- else
- {
- if ($_REQUEST["tarifs"] == "tarifEtudiant")
- {
- $prixTotal = 5.90;
- }
- else
- {
- if ($_REQUEST["tarifs"] == "tarifReduit")
- {
- $prixTotal = 6.90;
- }
- else
- {
- $prixTotal = 5.20;
- }
- }
- }
- if ($_REQUEST["heures"] == "11:10" || $_REQUEST["jours"] == "lundi")
- {
- $prixTotal = 5.20;
- }
- if (isset($_REQUEST["cbMajoration"]) && $_REQUEST["cbMajoration"] == "check")
- {
- $prixTotal = $prixTotal + 1.5;
- }
- else
- {
- }
- if (isset($_REQUEST["cbReduction"]) && $_REQUEST["cbReduction"] == "check")
- {
- $prixTotal = $prixTotal - 1;
- }
- else
- {
- }
- }
- ?>
- <!DOCTYPE html>
- <html>
- <body class="container">
- <h1>Cinéma</h1>
- <form method="post">
- <p>Quel jour ?</p>
- <select name="jours">
- <option name="jours" value="choisir">Choisir un jour</option>
- <option name="jours" value="lundi">Lundi</option>
- <option name="jours" value="mardi">mardi</option>
- <option name="jours" value="mercredi">mercredi</option>
- <option name="jours" value="jeudi">jeudi</option>
- <option name="jours" value="vendredi">vendredi</option>
- <option name="jours" value="samedi">samedi</option>
- <option name="jours" value="dimanche">dimanche</option>
- </select>
- <br><br>
- <p>Quelle heure ?</p>
- <select name="heures">
- <option name="heures" value="choisir">Choisir un horraire</option>
- <option name="heures" value="11:10">11:10</option>
- <option name="heures" value="12">12:00</option>
- <option name="heures" value="14">14:00</option>
- <option name="heures" value="16">16:00</option>
- <option name="heures" value="18">18:00</option>
- <option name="heures" value="20">20:00</option>
- <option name="heures" value="22">22:00</option>
- </select>
- <br><br>
- <p>Quel tarif ?</p>
- <input type="radio" name="tarifs" value="tarifPlein">Plein tarif : 8,70€<br>
- <input type="radio" name="tarifs" value="tarifEtudiant">Tarif étudiant : 5,90€<br>
- <input type="radio" name="tarifs" value="tarifReduit">Tarif réduit : 6,90€<br>
- <input type="radio" name="tarifs" value="tarifSpecial">Tarif spécial : 5,20€<br><br>
- <input type="checkbox" name="cbMajoration" value="check"> Film 3D : 1,50€<br>
- <input type="checkbox" name="cbReduction" value="check"> Réduction : 1€<br><br>
- <input type="submit" name="reponse" value="Valider">
- </form>
- <?php
- if(isset($_REQUEST["reponse"]))
- {
- ?>
- <hr>
- <p>Votre place de cinema coûte <?php echo $prixTotal ?>0 €</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