Jump to content

Help Please


dbdavis55

Recommended Posts

I have a drop down menu with items and my buttons set up. I need help when clicking on the items in the list to show the total to the total box. Here is what I have so far:

stdClass Object ( )Log out

Takeout Orders Start Over Items: Nachos  Buffalo Wings  Egg Rolls  Tostada Chips  Chicken Fajita Salad  Spinach Salad  Chicken Caesar Salad  Margarita Grilled Chicken  Margarita Grilled Tuna  Grilled Pork Chops  Bacon Burger  OldTimer Burger  Mushroom-Swiss Burger    

  

 

Your Order Item Price qty Order Total: $0.00

 

 

 

<?php
require_once "include/Session.php";
$session = new Session();
if (!isset($session->valid)) {
  require_once "login.php";
  exit();
}
require_once "include/menu.php";
 
/* DO NOT MODIFY THE ABOVE LINES !!!!! */
 
$params = (object) $_REQUEST;
print_r($params);
 
/* Remaining Php handler code goes here  */
 
 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<title>Takeout Orders</title>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<title>Takeout Orders</title>
<style type="text/css">
body {
  padding: 20px;
}
#logout {
  position: absolute;
  top: 40px;
  right: 40px;
  
  #items {
  width:250px;
  height: auto;
  padding:25px;
  border:10px black;
  margin:20px; 
}
 
#order {
  width:250px;
  height:auto;
  padding:25px;
  border:10px black;
  margin:20px; 
 }
 
#items_list {
  width:150px;
  height:auto;
  padding:20px;
  border:30px red;
  margin:auto; 
 }
}
 
 
</style>
</head>
<body>
<a id="logout" href="logout.php">Log out</a>
 
 
 
<h2>Takeout Orders</h2>
 
<form action="program.php" method="get">
  <button type="submit">Start Over</button>
</form>
 
<form action="program.php">
Items:<select name="menu_item">
 
<option>Nachos </option>
 
<option>Buffalo Wings </option>
 
<option>Egg Rolls </option>
 
<option>Tostada Chips </option>
 
<option>Chicken Fajita Salad </option>
 
<option>Spinach Salad </option>
 
<option>Chicken Caesar Salad </option>
 
<option>Margarita Grilled Chicken </option>
 
<option>Margarita Grilled Tuna </option>
 
<option>Grilled Pork Chops </option>
 
<option>Bacon Burger </option>
 
<option>OldTimer Burger </option>
 
<option>Mushroom-Swiss Burger </option>
 
</select>
<br />
<br />
<input type="submit" name="add" value="Add One" />
<input type="submit" name="remove" value="Remove All of Selected" />
</form>
<br />
 
<div id="order">   
<h3>Your Order</h3>
<table width="250" height="55" id="items_table">
<tr>
<th>Item</th>
<th>Price</th>
<th>qty</th>
</tr>
 
<tr><td><strong>Order Total: $0.00</strong></td></tr>
</table>
</div>
 
 
<!-- Add form and presentation code -->
 
</body>
</html>
 
 
I need to do this still:
 
DescriptionThe goal of this program is to create a simplistic web page for creating a takeout order, which is a list of food items, their individual prices and the quantity of each. A total price is also computed. These snapshots (using Firefox on Mac OSX) represent a sample run.

 

Upon initial entry or activating he Start Over button the current selections are cleared. Here is the opening page and depiction of the drop-down menu when activated. a.jpg?1394070783a1.png?1393874611

The user chooses "Egg Rolls" and presses the Add one button twice:

b.jpg?1394070783

One "Bacon Burger" and three "Chicken Fajita Salad" additions later:

c.jpg?1394070783

The user chooses "Egg Rolls" and presses the Remove all of selected button:

d.jpg?1394070784
Link to comment
https://forums.phpfreaks.com/topic/287319-help-please/#findComment-1474111
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.