Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML>
- <meta charset="UTF-8">
- <html>
- <head>
- <link rel="stylesheet" type="text/css" href="css.css">
- <title>Pete's Pizza</title>
- <script type="text/javascript" defer>
- // Author: Garlotch
- // Purpose: Order pizzas online from Pete's Pizza shop.
- // Version: 2.2
- // Date Completed: July 31st 2015
- function delivery(){
- var numbers1 = /^[0-9]+$/;
- var letters1 = /^[a-zA-Z\s]+$/;
- var address1 = /^[a-zA-Z0-9 \^.]{6,}\+$/
- var continue1 = confirm('Deliveries will cost an extra $5. \nAre you sure you want to continue?');
- if(continue1 == false)
- {
- location.reload();
- }
- var custName1 = prompt('What name will the order be under?');
- while(!custName1.match(letters1))
- {
- var custName1 = prompt('Please enter a valid (real) name.');
- }
- var custAddress1 = prompt ('What address should we deliver the order to?');
- while(!custAddress1.match(address1))
- {
- var custAddress1 = prompt("Please enter combination of alphanumeric characters only.");
- }
- var custNumber1 = prompt ('Please enter your phone number (land-line) in case we need to contact you');
- while ((isNaN(custNumber1)) || (custNumber1 < 8600000) || (custNumber1 > 9999999))
- {
- var custNumber1 = prompt('Please enter a valid 7 digit number.\nfrom 8600000-9999999');
- }
- 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');
- while (custDet1 == false)
- {
- alert('Restarting Order...');
- location.reload();
- }
- var ammount1 = prompt('How many pizzas would you like to order?');
- while((isNaN(ammount1)) || (ammount1 <= 0) || (ammount1 > 12))
- {
- var ammount1 = prompt('Please enter a valid number. \n(The pizza order ammount is limited to 12 per order, sorry.)\n');
- }
- }
- function pickup(){
- var letters2 = /^[a-zA-Z ]+$/;
- var custName2 = prompt('What name will the order be under?');
- while(!custName2.match(letters2))
- {
- var custName2 = prompt('Please enter a valid (real) name.');
- }
- var custDet2 = confirm('Customer Details\nName: '+custName2+'\n\nAre these details correct? Press Ok to proceed, or Cancel to restart.');
- if (custDet2 == false)
- {
- location.reload();
- }
- var ammount2 = prompt('How many pizzas would you like to order?');
- while((isNaN(ammount2)) || (ammount2 <= 0) || (ammount2 > 12))
- {
- var ammount2 = prompt('Please enter a valid number. \n(The pizza order ammount is limited to 12 per order, sorry.)\n');
- }
- }
- </script>
- </head>
- <body>
- <div id="order" style="max-width:430px;">
- <h2><b>Select Your Order Type</b></h2>
- <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;"> <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;">
- </div>
- <div id="title">
- <h1>Pete's Pizza</h1>
- <h2><i>"The best pizza in Gisborne!"</i></h2><br>
- </div>
- <div id="menu">
- <br>
- <h2><b><font color="#0D0000">◄</font> Pete's Pizza Menu <font color="#0D0000">►</font></b></h2>
- <h3><b><u>Standard Pizzas</u></b></h3>
- <table class="center1" style="width:45%; text-align:center;">
- <tr>
- <td>Hawaiian Pizza</td>
- <td>-</td>
- <td>$9.50</td>
- </tr>
- <tr>
- <td>Cheese Pizza</td>
- <td>-</td>
- <td>$9.50</td>
- </tr>
- <tr>
- <td>Veggie Pizza</td>
- <td>-</td>
- <td>$9.50</td>
- </tr>
- <tr>
- <td>Supreme Pizza</td>
- <td>-</td>
- <td>$9.50</td>
- </tr>
- <tr>
- <td>Pepperoni Pizza</td>
- <td>-</td>
- <td>$9.50</td>
- </tr>
- </table>
- <h3><b><u>Gourmet Pizzas</u></b></h3>
- <table class="center2" style="width:45%;text-align:center;">
- <tr>
- <td>Meat-Lovers Pizza</td>
- <td>-</td>
- <td>$15.50</td>
- </tr>
- <tr>
- <td>Chicken Pizza</td>
- <td>-</td>
- <td>$15.50</td>
- </tr>
- <tr>
- <td>Prawn Pizza</td>
- <td>-</td>
- <td>$15.50</td>
- </tr>
- </table>
- <br>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement