[go: up one dir, main page]

0% found this document useful (0 votes)
26 views21 pages

Certificate Merged

Uploaded by

Shreyansh Jain
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)
26 views21 pages

Certificate Merged

Uploaded by

Shreyansh Jain
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/ 21

CERTIFICATE

This is to certify that Krish Jain and


Shreyansh Jain of class: XII - B of Bharti
Public School Swasthya Vihar has done their
project on Restaurant Management System
under my supervision. They have taken
interest and has shown at most sincerity in
completion of this project.
I certify this project up to my expectation & as
per guidelines issued by CBSE, NEW DELHI.

Signature
ACKNOWLEDGEMENT

It is with pleasure that we acknowledge our


sincere gratitude to our teacher, Ms Yukti
Agarwal who taught and undertook the
responsibility of teaching the subject
computer science. I have been greatly
benefited from her classes.
I am especially indebted to our Principal
Ms Savita Arora who has always been a
source of encouragement and support and
without whose inspiration this project
would not have been a successful I would
like to place on record heartfelt thanks to
her.
Finally, I would like to express my sincere
appreciation for all the other students for
my batch their friendship & the fine time
that we all shared together.
HARDWARES AND SOFTWARES USED

HARDWARES
1) Desktop Computer
2) Mobile Phone

SOFTWARES
1) Python
2) SQL
3) Python mysql connector module
INTRODUCTION
The Restaurant Management System is a
software solution designed to streamline the
process of managing and operating a
restaurant. This system aims to automate and
simplify key restaurant operations, making it
more efficient and user-friendly for both
customers and restaurant staff.
The primary objective of the system is to
handle tasks such as managing the menu,
processing customer orders, recording
feedback, and generating bills, all while
ensuring a smooth and responsive experience
for the user. This system leverages MySQL as
the backend database to store critical
information related to the restaurant's menu,
customer orders, and feedback.
Key Features:
1. Menu Management: The system
allows the restaurant to maintain a list of
dishes available for customers to order,
along with their prices and categories
(e.g., vegetarian, non-vegetarian, etc.).
2. Order Management: Customers can
view the menu and place orders, including
selecting the dish, specifying the quantity,
and choosing the delivery method (home
delivery or pick-up). The system
calculates the total price based on the
selected quantity.
3. Customer Details: When a customer
places an order, their details such as
name, mobile number, address, and order
details are captured and stored in the
database. This information is then used
for future references, such as order
tracking and bill generation.
4. Feedback Management: After placing
an order, customers have the option to
provide feedback, which is recorded in the
system for review. This helps the
restaurant gain insights into customer
satisfaction.
5. Order History and Bill Generation:
The system enables restaurant staff to
view all past orders and generate bills for
customers. The bill includes detailed
information about the ordered items, their
quantities, and the total amount due.
6. User Interface: The system provides
a text-based user interface, which guides
the user through various options, such as
viewing the menu, placing orders,
submitting feedback, and generating bills.
It ensures a seamless interaction with
customers and restaurant staff.
FUNCTIONS USED

Function Purpose Main Operations


Name
vmen() View the Display menu
restaurant items, ask if the
menu. user wants to
order, choose
delivery and
payment
methods.
byo() Place an Get dish number,
order. quantity,
customer details,
and insert order
into the
database.
fdbck() Submit Collect feedback
feedback. message from
user and insert it
into the feedback
table.
view_orders() View all Fetch and display
customer all customer
orders.
orders from the
database.
generate_bill() Generate a bill Fetch order
for a specific details using
order. order_id and
display the bill.
main() Main function Display menu,
that provides call other
the overall functions based
menu and on user input,
navigation. and control the
flow of the
system.
import mysql.connector

# Establish the database connection


connection = mysql.connector.connect(
host="localhost",
user="root",
password="mysql",
charset='utf8'
)

cursor = connection.cursor()

# Create the database


cursor.execute("CREATE DATABASE IF NOT EXISTS restaurant")
cursor.execute("USE restaurant")

# Create 'menu' table


cursor.execute("""
CREATE TABLE IF NOT EXISTS menu (
ID INT PRIMARY KEY,
DISH_NAME VARCHAR(100) NOT NULL,
PRICE DECIMAL(10, 2) NOT NULL,
TYPE VARCHAR(50) NOT NULL
)
""")

# Customer details
cursor.execute("""
CREATE TABLE IF NOT EXISTS cusdet (
ORDER_ID INT AUTO_INCREMENT PRIMARY KEY,
QUANTITY INT NOT NULL,
NAME VARCHAR(100) NOT NULL,
MOBNO INT NOT NULL,
ADDRESS VARCHAR(255) NOT NULL,
ITEM_NAME VARCHAR(100) NOT NULL,
TOTAL_PRICE DECIMAL(10, 2) NOT NULL
)
""")

# Create 'feedback' table


cursor.execute("""
CREATE TABLE IF NOT EXISTS feedback (
ID INT AUTO_INCREMENT PRIMARY KEY,
NAME VARCHAR(100) NOT NULL,
MESSAGE TEXT NOT NULL
)
""")

# Function to view the menu


def vmen():
cursor.execute("SELECT * FROM menu")
menu = cursor.fetchall()

if menu:
print("\nAvailable Dishes:")
for dish in menu:
print(f"{dish[0]}. {dish[1]} - {dish[3]} - Rs{dish[2]}")
else:
print("No dishes available.")
choice = input("\nDo you want to order? (yes/no): ").strip().lower()
if choice == 'yes':
byo()
print("\nChoose Delivery Method:")
print("1. Home Delivery")
print("2. Pick-Up")
choice = input("Enter your choice: ").strip()

if choice == '1':
print("Home delivery selected. Your order will be delivered shortly.")
elif choice == '2':
print("Pick-Up selected. Your order will be ready for collection.")
else:
print("Invalid choice. Defaulting to Home Delivery.")
print("Home delivery selected. Your order will be delivered shortly.")
print("\nChoose Payment Method:")
print("1. Cash on Delivery")
print("2. Online Payment")
choice = input("Enter your choice: ").strip()

if choice == '1':
print("Cash on Delivery selected. Please prepare the exact amount.")
elif choice == '2':
print("Online Payment selected. You will receive payment details shortly.")
else:
print("Invalid choice. Defaulting to Cash on Delivery.")
print("Cash on Delivery selected. Please prepare the exact amount.")
else:
print("Goodbye!")
# Function to place an order
def byo():
try:
dish_id = int(input("Enter dish number to order: "))
quantity = int(input("Enter quantity: "))
query = "SELECT * FROM menu WHERE ID = " + str(dish_id)
cursor.execute(query)
dish = cursor.fetchone()

if dish:
dish_name = dish[1]
price = dish[2]
total_price = price * quantity

name = input("Enter your name: ")


mobno = int(input("Enter your mobile number: "))
address = input("Enter your address: ")

insert_query = f"""
INSERT INTO cusdet (QUANTITY, NAME, MOBNO, ADDRESS, ITEM_NAME,
TOTAL_PRICE)
VALUES ({quantity}, '{name}', {mobno}, '{address}', '{dish_name}', {total_price})
"""
cursor.execute(insert_query)
print(f"\nOrder placed! Total: Rs{total_price}")
connection.commit()
else:
print("Dish not found.")
except ValueError:
print("Invalid input. Please enter valid data.")

# Function to submit feedback


def fdbck():
name = input("Enter your name: ")
message = input("Enter your feedback: ")

if message:
insert_query = f"""
INSERT INTO feedback (NAME, MESSAGE)
VALUES ('{name}', '{message}')
"""
cursor.execute(insert_query)
print("Thank you for your feedback!")
connection.commit()
else:
print("Feedback cannot be empty.")

# Function to view orders


def view_orders():
cursor.execute("SELECT * FROM cusdet")
orders = cursor.fetchall()

if orders:
print("\nOrders:")
for order in orders:
print(f"Order ID: {order[0]}, Name: {order[2]}, Item: {order[5]}, Quantity: {order[1]}, Total:
${order[6]}, Address: {order[4]}")
else:
print("No orders found.")
# Function to generate bill
def generate_bill(order_id):
try:
query = f"SELECT * FROM cusdet WHERE ORDER_ID = {order_id}"
cursor.execute(query)
order = cursor.fetchone()

if order:
print("\n--- Bill ---")
print(f"Order ID: {order[0]}")
print(f"Customer Name: {order[2]}")
print(f"Mobile Number: {order[3]}")
print(f"Address: {order[4]}")
print(f"Item Name: {order[5]}")
print(f"Quantity: {order[1]}")
print(f"Total Price: Rs{order[6]}")
print("----------------")
else:
print("Order not found.")
except ValueError:
print("Invalid input. Please enter a valid Order ID.")

# Main function to run the system


def main():
while True:
print("\nWelcome to the Food Ordering System!")
print("1. View Menu")
print("2. View Orders")
print("3. Generate bill")
print("4. Submit Feedback")
print("5. Exit")

choice = input("Choose an option: ").strip()

if choice == '1':
vmen()
elif choice == '4':
fdbck()
elif choice == '2':
view_orders()
elif choice == '3':
try:
order_id = int(input("Enter Order ID to generate bill: "))
generate_bill(order_id)
except ValueError:
print("Invalid input. Please enter a valid Order ID.")
elif choice == '5':
print("Exiting...")
break
else:
print("Invalid choice. Please try again.")
main()
cursor.close()
connection.close()
Tables in database ‘restaurant’ :

Description and data in table cusdet :


Description and data in table menu;
Description and data in table feedback :
BIBILOGRAPHY

www.google.com
www.wikipedia.org
www.yahoo.com
Class XII Computer Science NCERT Textbook

You might also like