dbdavis55 Posted March 27, 2014 Share Posted March 27, 2014 I need help writing PHP code for this class I have. I'm new to PHP and can't quite understand it. Can anyone please help me. Here is the assignment: http://www.cs.wcupa.edu/rkline/wpeval/program-3.html Quote Link to comment Share on other sites More sharing options...
requinix Posted March 27, 2014 Share Posted March 27, 2014 Have you talked with your professor first? S/he is the best person to see if you have questions or problems with your homework as they know you and the assignment much better than we do. Quote Link to comment Share on other sites More sharing options...
SitdGames Posted March 27, 2014 Share Posted March 27, 2014 Is there anything in particular you're having trouble with? Quote Link to comment Share on other sites More sharing options...
dbdavis55 Posted March 27, 2014 Author Share Posted March 27, 2014 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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <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. The user chooses "Egg Rolls" and presses the Add one button twice: One "Bacon Burger" and three "Chicken Fajita Salad" additions later: The user chooses "Egg Rolls" and presses the Remove all of selected button: Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.