Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A web application for displaying a restaurant menu has two display states, meat and vegetarian. In the meat state, the page displays only the meat
A web application for displaying a restaurant menu has two display states, meat and vegetarian. In the meat state, the page displays only the meatbased items that are available. In the vegetarian state the page displays only the vegetarian items on the menu that are available. The display state is saved in a session variable named "menu" and the values are either "meat" or "vegetarian".
This session variable is created in another part of the application, but do not assume that it has been set correctly ie test it before you use it If the session variable is not set to either "meat" or "vegetarian" then the default is to not show any the menu items.
Write the PHP code for the file below so that the correct DOM elements are visible or invisible depending on whether the display state is meat or vegetarian. Manipulate the CSS values in the style section, not in the html section. Write the simpiest, most efficient code possible using proper programming techniques for this problem.
Part A: Add the code to use the session to determine the display state
Part B: Add the code to dynamically manipulate the meat class
Part C: Add the code to dynamically manipulate the vegetarian class
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started