0% found this document useful (0 votes)
32 views32 pages

Cs Project 1

Uploaded by

raimintu103
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views32 pages

Cs Project 1

Uploaded by

raimintu103
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

RANI LAXMI BAI MEMORIAL

SCHOOL,CHINHAT,LUCKNOW.

COMPUTER SCIENCE PROJECT


(2024-25)

TOPIC- Food Portal


SUBMITTED BY- Kanika Samanta
CLASS- XII
BOARD ROLL NO.-
-:UNDER THE GUIDANCE OF:-
Mrs. Rama Samal
ACKNOWLEDGEMENT
I undertook this project as part of
my XII Computer science course. I
had tried to apply my best
knowledge gained during the study
and class work experience.
However, developing system
software is generally quite complex
and time consuming process .It
requires a systematic study, insight
vision and professional approach
during the design and development
.I would like to extend my sincere
thanks and gratitude to my teacher
Mrs. Rama Samal .I am very thankful
to our principal Mrs .Sita Sethi for
giving us valuable time and moral
support in completing this project.
Kanika Samanta ,XII
CERTIFICATE
This is to certify that the food portal
is a bonafide work done by Kanika
Samanta of class XII session 2024-
25 in partial fulfilment of CBSE’s
AISSCE examination 2025 has been
carried out under my supervision
and guidance. This report or a
similar report on the topic has not
been submitted for any other
examination and does not form a
part of any other course undergone
by the candidate.

Signature of Internal Examiner:

Signature of External Examiner:

Signature of Principal:
INTRODUCTION , OBJECTIVE AND
SCOPE OF THE PROJECT
In our busy lives ,finding a quick and
delicious meal can be difficult. But
worry not as we present to you THE
FOOD PORTAL- a digital heaven for all
your culinary cravings .The control of
this food portal lies in the hands of the
admin as it is secured with a password.
This portal allows the customers to
browse through a tempting menu and
place their order to taste the unique
flavours and satisfy their taste buds.
The exit is as smooth as your favourite
dessert and we are always ready to
welcome you back for your next
gastronomical adventure. Our mission
is to create a vibrant and
interconnected food community. Join
us in this exciting journey and feel free
to provide your suggestions for the
improvement of this food portal.
SYSTEM IMPLEMENTATION
Hardware used:
1)Processor: Intel(R) Core(TM) i3-
10110U CPU @ 2.10GHz 2.59 GHz
2)Installed RAM: 8.00 GB
3)System type: 64-bit operating
system, x64-based processor
4)Pen and touch: No pen or touch
input is used.

Software used:
1)Microsoft Windows 11 as
operating system.
2)Python IDLE 3.11.3
3)MYSQL
PYTHON
Python is a popular programming
language which was created by
Guido van Rossum and released in
1991. It is used to create web
applications and connect database
systems.
Python works on various platforms
and has a simple syntax that allows
developers to write programs with
fewer lines of code.
IDLE(Integrated development and
learning environment) is an
integrated development
environment for python which is
used to execute a single statement
just like python shell and also to
create, modify, and execute python
scripts.
MYSQL
MYSQL is a relational database
management system (RDBMS)
developed by Oracle that is based
on structured query language(SQL).
Python MYSQL Connector is a
python driver that helps to integrate
Python and MYSQL. This python
MYSQL library allows the
conversion between python and
MYSQL data types. MYSQL
connector API is implemented using
pure python and does not require
any third party library.
CODING
import mysql.connector as p
file_obj=p.connect(host='localhost',
user='root',passwd='sk2977',datab
ase='restaurant')
mycursor=file_obj.cursor()

#Adding food in menu for admin


def add_food():
mycursor=file_obj.cursor()
while True:
fi=int(input("Enter food ID:"))
fn=input("Enter food name:")
fp=int(input("Enter food
price:"))
ft=input("Enter food type:")
mycursor.execute("insert into
menu
values({},'{}',{},'{}')".format(fi,fn,fp,ft
))
print("NEW ITEM ADDED IN
THE MENU SUCCESSFULLY")
file_obj.commit()
x=input("Want to add more to
menu?-yes/no:")
if x=='no':
break

#Updating menu for admin


def update_food():
mycursor=file_obj.cursor()
print("1.update food name")
print("2.update food price")
k=int(input("enter your
choice:"))
if k==1:
foodid=int(input("Enter food id
whose name you want to update:"))
foodname=input("Enter the
updated food name:")
mycursor.execute("Update
menu set FOOD_NAME='{}' where
FOOD_ID={}".format(foodid,foodna
me))
print("UPDATED
SUCCESSFULLY")
file_obj.commit()
elif k==2:
f=int(input("Enter food id
whose price you want to update:"))
fpp=int(input("Enter the
updated food price:"))
mycursor.execute("Update
menu set FOOD_PRICE={} where
FOOD_ID={}".format(f,fpp))
print("UPDATED
SUCCESSFULLY")
file_obj.commit()
print("You have been
redirected to the admin page")
admin_page()'''

#Deleting food option for admin


def delete_food():
mycursor=file_obj.cursor()
fkk=int(input("Enter food id you
want to delete:"))
mycursor.execute("delete from
menu where
FOOD_ID={}".format(fkk))
print("YOU HAVE DELETED A
FOOD ITEM SUCCESSFULLY")
file_obj.commit()

#Viewing order history for admin


def view_orders():
mycursor=file_obj.cursor()
print("Details of all orders are:")
mycursor.execute("select * from
orders")
data=mycursor.fetchall()
for i in data:

print("********************************
***************************************
**************")
print("Food name:",i[0])
print("Food price:",i[1])
print("Total price:",i[2])
print("Phone number:",i[3])
print("Address:",i[4])

print("********************************
***************************************
**************")

#Login option for admin


def ad_login():
while True:
print("1.Add food")
print("2.Update food")
print("3.Delete food")
print("4.View orders")
print("5.Logout")
a=int(input("Enter your
choice:"))
if a==1:
add_food()
if a==2:
update_food()
if a==3:
delete_food()
if a==4:
view_orders()
if a==5:
return

#Password for admin to login


def ad_panel():
paswd=input("Enter password")
if paswd=="Akaay's food":
print("Access granted")
ad_login()
else:
print("Wrong password")
print("You have been
redirected to the main page")
admin()'''

#menu card for customer


'''def show_menu():
mycursor.execute("select * from
menu")
data=mycursor.fetchall()

print("********************************
*MENU*******************************
*************")
for i in data:
print("Food no.:",i[0],"|","Food
name:",i[1],"|","Food
price:",i[2],"|","Food type:",i[3])
j=input("Do you want to order
food?")
if j=="Yes":
food_order()
else:
print("Thank You")
print("You have been
redirected to the main page")

#Ordering food item


def order_food():
d=int(input("Enter the food id you
want to order"))
qty=int(input("Enter the quantity
of food"))
phone=int(input("Enter your
phone number"))
add=input("Enter your address")
mycursor.execute("Select *from
menu where FOOD_ID=%s",(d,))
data=mycursor.fetchall()
print(data)
if data:
name=data[0][1]
price=data[0][2]
tprice=price*qty
v="insert into
orders(FOOD_NAME,FOOD_PRICE,
TOTAL_FOOD_PRICE,PHONE_NUM
BER,ADDRESS)values(%s,%s,%s,%
s,%s)"

values=(name,price,tprice,phone,a
dd)
mycursor.execute(v,values)
file_obj.commit()
else:
print("No data found for the
given food id")

print("******************BILL*********
***********")
print("Food name:",name)
print("Food price:",price)
print("Quantity of food:",qty)
print("Total price:",tprice)
print("Address:",add)
print("Phone number:",phone)

print("********************************
**********")
print("Thanks for ordering food!")
print("Your order has been
confirmed.")
print("You have been redirected
to the main page")
mycursor.execute(v)
file_obj.commit()

#Viewing your food order


def view():
px=int(input("Enter your phone
number:"))
a="select * from orders where
PHONE_NUMBER={}".format(px)
mycursor.execute(a)
data=mycursor.fetchall()
if len(data)>0:
for i in data:
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 number:",i[3])
print("Address:",i[4])
else:
print("You have not placed any
order")
file_obj.commit()

#Cancelling your food order


def f_cancel():
ph=int(input("Enter your phone
number:"))
z="delete from orders where
PHONE_NUMBER={}".format(ph)
mycursor.execute(z)
print("Your order has been
successfully cancelled")
print("You have been redirected
to the main page")
file_obj.commit()

#Feedback option for customer


def feedb():
pv=int(input("enter your phone
number:"))
print("Give us feedback...")
f=input("")
z="insert into feed values
PHONE_NUMBER,FEEDBACK={},'{}
'".format(pv,f)
print("Thanks for your
feedback!")
print("You have been redirected
to the main page")
file_obj.commit()

#Main menu for customer


def mainmenu():
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")
s=int(input("Enter the service
you want"))
if s==1:
show_menu()
if s==2:
order_food()
if s==3:
view()
if s==4:
f_cancel()
if s==5:
feedb()
if s==6:
break

#Homepage
def admin():
while True:

print("********************************
************************Welcome to
food
portal*********************************
*****************************")
print("1.Admin login")
print("2.Customer login")
print("3.Exit")
y=int(input("Enter option of
your choice"))
if y==1:
ad_panel()
if y==2:
mainmenu()
if y==3:
break
MYSQL DATABASE
FOOD ITEM TABLE:

FOOD ORDER TABLE:


FEEDBACK TABLE:

OUTPUTS
FOOD PORTAL MAIN PAGE:
ADMIN LOGIN OPTION:

ADDING FOOD ITEM BY ADMIN:


UPDATING FOOD PRICE BY
ADMIN:

DELETING FOOD ITEM BY


ADMIN:

FOOD ITEMS FOR CUSTOMER:


PLACING ORDER FOR
CUSTOMER:

FEEDBACK OF CUSTOMER:
ORDER HISTORY OF
CUSTOMER:

CANCELLING YOUR FOOD


ORDER:
BIBLIOGRAPHY
1)Class XI and XII Computer
Science book(Sumita Arora)

2)Our Computer Science


teacher: Mrs. Rama Samal

You might also like