Advertisement
Guest User

Untitled

a guest
May 29th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.17 KB | None | 0 0
  1. <!DOCTYPE>
  2. <html>
  3. <head>
  4. <link href="CSS/web.css" type="text/css" rel="stylesheet" >
  5. </head>
  6. <body>
  7. <?php
  8. session_start();
  9. ?>
  10. <div id="content">
  11. <div id="header">
  12. <img src="Pictures/senseiPizza.jpg" alt="Logo" width="100" height="90">
  13. <h1>Sensei Pizza</h1>
  14. <div class="address">
  15. <h2>Restaurant Location:</h2>
  16. <span>28 Sewer Street, (Shredder Town) New York</span>
  17. </div>
  18. </div>
  19. <div class="motto">
  20. <h3>Sensei Pizza will fufill its mission ... to feed you.</h3>
  21. </div>
  22. <div class="subContent">
  23. <nav>
  24. <ul>
  25. <li><a href="custhome.php">Home</a></li>
  26. <li><a href="profile.php">Profile</a></li>
  27. <li><a href="logout.php">Logout</a></li>
  28.  
  29. </ul>
  30. </nav>
  31. <div id="main">
  32. <p> Welcome to your experience at Sensei Pizza.
  33. Please create your pizza from the menu items.</p>
  34. <p>Once you have created your pizza and ordered the pizza you must then choose
  35. a ninja who will represent your cause as that ninja will duel another ninja. If your
  36. ninja wins you will get 5 percent discount. Choose wisely.</p>
  37. <?php
  38. $servername = "localhost";
  39. $username = "root";
  40. $password = "";
  41. $dbname = "senseipizza";
  42.  
  43. // Create connection
  44. $conn = mysqli_connect($servername, $username, $password, $dbname);
  45. // Check connection
  46. if (!$conn) {
  47. die("Connection failed: " . $conn->connect_error);
  48. }
  49. $sql1 = "SELECT stockName FROM stock";
  50. $sql2 = "SELECT staffName FROM staff";
  51. $result1 = $conn->query($sql1);
  52. $result2 = $conn->query($sql2);
  53.  
  54. ?>
  55. <form method="post" action="<?php $_PHP_SELF ?>">
  56. Pizza Name:<input type="text" name="pizza"><br>
  57. Ingredients:
  58. <select name="ingredient1"><option value="">Please select an ingredient</option><?php
  59. if ($result1->num_rows > 0) {
  60. while($row = $result1->fetch_assoc()) {
  61. $stock = $row["stockName"];
  62. echo "<option value='$stock'>" . $stock . "</option>";
  63. }
  64. } else {
  65. echo "no stock results";
  66. } ?>
  67. </select>
  68. <select name="ingredient2"><option value="">Please select an ingredient</option><?php
  69. if ($result1->num_rows > 0) {
  70. while($row = $result1->fetch_assoc()) {
  71. $stock = $row["stockName"];
  72. echo "<option value='$stock'>" . $stock . "</option>";
  73. }
  74. } else {
  75. echo "no stock results";
  76. } ?> </select>
  77. <select name="ingredient3"><option value="">Please select an ingredient</option><?php
  78. if ($result1->num_rows > 0) {
  79. while($row = $result1->fetch_assoc()) {
  80. $stock = $row["stockName"];
  81. echo "<option value='$stock'>" . $stock . "</option>";
  82. }
  83. } else {
  84. echo "no stock results";
  85. } ?> </select>
  86. <select name="ingredient4"><option value="">Please select an ingredient</option><?php
  87. if ($result1->num_rows > 0) {
  88. while($row = $result1->fetch_assoc()) {
  89. $stock = $row["stockName"];
  90. echo "<option value='$stock'>" . $stock . "</option>";
  91. }
  92. } else {
  93. echo "no stock results";
  94. } ?> </select>
  95. Size:<select name="size"><option value="small">Small</option><option value="large">Large</option></select>
  96. Ninja:<select name="ninja">
  97. <?php
  98. if ($result2->num_rows > 0) {
  99. while($row = $result2->fetch_assoc()) {
  100. $ninja = $row["staffName"];
  101. echo "<option value='$ninja'>" . $ninja . "</option>";
  102. }
  103. } else {
  104. echo "no staff results";
  105. } ?>
  106. </select>
  107. <input type="submit" name="order" id="order" value="Order Pizza">
  108. </form>
  109. <br/>
  110. <?php
  111. if(isset($_POST['order']))
  112. {
  113. echo "Pizza Name: " . $_POST['pizza'];
  114. echo "ingredient1: " . $_POST['ingredient1'];
  115. echo "ingredient2: " . $_POST['ingredient2'];
  116. echo "ingredient3: " . $_POST['ingredient3'];
  117. echo "ingredient4: " . $_POST['ingredient4'];
  118. echo "Size: " . $_POST['size'];
  119. echo "Ninja: " . $_POST['ninja'];
  120. }
  121. ?>
  122. </div>
  123. </div>
  124. <footer>
  125. <p> Sensei Pizza is a pizza registered restaurant and copywrited by the unifications act of the United States &#169; 2016 </p>
  126. </footer>
  127. </div>
  128. </body>
  129. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement