0% found this document useful (0 votes)
18 views40 pages

RISHI

Rishi Verma from JUSCO School South submitted a Computer Science project on a Restaurant Management System (RMS) under the supervision of Mr. Gurpreet Singh. The project includes a detailed overview of the RMS, its key features, and the necessary hardware and software requirements, along with Python code for implementing various functionalities such as menu management, order processing, and inventory control. The document also acknowledges the support of teachers and peers in completing the project.

Uploaded by

Dilshad Alam
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)
18 views40 pages

RISHI

Rishi Verma from JUSCO School South submitted a Computer Science project on a Restaurant Management System (RMS) under the supervision of Mr. Gurpreet Singh. The project includes a detailed overview of the RMS, its key features, and the necessary hardware and software requirements, along with Python code for implementing various functionalities such as menu management, order processing, and inventory control. The document also acknowledges the support of teachers and peers in completing the project.

Uploaded by

Dilshad Alam
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/ 40

JUSCO SCHOOL SOUTH

Computer Science Project

Topic: Restaurant Management System


Submitted by: RISHI VERMA (XII – ‘B’)
Roll No.:
Submitted To: MR. GURPREET SINGH

1
CERTIFICATE
This is to certify that RISHI VERMA of class
XII B of JUSCO SCHOOL SOUTH PARK has
done his project on RESTAURANT
MANAGEMENT SYSTEM under my
supervision. He has 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.

Internal Examiner External Examiner

Principal

2
ACKNOWLEDGEMENT
It is with pleasure that I acknowledge my
sincere gratitude to our teacher, MR.
GURPREET SINGH who taught and
undertook the responsibility of teaching
the subject computer science. I have been
greatly benefited from his classes. I am
especially indebted to our Principal MRS.
MILI SINHA who has always been a source
of encouragement and support and
without whose inspiration this project
would not have been 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.

3
HARDWARE AND
SOFTWARE REQUIRED
HARDWARE
1. Processor: 1GHz or higher
2. RAM: 2 GB minimum
3. Storage: 100 MB free space

SOFTWARE
1. Python (latest version)
2. MySQL
3. MySQL Connector for Python

4
CONTENT

Sl. Topics
No.
1. About Restaurant
2. Introduction
3. Python code
4. MySQL database
5. Outputs
6. References

5
RESTAURANT
A restaurant is an establishment dedicated
to providing a curated dining experience
that combines quality cuisine, impeccable
service, and a welcoming atmosphere. It
serves as a space where people gather to
enjoy meals prepared by skilled chefs,
showcasing a variety of culinary traditions
and innovations. Restaurants play a vital
role in fostering social connections,
celebrating milestones, and creating
memorable moments for guests. From fine
dining establishments to casual eateries,
the core of a restaurant lies in its
commitment to offering exceptional food,
ambiance, and hospitality. With a focus on
quality and guest satisfaction, restaurants
are an essential part of cultural and social
life.
6
INTRODUCTION
The Restaurant Management System
(RMS) is an innovative application that
leverages computer networks and
database management systems to
streamline the operations of restaurants.
The goal of an RMS is to integrate and
automate key aspects of a restaurant's
workflow, including menu management,
order processing, payment handling,
inventory tracking, staff management, and
reservation systems. In the modern era,
the integration of computer networks
within these systems is not just a
convenience but a necessity to ensure
seamless communication, enhanced
efficiency, and an exceptional customer
experience.

7
The Role of Computer Networks in RMS
A computer network forms the backbone
of an RMS by enabling data flow between
different components of the system. For
instance:

1. Client-Server Architecture: An RMS


typically operates on a client-server
model, where the database and
business logic reside on a central
server. Client devices like tablets,
point-of-sale (POS) systems, or
smartphones interact with the server
over a local area network (LAN) or
the internet. This architecture
ensures that multiple users, such as
waitstaff, kitchen staff, and
management, can access the system
simultaneously in real time.

8
2. Centralized Data Management: The
system relies on a relational
database, such as MySQL, to store
essential data like menu items,
orders, customer details, and
employee records. By connecting this
database over a network, the system
ensures that all users have up-to-date
information. For example, when an
order is placed at a table, it
immediately reflects in the kitchen
display system, eliminating delays
and miscommunication.

3. Cloud Connectivity: Many modern


RMS solutions extend their
functionality to the cloud, providing
remote accessibility. Cloud-based
systems allow restaurant owners to
monitor operations from anywhere,
track sales, or update menus

9
dynamically. This feature is especially
beneficial for restaurant chains, as it
ensures uniformity and centralized
control across multiple outlets.

4. Enhanced Customer Interaction:


Networks facilitate direct interaction
between customers and the system
through self-service kiosks or mobile
apps. Customers can browse the
menu, place orders, and even make
payments online. Such interactions
improve customer satisfaction and
reduce the burden on restaurant
staff.
KEY FEATURES
1. Menu Management: View, add, and
update menu items, categorized with
pricing details.

10
2. Order Processing: Place customer
orders, track order histories, and
calculate payments efficiently.
3. Inventory Control: Monitor stock
levels and update inventory
quantities as needed.
4. Customer and Employee
Management: Maintain records of
customers and employees, including
adding new entries and updating
existing details.
5. Reservations Handling: Enable
customers to reserve tables with
details like date, time, and party size.
6. Search Functionality: Quickly search
menu items by name or category for
convenience.

11
PYTHON
CODES

12
import mysql.connector

from mysql.connector import Error

from datetime import datetime

# Function to create a MySQL database connection

def create_connection():

connection = None

try:

connection = mysql.connector.connect(

host='localhost',

user='root', # replace with your username

password='password', # replace with your password

database='RestaurantDB'

print("Connection to MySQL DB successful.")

except Error as e:

print(f"The error '{e}' occurred.")

return connection

# Function to close the database connection

def close_connection(connection):

if connection:

connection.close()

print("MySQL connection closed.")

# Class to manage the restaurant system

class RestaurantManagementSystem:

13
def __init__(self, connection):

self.connection = connection

# View Menu

def view_menu(self):

try:

cursor = self.connection.cursor()

cursor.execute("SELECT * FROM Menu")

menu_items = cursor.fetchall()

if not menu_items:

print("No menu items found.\n")

else:

print("Menu:")

print("{:<5} {:<40} {:<30} {:<15}".format("ID", "Name", "Price", "Category"))

for item in menu_items:

print("{:<5} {:<40} ₹{:<30} {:<15}".format(item[0], item[1], item[2], item[3]))

print()

except Error as e:

print(f"Error retrieving menu: {e}")

# Add Menu Item

def add_menu_item(self):

item_name = input("Enter item name: ")

price = float(input("Enter item price: "))

category = input("Enter item category: ")

try:

cursor = self.connection.cursor()

cursor.execute("INSERT INTO Menu (item_name, price, category) VALUES (%s, %s, %s)",

14
(item_name, price, category))

self.connection.commit()

print(f"Menu item '{item_name}' added successfully.\n")

except Error as e:

print(f"Failed to add menu item: {e}")

# Update Menu Item

def update_menu_item(self):

self.view_menu()

item_id = int(input("Enter the ID of the item to update: "))

new_name = input("Enter new item name (press Enter to skip): ")

new_price = input("Enter new item price (press Enter to skip): ")

new_category = input("Enter new item category (press Enter to skip): ")

try:

cursor = self.connection.cursor()

if new_name:

cursor.execute("UPDATE Menu SET item_name = %s WHERE item_id = %s",

(new_name, item_id))

if new_price:

cursor.execute("UPDATE Menu SET price = %s WHERE item_id = %s",

(new_price, item_id))

if new_category:

cursor.execute("UPDATE Menu SET category = %s WHERE item_id = %s",

(new_category, item_id))

self.connection.commit()

print(f"Menu item ID {item_id} updated successfully.\n")

15
except Error as e:

print(f"Failed to update menu item: {e}")

# Place Order

def place_order(self):

table_number = int(input("Enter table number: "))

order_items = []

while True:

item_id = int(input("Enter menu item ID to order (0 to finish): "))

if item_id == 0:

break

quantity = int(input("Enter quantity: "))

order_items.append((item_id, quantity))

try:

cursor = self.connection.cursor()

cursor.execute("INSERT INTO Orders (table_number) VALUES (%s)", (table_number,))

order_id = cursor.lastrowid

for item_id, quantity in order_items:

cursor.execute("INSERT INTO OrderDetails (order_id, item_id, quantity) VALUES (%s, %s,


%s)",

(order_id, item_id, quantity))

self.connection.commit()

print(f"Order placed successfully. Order ID: {order_id}\n")

except Error as e:

print(f"Failed to place order: {e}")

# View Order History

16
def view_order_history(self):

try:

cursor = self.connection.cursor()

cursor.execute("""

SELECT o.order_id, o.table_number, od.item_id, m.item_name, od.quantity

FROM Orders o

JOIN OrderDetails od ON o.order_id = od.order_id

JOIN Menu m ON od.item_id = m.item_id

""")

orders = cursor.fetchall()

if not orders:

print("No orders found.\n")

else:

print("Order History:")

print("{:<10} {:<15} {:<10} {:<20} {:<10}".format("Order ID", "Table No", "Item ID", "Item
Name", "Quantity"))

for order in orders:

print("{:<10} {:<15} {:<10} {:<20} {:<10}".format(order[0], order[1], order[2], order[3],


order[4]))

print()

except Error as e:

print(f"Error retrieving orders: {e}")

# Process Payment

def process_payment(self):

order_id = int(input("Enter the Order ID for payment: "))

try:

cursor = self.connection.cursor()

17
cursor.execute("""

SELECT SUM(m.price * od.quantity)

FROM OrderDetails od

JOIN Menu m ON od.item_id = m.item_id

WHERE od.order_id = %s

""", (order_id,))

total = cursor.fetchone()[0]

if total is None:

print("Order ID not found or no items in the order.\n")

return

print(f"Total payment due: ₹{total:.2f}")

cursor.execute("DELETE FROM Orders WHERE order_id = %s", (order_id,))

self.connection.commit()

print(f"Payment processed for Order ID: {order_id}\n")

except Error as e:

print(f"Failed to process payment: {e}")

# Add Inventory Item

def add_inventory_item(self):

self.view_menu() # Show menu to select an existing menu item

item_id = int(input("Enter the item ID from the menu to add to inventory: "))

stock = int(input("Enter initial stock quantity: "))

try:

cursor = self.connection.cursor()

cursor.execute("INSERT INTO Inventory (item_id, stock) VALUES (%s, %s)", (item_id, stock))

self.connection.commit()

print(f"Inventory item with ID {item_id} added successfully with stock {stock}.\n")

18
except Error as e:

print(f"Failed to add inventory item: {e}")

# View Inventory

def view_inventory(self):

try:

cursor = self.connection.cursor()

cursor.execute("""

SELECT m.item_id, m.item_name, i.stock

FROM Menu m

JOIN Inventory i ON m.item_id = i.item_id

""")

inventory = cursor.fetchall()

if not inventory:

print("No inventory items found.\n")

else:

print("Inventory:")

print("{:<18} {:<25} {:<10}".format("Item ID", "Item Name", "Stock"))

for item in inventory:

print("{:<18} {:<25} {:<10}".format(item[0], item[1], item[2]))

print()

except Error as e:

print(f"Error retrieving inventory: {e}")

# Update Inventory

def update_inventory(self):

self.view_inventory()

19
item_id = int(input("Enter item ID to update stock: "))

new_stock = int(input("Enter new stock quantity: "))

try:

cursor = self.connection.cursor()

cursor.execute("UPDATE Inventory SET stock = %s WHERE item_id = %s", (new_stock, item_id))

self.connection.commit()

print(f"Inventory for item ID {item_id} updated successfully.\n")

except Error as e:

print(f"Failed to update inventory: {e}")

# Add Customer

def add_customer(self):

customer_name = input("Enter customer name: ")

customer_phone = input("Enter customer phone: ")

try:

cursor = self.connection.cursor()

cursor.execute("INSERT INTO Customers (customer_name, customer_phone) VALUES (%s,


%s)",

(customer_name, customer_phone))

self.connection.commit()

print(f"Customer '{customer_name}' added successfully.\n")

except Error as e:

print(f"Failed to add customer: {e}")

# View Customers

def view_customers(self):

try:

cursor = self.connection.cursor()

20
cursor.execute("SELECT * FROM Customers")

customers = cursor.fetchall()

if not customers:

print("No customers found.\n")

else:

print("Customer List:")

print("{:<5} {:<20} {:<15}".format("ID", "Name", "Phone"))

for customer in customers:

print("{:<5} {:<20} {:<15}".format(customer[0], customer[1], customer[2]))

print()

except Error as e:

print(f"Error retrieving customers: {e}")

# Add Employee

def add_employee(self):

employee_name = input("Enter employee name: ")

employee_position = input("Enter employee position: ")

salary = float(input("Enter employee salary: "))

try:

cursor = self.connection.cursor()

cursor.execute("INSERT INTO Employees (employee_name, employee_position, salary)


VALUES (%s, %s, %s)",

(employee_name, employee_position, salary))

self.connection.commit()

print(f"Employee '{employee_name}' added successfully.\n")

except Error as e:

print(f"Failed to add employee: {e}")

21
# View Employees

def view_employees(self):

try:

cursor = self.connection.cursor()

cursor.execute("SELECT * FROM Employees")

employees = cursor.fetchall()

if not employees:

print("No employees found.\n")

else:

print("Employee List:")

print("{:<15} {:<30} {:<30} {:<10}".format("ID", "Name", "Position", "Salary"))

for employee in employees:

print("{:<15} {:<30} {:<30} ₹{:<10.2f}".format(employee[0], employee[1], employee[2],


employee[3]))

print()

except Error as e:

print(f"Error retrieving employees: {e}")

# Update Employee

def update_employee(self):

self.view_employees()

employee_id = int(input("Enter the ID of the employee to update: "))

new_name = input("Enter new employee name (press Enter to skip): ")

new_position = input("Enter new employee position (press Enter to skip): ")

new_salary = input("Enter new employee salary (press Enter to skip): ")

try:

cursor = self.connection.cursor()

22
if new_name:

cursor.execute("UPDATE Employees SET employee_name = %s WHERE employee_id = %s",


(new_name, employee_id))

if new_position:

cursor.execute("UPDATE Employees SET employee_position = %s WHERE employee_id =


%s", (new_position, employee_id))

if new_salary:

cursor.execute("UPDATE Employees SET salary = %s WHERE employee_id = %s",


(new_salary, employee_id))

self.connection.commit()

print(f"Employee ID {employee_id} updated successfully.\n")

except Error as e:

print(f"Failed to update employee: {e}")

# Generate Employee Payroll

def generate_payroll(self):

try:

cursor = self.connection.cursor()

cursor.execute("SELECT employee_id, employee_name, salary FROM Employees")

employees = cursor.fetchall()

if not employees:

print("No employees found.\n")

else:

print("Payroll:")

print("{:<5} {:<20} {:<10}".format("ID", "Name", "Salary"))

for employee in employees:

print("{:<5} {:<20} ₹{:<10}".format(employee[0], employee[1], employee[2]))

print()

except Error as e:

23
print(f"Error generating payroll: {e}")

# Generate Daily Report

def daily_report(self):

date = input("Enter the date for the report (YYYY-MM-DD): ")

try:

cursor = self.connection.cursor()

cursor.execute("""

SELECT SUM(m.price * od.quantity)

FROM Orders o

JOIN OrderDetails od ON o.order_id = od.order_id

JOIN Menu m ON od.item_id = m.item_id

WHERE DATE(o.order_date) = %s

""", (date,))

total_sales = cursor.fetchone()[0] or 0

cursor.execute("SELECT COUNT(*) FROM Orders WHERE DATE(order_date) = %s", (date,))

total_orders = cursor.fetchone()[0]

print(f"Daily Report for {date}:")

print(f"Total Sales: ₹{total_sales:.2f}")

print(f"Total Orders: {total_orders}\n")

except Error as e:

print(f"Error generating daily report: {e}")

# Add Reservation

def add_reservation(self):

24
self.view_customers() # Show customers to select from

customer_id = int(input("Enter customer ID for the reservation: "))

reservation_date = input("Enter reservation date and time (YYYY-MM-DD HH:MM:SS): ")

table_number = int(input("Enter table number: "))

number_of_people = int(input("Enter number of people: "))

try:

cursor = self.connection.cursor()

cursor.execute("""

INSERT INTO Reservations (customer_id, reservation_date, table_number, number_of_people)

VALUES (%s, %s, %s, %s)

""", (customer_id, reservation_date, table_number, number_of_people))

self.connection.commit()

print("Reservation added successfully.\n")

except Error as e:

print(f"Failed to add reservation: {e}")

# View Reservations

def view_reservations(self):

try:

cursor = self.connection.cursor()

cursor.execute("SELECT * FROM Reservations")

reservations = cursor.fetchall()

if not reservations:

print("No reservations found.\n")

else:

print("Reservations List:")

25
print("{:<10} {:<25} {:<25} {:<15} {:<10}".format("ID", "Customer ID", "Date and Time",
"Table No", "People"))

for reservation in reservations:

print("{:<10} {:<25} {:<25} {:<15} {:<10}".format(reservation[0], reservation[1],


str(reservation[2]), reservation[3], reservation[4]))

print()

except Error as e:

print(f"Error retrieving reservations: {e}")

# Search Menu Items

def search_menu(self):

search_term = input("Enter menu item name or category to search: ")

try:

cursor = self.connection.cursor()

cursor.execute("SELECT * FROM Menu WHERE item_name LIKE %s OR category LIKE %s",

('%' + search_term + '%', '%' + search_term + '%'))

results = cursor.fetchall()

if not results:

print("No matching items found.\n")

else:

print("Search Results:")

print("{:<5} {:<20} {:<10} {:<15}".format("ID", "Name", "Price", "Category"))

for item in results:

print("{:<5} {:<20} {:<10} {:<15}".format(item[0], item[1], item[2], item[3]))

print()

except Error as e:

print(f"Error searching menu: {e}")

26
# Function to run the restaurant management system

def run_restaurant():

connection = create_connection()

if connection is None:

return

restaurant = RestaurantManagementSystem(connection)

while True:

print("\nRestaurant Management System")

print("1. View Menu")

print("2. Add Menu Item")

print("3. Update Menu Item")

print("4. Place Order")

print("5. View Order History")

print("6. Process Payment")

print("7. View Inventory")

print("8. Update Inventory")

print("9. Add Inventory Item")

print("10. Add Customer")

print("11. View Customers")

print("12. Add Employee")

print("13. View Employees")

print("14. Update Employee")

print("15. Generate Employee Payroll")

print("16. Generate Daily Report")

print("17. Add Reservation")

27
print("18. View Reservations")

print("19. Search Menu")

print("20. Exit")

choice = input("Enter your choice: ")

if choice == '1':

restaurant.view_menu()

elif choice == '2':

restaurant.add_menu_item()

elif choice == '3':

restaurant.update_menu_item()

elif choice == '4':

restaurant.place_order()

elif choice == '5':

restaurant.view_order_history()

elif choice == '6':

restaurant.process_payment()

elif choice == '7':

restaurant.view_inventory()

elif choice == '8':

restaurant.update_inventory()

elif choice == '9':

restaurant.add_inventory_item()

elif choice == '10':

restaurant.add_customer()

elif choice == '11':

28
restaurant.view_customers()

elif choice == '12':

restaurant.add_employee()

elif choice == '13':

restaurant.view_employees()

elif choice == '14':

restaurant.update_employee()

elif choice == '15':

restaurant.generate_payroll()

elif choice == '16':

restaurant.daily_report()

elif choice == '17':

restaurant.add_reservation()

elif choice == '18':

restaurant.view_reservations()

elif choice == '19':

restaurant.search_menu()

elif choice == '20':

print("Exiting the system.")

close_connection(connection)

break

else:

print("Invalid choice. Please try again.")

if __name__ == “__main__”:

run_restaurant()

29
MySQL
DATAbASE

30
➢ All tables used: -

❖Describing all tables: -


1. Customers:

2. Employees:

3. Inventory:

31
4. Menu:

5. Orders:

6. Orders Details:

7. Reservations:

32
OUTPUTS

33
❖ First interface:

❖ View menu:

❖ Add menu item:

34
❖ Update menu item:

❖ Place order:

❖ View order history:

❖ Process payment:

❖ View inventory:

35
❖ Update inventory:

❖ Add inventory:

❖ Add customer:

❖ View customers:

36
❖ Add employee:

❖ View employees:

❖ Update employee:

❖ Employees payroll:

❖ Daily report:

37
❖ Add reservation:

❖ View reservations:

❖ Search menu:

❖ Exit the system:

38
REFERENCES
❖ Class 12 CS Sumita Arora Book
❖ Class 11 CS Sumita Arora Book
❖ MySQL
❖ Python IDLE

39
THANK
yOU

40

You might also like