code
code
Database changed
-> );
+------+--------------------------------+--------+-----------+
+------+--------------------------------+--------+-----------+
+------+--------------------------------+--------+-----------+
-> );
-> );
+----------------+
| Tables_in_food |
+----------------+
| feed |
| item |
| orders |
+----------------+
+-----------+--------------+------+-----+---------+-------+
+-----------+--------------+------+-----+---------+-------+
+-----------+--------------+------+-----+---------+-------+
+---------+--------------+------+-----+---------+-------+
+---------+--------------+------+-----+---------+-------+
+---------+--------------+------+-----+---------+-------+
+--------+--------------+------+-----+---------+-------+
+--------+--------------+------+-----+---------+-------+
+--------+--------------+------+-----+---------+-------+
e = d.cursor()
def add_food():
e.execute("INSERT INTO item VALUES (%s, %s, %s, %s)", (ser, fi, fp, ft))
d.commit()
def update_food():
if us == 1:
fnid = int(input("Enter the Food ID whose food name you want to update: "))
d.commit()
print("UPDATED SUCCESSFULLY")
elif us == 2:
fnic = int(input("Enter the Food ID whose food price you want to update: "))
d.commit()
print("UPDATED SUCCESSFULLY")
def delete_food():
d.commit()
def view_orders():
rtt = e.fetchall()
if rtt:
for i in rtt:
print("***********************************************")
print(f"Address: {i[4]}")
print("***********************************************")
else:
# Admin Login
def ad_login():
while True:
print("5. Logout")
if ask == 1:
add_food()
elif ask == 2:
update_food()
elif ask == 3:
delete_food()
elif ask == 4:
view_orders()
elif ask == 5:
break
def ad_panel():
if pas == 'Zomato':
print("Access granted")
ad_login()
else:
print("Wrong Password")
ashish12345()
def show_menu():
w = e.fetchall()
print(f"Food No. {i[0]} Food Name: {i[1]} --Price: {i[2]} --Food type: {i[3]}")
if ui.lower() == "yes":
F_order()
else:
print("Thank you")
def F_order():
fi = e.fetchall()
if fi:
iname = fi[0][1]
iprice = fi[0][2]
e.execute("INSERT INTO orders (O_name, I_price, O_price, P_no, ADR) VALUES (%s, %s, %s, %s,
%s)",
d.commit()
print("********BILL********")
print(f"Address: {ADR}")
print("********************")
else:
def F_View():
rt = e.fetchall()
if rt:
for i in rt:
print(f"Address: {i[4]}")
else:
# Canceling Order
def F_Cancel():
d.commit()
# Feedback Option
def F_feedb():
fdb = int(input("Enter your Phone NO: "))
print("Give us Feedback--")
e.execute("INSERT INTO Feed (P_no, F_back) VALUES (%s, %s)", (fdb, fdc))
d.commit()
def main_menu():
while True:
print("5. Feedback")
print("6. Exit")
if a == 1:
show_menu()
elif a == 2:
F_order()
elif a == 3:
F_View()
elif a == 4:
F_Cancel()
elif a == 5:
F_feedb()
elif a == 6:
break
# Home Page
def admin():
while True:
print("***********************************************")
print("3. EXIT")
if op == 1:
ad_panel()
elif op == 2:
main_menu()
elif op == 3:
break
admin()