Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <meta charset="UTF-8">
- <meta name="description" content="Pizza">
- <meta name="keywords" content="Michael,lord,author,cis231,occ,sunyonondaga,Pizza,order">
- <meta name="author" content="Michael Lord" >
- <meta name="viewpoint" content="
- width: device-width;
- zoom: 1;
- min-zoom: 67%;
- max-zoom: 67%;
- user-zoom: fixed;"/>
- <title></title>
- <link rel="stylesheet" href="lab1.css">
- </head>
- <body>
- <div class="transbox">
- <?php
- if (!empty($_POST['name'])) {
- $Name = $_POST['name'];
- } else {
- $Name = NULL;
- echo '<p class="error">You forgot to enter your name! Please go back and enter your name.</p>';
- }
- if (isset($_POST["toppings"])) {
- $top = $_POST['toppings'];
- } else {
- $top = NULL;
- echo '<p class="error">You need to go back and select a topping please.</p>';
- }
- if (isset($_POST['ordertype'])) {
- $order = $_POST['ordertype'];
- } else {
- $order = NULL;
- echo '<p class="error">You have forgot to select your order</p>';
- }
- if (isset($_POST['quantity']) and is_numeric($_POST['quantity'])) {
- $quan = $_POST['quantity'];
- }
- else {
- $quan = NULL;
- echo '<p class="error">You have not selected a number of pizzas. Please go back and select a number of pizzas.</p'; }
- $pizzacost = 8;
- if ($top == "meatlovers") {
- $pizzacost = $pizzacost + 3;
- }
- if ($top == "cheese") {
- $pizzacost = $pizzacost + 1.5;
- }
- if ($top == "extracheese") {
- $pizzacost = $pizzacost + 2.5;
- }
- if ($order == "delivered") {
- $total = 2;
- $total = $pizzacost * $quan + $total; }
- if ($order != "delivered") {
- $total = 0;
- $total = $pizzacost * $quan + $total; }
- ?>
- <h1>Thanks for the order, <?php echo "$Name" ?>!</h1>
- <center><p>Your total bill for pizza is: $<?php echo number_format($total, 2) ?></p>
- </center>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement