Advertisement
Garlotch

Pete's Pizza v2.2

Jul 30th, 2015
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE HTML>
  2. <meta charset="UTF-8">
  3. <html>
  4. <head>
  5. <link rel="stylesheet" type="text/css" href="css.css">
  6. <title>Pete's Pizza</title>
  7. <script type="text/javascript" defer>
  8.  
  9. // Author: Garlotch
  10. // Purpose: Order pizzas online from Pete's Pizza shop.
  11. // Version: 2.2
  12. // Date Completed: July 31st 2015
  13.  
  14. function delivery(){
  15.  
  16.     var numbers1 = /^[0-9]+$/;
  17.     var letters1 = /^[a-zA-Z\s]+$/;
  18.     var address1 = /^[a-zA-Z0-9 \^.]{6,}\+$/
  19.    
  20.     var continue1 = confirm('Deliveries will cost an extra $5. \nAre you sure you want to continue?');
  21.         if(continue1 == false)
  22.         {
  23.             location.reload();
  24.         }
  25.    
  26.     var custName1 = prompt('What name will the order be under?');
  27.         while(!custName1.match(letters1))
  28.         {
  29.             var custName1 = prompt('Please enter a valid (real) name.');
  30.         }
  31.        
  32.     var custAddress1 = prompt ('What address should we deliver the order to?');
  33.         while(!custAddress1.match(address1))       
  34.             {
  35.             var custAddress1 = prompt("Please enter combination of alphanumeric characters only.");
  36.             }      
  37.            
  38.     var custNumber1 = prompt ('Please enter your phone number (land-line) in case we need to contact you');
  39.         while ((isNaN(custNumber1)) || (custNumber1 < 8600000) || (custNumber1 > 9999999))
  40.             {
  41.                 var custNumber1 = prompt('Please enter a valid 7 digit number.\nfrom 8600000-9999999');
  42.             }
  43.     var custDet1 = confirm('Customer Details\nName: '+custName1+'\nAddress: '+custAddress1+'\nPhone Number: '+custNumber1+'\n\nAre these details correct? Press Ok to proceed, or Cancel to restart.\n');
  44.         while (custDet1 == false)
  45.         {
  46.             alert('Restarting Order...');
  47.             location.reload();
  48.         }
  49.     var ammount1 = prompt('How many pizzas would you like to order?');
  50.         while((isNaN(ammount1)) || (ammount1 <= 0) || (ammount1 > 12))
  51.         {
  52.             var ammount1 = prompt('Please enter a valid number. \n(The pizza order ammount is limited to 12 per order, sorry.)\n');
  53.         }
  54. }
  55. function pickup(){
  56.     var letters2 = /^[a-zA-Z ]+$/;
  57.     var custName2 = prompt('What name will the order be under?');
  58.         while(!custName2.match(letters2))
  59.         {
  60.             var custName2 = prompt('Please enter a valid (real) name.');
  61.         }
  62.     var custDet2 = confirm('Customer Details\nName: '+custName2+'\n\nAre these details correct? Press Ok to proceed, or Cancel to restart.');
  63.     if (custDet2 == false)
  64.         {
  65.             location.reload();
  66.         }
  67.     var ammount2 = prompt('How many pizzas would you like to order?');
  68.         while((isNaN(ammount2)) || (ammount2 <= 0) || (ammount2 > 12))
  69.             {
  70.                 var ammount2 = prompt('Please enter a valid number. \n(The pizza order ammount is limited to 12 per order, sorry.)\n');
  71.             }
  72. }
  73. </script>
  74. </head>
  75. <body>
  76. <div id="order" style="max-width:430px;">
  77. <h2><b>Select Your Order Type</b></h2>
  78. <input type="button" value="DELIVERY" onclick="delivery()" id="delivery" style="width:150px;height:60px;font-size:150%;font-family:Arial, sans-serif;background-color:#CC0033;font-weight:bold;">&nbsp;&nbsp;<input type="button" value="PICKUP" onclick="pickup()" id="pickup" style="width:150px;height:60px;font-size:150%;font-family:Arial, sans-serif;background-color:#CC0033;font-weight:bold;">
  79. </div>
  80. <div id="title">
  81. <h1>Pete's Pizza</h1>
  82. <h2><i>"The best pizza in Gisborne!"</i></h2><br>
  83. </div>
  84. <div id="menu">
  85. <br>
  86. <h2><b><font color="#0D0000">◄</font> Pete's Pizza Menu <font color="#0D0000"></font></b></h2>
  87. <h3><b><u>Standard Pizzas</u></b></h3>
  88. <table class="center1" style="width:45%; text-align:center;">
  89.     <tr>
  90.         <td>Hawaiian Pizza</td>
  91.         <td>-</td>
  92.         <td>$9.50</td>
  93.     </tr>
  94.     <tr>
  95.         <td>Cheese Pizza</td>
  96.         <td>-</td>
  97.         <td>$9.50</td>
  98.     </tr>
  99.     <tr>
  100.         <td>Veggie Pizza</td>
  101.         <td>-</td>
  102.         <td>$9.50</td>
  103.     </tr>
  104.     <tr>
  105.         <td>Supreme Pizza</td>
  106.         <td>-</td>
  107.         <td>$9.50</td>
  108.     </tr>
  109.     <tr>
  110.         <td>Pepperoni Pizza</td>
  111.         <td>-</td>
  112.         <td>$9.50</td>
  113.     </tr>
  114. </table>
  115. <h3><b><u>Gourmet Pizzas</u></b></h3>
  116. <table class="center2" style="width:45%;text-align:center;">
  117.     <tr>
  118.         <td>Meat-Lovers Pizza</td>
  119.         <td>-</td>
  120.         <td>$15.50</td>
  121.     </tr>
  122.     <tr>
  123.         <td>Chicken Pizza</td>
  124.         <td>-</td>
  125.         <td>$15.50</td>
  126.     </tr>
  127.     <tr>
  128.         <td>Prawn Pizza</td>
  129.         <td>-</td>
  130.         <td>$15.50</td>
  131.     </tr>
  132. </table>
  133. <br>
  134. </div>
  135. </body>
  136. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement