Professional Documents
Culture Documents
Food Ordering System
Food Ordering System
TEACHER INCHARGE
(Mrs .Satyseela Yagnamurthy)
DATE :-
ACKNOWLEDGE
MENT
I would like to express my special thanks of
gratitude to my Computer Science Teacher,
Mrs. Satyseela Yagnamurthy, as well as our
principal, Mrs. Suvarna Khot, for their
precious guidance and forgiving me this
golden opportunity to do this project which
also helped me in doing a lot of research and
learn new things.
SOURCE CODE:
import os
import platform
import mysql.connector
import pandas as pd
#creating DB
mycursor = mydb.cursor()
mycursor.execute("use food1")
#creating Tables
mycursor.execute("""
emp_g VARCHAR(10),
eage INT,
emp_phone BIGINT,
pwd VARCHAR(255)
""")
mycursor.execute("""
cphone BIGINT,
payment INT,
pstatus VARCHAR(20),
email VARCHAR(255),
orderid INT,
date DATE
""")
mycursor.execute("""
Food_size VARCHAR(20),
prize INT
""")
mycursor.execute("""
C_id INT,
Emp_id INT,
Food_id INT,
Food_qty INT,
Total_price INT
""")
feedeposit INT,
month VARCHAR(10)
""")
# main COde
def Customer():
L = []
L.append(c_id)
L.append(name)
L.append(cphone)
payment = int(input("Enter payment method (1 for credit card, 2 for Debit Card): "))
L.append(payment)
L.append(pstatus)
L.append(email)
L.append(orderid)
L.append(date)
cust = (L,)
sql = "INSERT INTO customer (c_id, name, cphone, payment, pstatus, email, orderid, date) VALUES (%s, %s,
mycursor.execute(sql, cust)
mydb.commit()
def Employee():
L = []
L.append(Emp_id)
L.append(ename)
L.append(emp_g)
L.append(eage)
L.append(emp_phone)
L.append(pwd)
sql = "INSERT INTO Employee (Emp_id, ename, emp_g, eage, emp_phone, pwd) VALUES (%s, %s, %s, %s,
%s, %s)"
mycursor.execute(sql, EMP)
mydb.commit()
def Food():
L = []
L.append(Food_id)
L.append(Foodname)
L.append(Food_size)
L.append(prize)
Food = (L,)
sql = "INSERT INTO Food (Food_id, Foodname, Food_size, prize) VALUES (%s, %s, %s, %s)"
mycursor.execute(sql, Food)
mydb.commit()
def OrderFood():
L = []
L.append(Orderf_id)
L.append(C_id)
L.append(Emp_id)
L.append(Food_id)
L.append(Food_qty)
L.append(Total_price)
sql = "INSERT INTO OrderFood (Orderf_id, C_id, Emp_id, Food_id, Food_qty, Total_price) VALUES (%s, %s,
mycursor.execute(sql, OrderFood)
mydb.commit()
def View():
print("1. Employee")
print("2. Customer")
print("3. Food")
if ch == 1:
res = mycursor.fetchall()
for x in res:
print(x)
elif ch == 2:
mycursor.execute(sql, (c_name,))
res = mycursor.fetchall()
for x in res:
print(x)
elif ch == 3:
mycursor.execute(sql)
res = mycursor.fetchall()
for x in res:
print(x)
elif ch == 4:
mycursor.execute(sql, (food_id,))
res = mycursor.fetchall()
for x in res:
print(x)
def MenuSet():
except ValueError:
else:
print("\n")
if userInput == 1:
Employee()
elif userInput == 2:
Customer()
elif userInput == 3:
Food()
elif userInput == 4:
OrderFood()
elif userInput == 5:
View()
else:
def runAgain():
if platform.system() == "Windows":
os.system("cls")
else:
os.system("clear")
MenuSet()
MenuSet()
1. Employee
2. Customer
3. Food
4. Order Food