Untitled
unknown
plain_text
2 years ago
984 B
8
Indexable
# Display Menu
def display_menu():
try:
cur.execute("SELECT * FROM Menu")
menu_items = cur.fetchall()
table = PrettyTable(["Item ID", "Item Name", "Category", "Price"])
for item in menu_items:
table.add_row(item)
print(table)
except mysql.connector.Error as err:
print(f"Error: {err}")
con.rollback()
# Customer Menu
def login_as_customer_menu(customer_name):
while True:
print("\n\t\t\t\tCustomer Menu")
y = int(input('''
1. Display Menu
2. Place Order
3. Display Your Orders
4. Modify Order
5. Exit
'''))
if y == 1:
display_menu()
elif y == 2:
place_order(customer_name)
elif y == 3:
display_customer_orders(customer_name)
elif y == 4:
modify_order(customer_name)
elif y == 5:
break
else:
print('Please enter a valid input. ')
Editor is loading...
Leave a Comment