Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE>
- <html>
- <head>
- <link href="CSS/web.css" type="text/css" rel="stylesheet" >
- </head>
- <body>
- <?php
- session_start();
- ?>
- <div id="content">
- <div id="header">
- <img src="Pictures/senseiPizza.jpg" alt="Logo" width="100" height="90">
- <h1>Sensei Pizza</h1>
- <div class="address">
- <h2>Restaurant Location:</h2>
- <span>28 Sewer Street, (Shredder Town) New York</span>
- </div>
- </div>
- <div class="motto">
- <h3>Sensei Pizza will fufill its mission ... to feed you.</h3>
- </div>
- <div class="subContent">
- <nav>
- <ul>
- <li><a href="custhome.php">Home</a></li>
- <li><a href="profile.php">Profile</a></li>
- <li><a href="logout.php">Logout</a></li>
- </ul>
- </nav>
- <div id="main">
- <p> Welcome to your experience at Sensei Pizza.
- Please create your pizza from the menu items.</p>
- <p>Once you have created your pizza and ordered the pizza you must then choose
- a ninja who will represent your cause as that ninja will duel another ninja. If your
- ninja wins you will get 5 percent discount. Choose wisely.</p>
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "senseipizza";
- // Create connection
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- // Check connection
- if (!$conn) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql1 = "SELECT stockName FROM stock";
- $sql2 = "SELECT staffName FROM staff";
- $result1 = $conn->query($sql1);
- $result2 = $conn->query($sql2);
- ?>
- <form method="post" action="<?php $_PHP_SELF ?>">
- Pizza Name:<input type="text" name="pizza"><br>
- Ingredients:
- <select name="ingredient1"><option value="">Please select an ingredient</option><?php
- if ($result1->num_rows > 0) {
- while($row = $result1->fetch_assoc()) {
- $stock = $row["stockName"];
- echo "<option value='$stock'>" . $stock . "</option>";
- }
- } else {
- echo "no stock results";
- } ?>
- </select>
- <select name="ingredient2"><option value="">Please select an ingredient</option><?php
- if ($result1->num_rows > 0) {
- while($row = $result1->fetch_assoc()) {
- $stock = $row["stockName"];
- echo "<option value='$stock'>" . $stock . "</option>";
- }
- } else {
- echo "no stock results";
- } ?> </select>
- <select name="ingredient3"><option value="">Please select an ingredient</option><?php
- if ($result1->num_rows > 0) {
- while($row = $result1->fetch_assoc()) {
- $stock = $row["stockName"];
- echo "<option value='$stock'>" . $stock . "</option>";
- }
- } else {
- echo "no stock results";
- } ?> </select>
- <select name="ingredient4"><option value="">Please select an ingredient</option><?php
- if ($result1->num_rows > 0) {
- while($row = $result1->fetch_assoc()) {
- $stock = $row["stockName"];
- echo "<option value='$stock'>" . $stock . "</option>";
- }
- } else {
- echo "no stock results";
- } ?> </select>
- Size:<select name="size"><option value="small">Small</option><option value="large">Large</option></select>
- Ninja:<select name="ninja">
- <?php
- if ($result2->num_rows > 0) {
- while($row = $result2->fetch_assoc()) {
- $ninja = $row["staffName"];
- echo "<option value='$ninja'>" . $ninja . "</option>";
- }
- } else {
- echo "no staff results";
- } ?>
- </select>
- <input type="submit" name="order" id="order" value="Order Pizza">
- </form>
- <br/>
- <?php
- if(isset($_POST['order']))
- {
- echo "Pizza Name: " . $_POST['pizza'];
- echo "ingredient1: " . $_POST['ingredient1'];
- echo "ingredient2: " . $_POST['ingredient2'];
- echo "ingredient3: " . $_POST['ingredient3'];
- echo "ingredient4: " . $_POST['ingredient4'];
- echo "Size: " . $_POST['size'];
- echo "Ninja: " . $_POST['ninja'];
- }
- ?>
- </div>
- </div>
- <footer>
- <p> Sensei Pizza is a pizza registered restaurant and copywrited by the unifications act of the United States © 2016 </p>
- </footer>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement