0% found this document useful (0 votes)
15 views20 pages

Computer Project-1zxcxzzccz

This document outlines the development of a restaurant management system, detailing its purpose, features, and the technologies used in its implementation. It includes acknowledgments, a table of contents, an introduction to the system's functionalities, modules and functions utilized, hardware and software requirements, a flowchart of operations, and the source code for the program. The system aims to enhance operational efficiency, customer service, and profitability for restaurant owners.
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)
15 views20 pages

Computer Project-1zxcxzzccz

This document outlines the development of a restaurant management system, detailing its purpose, features, and the technologies used in its implementation. It includes acknowledgments, a table of contents, an introduction to the system's functionalities, modules and functions utilized, hardware and software requirements, a flowchart of operations, and the source code for the program. The system aims to enhance operational efficiency, customer service, and profitability for restaurant owners.
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/ 20

1

2
3. ACKNOWLEDGEMENT

In the accomplishment of this project successfully, many have bestowed upon


me their blessings and the heart pledged support, this time I am using to
thank all the people who have been concerned in my project.

Primarily I would like to thank the god for being able to complete this project
with success. Then I would like to thank my computer science teacher: Mrs.
Juliet Priya whose valuable guidance has been ones that helped me patch
this project make it full proof success. Her suggestions and her instructions
have served as the major contributions towards the completion to the project.

I would like to thank principal Mrs. Jyothi Menon who is a constant source of
encouragement to the students.

Finally, I would like to thank my parents and classmates for their valuable
suggestions and guidance.

3
4. TABLE OF CONTENTS

Content Page No.


1. Title 1
2. Bonafide 2
3. Acknowledgement 3
4. Table of contents 4
5. Introduction 5
6. Modules and functions used 6
7. H/w and s/w requirements 7
8. Flowchart of your project 9
9. Source code 10
10. Outputs 17
11. Bibliography 20

4
5. INTRODUCTION

A restaurant management system is a software program that helps restaurant owners


manage and operate their business more efficiently. It provides a range of tools and
features that allow restaurants to streamline their operations, improve customer service,
and increase profitability. Some common features of a restaurant management system
include point of sale (POS) functionality, inventory management, staff scheduling, and
customer relationship management. It can also include features for financial
management, such as accounting and payroll. By automating many of the tasks involved
in running a restaurant, a restaurant management system can save time and reduce the
risk of errors, allowing restaurant owners to focus on other aspects of their business.

One of the key features of a restaurant management system is its ability to track and
analyze sales data. This data can be used to make informed decisions about menu
pricing, inventory levels, and staffing needs. The system can also help to identify trends
and patterns in customer behavior, allowing businesses to tailor their marketing and
promotional efforts accordingly.

In addition to sales tracking and analysis, a restaurant management system can also help
to streamline other aspects of restaurant operations. For example, it can be used to
create and manage employee schedules, track employee hours, and process payroll. It
can also help with menu planning, allowing restaurants to optimize their menus based on
customer preferences and trends.

Another important feature of a restaurant management system is its ability to track and
manage customer relationships. This includes the ability to collect customer feedback,
track customer loyalty, and send personalized promotions and offers to customers.

Overall, a restaurant management system can be an invaluable tool for restaurant


owners and managers, helping to improve efficiency, increase profitability, and enhance
the customer experience. With its many features and capabilities, a restaurant
management system can help businesses in the food industry thrive in an increasingly
competitive market.

5
6. MODULES AND FUNCTIONS USED

mysql.connector is a Python driver that allows you to connect to MySQL servers from
Python. It is implemented as a pure Python C extension, and it supports the following
features:

 Connect to MySQL servers from Python


 Connect to MySQL servers using connection pools
 Execute SQL statements and stored procedures
 Iterate over the results of a query
 Fetch large result sets using chunks
 Call stored procedures
 Support for all MySQL data types

The following functions were used in making this program :-

 import statement
 mysql.connector.connect()
 cc.connect()
 con.cursor()
 cur.execute()
 cur.fetchall()
 con.commit()
 print()
 input()

6
7. HARDWARE & SOFTWARE REQUIREMENTS

 Hardware – Basic Requirements


 To run Python, you will need a computer with at least:
 A processor with at least 1 GHz of speed (preferably faster)
 At least 2 GB of RAM (preferably more)
 A hard drive with at least 10 GB of free space (preferably more)
 A graphics card that supports at least OpenGL 2.0 (preferably newer)
 An operating system that supports Python (such as Windows, macOS, or Linux)

 Software - Python
 Python is a high-level, interpreted programming language that is widely used
for web development, data analysis, scientific computing, and artificial
intelligence.
 Python has a large, active community of developers who contribute to its open-
source ecosystem of libraries and frameworks.
 Python is known for its simplicity and readability, with a syntax that is easy to
learn and use.
 Python supports object-oriented, functional, and imperative programming
styles, making it a versatile language for a wide range of applications.
 Python has a large standard library, as well as third-party libraries and
frameworks, that provide tools and functionality for a wide range of tasks,
including web development, data analysis, machine learning, and more.

7
 Software – MySQL
 MySQL is a popular open-source database management system that is used to
store and organize data.
 It is written in C and C++ and is available on many operating systems, including
Linux, Windows, and MacOS.
 MySQL is widely used in web applications, as it allows for fast access to large
amounts of data and is easy to use and configure.
 It is commonly used in conjunction with the PHP programming language, as
PHP is often used to interact with MySQL databases in web applications.
 MySQL has a number of features that make it an attractive choice for
developers, including support for multiple storage engines, a flexible schema,
and a wide range of built-in functions and tools.

 Software – Visual Studio Code


 Visual Studio Code is a free, open-source code editor developed by Microsoft
for Windows, Linux, and macOS.
 It features a built-in debugger, syntax highlighting, and support for multiple
programming languages.
 To use Visual Studio Code, you will need a computer with at least 1 GB of RAM
and a processor speed of 1.6 GHz or higher.
 It can be downloaded from the Visual Studio Code website and installed on
your computer.
 Visual Studio Code also offers extensions that can be installed to add
additional functionality, such as support for additional programming languages
or integration with other tools.

8
8. FLOWCHART

 Import the mysql connector


 Connect to the MySQL database using the provided host, user, and password
 Create a cursor object and execute a statement to show the databases
 Fetch all the databases and put them in a list called dlempt
 Check if the 'restaurant' database is in the list dlempt
a. If 'restaurant' is in the list dlempt, execute a statement to use the 'restaurant'
database
b. If 'restaurant' is not in the list dlempt, execute a series of statements to create a
new 'restaurant' database and several tables within it
 Define the function signin() which prompts the user to enter a password and, if the
password is correct, calls the options() function
 Define the function options() which presents the user with a list of options and calls
the corresponding function based on the user's choice
 Define the function dishID() which retrieves the maximum dish ID from the Dish table
and adds 1 to it
 Define the function dishes() which allows the user to add, remove, or display dishes
and returns to the main menu when finished
 Define the function order() which allows the user to place an order and returns to the
main menu when finished
 Define the function cooks() which allows the user to add, remove, or display cooks
and returns to the main menu when finished
 Define the function salary() which allows the user to view cook salary information
and returns to the main menu when finished
 Define the function income() which allows the user to view income information and
returns to the main menu when finished
 Define the function expense() which allows the user to view or add expense
information and returns to the main menu when finished
 Call the signin() function to begin the program.

9
9. SOURCE CODE
import mysql.connector as cc

# connecting DB
con = cc.connect(
host='localhost',
user='root',
password='password'
)

# create Db
cur = con.cursor()
cur.execute('show databases') # shows the databases
datalist = cur.fetchall() # collects the databases from the above statement
dlempt = []
for i in datalist:
dlempt.append(i[0]) # puts the collected data in a list
if 'restaurant' in dlempt: # uses the database if it exists, if not it creates a new
one with tables
cur.execute('use restaurant')
else:
q1 = 'create database restaurant'
q2 = 'use restaurant'
q3 = 'create table Dish(Dish varchar(30), Cost int, DishID varchar(70))'
q4 = 'create table Cook(Name varchar(40), Aadhar varchar(12), Salary int,
DOJ varchar(10))'
q5 = 'create table Orders(Date varchar(10), Name varchar(40), Aadhar varchar(12),
DishIDs varchar(70), Cost int)'
q6 = 'create table Salary(Name varchar(40), Aadhar varchar(12), Bank varchar(30),
Account varchar(15), Payday varchar(10), Salary int, Days int, Net int)'
q7 = 'create table Expense(Type varchar(30), Expense int, Date varchar(10))'
cur.execute(q1)
cur.execute(q2)
cur.execute(q3)
cur.execute(q4)
cur.execute(q5)
cur.execute(q6)
cur.execute(q7)
con.commit()
print('Created Database')

# signing in into the client

def signin():
print('\n')
print(' ------------------------------>>>>>>>>>>>>>>> WELCOME TO OREO\'S CAFE
<<<<<<<<<<<<<<<-----------------------------')
print('\n')

10
# signin into the client so that only the person who knows the password can enter
client = input('Enter Password: ')
if client == 'oreo123':
options()

else:
print('Wrong password! Try again!')
signin()

def options(): # options for the user to choose from


print("""
------------------------------------------------------------------------------------
------------------------------
1. DISHES
2. ORDER
3. COOKS
4. SALARY
5. INCOME
6. EXPENSE
------------------------------------------------------------------------------------
------------------------------
""")
ch = input("Enter your Choice: ")
while True:
if ch == '1':
dishes()
elif ch == '2':
order()
elif ch == '3':
cooks()
elif ch == '4':
salary()
elif ch == '5':
income()
elif ch == '6':
expense()
else:
print('Not a Valid Choice')
ch = input("Enter your Choice: ")

def dishID(): # it is a function to create dishID; it fetches the maximum number from
the dish ID & adds +1 to it
query = 'select count(*), max(DishID) from Dish'
cur.execute(query)
fetch = cur.fetchall()

11
for i in fetch:
if i[0] == 0:
return 1
else:
return (int(i[1]) + 1)

def dishes(): # a function which is used to show to add, remove, display food available
ch = input('1. Add Food 2. Remove Food 3. Display Food 4. Main Menu: ')

if ch == '1':
dishname = input('Enter Dish Name: ')
dishprice = int(input('Enter Dish Price: '))
dishid = str(dishID())
query = 'insert into dish values(\'{}\', {}, {})'.format(
dishname, dishprice, dishid)
cur.execute(query)
con.commit()
print("Dish has been added successfully")
elif ch == '2':
dishid = input('Enter Dish ID: ')
query = 'delete from Dish where DishID={}'.format(dishid)
cur.execute(query)
con.commit()
print("Dish has been deleted successfully")
elif ch == '3':
print('\n')
query = ('select * from Dish')
cur.execute(query)
fetch = cur.fetchall()
for i in fetch:
print(i[0], '-', i[1], '-', i[2])
print('\n')
else:
options()

def order(): # A function which is used to order food


query = ('select * from Dish')
cur.execute(query)
fetch = cur.fetchall() # fetches all the data about the food from the Dish Table
print("NAME ----- COST ----- DISH ID")
for i in fetch:
print(i[0], '-', i[1], '-', i[2])
print('\n')

12
dil = []
while True: # create a loop so that people can order more than 1 food item
# as dishID 0 does not exists we can use 0 as a check statement so that the loop
terminates when 0 is entered
di = input("Select Dish ID {Enter 0 when done}: ")
if di == '0':
break
else:
dil.append(di)
sql = 'select DishID, Cost from Dish'
cur.execute(sql)
d = cur.fetchall()
dic1 = {}
for i in d: # fetches the data at 'line 139' and puts them in a dictionary
dic1[i[0]] = i[1]
tc = 0
for i in dil:
# accesses the Cost column of the database & adds it together
dc = dic1[i]
tc = tc+dc
name = input("Enter Name: ")
aadhar = input("Enter aadhar ID: ")
date = input('Enter Date (YYYY-MM-DD): ')
# for confirmation, we ask the dish ID/order of the user again
lis = input("Enter Dish IDs: ")
sql2 = "insert into Orders value('{}', '{}', '{}', '{}', {})".format(
date, name, aadhar, lis, tc)
cur.execute(sql2)
con.commit()

print("Total Amount Rs.", tc) # Bill


print("Order Placed successfully!")
print('-----------------------------------------------------------------------------
-------------------------------------')
ui = input("1. Order Menu 2. Main Menu: ")
print('-----------------------------------------------------------------------------
-------------------------------------')
if ui == '1':
order()
elif ui == '2':
options()
else:
options()

13
def cooks(): # adds, removes, displays information about cooks
ch = input('1. Add Cook 2. Remove Cook 3. Display Cook 4. Main Menu: ')

if ch == '1':
cookname = input('Enter Cook Name: ')
aadhar = input('Enter Aadhar no: ')
salary = int(input('Enter Salary: '))
joind = input('Enter Date of Joining (YYYY-MM-DD): ')
query = 'insert into Cook values(\'{}\', {}, {}, \'{}\')'.format(
cookname, aadhar, salary, joind)
cur.execute(query)
con.commit()
print("Cook has been added successfully")
elif ch == '2':
cookn = input('Enter Cook Name: ')
aadharn = int(input('Enter Aadhar No.: '))
query = "delete from Cook where Name='{}' and Aadhar={}".format(
cookn, aadharn)
cur.execute(query)
con.commit()
print("Cook has been deleted successfully")
elif ch == '3':
print('\n')
query = ('select * from Cook')
cur.execute(query)
fetch = cur.fetchall()
for i in fetch:
print(i[0], '-', i[1], '-', i[2])
print('\n')
else:
options()

def salary(): # pays the salary to the respective cooks


print('\n')
query = ('select * from Cook')
cur.execute(query)
fetch = cur.fetchall()
for i in fetch:
print(i[0], '-', i[1], '-', i[2])
print('-----------------------------------------------------------------------------
-------------------------------------')
cookname = input("Enter cook's name: ")
aadhar = int(input("Enter Cook's aadhar ID: "))
bank = input("Enter Cook's bank name:")

14
acc = int(input("Enter cook's account number: "))
date = input('Enter Date of Salary (YYYY-MM-DD): ')
sal = int(input("Enter cook's salary: "))
days = int(input("Enter no. of working days: "))
# splits the date i.e it chooses the month, which has 31 days
if date[5:7] in ['01', '03', '05', '07', '08', '10', '12']:
ns = (sal/31)*days
# splits the date i.e it chooses the month, which has 30 days
elif date[5:7] in ['04', '06,', '09', '11']:
ns = (sal/30)*days
else:
# splits the date i.e it chooses the month, which has 28 days i.e february
ns = (sal/28)*days
sql = "insert into Salary values('{}', {}, '{}', {}, '{}', {}, {}, {})".format(
cookname, aadhar, bank, acc, date, sal, days, ns)
cur.execute(sql)
con.commit()
print("Net Salary Paid: Rs.", ns)
print('-----------------------------------------------------------------------------
-------------------------------------')
ui = input("1. Salary Menu 2. Main Menu: ")
print('-----------------------------------------------------------------------------
-------------------------------------')
if ui == '1':
salary()
elif ui == '2':
options()
else:
options()

def income(): # calculates the total amount of income/sales


t = input('1. All 2. Year 3. Date 4. Main Menu: ')
if t == '1':
query = 'Select Cost from Orders'
cur.execute(query)
d = cur.fetchall()
oi = 0
for i in d:
oi = oi+i[0]
print("Total income from Orders: Rs. ", oi, )
elif t == '2':
yr = input('Enter Year: ')
query = 'Select Cost, Date from Orders'
cur.execute(query)
d = cur.fetchall()
oi = 0

15
for i in d:
if yr in i[1]: # as the date column is fetched by sql, it compares it with
the user input
oi = oi+i[0]
print("Total income from Orders: Rs. ", oi, )
elif t == '3':
dt = input('Enter Year/Month/Date: ')

query = 'Select Cost from Orders where Date like %s'


data = (dt,)
cur.execute(query, data)
d = cur.fetchall()
oi = 0
for i in d: # as the date column is fetched by sql, it compares it with the
user input but as a specific date
oi = oi+i[0]
print("Total income from Orders: Rs. ", oi, )
else:
options()

def expense(): # tallys the expenses done by the store like electricity bill, water
bill etc.
exp = input('1. Bill Entry 2. Show Bills 3. Main Menu: ')
if exp == '1': # the value is added to database
type = input('Type: ')
cost = int(input('Cost: '))
date = input('Date (YYYY/MM/DD): ')
data = (type, cost, date)
query = 'insert into Expense values(%s, %s, %s)'
cur.execute(query, data)
con.commit()
print('Data entered successfully!')
elif exp == '2': # values is fetched from the database
query = 'Select * from Expense order by Date;' # arranges them in ascending
order
cur.execute(query)
d = cur.fetchall()
for i in d:
print(i)
else:
options()

signin()

16
10. OUTPUT

17
18
19
11. BIBLIOGRAPHY

https://openai.com/blog/chatgpt/
https://www.w3schools.com
https://docs.python.org/3/
https://dev.mysql.com/doc/

20

You might also like