SHARE
TWEET

Untitled

ianj844 Dec 7th, 2019 (edited) 114 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. if(isset($_POST['submit'])) {
  3.     $general = $_POST['general'];
  4.     $vip = $_POST['vip'];
  5.     if($general + $vip == 0) {
  6.         echo "No Tickets Ordered";
  7.     } else {
  8.         $general_t = $general * 10;
  9.         $vip_t = $vip * 20;
  10.         if($general + $vip >= 10) {
  11.             $save = true;
  12.             $total_before = $general_t + $vip_t;
  13.             $total_save = $total_before * .1;
  14.             $total = $total_before - $total_save;
  15.         } else {
  16.             $save = false;
  17.             $total = $general_t + $vip_t;
  18.         }
  19.  
  20.         echo "Your Cart:<br />";
  21.         echo "General Tickets: ".$general." @ $10/each = ".$general_t."<br />";
  22.         echo "VIP Tickets: ".$vip." @ $20/each = ".$vip_t."<br /><br >";
  23.         echo "TOTAL:<br />";
  24.        
  25.         if($save == true) {
  26.             echo "You Saved 10% Today";
  27.         }
  28.  
  29.         echo "Total Price = $".$total;
  30.     }
  31. }
  32. ?>
  33. <html>
  34. <title>Chase is going to lose</title>
  35.  
  36. <h1>Welcome please select the ammount of tickets you would like below:</h1>
  37. <h3>PLEASE NOTE: A PURCAHSE OF 10% OR MORE COMBINED TICKETS WILL RESULT IN A 10% TOTAL DISCOUNT</h3>
  38.  
  39. <form method="POST">
  40.     <label>General Admission ($10)</label>
  41.     <input type="number" name="general"><br />
  42.  
  43.     <label>VIP Admission ($20)</label>
  44.     <input type="number" name="vip"><br />
  45.    
  46.     <button type="submit" name="submit">Add to Cart</button>
  47. </form>
  48.  
  49. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top