0% found this document useful (0 votes)
15 views

Computer Science

Uploaded by

mohapatra365ram
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Computer Science

Uploaded by

mohapatra365ram
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

D.A.V.

PUBLIC SCHOOL, NEW


PANVEL

COMPUTER SCIENCE
INVESTIGATORY
PROJECT

TOPIC:- RESTAURANT
MANAGEMENT
MADE BY:-
NAME:- SHIV NITIN GUPTA
INDEX

CONTENT PAGE NO.

Acknowledgement 01
Certificate 02

Introduction 03
Requirements 04
Modules 05-19
Code 20-34
Output 35-37
Analysis 38
Conclusion 39
Bibliography 40
ACKNOWLEDGMENT

I would like to acknowledge the support and


help that was provided by my teachers and
friends for helping me to complete the given
project within the stipulated time.
I would like to thank our respected Principal,
Mr. Sumanth Ghosh Sir for his mutual support. I
would also like to express my gratitude to my
computer science teacher
Mrs. Neelu Raina madam for giving me the
golden opportunity to work on the wonderful
computer science project. Finally I would like to
thank CBSE for giving me this opportunity to
undertake this project.

01
CERTIFICATE
EXAMINATION ROLL NO:
This is to certify that Shiv Nitin Gupta of Class XII-A
has satisfactorily completed his computer science project
work on the topic Restaurant management for the year
2024-2025
Date: _____________

_________________ ________________

SIGNATURE OF SUBJECT SIGNATURE OF THE


TEACHER PRINCIPAL

__________________ _________________

SCHOOL STAMP SIGNATURE OF EXTERNAL


EXAMINER

02
INTRODUCTION

The purpose of the project is to present the


requirement of the computerization of
Restaurant Management. The project thus
calculates the bills automatically. It does work
which is related to automatic telephone billing
connection system via- new connection ,
customer record modification, viewing
customer records & all works related to rate of
bills, meter readings in addition to bill
calculation and bill generation. “Restaurant
Management ” is developed as per seeing the
increasing requirement to speed up the work
and incorporate a new work culture. Thus a new
software has been proposed to reduce manual
work, improving work efficiency, saving time and
to provide greater flexibility and user-
friendliness as the system previously followed
was totally manual one with lots of errors.

03
REQUIREMENTS

HARDWARE REQUIRED
Printer, to print the required documents of
the project
Compact Drive
Processor : Processor Intel(R) Core(TM) i5-
8265U CPU @ 1.60GHz, 1800 Mhz, 4 Core(s)
SSD -256 GB
RAM-8.00 GB

SOFTWARE REQUIRED

Operating system : Windows 11


IDLE(Python 3.6 32-bit), for execution of program
Ms word, for presentation of output.

04
MODULES

Tkinter Module:
Before we proceed, let's define some of the common
terms.
Window:This term has different meanings in different
contexts, but in general itrefers to a rectangular area
somewhere on your display screen.
Top-level window:A window that exists independently
on your screen. It will bedecorated with the standard
frame and controls for your system's desktop manager.
You can move it around on your desktop. You can
generally resize it, although your application can prevent
this
Widget:The generic term for any of the building blocks
that make up an applicationin a graphical user interface.
Examples of widgets: buttons, radio buttons, text fields,
frames, and text labels.

05
Frame:In Tkinter, the Frame widget is the basic unit of
organization for complexlayouts. A frame is a
rectangular area that can contain other widgets.

Child, parent:When any widget is created, a parentchild


relationship is created. Forexample, if you place a text
label inside a frame, the frame is the parent of the label.
There are two main methods which the user need to
remember while creating the Python application with

GUI.
1. Tk():To create a main window, tkinter offers a
method ‘Tk()’. The basic codeused to create the
main window of the application is:
from tkinter import *

master = Tk()
Then title, geometry, resizable properties of the master
window are set.

Title: Text to be displayed in the title bar of the window


Geometry: w x h ± x ± y. The w and h parts give the
window width and height inpixels. They are separated by
the character 'x'. If the next part has the form +x, it
specifies that the left side of the window should be x pixels
from the left side of the desktop. If it has the form -x, the

06
Frame:In Tkinter, the Frame widget is the basic unit of
organization for complexlayouts. A frame is a
rectangular area that can contain other widgets.

Child, parent:When any widget is created, a parentchild


relationship is created. Forexample, if you place a text
label inside a frame, the frame is the parent of the label.
There are two main methods which the user need to
remember while creating the Python application with

GUI.
1. Tk():To create a main window, tkinter offers a
method ‘Tk()’. The basic codeused to create the
main window of the application is:
from tkinter import * master = Tk()
Then title, geometry, resizable properties of the master
window are set.

Title: Text to be displayed in the title bar of the window


Geometry: w x h ± x ± y. The w and h parts give the
window width and height inpixels. They are separated by
the character 'x'. If the next part has the form +x, it
specifies that the left side of the window should be x pixels
from the left side of the desktop. If it has the form -x, the
07
right side of the window is x pixels from the right side of
the desktop. If the next part has the form +y, it specifies
that the top of the window should be y pixels below the
top of the desktop. If it has the form -y, the bottom of the
window will be y pixels above the bottom edge of the
desktop.

Resizable(width=value, height=value):If width is true,


allow horizontal resizing. Ifheight is true, allow
vertical resizing.

Withdraw() method hides the window anddeiconify()


method restores it.

2. Mainloop():There is a method known by the name


mainloop() which is usedwhen you are ready for the
application to run. mainloop() is an infinite loop
used to run the application, wait for an event (e.g.
clicking a mouse button, moving the mouse cursor,
pressing a key etc.) to occur and process the event
till the window is not closed.

master.mainloop()

08
tkinter also offers access to the geometric configuration

of the widgets (e.g. label, entry, button, listbox, scrollbar,


canvas, image etc.) which can organize the widgets in
the parent windows. The following geometry manager
methods have been used:

Pack() method: Pack is the easiest geometry managers


of Tk and Tkinter. Insteadof having to declare precisely
where a widget should appear on the display screen, we
can declare the positions of widgets with the pack
command relative to each other. The pack command
takes care of the details.
Grid(row=value, column=value, sticky=value)
method:Grid geometry managerplaces the widgets in a
2-dimensional table, which consists of a number of rows
and columns. The position of a widget is defined by a
row and a column number. Correspondingly, widgets
with the same row number but different column
numbers will be on the same "line" and will be beside of
each other, i.e. to the left or the right. Sticky is a string
that defines how this element is to be positioned within
its parent. This string may containzero or more of the

09
characters 'n', 's', 'e', and 'w'. For example, the value
sticky='ns' would stretch this element to adhere to the
north and south sides of the cavity within its parent
element.

There are a number of widgets which you can put in your

tkinter application. Some of the major widgets are

explained below:

Label widget: It refers to the display box where you can


put any text or image whichcan be updated any time as
per the code. The general syntax is: lbl=Label(master,
text = value) where master is the parameter used to
representthe parent window. The text parameter is set to
the text to be displayed in the label widget. The
configure method of Label widget is used to set font, fg
(foreground color) of the text.
Button widget:The Button widget is a standard Tkinter
widget, which is used forvarious kinds of buttons. A
button is a widget which is designed for the user to
interact with, i.e. if the button is pressed by mouse click
some action might be started. They can also contain text
and images like labels. While labels can display text in

10
various fonts, a button can only display text in a single
font. The text of a button can span

more than one line. A Python function or method can be


associated with a button. This function or method will
be executed, if the button is pressed in some way.
The general syntax is:
w=Button(master, text=value, width=value, command=value)
wheremaster is the parent window where the button widget
is be placed, text is button text, width is button width,
command is the function or method to be called when the
button is clicked. The configure method of the button widget
can be used set value for font, fg
(foreground colour of the button text)
Entry widget: Entry widgets allow the user to enter a
single line of text. If the userenters a string, which is
longer than the available display space of the widget, the
content will be scrolled. This means that the string
cannot be seen in its entirety. The arrow keys can be
used to move to the invisible parts of the string. The
syntax of an entry widget looks like this:
e = Entry(master, textvariable=value, show=value)
where"master" represents the parent window where the
entry widget is to be placed, textvariable is assigned to a

11
control variable and show specifies the character
toappear as the user types. To make a “password” entry
that echoes each character as an asterisk, set show='*'.
The insertion cursor is displayed in the Entry widget only
when the user clicks the mouse somewhere in the
widget. It usually appears as a blinking vertical line
inside the widget. This insertion cursor shows where new
text will be inserted. Positions within the entry widget's
displayed text are given as an index. Index 0 refers to the
position before the existing text and the constant
ENDrefers to the position after the existing text.

Control Variable: In order to be able to retrieve the


current text from entry widget,textvariable must be set
to a control variables. A Tkinter control variable is a
special object that acts like a regular Python variable in
that it is a container for a value, such as a number or
string. One special quality of a control variable is that it
can be shared by a number of different widgets, and the
control variable can remember all the widgets that are
currently sharing it. Normally the text displayed in an
Entry widget is linked to a control variable. There are 4
types of control valiables: StringVar(), IntVar(),
DoubleVar() and

12
BoolVar(). All control variables have these two methods:

.get()- Returns the current value of the variable.


.set(value)- Changes the current value of the variable.
Frame widget:A frame is basically just a container for
other widgets. Each framehas its own grid layout, so
the gridding of widgets within each frame works
independently.
Frame widgets are a valuable tool in making your

application modular. It is used for grouping and

organizing the widgets. The general syntax is:

w = Frame(master)

Listbox widget: The purpose of a listbox widget is to


display a set of lines of text.
Generally they are intended to allow the user to select
one or more items from a list.
All the lines of text use the same font. The general syntax
is:

Lbox1= Listbox(master, height=value, width=value)

lbox1.config(yscrollcommand=sbar1.set) where
Mysql.Connector Module:

13
MySQL Connector is a standardized database driver
provided by MySQL to access the MySQL database from
Python. In order to use this module, the mysql connector
is to be downloaded and installed as follows:

C:\Users\Your
Name\AppData\Local\Programs\Python\Python36-
32\Scripts>python -m

pip install mysql-connector

import mysql.connector

If the above code is executed with no errors, "MySQL

Connector" is installed and ready to be used.

Mysql.Connector.Error:

This module is the base class for all other exceptions in

the errors module. It can be used to catch all errors in a


single except statement. The following example shows

how we could catch syntax errors:

import mysql.connector

try:
cnx=mysql.connector.connect(user=’scott’,password

14
=’’tiger’,

database=’bookstore’)

cursor=cnx.cursor()

cursor.execute(“select * form book”) #


Syntax error in query cnx.close()

except mysql.connector.Error as err:

print("Something went wrong: {}".format(err))


Mysql.connector.connect() :Aconnection with the
MySQL server can beestablished using either the
mysql.connector.connect() function. The syntax is as
follows:

conn = mysql.connector.connect(host=value, user=value,


password=value, database=value)
where host is the host name or IP address of the MySQL

server, user and password are used to login to the MySQL


server and database is the database name to use when

connecting with the MySQL server.

Cursor() Function:A database cursor is a useful control


structure of databaseconnectivity. When you connect to
a database from within a program, the thesql query gets

15
sent to the database server, where it gets executed and
the resultset (the set of records retrieved as per query) is
sent over the connection to you in one go. But you may
want to access the retrieved data, one row at a time. But
query processing cannot happen as one row at a time, so
a special type of control structure called database cursor
can be created that gets access of all the records as per
query (called the resultset) and allows you to traverse the
resultset row by row. The syntax to create a database
cursor is as follows: cur = conn.cursor()where we
established database connection through connection
object “conn” earlier and we have created a cursor object
“cur” using the same connection object “conn”.

Execute() Function:Once you have created a cursor,


you can execute SQL queryusing execute() function with
the cursor object as per following syntax:
cur.execute(“select * from book”)
where the above code will execute the given SQL query

and retrieve the records (i.e. the resultset) in the cursor


object “cur” which you can then use in your program as

required.

Fetchall() Function:Once the result of SQL query is


available in the form of aresultset stored in a cursor
16
object, you can extract data from the resultset using
fetchall() function. The syntax is as follows:
rows=cur.fetchall()where the above command will
return all the records retrieved as per query in a tuple
“rows”.

Rowcount:It is a property of cursor object that returns


the number of rowsretrieved from the cursor so far (e.g.
cur.rowcount ).

Commit() Function: With INSERT, UPDATE,


DELETE queries which make changes to the database,
you must commit your query after executing the
queries. For this you must run commit() function of
the connection object (e.g. conn.commit() )

Close() Function:After going through all the


processing, you need to closethe connection established
(e.g. cnx.close() )

Main.py Module:
The master window has two buttons (Enter and Exit).
Login_command() function is called when the user clicks
on the Enter button and the master window is closed
when Exit button is clicked.

17
len() function :The len() function returns the number
of items (length) of anobject.

The syntax of len() is: len(s)


where s is sequence (string, bytes, tuple, list, or range) or
a collection.

Isalpha() method: The isalpha() methods returns “True”


if all characters in the
string are alphabets, Otherwise, It returns “False”.

The syntax is: String.isalpha()

Isalnum() method: This methods returns “True” if all


characters in the string are
alphabet or numeric, Otherwise, It returns “False”.
The syntax is: String.isalnum()
Isspace() method:The isspace() methods returns “True”
if all characters in the
string are whitespace characters, Otherwise, It returns
“False”. This function is used to check if the argument
contains all whitespace characters such as space,
newline, tab etc.
The syntax is: String.isspace()

Isnumeric() method: The issnumeric() methods returns


18
“True” if all characters inthe string are numeric characters,
Otherwise, It returns “False”.
This function is used to check if the argument contains

all numeric characters. The syntax is:

string.isnumeric()

Int() function: The int() function returns an integer

object from any number orstring.

The syntax is: int(value, base)

Where value is a number or a string that can be

converted into an integer number and base is a number

representing the number format. Default value: 10 str()

function:This function converts the specified value

into a string.

The syntax is: str(obj=”)


Return a string containing a nicely printable
representation of an object. For strings, this returns the

string itself.

19
CODE
### Importing required libraries ###
from tkinter import *
import random
import time
from tkinter import ttk
from tkinter import messagebox
import sqlite3
from tkinter import *

#It is definition of System def system():


root = Tk()
root.geometry("1700x800")

root.title("Restaurant Management System")

def Database():

global connectn, cursor

connectn = sqlite3.connect("Restaurant.db")

cursor = connectn.cursor() # creating bill table

cursor.execute("CREATE TABLE IF NOT EXISTS

Restaurantrecords(ordno text,piz text,bur text,ice text,

20
dr text, ct text,sb text,tax text,sr text,tot text)")

# variable datatype assignment orderno = StringVar()


pizza = StringVar() burger = StringVar() icecream =
StringVar() drinks = StringVar() cost = StringVar()
subtotal = StringVar() tax = StringVar() service =
StringVar() total = StringVar()

# defining total function def tottal():


# fetching the values from entry box order = (orderno.get()) pi
= float(pizza.get()) bu = float(burger.get()) ice =
float(icecream.get()) dr = float(drinks.get())

# computing the cost of items

costpi = pi * 240 costbu = bu * 125


costice = ice * 80 costdr = dr * 60

# computing the charges

costofmeal = (costpi + costbu + costice + costdr)


ptax = ((costpi + costbu + costice + costdr) * 0.18)

sub = (costpi + costbu + costice + costdr)


ser = ((costpi + costbu + costice + costdr) / 99)
paidtax = str(ptax)

Service = str(ser)
overall = str(ptax + ser + sub)

# Displaying the values


cost.set(costofmeal)

21
.set(ptax)
subtotal.set(sub)
service.set(ser)
total.set(overall)

# defining reset function def reset():


orderno.set("")
pizza.set("") burger.set("")
icecream.set("") drinks.set("")

cost.set("") subtotal.set("") tax.set("")

service.set("") total.set("")

# defining exit function def exit():


root.destroy()

# Topframe

topframe = Frame(root, bg="white", width=1600, height=50)

topframe.pack(side=TOP)

# Leftframe leftframe = Frame(root, width=900, height=700)


leftframe.pack(side=LEFT)

# rightframe

rightframe = Frame(root, width=400, height=700) rightframe.pack(side=RIGHT)

################## display data


#################### def DisplayData():
Database()
my_tree.delete(*my_tree.get_children()) cursor = connectn.execute("SELECT
* FROM Restaurantrecords") fetch = cursor.fetchall() for data in fetch:

22
my_tree.insert('', 'end', values=(data)) cursor.close()

connectn.close()

style = ttk.Style() style.configure("Treeview",

foreground="black", rowheight=40,
fieldbackground="white"
)

style.map('Treeview',

background=[('selected', 'lightblue')])

########### Creating table


#############
my_tree = ttk.Treeview(rightframe)

my_tree['columns'] = ("ordno", "piz", "bur", "ice", "dr", "ct", "sb", "tax", "sr", "tot")

############ creating for table


################

horizontal_bar = ttk.Scrollbar(rightframe,
orient="horizontal")
horizontal_bar.configure(command=my_tree.xview)

my_tree.configure(xscrollcommand=horizontal_bar.set)
horizontal_bar.pack(fill=X, side=BOTTOM)

vertical_bar = ttk.Scrollbar(rightframe, orient="vertical")

vertical_bar.configure(command=my_tree.yview)

my_tree.configure(yscrollcommand=vertical_bar
.set) vertical_bar.pack(fill=Y, side=RIGHT)

23
# defining column for table

my_tree.column("#0", width=0, minwidth=0)

my_tree.column("ordno", anchor=CENTER, width=80, minwidth=25)

my_tree.column("piz", anchor=CENTER, width=60,


minwidth=25)
my_tree.column("bur", anchor=CENTER, width=50, minwidth=25)

my_tree.column("ice", anchor=CENTER, width=80, minwidth=25)

my_tree.column("dr", anchor=CENTER, width=50, minwidth=25)

my_tree.column("ct", anchor=CENTER, width=50, minwidth=25)

my_tree.column("sb", anchor=CENTER, width=100, minwidth=25)

my_tree.column("tax", anchor=CENTER, width=50, minwidth=25)

my_tree.column("sr", anchor=CENTER, width=100, minwidth=25)

my_tree.column("tot", anchor=CENTER, width=50, minwidth=25)

# defining headings for table my_tree.heading("ordno", text="Order No",


anchor=CENTER)
my_tree.heading("piz", text="Pizza", anchor=CENTER)

my_tree.heading("bur", text="Burger", anchor=CENTER)

my_tree.heading("ice", text="Ice cream", anchor=CENTER)

my_tree.heading("dr", text="Drinks", anchor=CENTER)

my_tree.heading("ct", text="Cost", anchor=CENTER)

my_tree.heading("sb", text="Subtotal", anchor=CENTER)

my_tree.heading("tax", text="Tax", anchor=CENTER)

my_tree.heading("sr", text="Service", anchor=CENTER)

my_tree.heading("tot", text="Total", anchor=CENTER)

my_tree.pack()

DisplayData()

24
# defining add function to add record def add():
Database() # getting data orders =
orderno.get() pizzas = pizza.get() burgers
= burger.get() ices = icecream.get() drinkss
= drinks.get() costs = cost.get() subtotals
= subtotal.get() taxs = tax.get() services =
service.get() totals = total.get()
if orders == "" or pizzas == "" or burgers == "" or ices == ""

or drinkss == "" or costs == "" or subtotals == "" or taxs == "" or services == ""

or totals == "":

messagebox.showinfo("Warning", "Please fill the empty field!!!") else:


connectn.execute(

'INSERT INTO Restaurantrecords (ordno, piz, bur , ice ,dr ,ct ,sb ,tax, sr, tot)

VALUES (?,?,?,?,?,?,?,?,?,?)',

(orders, pizzas, burgers, ices, drinkss, costs, subtotals, taxs, services,

totals));

connectn.commit()

messagebox.showinfo("Message", "Stored successfully")

# refresh table data

DisplayData()
connectn.close()

# defining function to access data from sqlite datrabase def DisplayData():


Database()
my_tree.delete(*my_tree.get_children())
cursor = connectn.execute("SELECT
* FROM Restaurantrecords") fetch = cursor.fetchall() for data in fetch:
my_tree.insert('', 'end', values=(data)) cursor.close() connectn.close()

25
# defining function to delete record def Delete():
# open database Database() if not
my_tree.selection():
messagebox.showwarning("Warning", "Select data

to delete") else:

result = messagebox.askquestion('Confirm',
'Are you sure you want to delete this record?',

icon="warning") if result == 'yes':


curItem = my_tree.focus() contents = (my_tree.item(curItem))
selecteditem = contents['values'] my_tree.delete(curItem)
cursor = connectn.execute("DELETE FROM Restaurantrecords WHERE ordno= %d" %
selecteditem[0]) connectn.commit() cursor.close() connectn.close()

# Time

localtime = time.asctime(time.localtime(time.time())) # Top part

main_lbl = Label(topframe, font=('Calibri', 25, 'bold'),

text="Restaurant Management System", fg="Blue",

anchor=W) main_lbl.grid(row=0, column=0)


main_lbl = Label(topframe, font=('Calibri', 15,), text=localtime, fg="lightgreen",

anchor=W) main_lbl.grid(row=1, column=0)

### Labels # items


ordlbl = Label(leftframe, font=('Calibri', 16, 'bold'), text="Order No.",

fg="black", bd=5, anchor=W).grid(row=1,

column=0)

ordtxt = Entry(leftframe, font=('Calibri', 16, 'bold'), bd=6, insertwidth=4,


justify='right', textvariable=orderno).grid(row=1, column=1) # Pizza
pizlbl = Label(leftframe, font=('Calibri', 16, 'bold'), text="Pizza",

fg="black", bd=5, anchor=W).grid(row=2,

26
column=0)

piztxt = Entry(leftframe, font=('Calibri', 16, 'bold'), bd=6, insertwidth=4,

justify='right',

textvariable=pizza).grid(row=2, column=1)

# burger

burlbl = Label(leftframe, font=('Calibri', 16, 'bold'), text="Burger",

fg="black", bd=5, anchor=W).grid(row=3,

column=0)

burtxt = Entry(leftframe, font=('Calibri', 16, 'bold'), bd=6, insertwidth=4,

justify='right',

textvariable=burger).grid(row=3, column=1) # icecream

icelbl = Label(leftframe, font=('Calibri', 16, 'bold'),


text="Ice Cream", fg="black", bd=5, anchor=W).grid(row=4,
column=0)

icetxt = Entry(leftframe, font=('Calibri', 16, 'bold'), bd=6, insertwidth=4,

textvariable=icecream).grid(row=4, column=1)
justify='right', # drinks

drinklbl = Label(leftframe, font=('Calibri', 16, 'bold'), text="Drinks",

fg="black", bd=5, anchor=W).grid(row=5,

column=0)

drinktxt = Entry(leftframe, font=('Calibri', 16, 'bold'), bd=6, insertwidth=4,

justify='right',

textvariable=drinks).grid(row=5, column=1)

# cost costlbl = Label(leftframe, font=('Calibri', 16, 'bold'),


text="Cost", bd=5, anchor=W).grid(row=6, column=0)

costtxt = Entry(leftframe, font=('Calibri', 16, 'bold'),

bd=6, insertwidth=4, justify='right',

textvariable=cost).grid(row=6, column=1)

27
# subtotal

sublbl = Label(leftframe, font=('Calibri', 16, 'bold'),

text="Subtotal", bd=5, anchor=W).grid(row=7, column=0)

subtxt = Entry(leftframe, font=('Calibri', 16, 'bold'), bd=6, insertwidth=4,

justify='right', textvariable=subtotal).grid(row=7, column=1) # tax

taxlbl = Label(leftframe, font=('Calibri', 16, 'bold'),

text="Tax", bd=5, anchor=W).grid(row=8, column=0)

taxtxt = Entry(leftframe, font=('Calibri', 16, 'bold'),

bd=6, insertwidth=4, justify='right',

textvariable=tax).grid(row=8, column=1)

# service

servicelbl = Label(leftframe, font=('Calibri', 16,


'bold'), text="Service", bd=5, anchor=W).grid(row=9,

column=0)

servicetxt = Entry(leftframe, font=('Calibri', 16, 'bold'),


bd=6, insertwidth=4, justify='right',

textvariable=service).grid(row=9, column=1) # total

totallbl = Label(leftframe, font=('Calibri', 16,


'bold'), text="Total", bd=5, anchor=W).grid(row=10,

column=0)

totaltxt = Entry(leftframe, font=('Calibri', 16, 'bold'),


bd=6, insertwidth=4, justify='right',

textvariable=total).grid(row=10, column=1)
# ---button--

totbtn = Button(leftframe, font=('Calibri', 16, 'bold'),

text="Total", bg="Lightgrey", fg="black", bd=3, padx=5, pady=5,

28
width=6, command=tottal).grid(row=6, column=3)

resetbtn = Button(leftframe, font=('Calibri', 16, 'bold'),


text="Reset", bg="lightgrey", fg="black", bd=3, padx=5,
pady=5, width=6,
command=reset).grid(row=4, column=3)

exitbtn = Button(leftframe, font=('Calibri', 16, 'bold'),

text="Exit The System", bg="lightgrey", fg="black", bd=3, padx=5,

pady=5, width=12,
command=exit).grid(row=6, column=2)

addbtn = Button(leftframe, font=('Calibri', 16, 'bold'),

text="Add", bg="lightgrey", fg="black", bd=3, padx=5, pady=5,

width=6, command=add).grid(row=2, column=3)

deletebtn = Button(leftframe, font=('Calibri', 16, 'bold'),

text="Delete Record", bg="lightgrey", fg="black", bd=3,

padx=5, pady=5, width=12, command=Delete).grid(row=4, column=2)

########################### feedback form


##############################
##

def feedbackk(): feed = Tk()


feed.geometry("600x500")
feed.title("Submit Feedback form")
# database #

connectn = sqlite3.connect("Restaurant.db")

29
cursor = connectn.cursor()

cursor.execute("CREATE TABLE IF NOT EXISTS FEEDBACK(n text,eid

text,feedback5 text,com text)")

# variable datatype asssignment #


name = StringVar()
email = StringVar()
comments = StringVar()

# defiing submit function


def submit():
n = name.get()

eid = email.get()

com = txt.get('1.0', END)

feedback1 = ""

feedback2 = ""

feedback3 = ""

feedback4 = ""

if (checkvar1.get() == "1"):

feedback1 = "Excellent"

if (checkvar2.get() == "1"):

feedback2 = "Good"
if (checkvar3.get() == "1"):
feedback2 = "Average" if (checkvar4.get() == "1"):
feedback2 = "Poor"
feedback5 = feedback1 + " " + feedback2 + " " + feedback3 + " " + feedback4

conn = sqlite3.connect("Restaurant.db")

30
cursor = conn.cursor()
cursor.execute("INSERT INTO FEEDBACK VALUES ('" + n + "','" + eid + "','" +

com + "','" + feedback5 + "')")

messagebox.showinfo("message", "data inserted


!")
feed.destroy()

# defining cancel button

def cancel():

feed.destroy()

# label#

lb1 = Label(feed, font=("Calisto MT", 15, "bold"),

text="Thanks for Visiting!", fg="black").pack(side=TOP)

lbl2 = Label(feed, font=("calisto MT", 15),

text="We're glad you chose us ! Please tell us how it was!",

fg="black").pack(side=TOP)

# name

namelbl = Label(feed, font=('vardana', 15),

text="Name:-", fg="black", bd=10, anchor=W).place(x=10, y=150)

nametxt = Entry(feed, font=('vardana', 15), bd=6, insertwidth=2

, bg="white", justify='right',

textvariable=name).place(x=15, y=185)

# email

emaillbl = Label(feed, font=('vardana', 15),

text="Email:-", fg="black", bd=10, anchor=W).place(x=280, y=150)

emailtxt = Entry(feed, font=('vardana', 15), bd=6,

31
insertwidth=2,
bg="white", justify='right',

textvariable=email).place(x=285, y=185)

###checkbutton

ratelbl = Label(feed, font=('vardana', 15),

text="How would you rate us?", fg="black", bd=10, anchor=W).place(

x=10, y=215) checkvar1 = StringVar()


checkvar2 = StringVar() checkvar3 =
StringVar() checkvar4 = StringVar()
c1 = Checkbutton(feed, font=('Calibri', 10, "bold"),
text="Excellent", bg="white", variable=checkvar1)
c1.deselect() c1.place(x=15, y=265)

c2 = Checkbutton(feed, font=('Calibri', 10, "bold"),

text="Good", bg="white", variable=checkvar2, )

c2.deselect()

c2.place(x=120, y=265)

c3 = Checkbutton(feed, font=('Calibri', 10, "bold"),


text=" Average", bg="white", variable=checkvar3, )
c3.deselect()

c3.place(x=220, y=265)
c4 = Checkbutton(feed, font=('Calibri', 10, "bold"),
text=" Poor ", bg="white", variable=checkvar4, )

c4.deselect() c4.place(x=320, y=265)

# comments"
commentslbl = Label(feed, font=('Calibri', 15),

text="Comments", fg="black", bd=10, anchor=W).place(x=10, y=300)

txt = Text(feed, width=50, height=5)

txt.place(x=15, y=335)

32
# button

submit = Button(feed, font=("Calibri", 15), text="Submit", fg="black",


bg="green", bd=2, command=submit).place( x=145, y=430)

cancel = Button(feed, font=("Calibri", 15),


text="Cancel", fg="black", bg="red", bd=2, command=cancel).place(
x=245, y=430) feed.mainloop()

# Feedbackbutton

feedbtn = Button(leftframe, font=('Calibri', 16, 'bold'),

text="Feedback Form", fg="black", bg="lightgrey", bd=3, padx=10,

pady=10, width=10,
command=feedbackk).grid(row=8, column=2, columnspan=1)

##################### Menu card


##############################
##
def menu(): roott = Tk()
roott.title("Price Menu") roott.geometry("300x300")

lblinfo = Label(roott, font=("Calibri", 20, "bold"),

text="ITEM LIST", fg="black", bd=10)

lblinfo.grid(row=0, column=0)

lblprice = Label(roott, font=("Calibri", 20, "bold"),

text="Prices", fg="black", bd=10) lblprice.grid(row=0, column=3)

lblpizza = Label(roott, font=("Calibri", 20, "bold"),

text="Pizza", fg="Blue", bd=10) lblpizza.grid(row=1, column=0)

lblpricep = Label(roott, font=("Calibri", 20, "bold"),

text="240/-", fg="blue", bd=10) lblpricep.grid(row=1, column=3)

lblburger = Label(roott, font=("Calibri", 20, "bold"),


text="Burger", fg="Blue", bd=10) lblburger.grid(row=3, column=0)

33
lblpriceb = Label(roott, font=("Calibri", 20, "bold"), text="125/-", fg="blue",
bd=10) lblpriceb.grid(row=3, column=3)
lblicecream = Label(roott, font=("Calibri", 20, "bold"), text="Ice-Cream",
fg="Blue", bd=10) lblicecream.grid(row=4, column=0)

lblpricei = Label(roott, font=("Calibri", 20, "bold"),


text="80/-", fg="blue", bd=10) lblpricei.grid(row=4, column=3)

lbldrinks = Label(roott, font=("Calibri", 20, "bold"),

text="Drinks", fg="Blue", bd=10) lbldrinks.grid(row=5, column=0)

lblpriced = Label(roott, font=("Calibri", 20,


"bold"), text="60/-", fg="blue", bd=10) lblpriced.grid(row=5,
column=3) roott.mainloop()

# menubutton

menubtn = Button(leftframe, font=('Calibri', 16, 'bold'),

text="Menu Card", bg="lightgrey", fg="black", bd=3, padx=6,

pady=6, width=12,
command=menu).grid(row=2, column=2)
root.mainloop()

system()

34
OUTPUT

35
OUTPUT

36
OUTPUT

37
Analysis

This project has helped me to understand the basics of


python programming and to gain hands-on experience
on testing this knowledge of python tkinter
GUI(Graphical User Interface)module, error handling,
data validation, connectivity between python frontend
and mysql database backend.

38
BIBLIOGRAPHY

Stationary refered:
Computer Science With PYTHON By Sumita
Arora Websites:
https://docs.python.org/3/tutorial.com
https://www.w3school.com/python/.com

40
CONCLUSION

In conclusion, our restaurant management


project highlights the critical role of technology
in enhancing efficiency and customer
experience. By streamlining operations and
providing valuable insights, our system
positions restaurants for success in a
competitive landscape, paving the way for
future innovations.

39

You might also like