I want to add and remove items from a menu with PHP.
- by CDeanMartin
This menu will need to be updated daily.
<html><head></head><body>
<h1> Welcome to Burgerama </h1>
<?php include("menuBuilder.php");
showBurgerMenu();
?>
</body></html>
Menu items are stored in the database. Items have a display field; if it is on, the item should be displayed on the menu. The menu only displays 4 or 5 "specials" at a time, and the manager needs to change menu items easily. I want to make a menu editing page like this:
<?php include("burger_queries.php");
dbconnect("burger_database");
foreach($menuItem in burger_database)
{
echo createToggleButton($menuItem);
}
?>
.. with a toggle button for each menu item. Ideally the button will be labeled with the menu item, in blue if the item is "on", and red if the item is "off." Clicking the button switches between "on" and "off"
I am stuck trying to a get a button to execute an UPDATE query on its corresponding menu item.