LePetitGlacon

PHP FICHE 2 radeau réponse

Feb 3rd, 2020
559
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.89 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6.     <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7.     <title>Document</title>
  8.     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
  9. </head>
  10. <body>
  11.     <div class="container">
  12.     <h1 class="allign-middle">Projet Radeau</h1>
  13.         <?php
  14.  
  15.             $code = 0;
  16.             $annee = $_POST["annee"];
  17.             $salaire = $_POST["salaire"];
  18.  
  19.             if ($annee < 2 && $salaire < 60000)
  20.             {
  21.                 $code = 1;
  22.                 $pourcentage = 0;
  23.             }
  24.             else{
  25.                 if (($annee < 5 && $salaire < 100000) || ($annee >= 5 && $salaire < 60000))
  26.                 {
  27.                     $code = 2;
  28.                     $pourcentage = 1;
  29.                 }
  30.                 else
  31.                 {
  32.                     if (($annee >= 5 && ($salaire >= 60000 && $salaire < 100000)) || ($annee < 2 && $salaire >= 100000))
  33.                     {
  34.                         $code = 3;
  35.                         $pourcentage = 1.5;
  36.                     }
  37.                    
  38.                     else
  39.                     {
  40.                         if (($annee >= 2 && $annee < 5) && $salaire >= 100000)
  41.                         {
  42.                             $code = 4;
  43.                             $pourcentage = 2;
  44.                         }
  45.                         else
  46.                         {
  47.                             $code = 5;
  48.                             $pourcentage = 2.5;
  49.                         }
  50.                     }
  51.                 }
  52.             }
  53.             echo "Votre code est ".$code;
  54.  
  55.         ?>
  56.     </div>
  57.    
  58. </body>
  59. </html>
Advertisement
Add Comment
Please, Sign In to add comment