FP Main
FP Main
INTRODUCTION
Welcome to food portal
In the hustle and bustle of our daily lives, finding a
quick and delicious meal can be a challenge. But fear
not, for we present to you the Food Portal – a digital
haven for all your culinary cravings! Whether you're an
admin looking to manage the portal with precision or a
hungry soul ready to explore a world of delectable
options, our portal had made sure that you are covered.
Admin Access: Unlock the Power
The gateway to culinary control lies in the hands of the
admin. Armed with a secure password, the admin block
opens up a realm of possibilities for managing the Food
Portal with finesse. From overseeing orders to updating
the menu, the admin has the key to culinary command.
Ordering Bliss: Explore and Indulge
For the food enthusiasts who crave a delightful dining
experience, the Food Portal offers an extensive array of
culinary delights. Browse through a tempting menu
showcasing a variety of dishes, each with its own
unique flavour profile. With just a few clicks, you can
place your order and tantalize your taste buds with the
finest cuisines.
2|Page
Seamless Exit: You’re Way Out
Had your fill of culinary delights or finished managing
the admin block? Fear not, for the exit is as smooth as
your favourite dessert. With a simple command, bid
adieu to the Food Portal, knowing that it's always ready
to welcome you back for your next gastronomic
adventure.
Embrace the fusion of technology and taste with the
Food Portal – where admin control meets culinary
exploration. Join us on this digital journey, and let the
flavours of innovation and convenience tantalize your
senses. Bon appétit!
Our MISSION
Our mission is to create a vibrant and interconnected
food community, fostering a love for diverse cuisines
and culinary experiences. Whether you're a food
enthusiast looking for your next dining adventure or a
restaurant seeking to expand your reach, our project
FOOD PORTAL is the go-to platform for all things
food-related.
Join us on this exciting journey as we redefine the way
people discover, share, and savoir the world of food
through our project FOOD PORTAL.
Feel free to customize this introduction to better fit the
specific features and goals of your food portal project.
3|Page
XXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX
PYTHON SOURCE
CODE
XXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX
4|Page
import mysql.connector as pro
d=pro.connect(host="localhost",user="root",password="
admin",database="food")
e=d.cursor()
d=pro.connect(host="localhost",user="root",password="
admin",database="food")
e=d.cursor()
ser=int(input("Enter the Food ID:"))
fi=input("Enter the Food name:")
fp=int(input("Enter the Price of Food:"))
ft=input("Enter the Food Type:")
e.execute("insert into item values ({},'{}',
{},'{}')".format(ser,fi,fp,ft))
print("NEW FOOD ADDED SUCCESSFULLY")
d.commit()
5|Page
d=pro.connect(host="localhost",user="root",password="
admin",database="food")
e=d.cursor()
print("1. update food name")
print("2. update food price")
us=int(input("Enter your choice :"))
if us==1:
fnid=int(input("Enter the Food ID whose food
name you want to update :"))
fna=input("Enter the updated Food Name: ")
e.execute("update Item set Food_Item='{}' where
S_no={}".format(fna,fnid))
print("UPDATED
SUCCESSFULLY")
d.commit()
elif us==2:
fnic=int(input("Enter the Food ID whose food price
you want to update :"))
fnf=input("Enter the updated Food Price: ")
e.execute("update Item set Prices={} where
S_no={}".format(fnf,fnic))
print("UPDATED
SUCCESSFULLY")
d.commit()
6|Page
print("You have been Redirected to the Admin page")
ad_login()
7|Page
# DELETING FOOD OPTION FOR
ADMIN
def delete_food():
d=pro.connect(host="localhost",user="root",password="
admin",database="food")
e=d.cursor()
fidd=int(input("Enter the Food ID you want to delete
:"))
e.execute("delete from item where
S_no={}".format(fidd))
print("YOU HAVE DELETED A FOOD ITEM
SUCCESSFULLY")
d.commit()
d=pro.connect(host="localhost",user="root",password="
admin",database="food")
e=d.cursor()
fgg=("select * from orders")
print("Details of all orders are:")
8|Page
e.execute(fgg)
rtt=e.fetchall()
for i in rtt:
print("********************************************
*********")
print("Food name:",i[0])
print("Food price:",i[1])
print("Total price:",i[2])
print("Phone NO:",i[3])
print("Address:",i[4])
print("********************************************
**********")
9|Page
if ask==1:
add_food()
elif ask==2:
update_food()
elif ask==3:
delete_food()
elif ask==4:
view_orders()
elif ask==5:
return
10 | P a g e
# FOOD ITEMS TO SHOW
CUSTOMER
def show_menu():
e.execute("select * from item")
w=e.fetchall()
print("-------------MENU FOR TODAY--------------")
for i in w:
print("Food No.",i[0],"Food Name:",i[1],"--
Price:",i[2],"--Food type:",i[3] )
d.commit()
ui=input("Do you want to order food:")
if ui=="Yes" or ui=="yes":
F_order()
else:
print("Thank you")
print("You have been Redirected to the Main Page")
return
12 | P a g e
# VIEWING YOUR FOOD ORDER
HISTORY
def F_View():
yno=int(input("Enter your phone NO:"))
a=("select * from orders where P_no={}").format(yno)
e.execute(a)
rt=e.fetchall()
if len(rt)>0:
for i in rt:
print("Your recent orders are:")
print("**********YOUR ORDER DETAILS ARE
SHOWN BELOW**********")
print("Food name:",i[0])
print("Food price:",i[1])
print("Total price:",i[2])
print("Phone NO:",i[3])
print("Address:",i[4])
else:
print("YOU HAVE NOT PLACED ANY ORDER")
d.commit()
13 | P a g e
def F_Cancel():
cor=int(input("Enter your phone NO:"))
dele=("delete from orders where P_no={}").format(cor)
e.execute(dele)
print("Your order has been cancelled
SUCCESSFULLY")
print("You have been Redirected to the MAIN PAGE")
d.commit()
# HOME PAGE
15 | P a g e
def admin():
while True:
print("********************************************
**")
print("WELCOME TO FOOD PORTAL")
print("1. Admin Login")
print("2. Customer Login")
print("3. EXIT")
op=int(input("Enter option :"))
if op==1:
ad_panel()
elif op==2:
main_menu()
elif op==3:
break
admin()
16 | P a g e
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
MySQL Database
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
17 | P a g e
FOOD ITEM TABLE:
18 | P a g e
Food Order Table:
Feedback Table:
19 | P a g e
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
OUTPUTS
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
20 | P a g e
FOOD PORTAL MAIN PAGE:
21 | P a g e
ADDING FOOD ITEM BY ADMIN:
22 | P a g e
DELETING FOOD ITEM BY ADMIN:
23 | P a g e
LOGOUT OPTION FOR ADMIN:
24 | P a g e
FOOD ITEMS FOR CUSTOMER:
25 | P a g e
PLACING ORDER FOR CUSTOMER:
FEEDBACK OF CUSTOMER:
26 | P a g e
PERSONAL ORDER HISTORY OF CUSTOMER:
27 | P a g e
28 | P a g e
BIBLIOGRAPHY
Wikipedia
https://www.wikipedia.org/
Python
https://www.python.org/
MySQL
https://www.mysql.com/
29 | P a g e