FP CS PJ
FP CS PJ
SSCE -2024-25
Class-12 th
CERTIFICATE
EXAMINER
Acknowledgement
I would like to express my profound gratitude and
sincere appreciation to Mr. Mohan Chandra Satyawali, the
esteemed principal of our institution, for his unwavering
support and encouragement throughout this endeavor.
I also wish to extend my heartfelt thanks to my computer
science teacher, Mrs. Meena Rawat ,whose expert
guidance was instrumental in successfully completing
this project. Her invaluable mentorship, constant
encouragement, ans unwavering motivation have been a
driving force behind my progress at every stage of this
project.
Furthermore, I wish to acknowledge the significant
contribution of my parents and classmates, whose
invaluable assistance and advice were pivotal in the
successful execution of this project. Their consistent
support and guidance, provided at various junctures,
have been deeply appreciated.
I am profoundly grateful to all those who have played a
role in this realization of this project, and their support
has been instrumental in its successful completion.
Index
Certificate
Acknowledgement
Hardwares and Softwares Required
Introduction
Python Source Code
MySQL Database
Outputs
References
HARDWARES AND
SOFTWARES REQUIRED
• HARDWARES :-
1. Desktop Computer
2. PC
• SOFTWARES:-
1. Python (latest version)
2. MySQL
3. Python Connector Module
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.
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.
--------------------------------------------------
*************************************
--------------------------------------------------
*************************************
--------------------------------------------------
PYTHON SOURCE
CODE
--------------------------------------------------
*************************************
--------------------------------------------------
*************************************
--------------------------------------------------
import mysql.connector as pro
d=pro.connect(host="localhost",user="root",password="
admin",database="food")
e=d.cursor()
def add_food():
d=pro.connect(host="localhost",user="root",passwor
d="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()
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()
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()
def view_orders():
d=pro.connect(host="localhost",user="root",password="
admin",database="food")
e=d.cursor()
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("***************************************************
***")
def ad_login():
while 1:
print("1. Add food")
print("2. Update food")
print("3. Delete food")
print("4. View orders")
print("5. Logout")
ask=int(input("Enter your Choice: "))
if ask==1:
add_food()
elif ask==2:
update_food()
elif ask==3:
delete_food()
elif ask==4:
view_orders()
elif ask==5:
return
def ad_panel():
pas=input("Enter Password :")
if pas=='Zomato':
print("Access granted")
ad_login()
else:
print("Wrong Password")
print("You have been REdirected to the Main Page")
admin()
# FOOD ITEMS TO SHOW CUSTOMER
def show_menu():
def F_order():
e.execute(fi)
fi=e.fetchall()
iname=fi[0][1]
iprice=fi[0][2]
oprice=iprice*QTY
ins="insert into
orders(O_name,I_price,O_price,P_no,ADR)values('{}',{},{},{
},'{}')".format(iname,iprice,oprice,phn,ADR)
print("********BILL********")
print("Address:",ADR)
print("Phone NO:",phn)
print("Food name:",iname)
print('Food price:',iprice)
print("QTY of food:",QTY)
print('Total price:',oprice)
print("********************")
print("Thanks for ordering food")
print("Your order has been confirmed")
print("You have been Redirected to the MAIN PAGE")
e.execute(ins)
d.commit()
def F_View():
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()
def F_Cancel():
d.commit()
# FEEDBACK OPTION FOR CUSTOMER
def F_feedb():
def main_menu():
while True:
print("----------------------WELCOME TO FOOD PORTAL--
--------------------")
print("1. Main Menu")
print("2. Place your Orders")
print("3. View order")
print("4. Cancel your Order")
print("5. Feedback")
print("6. Exit")
a=int(input("Enter the Service you want:"))
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("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()
--------------------------------------------------
*************************************
--------------------------------------------------
*************************************
--------------------------------------------------
MySQL DATABASE
--------------------------------------------------
*************************************
--------------------------------------------------
*************************************
--------------------------------------------------
FOOD ITEM TABLE
FOOD ORDER TABLE
FEEDBACK TABLE
--------------------------------------------------
*************************************
--------------------------------------------------
*************************************
--------------------------------------------------
OUTPUTS
--------------------------------------------------
*************************************
--------------------------------------------------
*************************************
--------------------------------------------------
FOOD PORTAL MAIN PAGE
FEEDBACK OF CUSTOMER
PERSONAL ORDER HISTORY OF CUSTOMER
• Wikipedia
https://www.wikipedia.org/
• Python
https://www.python.org/
• MySQL
https://www.mysql.com/