Question: 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 meat-based 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 (i.e. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!