Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 77

CHINMAYA VIDYALAYA

SENIOR SECONDARY SCHOOL


Thondamuthur Road, Vadavalli, Coimbatore-641046

AISSCE 2021-22
INFORMATICS PRACTICES PROJECT
CAFE MANAGEMENT SYSTEM

SUBMITTED BY

A VISHNU DEV –XIIB


ROLL NO:
CAFE MANAGEMENT
SYSTEM
(USING PYTHON & MySQL)
ACKNOWLEDGEMENT

I would like to extend my sincere and heartfelt obligation towards all those
who have helped me in undertaking this project. Without their active guidance,
help, cooperation and encouragement, I would not be able to achieve the target on
time.

I am extremely thankful and pay my gratitude to my teacher Mrs. Devipriya


for her valuable guidance and support for completion of this project.

I extend my gratitude to my principal Mrs. Radha Srikaanth for the moral


support extended during the tenure of the project.

Finally, I would like to thank my family and friends who helped and
supported me in completing this project within the stipulated time.

Date: (Name of the student)


TABLE OF CONTENTS

S TITLE PAGE
NO. NO.

1 SYNOPSIS 1

2 INTRODUCTION ABOUT THE 3


PROJECT

3 SYSTEM CONFIGURATION 6

4 ABOUT PYTHON 8

5 MODULES USED 10

6 TKINTER MODULE 12

7 MySQL 14

8 SOURCE CODE 20

9 OUTPUT 50

10 CONCLUSION 82

11 FUTURE ENHANCEMENTS 84

12 BIBLIOGRAPHY 86
SYNOPSIS
SYNOPSIS

The “Central Perk” - Cafe Management System is an application


designed for cafes to manage their day-to-day activities like billing orders and
help the Administrator to manage the stock inventory, employee details and
other data related to the cafe in an organized manner. It is an Administrator
based application and not consumer based.

It has a themed design according to the cafe and a sorted structure. All
the buttons are arranged in such a way that they can be accessed easily. Thus, it
is user-friendly. This is also eco-friendly considering the fact that this
application prevents printing bills and rather produces a digital bill.

This program has been designed using Python 3.9.1 (64 bits) as the
front- end. VS CODE was used as source code editor. It is a very efficient and
easy to use editor, supports many languages and has tools for debugging,
syntax highlighting etc. The tkinter module was used for designing the
framework of this system.

This program uses MySQL as a Back-end to store data using relations.

MySQL is an Oracle-backed open-source relational database management


system (RDBMS) based on Structured Query Language (SQL).Although it can
be used in a wide range of applications, MySQL is most often associated with
web applications and online publishing.
INTRODUCTION
ABOUT THE
PROJECT
INTRODUCTION ABOUT THE PROJECT

The “CAFÉ MANAGEMENT SYSTEM” allows efficient administration


of a cafe and at the same time is very user- friendly.

HOME PAGE:

The different pages in the application are accessed via the home
page. The home page has 6 main sections on the sidebar:

● Employees

● Menu

● Billing

● Payslip

● License

● Grievance

● Inventory

EMPLOYEES:

This Employees button allows the administrator to access the names of the
employees working in that café along with a view button that allows them to
view the personal details of the employee like Name, EmployeeID, Contact
number, Blood Group and address from their database.
MENU:

The menu button allows the administrator to view the menu of the café which
will be in a static .jpg format. It is a simple image file that helps to easily access the
menu.

BILLING:

This button allows the administrator or one of the employees to


bill the customer order. The Name, Customer ID and Contact number
are mandatory while billing. The menu items are present in such a way
with a pre-determined price and a box next to it where we can select the
quantity of items and just click on generate bill which would show the
bill with the total amount.

PAYSLIP:
The payslip allows the Admin or the employees to print their
payslip with their employeeID, Designation and salary. This would help
for the employees to have a receipt proof of their salary.

License:
The license button is a simple function that allows the
administrator to view the license of the café i.e. the required documents
to run the café like a food safety license. This is just in case any food
safety officials show up and the café has the required data in hand every
time.
GRIEVANCE:
Here the administrator is given the option to enter the customer
name, order ID and contact number and a text box to type and record
any grievance by any customer. The recorded grievance gets stored in
the grievance table of the café’s database. This will be useful for the
business to tackle such problems and maintain a healthy relationship
with customers.

INVENTORY:

The inventory is used to record the daily stock of raw materials


and other goods stored at the café. It is displayed in the form of a table
in a window and is helpful for easy management of stock. The data
entered in a sql table in the café’s database is used to display the data
on the program.
SYSTEM
CONFIGURATION
SYSTEM CONFIGURATION

SOFTWARE USED:

❖ Python 3.8.10 (64 bit) – Front End

❖ VS Code – Source Code Editor

❖ Microsoft® Windows 10 Home – Operating System

❖ MySQL8.0.23 Community Server – Back End

HARDWARE USED:

❖ 8 GB RAM

❖ Hard Drive Capacity: 1 TB

❖ Processor: INTEL CORE i5

❖ 1920x1080 Monitor (resolution) – Output Device

❖ Mouse, keyboard – Input Device


ABOUT PYTHON
ABOUT PYTHON

Python is an interpreted, high-level and general-purpose programming


language. Python's design philosophy emphasizes code readability. Its language
constructs and object-oriented approach aim to help programmers write clear,
logical code for small and large-scale projects. Python is often described as a
"batteries included" language due to its comprehensive standard library.

Python was created in the late 1980s, and first released in 1991 by Guido
Van Rossum. It is based on the languages ABC and Modula 3.

ADVANTAGES:
⮚ Versatile, Easy to use.
⮚ Fast to Develop.
⮚ Open Source with a Vibrant Community.
⮚ High-level language

DISADVANTAGES:

⮚ Python is less memory efficient.


⮚ It is very slow.
⮚ It has much lesser libraries than other languages.
⮚ It is difficult to convert to other languages.
MODULES USED
MODULES USED

● Tkinter:
Tkinter is the standard GUI library for Python. Python when combined
with Tkinter provides a fast and easy way to create GUI applications.

● PIL:
Python Imaging Library is a free and open-source additional library for
the Python programming language that adds support for opening,
manipulating, and saving many different image file formats.

● Datetime:
Datetime module supplies classes to work with date and time. These
classes provide a number of functions to deal with dates, times and time
intervals. Date and datetime are an object in Python, so when you
manipulate them, you are actually manipulating objects and not string or
timestamps.

● Mysql.connector:
mysql.connector is a module that enables Python programs to access
MySQL databases, using an API that is compliant with the Python Database
API Specification v2.0 (PEP 249). It is written in pure Python and does not
have any dependencies except for the Python Standard Library. There are
various versions of MySQL Connector/Python available.
TKINTER MODULE
TKINTER MODULE

Tkinter is the standard GUI library for Python. Python when combined
with Tkinter provides a fast and easy way to create GUI applications. Tkinter
provides a powerful object-oriented interface to the Tk GUI toolkit.

Here, objects called widgets make up the window and have master or
parent widget. Properties of the widgets are specified with keyword arguments.
Keyword arguments have the same name as the corresponding resource under
Tk.

Widgets are positioned with one of the geometry managers Place, Pack or
Grid. These managers can be called with methods place, pack, grid available in
every Widget.

The various widgets used in this program are:

● Button: The Button widget is a standard Tkinter widget, which is used


for various 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.

● Canvas: The Canvas widget supplies graphics facilities for Tkinter.


Among these graphical objects are lines, circles, images, and even other
widgets. With this widget it's possible to draw graphs and plots, create
graphics editors, and implement various kinds of custom widgets.
● Entry: Entry widgets are the basic widgets of Tkinter used to get input,
i.e. text strings, from the user of an application. This widget allows the
user to enter a single line of text. If the user enters a string, which is
longer than the available display space of the widget, the content will be
scrolled.

● RadioButton: A radio button, sometimes called option button, is a


graphical user interface element of Tkinter, which allows the user to
choose (exactly) one of a predefined set of options. Radio buttons can
contain text or images.

● Scrollbar: The scrollbar widget is used to scroll down the content of the
other widgets like listbox, text, and canvas. However, we can also create
the horizontal scrollbars to the Entry widget.

● Ttk.Treeview: Treeview widget allows you to display data in both


tabular and hierarchical structures. To create a Treeview widget, we use
the ttk.Treeview class. A Treeview widget holds a list of items. Each item
has one or more columns.

● Label: This widget implements a display box where you can place text
or images. The text displayed by this widget can be updated at any time
you want. It is also possible to underline part of the text (like to identify a
keyboard shortcut) and span the text across multiple lines.
MySQL
MySQL

MySQL is an open-source relational database management


system (RDBMS). A relational database organizes data into one or more data
tables in which data types may be related to each other; these relations help
structure the data. SQL is a language programmers use to create, modify and
extract data from the relational database, as well as control user access to the
database. In addition to relational databases and SQL, an RDBMS like MySQL
works with an operating system to implement a relational database in a
computer's storage system, manages users, allows for network access and
facilitates testing database integrity and creation of backups.

ADVANTAGES:

⮚ More secure as it consists of a solid data security layer to protect


sensitive data from intruders and passwords in MySQL are encrypted.
⮚ Available for free to download and use from the official site of MySQL.

⮚ Is compatible with most of the operating systems, including Windows,


Linux, NetWare, Novell, Solaris and other variations of UNIX.

DISADVANTAGES:

⮚ Is not very efficient in handling very large databases.


⮚ Is prone to data corruption as it inefficient in handling transactions.
⮚ It does not support SQL check constraints.
TABLES CREATED:

During the execution of this application, tw tables were created in MySQL


and these can also be viewed in VS Code itself or in MySQL command line.

⮚ EMPLOYEES TABLE: This table was created having the details of the
user along with their username and password. When the user logs in with
their username and password, they are checked against this database.

TABLE: EMPLOYEES

⮚ INVENTORY TABLE: This table contains the details regarding the rooms.
TABLE: INVENTORY
SOURCE CODE
SOURCE CODE

LOGIN PAGE:
from tkinter import *
import ctypes
from tkinter import messagebox
from PIL import Image, ImageTk
import time

#Custom Modules
from customwidgets import HoverButton, UpdatingLabel

#  Required variables
user32 = ctypes.windll.user32
screen_width = user32.GetSystemMetrics(0)
screen_height = user32.GetSystemMetrics(1)

#  Predefined Functions
#  Image Resizer  Variable
def ImageResizer(width, height, file):
    '''A function to resize images for adding to the canvas'''
    file = Image.open(file)
    file = file.resize((width, height), Image.ANTIALIAS)
    file = ImageTk.PhotoImage(file)
    return file

def clock():
    '''A function to display a digital clock'''
    hour = time.strftime('%I')
    minute = time.strftime('%M')
    second = time.strftime('%S')
    am_pm = time.strftime('%p')
    time_zone = time.strftime('%Z')
    clock_label.config(text=f'{hour}:{minute}:{second} {am_pm} \n{time_zone}')
    login_canvas.create_window(1000, 75, anchor=NW, window=clock_label)
    clock_label.after(1000, clock)

def Quit():
    '''Leaving the window'''
    response = messagebox.askyesno('Quit Confirmation', 'Are You Sure You Want To Quit?')
    if response == 1:
        root.destroy()
root = Tk()
root.geometry(f'{screen_width}x{screen_height}')
login_canvas = Canvas(width=screen_width, height=screen_height, highlightthickness=0, borderwi
dth=0)

login_bg = ImageResizer(width=1600, height=900, file='Images/Coffee.jpg')
login_canvas.create_image(0, 0, anchor=NW, image=login_bg)

#  Title
title_canvas = Canvas(width=screen_width, height=30, background='#095659', borderwidth=0, hig
hlightthickness=0)
title_canvas.create_text(screen_width//2, 15, text='CENTRAL PERK ', font=('Lucida Handwriting', 
18, 'bold'), fill='#f2e9de')
login_canvas.create_window(0, 0, anchor=NW, window=title_canvas)

#  Black Canvas  background
black_canvas = Canvas(login_canvas, width=400, height=screen_height, bg='#000000', borderwidt
h=0, highlightthickness=0)
login_canvas.create_window(85, 0, anchor=NW, window=black_canvas)
black_canvas.create_text(30, 150, anchor=NW, text='Central Perk Welcomes You', font=('Garamo
nd', 26, 'italic'), fill='#ffffff')

#  Clock
clock_label = Label(login_canvas, text="", font=('Helvetica', 28), fg='#f2e9de', bg='black')
login_canvas.create_window(1250, 75, anchor=NW, window=clock_label)
clock()

#  Username
login_textbox = Entry(login_canvas, background='#b52331', width=30, highlightthickness=3,
                     highlightbackground='#ffffff', font=('Source Sans', 16), fg='#000000')
login_canvas.create_window(100, 350, anchor=NW, window=login_textbox)
black_canvas.create_text(10, 310, anchor=NW, text='Manager ID', font=('Source Sans', 20, 'bold'), 
fill='#ffffff')
#  Password
login_textbox = Entry(login_canvas,background='#b52331', width=30, highlightthickness=3,
                     highlightbackground='#ffffff', font=('Source Sans', 16), fg='#000000', show='*')
login_canvas.create_window(100, 460, anchor=NW, window=login_textbox)
black_canvas.create_text(10, 420, anchor=NW, text='Password', font=('Source Sans', 20, 'bold'), fill
='#ffffff')

#  Navigation  Buttons:
forgot_pass = HoverButton(master=login_canvas, bg='#000000', fg='#ffffff',
                     activebackground='#000000', activeforeground='#b52331', text='Forgot Password', fo
nt=('Open Sans', 16, 'bold'),
                      height=1, borderwidth=0, highlightthickness=0)
login_canvas.create_window(270, 510, anchor=NW, window=forgot_pass)
log_in_btn = HoverButton(master=login_canvas, bg='#b52331', fg='#000000',
                     activebackground='#095659', activeforeground='#000000', text='Log In', font=('Open 
Sans', 18, 'bold'),
                     width=8, borderwidth=0, highlightthickness=3, highlightbackground='#ffffff')
login_canvas.create_window(200, 570, anchor=NW, window=log_in_btn)
quit_btn = HoverButton(master=login_canvas, bg='#b52331', fg='#000000',
                     activebackground='#095659', activeforeground='#000000', text='Quit', font=('Open Sa
ns', 18, 'bold'),
                     width=8, borderwidth=0, highlightthickness=3, highlightbackground='#ffffff', comma
nd=Quit)
login_canvas.create_window(340, 570, anchor=NW, window=quit_btn)

#  Dynamic Quote Label
quotes = ["What Goes Best With A Cup Of Coffee ? Another Cup ;)",
          "Today's Good Mood Is Sponsored By Coffee :)",
          "A Coffee A Day, Keeps Grumpy Away :P",
          "COFFEE: Unrealistic Expectations of Productivity"]
quote_label = UpdatingLabel(master=black_canvas, text='Hello World', fg='#ffffff', bg='#000000', 
font=('Seoge UI', 18, 'italic'),
                            wraplength=400, justify = CENTER, time = 4000, updating_texts=quotes)
black_canvas.create_window(30, 640, anchor=NW, window=quote_label)

#  Packing Things Up
login_canvas.pack()
root.overrideredirect(True)
root.mainloop()

HOME SCREEN:
from tkinter import *
from PIL import Image, ImageTk
import ctypes
import sys
import subprocess
from tkinter.scrolledtext import ScrolledText
import mysql.connector as sql
from tkinter import ttk
#  Required variables
user32 = ctypes.windll.user32
screen_width = user32.GetSystemMetrics(0)
screen_height = user32.GetSystemMetrics(1)

#  Mysql  connection
connectdb = sql.connect(host='localhost',
    user='root',
    passwd='vmrtw123',
    database='central_perk')
cursordb = connectdb.cursor()

def treeview_display(number):
    """Function for creating the treeview that displays the details of the employees"""
    #  Creating tkinter window
    window_1 = Tk()
    window_1.resizable(0, 0)
    #  Using treeview  widget
    treev = ttk.Treeview(window_1, selectmode ='browse')

    #  Calling pack method w.r.to  treeview


    treev.pack(side ='right')

    #  Constructing vertical  scrollbar


    #  with treeview
    #  verscrlbar = ttk.Scrollbar(window_1,
    #                                 orient ="horizontal",
    #                                 command = treev.xview)

    #  # Calling pack  method  w.r.to verical


    #  # scrollbar
    #  verscrlbar.pack(side  ='left', fill ='y')

    #  # Configuring treeview
    #  treev.configure(yscrollcommand = verscrlbar.set)
    #  Defining number of columns
    treev["columns"] = ("1", "2", "3", "4", "5", "6")

    #  Defining heading
    treev['show'] = 'headings'

    #  Assigning  the width  and anchor to the


    #  respective columns
    treev.column("1", width = 120, anchor ='c')
    treev.column("2", width = 120, anchor ='c')
    treev.column("3", width = 120, anchor ='c')
    treev.column("4", width = 120, anchor ='c')
    treev.column("5", width = 120, anchor ='c')
    treev.column("6", width = 300, anchor ='w')

    #  Assigning  the heading  names to the


    #  respective columns
    treev.heading("1", text ="Name")
    treev.heading("2", text ="Employee ID")
    treev.heading("3", text ="D-O-B")
    treev.heading("4", text ="Contact number")
    treev.heading("5", text ='Blood Group')
    treev.heading("6", text ="Address")

    cursordb = connectdb.cursor()
    cursordb.execute(f'select * from employees where employee_ID ={number}')
    data = cursordb.fetchall()
    listfordata = []
    for datas in data:
        
        for datass in datas:
            listfordata.append(datass)
            
    #  Inserting  the items and their features to the
    #  columns built
    treev.insert("", 'end', text ="L1",
                values =(f"{listfordata[0]}", f"{listfordata[1]}", f"{listfordata[2]}", f"{listfordata[3]}", f"
{listfordata[4]}", f"{listfordata[5]}"))
   
    #  Calling mainloop
    window_1.mainloop()

#  Class for hoverbutton
class HoverButton(Button):

    def init(self, master, **kw):
        '''A HoverButton Child class for the parent Button class in the tkinter module.'''
        Button.init(self, master=master, **kw)
        self.defaultBackground = self["background"]
        self.defaultForeground = self["foreground"]
        self.bind("<Enter>", self.on_enter)
        self.bind("<Leave>", self.on_leave)

    def on_enter(self, event):
        '''Hover effect when the mouse pointer is over the button'''
        self['bg'] = self['activebackground']
        self['fg'] = self['activeforeground']

    def on_leave(self, event):
        '''Hover effect when the mouse pointer stops hovering over the button.'''
        self['background'] = self.defaultBackground
        self['foreground'] = self.defaultForeground

def ImageResizer(width, height, file):
    '''A function to rezize images for adding to the canvas'''
    file = Image.open(file)
    file = file.resize((width, height), Image.ANTIALIAS)
    file = ImageTk.PhotoImage(file)
    return file

#  Button Function

def payslip():
    subprocess.run(
        ['python', 'F:\\COFFEE STORE MANAGEMENT SYSTEM\\IP PROJECT\\PAYSLIP.py'])
    sys.exit(0)
def billing():
    subprocess.run(
        ['python', 'F:\\COFFEE STORE MANAGEMENT SYSTEM\\IP PROJECT\\BILLING.py'])
    sys.exit(0)

def grivences():
    """Function for creating grivences window"""
    window = Toplevel(mainscreen_canvas)
    window.geometry('400x400')
    window.resizable(0, 0)
    window_canvas = Canvas(window, height=400, width=400, highlightthickness=0)
    window_canvas.create_text(10, 10, anchor=NW, font=(
        'Helvetica', 15), fill='Black', text='Give your Grivences here')
    window_text = ScrolledText(window_canvas, width=100, height=100)
    window_canvas.create_window(0, 40, anchor=NW, window=window_text)
    window_canvas.pack()
    window.mainloop()

#  def upload_and_show(name):
#       """Function for creating  the window  for View button"""

#       viewbutton = Toplevel(mainscreen_canvas)
#       viewbutton.geometry('600x600')
#       cursordb.execute('SELECT  * from employees')
#       viewbutton.mainloop()
    
    
def open():
    global my_img
    top = Toplevel()
    top.title("Employees")
    top.geometry('1500x600')
    mainscreen_canvas = Canvas(
        top, width=1300, height=600, highlightthickness=0, borderwidth=0, bg='#000000')

    #  names of those who are  working  in my company


    mainscreen_canvas.create_text(
        80, 50, anchor=NW, text="Name", fill='#ffffff', font=('Helvetica', 30, 'bold'))
    mainscreen_canvas.create_text(
        80, 120, anchor=NW, text="VISHNU DEV", fill='#ffffff', font=('Helvetica', 15, 'bold'))
    mainscreen_canvas.create_text(
        80, 160, anchor=NW, text="AADHI", fill='#ffffff', font=('Helvetica', 15, 'bold'))
    mainscreen_canvas.create_text(
        80, 200, anchor=NW, text="VARSHA", fill='#ffffff', font=('Helvetica', 15, 'bold'))
    mainscreen_canvas.create_text(
        80, 240, anchor=NW, text="NIKIL", fill='#ffffff', font=('Helvetica', 15, 'bold'))
    mainscreen_canvas.create_text(
        80, 280, anchor=NW, text="RITESH", fill='#ffffff', font=('Helvetica', 15, 'bold'))
    mainscreen_canvas.create_text(
        80, 320, anchor=NW, text="SIDDARTH", fill='#ffffff', font=('Helvetica', 15, 'bold'))
    mainscreen_canvas.create_text(
        80, 360, anchor=NW, text="ARAVIND", fill='#ffffff', font=('Helvetica', 15, 'bold'))
    mainscreen_canvas.create_text(
        80, 400, anchor=NW, text="SHARON", fill='#ffffff', font=('Helvetica', 15, 'bold'))
    mainscreen_canvas.create_text(
        80, 440, anchor=NW, text="RADHA", fill='#ffffff', font=('Helvetica', 15, 'bold'))
    #  this  section is for designation,  for easy identification of the professsion they are in my  com
pany
    mainscreen_canvas.create_text(
        420, 120, anchor=NW, text="MANAGER", fill='#ffffff', font=('Helvetica', 20, 'bold'))
    mainscreen_canvas.create_text(
        420, 160, anchor=NW, text="BAKER", fill='#ffffff', font=('Helvetica', 20, 'bold'))
    mainscreen_canvas.create_text(
        420, 200, anchor=NW, text="FNB MANAGER", fill='#ffffff', font=('Helvetica', 20, 'bold'))
    mainscreen_canvas.create_text(
        420, 240, anchor=NW, text="SALES MANAGER", fill='#ffffff', font=('Helvetica', 20, 'bold'))
    mainscreen_canvas.create_text(
        420, 280, anchor=NW, text="DELIVERY STAFF", fill='#ffffff', font=('Helvetica', 20, 'bold'))
    mainscreen_canvas.create_text(
        420, 320, anchor=NW, text="BILLING STAFF", fill='#ffffff', font=('Helvetica', 20, 'bold'))
    mainscreen_canvas.create_text(
        420, 360, anchor=NW, text="STEWARD", fill='#ffffff', font=('Helvetica', 20, 'bold'))
    mainscreen_canvas.create_text(
        420, 400, anchor=NW, text="CHEF", fill='#ffffff', font=('Helvetica', 20, 'bold'))
    mainscreen_canvas.create_text(
        420, 440, anchor=NW, text="TEETOTTLER", fill='#ffffff', font=('Helvetica', 20, 'bold'))

    mainscreen_canvas.create_text(
        350, 35, anchor=NW, text="Designation", fill='#ffffff', font=('Helvetica', 40, 'bold'))
#  To know more about them we use this  , so that we can get their entire  details about them
    View_btn = HoverButton(master=mainscreen_canvas, bg='#de1010', fg='#ffffff',
                           activebackground='#000000', activeforeground='#de1010', text='View', font=('Ope
n Sans', 16, 'bold'),
                           width=15, height=1, borderwidth=0, highlightthickness=0, command=lambda:tree
view_display(1))
    mainscreen_canvas.create_window(780, 120, anchor=NW, window=View_btn)

    View_btn = HoverButton(master=mainscreen_canvas, bg='#de1010', fg='#ffffff',
                           activebackground='#000000', activeforeground='#de1010', text='View', font=('Ope
n Sans', 16, 'bold'),
                           width=15, height=1, borderwidth=0, highlightthickness=0, command=lambda:tree
view_display(2))
    mainscreen_canvas.create_window(780, 160, anchor=NW, window=View_btn)

    View_btn = HoverButton(master=mainscreen_canvas, bg='#de1010', fg='#ffffff',
                           activebackground='#000000', activeforeground='#de1010', text='View', font=('Ope
n Sans', 16, 'bold'),
                           width=15, height=1, borderwidth=0, highlightthickness=0, command=lambda:tree
view_display(3))
    mainscreen_canvas.create_window(780, 200, anchor=NW, window=View_btn)
    View_btn = HoverButton(master=mainscreen_canvas, bg='#de1010', fg='#ffffff',
                           activebackground='#000000', activeforeground='#de1010', text='View', font=('Ope
n Sans', 16, 'bold'),
                           width=15, height=1, borderwidth=0, highlightthickness=0, command=lambda:tree
view_display(4))
    mainscreen_canvas.create_window(780, 240, anchor=NW, window=View_btn)

    View_btn = HoverButton(master=mainscreen_canvas, bg='#de1010', fg='#ffffff',
                           activebackground='#000000', activeforeground='#de1010', text='View', font=('Ope
n Sans', 16, 'bold'),
                           width=15, height=1, borderwidth=0, highlightthickness=0, command=lambda:tree
view_display(5))
    mainscreen_canvas.create_window(780, 280, anchor=NW, window=View_btn)

    View_btn = HoverButton(master=mainscreen_canvas, bg='#de1010', fg='#ffffff',
                           activebackground='#000000', activeforeground='#de1010', text='View', font=('Ope
n Sans', 16, 'bold'),
                           width=15, height=1, borderwidth=0, highlightthickness=0, command=lambda:tree
view_display(6))
    mainscreen_canvas.create_window(780, 320, anchor=NW, window=View_btn)

    View_btn = HoverButton(master=mainscreen_canvas, bg='#de1010', fg='#ffffff',
                           activebackground='#000000', activeforeground='#de1010', text='View', font=('Ope
n Sans', 16, 'bold'),
                           width=15, height=1, borderwidth=0, highlightthickness=0, command=lambda:tree
view_display(7))
    mainscreen_canvas.create_window(780, 360, anchor=NW, window=View_btn)

    View_btn = HoverButton(master=mainscreen_canvas, bg='#de1010', fg='#ffffff',
                           activebackground='#000000', activeforeground='#de1010', text='View', font=('Ope
n Sans', 16, 'bold'),
                           width=15, height=1, borderwidth=0, highlightthickness=0, command=lambda:tree
view_display(8))
    mainscreen_canvas.create_window(780, 400, anchor=NW, window=View_btn)

    View_btn = HoverButton(master=mainscreen_canvas, bg='#de1010', fg='#ffffff',
                           activebackground='#000000', activeforeground='#de1010', text='View', font=('Ope
n Sans', 16, 'bold'),
                           width=15, height=0, borderwidth=0, highlightthickness=0, command=lambda:tree
view_display(9))
    mainscreen_canvas.create_window(780, 440, anchor=NW, window=View_btn)

    mainscreen_canvas.pack()

def treeview_display_inventory():
    #  Creating tkinter window
    window_1 = Tk()
    window_1.resizable(0, 0)

    #  Using treeview  widget


    treev = ttk.Treeview(window_1, selectmode ='browse')
    #  Calling pack method w.r.to  treeview
    treev.pack(side ='right')

    #  Constructing vertical  scrollbar


    #  with treeview
    verscrlbar = ttk.Scrollbar(window_1,
                            orient ="vertical",
                            command = treev.yview)

    #  Calling pack method w.r.to  verical


    #  scrollbar
    verscrlbar.pack(side ='right', fill ='x')

    #  Configuring treeview
    treev.configure(xscrollcommand = verscrlbar.set)
    #  Defining number of columns
    treev["columns"] = ("1", "2", "3",)

    #  Defining heading
    treev['show'] = 'headings'

    #  Assigning  the width  and anchor to the


    #  respective columns
    treev.column("1", width = 120, anchor ='c')
    treev.column("2", width = 120, anchor ='c')
    treev.column("3", width = 120, anchor ='c')
 

    #  Assigning  the heading  names to the


    #  respective columns
    treev.heading("1", text ="Date")
    treev.heading("2", text ="Item")
    treev.heading("3", text ="Quantity")
    

    connectdb = sql.connect(host='localhost',
        user='root',
        passwd='vmrtw123',
        database='central_perk')

    #  cursordb  = connectdb.cursor()


    cursordb.execute(f'select * from inventory')
    data = cursordb.fetchall()

    for datas in data:
        treev.insert("", 'end', text ="L1",
                values =datas) 
            
    #  print(len(listfordata))
            
    
   
    #  Calling mainloop
    window_1.mainloop()

def open12():
    global my_img
    top = Tk()
    top.title("Employees")
    top.geometry('1500x600')
    #  mainscreen_canvas = Canvas(
    #       top,  width=1500,  height=600, highlightthickness=0,  borderwidth=0, bg='#000000')

    #  names of those who are  working  in my company


    #  mainscreen_canvas.create_text(
    #       160, 50, anchor=NW, text="Date", fill='#ffffff', font=('Helvetica', 30, 'bold'))
    #  mainscreen_canvas.create_text(
    #       160, 120, anchor=NW, text="16/01/2021", fill='#ffffff', font=('Helvetica', 15,  'bold'))
    #  mainscreen_canvas.create_text(
    #       160, 160, anchor=NW, text="12/03/2021", fill='#ffffff', font=('Helvetica', 15,  'bold'))
    #  mainscreen_canvas.create_text(
    #       160, 200, anchor=NW, text="18/01/2021", fill='#ffffff', font=('Helvetica', 15,  'bold'))
    #  mainscreen_canvas.create_text(
    #       160, 240, anchor=NW, text="26/04/2021", fill='#ffffff', font=('Helvetica', 15,  'bold'))
    #  mainscreen_canvas.create_text(
    #       160, 280, anchor=NW, text="31/03/2021", fill='#ffffff', font=('Helvetica', 15,  'bold'))
    #  mainscreen_canvas.create_text(
    #       160, 320, anchor=NW, text="10/02/2021", fill='#ffffff', font=('Helvetica', 15,  'bold'))
    #  mainscreen_canvas.create_text(
    #       160, 360, anchor=NW, text="1/05/2021", fill='#ffffff', font=('Helvetica', 15,  'bold'))
    #  mainscreen_canvas.create_text(
    #       160, 400, anchor=NW, text="28/05/2021", fill='#ffffff', font=('Helvetica', 15,  'bold'))
    #  mainscreen_canvas.create_text(
    #       160, 440, anchor=NW, text="10/07/2021", fill='#ffffff', font=('Helvetica', 15,  'bold'))
    #  # this section is for  designation, for easy identification of the  professsion they are in  my co
mpany
    #  mainscreen_canvas.create_text(
    #       420, 120, anchor=NW, text="MAIDA", fill='#ffffff', font=('Helvetica', 25, 'bold'))
    #  mainscreen_canvas.create_text(
    #       420, 160, anchor=NW, text="PANNER", fill='#ffffff', font=('Helvetica', 25, 'bold'))
    #  mainscreen_canvas.create_text(
    #       420, 200, anchor=NW, text="COFFEE SEEDS",  fill='#ffffff', font=('Helvetica', 25, 'bold'
))
    #  mainscreen_canvas.create_text(
    #       420, 240, anchor=NW, text="COFFEE SEEDS",  fill='#ffffff', font=('Helvetica', 25, 'bold'
))
    #  mainscreen_canvas.create_text(
    #       420, 280, anchor=NW, text="MAIDA", fill='#ffffff', font=('Helvetica', 25, 'bold'))
    #  mainscreen_canvas.create_text(
    #       420, 320, anchor=NW, text="MILK", fill='#ffffff', font=('Helvetica', 25, 'bold'))
    #  mainscreen_canvas.create_text(
    #       420, 360, anchor=NW, text="MILK", fill='#ffffff', font=('Helvetica', 25, 'bold'))
    #  mainscreen_canvas.create_text(
    #       420, 400, anchor=NW, text="SPICES", fill='#ffffff', font=('Helvetica', 25,  'bold'))
    #  mainscreen_canvas.create_text(
    #       420, 440, anchor=NW, text="DRINKS",  fill='#ffffff', font=('Helvetica', 25, 'bold'))

    #  mainscreen_canvas.create_text(
    #       420, 35, anchor=NW, text="Item", fill='#ffffff', font=('Helvetica', 40, 'bold'))

    #  mainscreen_canvas.create_text(
    #       900, 35, anchor=NW, text="Quantity",  fill='#ffffff', font=('Helvetica', 40, 'bold'))

    #  mainscreen_canvas.create_text(
    #       900, 120, anchor=NW, text="X100", fill='#ffffff', font=('Helvetica', 30, 'bold'))
    #  mainscreen_canvas.create_text(
    #       900, 160, anchor=NW, text="X10", fill='#ffffff', font=('Helvetica', 30, 'bold'))
    #  mainscreen_canvas.create_text(
    #       900, 200, anchor=NW, text="X1000", fill='#ffffff', font=('Helvetica', 30, 'bold'))
    #  mainscreen_canvas.create_text(
    #       900, 240, anchor=NW, text="X2000", fill='#ffffff', font=('Helvetica', 30, 'bold'))
    #  mainscreen_canvas.create_text(
    #       900, 280, anchor=NW, text="X150", fill='#ffffff', font=('Helvetica', 30, 'bold'))
    #  mainscreen_canvas.create_text(
    #       900, 320, anchor=NW, text="X200", fill='#ffffff', font=('Helvetica', 30, 'bold'))
    #  mainscreen_canvas.create_text(
    #       900, 360, anchor=NW, text="X500", fill='#ffffff', font=('Helvetica', 30, 'bold'))
    #  mainscreen_canvas.create_text(
    #       900, 400, anchor=NW, text="X100", fill='#ffffff', font=('Helvetica', 30, 'bold'))
    #  mainscreen_canvas.create_text(
    #       900, 440, anchor=NW, text="X500", fill='#ffffff', font=('Helvetica', 30, 'bold'))

    #  mainscreen_canvas.pack()

def open1():
    global my_img
    top = Toplevel()
    top.title("welcome")
    top.geometry('1300x768')
    mainscreen_canvas = Canvas(
        top, width=1300, height=768, highlightthickness=0, borderwidth=0, bg='#000000')
    English_bg = ImageResizer(width=1300, height=790, file="Images//MENU.JPEG")
    mainscreen_canvas.create_image(0, 0, anchor=NW, image=English_bg)

    mainscreen_canvas.pack()
    top.mainloop()

def open2():
    global my_img
    top = Toplevel()
    top.title("welcome")
    top.geometry('1300x792')
    mainscreen_canvas = Canvas(
        top, width=1300, height=792, highlightthickness=0, borderwidth=0, bg='#000000')
    English_bg = ImageResizer(width=1300, height=790, file="Images//FSSAI.PNG")
    mainscreen_canvas.create_image(0, 0, anchor=NW, image=English_bg)
    mainscreen_canvas.pack()
    top.mainloop()

def open3():
    global my_img
    top = Toplevel()
    top.title("welcome")
    top.geometry('600x500')
    mainscreen_canvas = Canvas(
        top, width=600, height=500, highlightthickness=0, borderwidth=0, bg='#000000')
    mainscreen_canvas.create_text(
        180, 50, anchor=NW, text="Inventory", fill='#ffffff', font=('Helvetica', 40, 'bold'))
    mainscreen_canvas.create_text(
        60, 200, anchor=NW, text="Date", fill='#ffffff', font=('Helvetica', 20, 'bold'))
    mainscreen_canvas.create_text(
        250, 200, anchor=NW, text="Item", fill='#ffffff', font=('Helvetica', 20, 'bold'))
    mainscreen_canvas.create_text(
        450, 200, anchor=NW, text="Quantity", fill='#ffffff', font=('Helvetica', 20, 'bold'))

    mainscreen_canvas.pack()

#  Main  Screen
root = Tk()
root.geometry(f'{screen_width}x{screen_height}')
mainscreen_canvas = Canvas(root, width=screen_width, height=screen_height,
                           highlightthickness=0, borderwidth=0, bg='#000000')
English_bg = ImageResizer(width=1360, height=790,
                          file="Images/CENTRAL PERK.jpg")
mainscreen_canvas.create_image(0, 0, anchor=NW, image=English_bg)

#  Navigation  Bar
navbar_canvas = Canvas(mainscreen_canvas, width=screen_width,
                       height=120, highlightthickness=0, borderwidth=0, bg='#282928')
mainscreen_canvas.create_window(0, 0, anchor=NW, window=navbar_canvas)
navbar_canvas.create_text(70, 40, anchor=NW, text='CENTRAL PERK', font=(
    'Open Sans', 25, 'bold'), fill='white')
navbar_canvas.create_text(1100, 40, anchor=NW, text='MY BRANCH', font=(
    'Open Sans', 25, 'bold'), fill='white')

#  Navigation  Bar
sidebar = Canvas(mainscreen_canvas, bg='#000000', width=180,
                 height=screen_height, highlightthickness=0)
mainscreen_canvas.create_window(0, 120, anchor=NW, window=sidebar)
#  sidebar.create_text(text='Menu', font=('HP  Simplified Hans', 16),  fill='black')

Employees_btn = HoverButton(mainscreen_canvas, bg='#ffffff', fg='#000000',
                            activebackground='red', activeforeground='#000000', text='Employees', font=('Op
en Sans', 14, ),
                            width=15, height=1, borderwidth=0, highlightthickness=0, command=open)
mainscreen_canvas.create_window(3, 230, anchor=NW, window=Employees_btn)
Menu_btn = HoverButton(mainscreen_canvas, bg='#ffffff', fg='#000000',
                       activebackground='red', activeforeground='#000000', text='Menu', font=('Open Sans', 
14),
                       width=15, height=1, borderwidth=0, highlightthickness=0, command=open1)
mainscreen_canvas.create_window(3, 280, anchor=NW, window=Menu_btn)
Billing_btn = HoverButton(mainscreen_canvas, bg='#ffffff', fg='#000000',
                          activebackground='red', activeforeground='#000000', text='Billing', font=('Open Sa
ns', 14, ),
                          width=15, height=1, borderwidth=0, highlightthickness=0, command=billing)
mainscreen_canvas.create_window(3, 330, anchor=NW, window=Billing_btn)
Payslip_btn = HoverButton(mainscreen_canvas, bg='#ffffff', fg='#000000',
                          activebackground='red', activeforeground='#000000', text='PaySlip', font=('Open S
ans', 14, ),
                          width=15, height=1, borderwidth=0, highlightthickness=0, command=payslip)
mainscreen_canvas.create_window(3, 380, anchor=NW, window=Payslip_btn)

Lisence_btn = HoverButton(mainscreen_canvas, bg='#ffffff', fg='#000000',
                          activebackground='red', activeforeground='#000000', text='License', font=('Open S
ans', 14,),
                          width=15, height=1, borderwidth=0, highlightthickness=0, command=open2)
mainscreen_canvas.create_window(3, 430, anchor=NW, window=Lisence_btn)
Grivence_btn = HoverButton(mainscreen_canvas, bg='#ffffff', fg='#000000',
                           activebackground='red', activeforeground='#000000', text='Grievance', font=('Ope
n Sans', 14,),
                           width=15, height=1, borderwidth=0, highlightthickness=0, command=grivences)
mainscreen_canvas.create_window(3, 480, anchor=NW, window=Grivence_btn)
Inventory_btn = HoverButton(mainscreen_canvas, bg='#ffffff', fg='#000000',
                            activebackground='red', activeforeground='#000000', text='Inventory', font=('Ope
n Sans', 14,),
                            width=15, height=1, borderwidth=0, highlightthickness=0, command=treeview_di
splay_inventory)
mainscreen_canvas.create_window(3, 530, anchor=NW, window=Inventory_btn)

#  Packing and  Looping
mainscreen_canvas.pack()
root.overrideredirect(True)

root.mainloop()

BILLING:
from tkinter import *
from tkinter import ttk
import tkinter.messagebox as tkm
import datetime
import time
import ctypes as c

'''Validating Entry Widgets'''
def valid_characters(character):
    '''Validating characters allowed for username and password entries.'''
    text = character
    
    if text.isdigit():          
        #  Cheking for alphanumeric  character
        return True                
    elif text == '':           
        #  Checking is  the string is empty
        return True
    else:
        #  Not  validating special characters and spaces.
        tkm.showerror('Invalid Character Type', 'Only numbers are allowed')
        return False

''' Screen Measurements'''
width = c.windll.user32.GetSystemMetrics(0)
height = c.windll.user32.GetSystemMetrics(1)

root = Tk()
reg = root.register(valid_characters)

'''Styling a treeview'''
#  Configure the  treeview Colours
''' Colour Palette '''
colours = {
    'grey0' : '#4d4a4a',
    'grey1' : '#24292e',
    'grey2' : '#1f2428',
    'white' : '#ffffff',
    'skin1' : '#2471d6',
    'black' : '#000000',
    'blak_1' : '#202120'
}

style = ttk.Style()
style.theme_use('default')
style.configure("Treeview",
    background = colours['grey0'],
    foreground = colours['white'],
    fieldbackground = colours['grey1'],
    rowheight=25,
    font=('HP Simplified Hans', 12)
)

#Heading of TreeView
style.configure("Treeview.Heading", font=('Segoue UI', 14, 'bold'))
#  Change  Selected  Colour
style.map('Treeview',
    background=[('selected', 'red')],
)

#  Overall canvas
canvas = Canvas(root, width=width, height=height, highlightthickness=0, bg='black')
canvas.create_text(width//2, 20, anchor=N, text='Central Perk Menu', fill='red', font=('HP Simplifie
d', 32, 'bold'))

#  Frames for customer  details
details = LabelFrame(canvas, text='Customer Details', font=('HP Simplified', 24, 'bold'), fg='red', b
g='#000000', border=4)
name = Label(details, width=18, text='Name :', font=('HP Simplified', 16, 'bold'), fg='#ffffff', bg='#
000000', relief=FLAT)
name_e_var = StringVar()
name_e = Entry(details, textvariable=name_e_var, insertbackground='red', background='black', for
eground='white', border=3, font=('Times New Roman', 16), relief=RIDGE)
contact_no = Label(details, width=18, text='Contact No:', font=('HP Simplified', 16, 'bold'), fg='#fff
fff', bg='#000000', relief=FLAT)
contact_no_e_var = StringVar()
contact_no_e = Entry(details, textvariable=contact_no_e_var, insertbackground='red', background=
'black', foreground='white',  border=3, font=('Times New Roman', 16), relief=RIDGE)
contact_no_e.config(validate ="key", validatecommand =(reg, '%P'))
bill_no = Label(details, width=18, text='Bill No:', font=('HP Simplified', 16, 'bold'), fg='#ffffff', bg
='#000000', relief=FLAT)
bill_no_e_var = StringVar()
bill_no_e = Entry(details, textvariable=bill_no_e_var, insertbackground='red', background='black', 
foreground='white', border=3, font=('Times New Roman', 16), relief=RIDGE)
bill_no_e.config(validate ="key", validatecommand =(reg, '%P'))

canvas.create_window(10, 70, anchor=NW, window=details)
name.grid(column=0, row=0, padx=15, pady=5)
name_e.grid(column=1, row=0, padx=15, pady=5)
contact_no.grid(column=2, row=0, padx=15, pady=5)
contact_no_e.grid(column=3, row=0, padx=15, pady=5)
bill_no.grid(column=4, row=0, padx=15, pady=5)
bill_no_e.grid(column=5, row=0, padx=15, pady=5)

#  Frames for each food item
menu = LabelFrame(canvas, text='Menu', font=('HP Simplified Hans', 24, 'bold'), fg='red', bg='#00
0000', border=4)
starters = LabelFrame(menu, text='Starters', font=('HP Simplified', 20, 'bold'),fg='red', bg='#000000
', border=4)
main_course = LabelFrame(menu, text='Main course', font=('HP Simplified', 20, 'bold'), fg='red', b
g='#000000', border=4)
pasta = LabelFrame(main_course, text='Pasta', font=('HP Simplified', 20, 'bold'), fg='red', bg='#000
000', border=4)
pizza = LabelFrame(main_course, text='Pizza (Regular Size)', font=('HP Simplified', 20, 'bold'), fg
='red', bg='#000000', border=4)
sandiwch = LabelFrame(main_course, text='Sandwich', font=('HP Simplified', 20, 'bold'), fg='red', 
bg='#000000', border=4)
drinks = LabelFrame(menu, text='Drinks', font=('HP Simplified', 20, 'bold'), fg='red', bg='#000000', 
border=4)
desserts = LabelFrame(menu, text='Desserts', font=('HP Simplified', 20, 'bold'), fg='red', bg='#0000
00', border=4)

#  Food  items
starters_prod_1 = Label(starters, anchor='w', width=25, font=('HP Simplified Light', 14), bg='#000
000', fg='#ffffff', text='Nuggets', relief=FLAT)
starters_prod_2 = Label(starters, anchor='w', width=25, font=('HP Simplified Light', 14), bg='#000
000', fg='#ffffff', text='Peri Peri Fries', relief=FLAT)
starters_prod_3 = Label(starters, anchor='w', width=25, font=('HP Simplified Light', 14), bg='#000
000', fg='#ffffff', text='Cheesy Fries', relief=FLAT)
starters_prod_1_cost = Label(starters,anchor='w', width=6, fg='green', bg='#000000', relief=FLAT, 
font=('HP Simplified', 14), text='$80')
starters_prod_2_cost = Label(starters,anchor='w', width=6, fg='green', bg='#000000', relief=FLAT, 
font=('HP Simplified', 14), text='$70')
starters_prod_3_cost = Label(starters,anchor='w', width=6, fg='green', bg='#000000', relief=FLAT, 
font=('HP Simplified', 14), text='$90')
starters_prod_1_spin_var = StringVar()
starters_prod_2_spin_var = StringVar()
starters_prod_3_spin_var = StringVar()
starters_prod_1_spin = Spinbox(starters, from_=0, to=10, font=('HP Simplified Hans', 16), bg='#00
0000', fg='red', width=5, textvariable=starters_prod_1_spin_var)
starters_prod_2_spin = Spinbox(starters, from_=0, to=10, font=('HP Simplified Hans', 16), bg='#00
0000', fg='red', width=5, textvariable=starters_prod_2_spin_var)
starters_prod_3_spin = Spinbox(starters, from_=0, to=10, font=('HP Simplified Hans', 16), bg='#00
0000', fg='red', width=5, textvariable=starters_prod_3_spin_var)

starters_prod_1.grid(column=0, row=0)
starters_prod_2.grid(column=0, row=1)
starters_prod_3.grid(column=0, row=2)
starters_prod_1_spin.grid(column=2, row=0)
starters_prod_2_spin.grid(column=2, row=1)
starters_prod_3_spin.grid(column=2, row=2)
starters_prod_1_cost.grid(column=1, row=0)
starters_prod_2_cost.grid(column=1, row=1)
starters_prod_3_cost.grid(column=1, row=2)

drinks_prod_1 = Label(drinks, anchor='w', width=25, font=('HP Simplified Light', 14), bg='#00000
0', fg='#ffffff', text='Oreo Shake', relief=FLAT)
drinks_prod_2 = Label(drinks, anchor='w', width=25, font=('HP Simplified Light', 14), bg='#00000
0', fg='#ffffff', text='Chocolate Shake', relief=FLAT)
drinks_prod_3 = Label(drinks, anchor='w', width=25, font=('HP Simplified Light', 14), bg='#00000
0', fg='#ffffff', text='Cold Coffee', relief=FLAT)
drinks_prod_1_cost = Label(drinks,anchor='w', width=6, fg='green', bg='#000000', relief=FLAT, fo
nt=('HP Simplified', 14), text='$150')
drinks_prod_2_cost = Label(drinks,anchor='w', width=6, fg='green', bg='#000000', relief=FLAT, fo
nt=('HP Simplified', 14), text='$200')
drinks_prod_3_cost = Label(drinks,anchor='w', width=6, fg='green', bg='#000000', relief=FLAT, fo
nt=('HP Simplified', 14), text='$100')
drinks_prod_1_spin_var = StringVar()
drinks_prod_2_spin_var = StringVar()
drinks_prod_3_spin_var = StringVar()
drinks_prod_1_spin = Spinbox(drinks, from_=0, to=10, font=('HP Simplified Hans', 16), bg='#000
000', fg='red', width=5, textvariable=drinks_prod_1_spin_var)
drinks_prod_2_spin = Spinbox(drinks, from_=0, to=10, font=('HP Simplified Hans', 16), bg='#000
000', fg='red', width=5, textvariable=drinks_prod_2_spin_var)
drinks_prod_3_spin = Spinbox(drinks, from_=0, to=10, font=('HP Simplified Hans', 16), bg='#000
000', fg='red', width=5, textvariable=drinks_prod_3_spin_var)

drinks_prod_1.grid(column=0, row=0)
drinks_prod_2.grid(column=0, row=1)
drinks_prod_3.grid(column=0, row=2)
drinks_prod_1_spin.grid(column=2, row=0)
drinks_prod_2_spin.grid(column=2, row=1)
drinks_prod_3_spin.grid(column=2, row=2)
drinks_prod_1_cost.grid(column=1, row=0)
drinks_prod_2_cost.grid(column=1, row=1)
drinks_prod_3_cost.grid(column=1, row=2)

dessert_prod_1 = Label(desserts,anchor='w', width=25, font=('HP Simplified Light', 14), bg='#0000
00', fg='#ffffff', text='Brownie With Ice-cream', relief=FLAT)
dessert_prod_2 = Label(desserts,anchor='w', width=25, font=('HP Simplified Light', 14), bg='#0000
00', fg='#ffffff', text='Red Velvet Cake', relief=FLAT)
dessert_prod_3 = Label(desserts,anchor='w', width=25, font=('HP Simplified Light', 14), bg='#0000
00', fg='#ffffff', text='Chocolate Truffle', relief=FLAT)
dessert_prod_1_cost = Label(desserts,anchor='w', width=6, fg='green', bg='#000000', relief=FLAT, 
font=('HP Simplified', 14), text='$180')
dessert_prod_2_cost = Label(desserts,anchor='w', width=6, fg='green', bg='#000000', relief=FLAT, 
font=('HP Simplified', 14), text='$100')
dessert_prod_3_cost = Label(desserts,anchor='w', width=6, fg='green', bg='#000000', relief=FLAT, 
font=('HP Simplified', 14), text='$120')
dessert_prod_1_spin_var = StringVar()
dessert_prod_2_spin_var = StringVar()
dessert_prod_3_spin_var = StringVar()
dessert_prod_1_spin = Spinbox(desserts, from_=0, to=10, font=('HP Simplified Hans', 16), bg='#00
0000', fg='red', width=5, textvariable=dessert_prod_1_spin_var)
dessert_prod_2_spin = Spinbox(desserts, from_=0, to=10, font=('HP Simplified Hans', 16), bg='#00
0000', fg='red', width=5, textvariable=dessert_prod_2_spin_var)
dessert_prod_3_spin = Spinbox(desserts, from_=0, to=10, font=('HP Simplified Hans', 16), bg='#00
0000', fg='red', width=5, textvariable=dessert_prod_3_spin_var)

dessert_prod_1.grid(column=0, row=0)
dessert_prod_2.grid(column=0, row=1)
dessert_prod_3.grid(column=0, row=2)
dessert_prod_1_spin.grid(column=2, row=0)
dessert_prod_2_spin.grid(column=2, row=1)
dessert_prod_3_spin.grid(column=2, row=2)
dessert_prod_1_cost.grid(column=1, row=0)
dessert_prod_2_cost.grid(column=1, row=1)
dessert_prod_3_cost.grid(column=1, row=2)

pasta_prod_1 = Label(pasta,anchor='w', width=25, fg='#ffffff', bg='#000000', relief=FLAT, font=('
HP Simplified Light', 14), text='Alfredo Pasta')
pasta_prod_2 = Label(pasta,anchor='w', width=25, fg='#ffffff', bg='#000000', relief=FLAT, font=('
HP Simplified Light', 14), text='Mac n Cheese')
pasta_prod_3 = Label(pasta,anchor='w', width=25, fg='#ffffff', bg='#000000', relief=FLAT, font=('
HP Simplified Light', 14), text='Pasta Bologanesh')
pasta_prod_1_cost = Label(pasta,anchor='w', width=6, fg='green', bg='#000000', relief=FLAT, font
=('HP Simplified', 14), text='$200')
pasta_prod_2_cost = Label(pasta,anchor='w', width=6, fg='green', bg='#000000', relief=FLAT, font
=('HP Simplified', 14), text='$250')
pasta_prod_3_cost = Label(pasta,anchor='w', width=6, fg='green', bg='#000000', relief=FLAT, font
=('HP Simplified', 14), text='$200')
pasta_prod_1_spin_var = StringVar()
pasta_prod_2_spin_var = StringVar()
pasta_prod_3_spin_var = StringVar()
pasta_prod_1_spin = Spinbox(pasta, from_=0, to=10, font=('HP Simplified Hans', 16), bg='#00000
0', fg='red', width=5, textvariable=pasta_prod_1_spin_var)
pasta_prod_2_spin = Spinbox(pasta, from_=0, to=10, font=('HP Simplified Hans', 16), bg='#00000
0', fg='red', width=5, textvariable=pasta_prod_2_spin_var)
pasta_prod_3_spin = Spinbox(pasta, from_=0, to=10, font=('HP Simplified Hans', 16), bg='#00000
0', fg='red', width=5, textvariable=pasta_prod_3_spin_var)

pasta_prod_1.grid(column=0, row=0)
pasta_prod_2.grid(column=0, row=1)
pasta_prod_3.grid(column=0, row=2)
pasta_prod_1_spin.grid(column=2, row=0)
pasta_prod_2_spin.grid(column=2, row=1)
pasta_prod_3_spin.grid(column=2, row=2)
pasta_prod_1_cost.grid(column=1, row=0)
pasta_prod_2_cost.grid(column=1, row=1)
pasta_prod_3_cost.grid(column=1, row=2)

pizza_prod_1 = Label(pizza,anchor='w', width=25, fg='#ffffff', bg='#000000', relief=FLAT, font=('
HP Simplified Light', 14), text='Veg Overload')
pizza_prod_2 = Label(pizza,anchor='w', width=25, fg='#ffffff', bg='#000000', relief=FLAT, font=('
HP Simplified Light', 14), text='Paneer Tikka')
pizza_prod_3 = Label(pizza,anchor='w', width=25, fg='#ffffff', bg='#000000', relief=FLAT, font=('
HP Simplified Light', 14), text='Mushroom Maze')
pizza_prod_1_cost = Label(pizza,anchor='w', width=6, fg='green', bg='#000000', relief=FLAT, font
=('HP Simplified', 14), text='$350')
pizza_prod_2_cost = Label(pizza,anchor='w', width=6, fg='green', bg='#000000', relief=FLAT, font
=('HP Simplified', 14), text='$350')
pizza_prod_3_cost = Label(pizza,anchor='w', width=6, fg='green', bg='#000000', relief=FLAT, font
=('HP Simplified', 14), text='$400')
pizza_prod_1_spin_var = StringVar()
pizza_prod_2_spin_var = StringVar()
pizza_prod_3_spin_var = StringVar()
pizza_prod_1_spin = Spinbox(pizza, from_=0, to=10, font=('HP Simplified Hans', 16), bg='#00000
0', fg='red', width=5, textvariable=pizza_prod_1_spin_var)
pizza_prod_2_spin = Spinbox(pizza, from_=0, to=10, font=('HP Simplified Hans', 16), bg='#00000
0', fg='red', width=5, textvariable=pizza_prod_2_spin_var)
pizza_prod_3_spin = Spinbox(pizza, from_=0, to=10, font=('HP Simplified Hans', 16), bg='#00000
0', fg='red', width=5, textvariable=pizza_prod_3_spin_var)

pizza_prod_1.grid(column=0, row=0)
pizza_prod_2.grid(column=0, row=1)
pizza_prod_3.grid(column=0, row=2)
pizza_prod_1_spin.grid(column=2, row=0)
pizza_prod_2_spin.grid(column=2, row=1)
pizza_prod_3_spin.grid(column=2, row=2)
pizza_prod_1_cost.grid(column=1, row=0)
pizza_prod_2_cost.grid(column=1, row=1)
pizza_prod_3_cost.grid(column=1, row=2)

sandwich_prod_1 = Label(sandiwch,anchor='w', width=25, fg='#ffffff', bg='#000000', relief=FLAT
, font=('HP Simplified Light', 14), text='Special Club Sandwich')
sandwich_prod_1_cost = Label(sandiwch,anchor='w', width=6, fg='green', bg='#000000', relief=FL
AT, font=('HP Simplified', 14), text='$250')
sandwich_prod_2_cost = Label(sandiwch,anchor='w', width=6, fg='green', bg='#000000', relief=FL
AT, font=('HP Simplified', 14), text='$200')
sandwich_prod_2 = Label(sandiwch,anchor='w', width=25, fg='#ffffff', bg='#000000', relief=FLAT
, font=('HP Simplified Light', 14), text='Paneer Xtreme Sandwich')
sandwich_prod_3_cost = Label(sandiwch,anchor='w', width=6, fg='green', bg='#000000', relief=FL
AT, font=('HP Simplified', 14), text='$150')
sandwich_prod_3 = Label(sandiwch,anchor='w', width=25, fg='#ffffff', bg='#000000', relief=FLAT
, font=('HP Simplified Light', 14), text='Cheese n Chaos')
sandwich_prod_1_spin_var = StringVar()
sandwich_prod_2_spin_var = StringVar()
sandwich_prod_3_spin_var = StringVar()
sandwich_prod_1_spin = Spinbox(sandiwch, from_=0, to=10, font=('HP Simplified Hans', 16), bg=
'#000000', fg='red', width=5, textvariable=sandwich_prod_1_spin_var)
sandwich_prod_2_spin = Spinbox(sandiwch, from_=0, to=10, font=('HP Simplified Hans', 16), bg=
'#000000', fg='red', width=5, textvariable=sandwich_prod_2_spin_var)
sandwich_prod_3_spin = Spinbox(sandiwch, from_=0, to=10, font=('HP Simplified Hans', 16), bg=
'#000000', fg='red', width=5, textvariable=sandwich_prod_3_spin_var)

sandwich_prod_1.grid(column=0, row=0)
sandwich_prod_2.grid(column=0, row=1)
sandwich_prod_3.grid(column=0, row=2)
sandwich_prod_1_spin.grid(column=2, row=0)
sandwich_prod_2_spin.grid(column=2, row=1)
sandwich_prod_3_spin.grid(column=2, row=2)
sandwich_prod_1_cost.grid(column=1, row=0)
sandwich_prod_2_cost.grid(column=1, row=1)
sandwich_prod_3_cost.grid(column=1, row=2)

pasta.grid(column=0, row=0, padx=10, pady=10)
sandiwch.grid(column=0, row=1, padx=10, pady=10)
pizza.grid(column=0, row=2, padx=10, pady=10)

canvas.create_window(10, 160, anchor=NW, window=menu)
starters.grid(column=0, row=0, padx=10, pady=10)
main_course.grid(column=1, row=0, rowspan=3, padx=10, pady=10)
drinks.grid(column=0, row=1, pady=10, padx=10)
desserts.grid(column=0, row=2, pady=10, padx=10)

#  Billing area
bill = Frame(canvas)
header = Canvas(bill, width=600, height=70, highlightthickness=0, background='red')
header.create_text(600//2, 5, anchor=N, text='Central Perk Billing Area', font=('HP Simplified Han
s', 20, 'bold'), fill='#ffffff')
header.create_text(600//2, 35, anchor=N, text='Contact.no : XXXXX-XXXXX', font=('HP Simplifi
ed Hans', 14), fill='#ffffff')

bill_area = Canvas(bill, width=600, height=650, highlightthickness=0, background='black')
bill_area.create_text(15, 5, anchor=NW, text='Bill No :', font=('HP Simplified Hans', 16,), fill='#fff
fff')
bill_area.create_text(15, 25, anchor=NW, text='Customer Name :', font=('HP Simplified Hans', 16,)
, fill='#ffffff')
bill_area.create_text(15, 45, anchor=NW, text='Phone No. :', font=('HP Simplified Hans', 16,), fill='
#ffffff')

tree_frame = Frame(bill, border=4)
tree_scroll = Scrollbar(tree_frame, orient=VERTICAL)
treeview = ttk.Treeview(tree_frame, height=12, yscrollcommand=tree_scroll.set, selectmode='exten
ded')

treeview['columns'] = ('Serial Number', 'Item Name', 'Qty')
treeview.column('#0', width=0, minwidth=0, stretch=NO)
treeview.column('Serial Number', width=70, anchor=W)
treeview.column('Item Name', width=310, anchor=W)
treeview.column('Qty', width=140, anchor=W)
treeview.heading('#0', text='', anchor=W)
treeview.heading('Serial Number', text='S.No', anchor=W)
treeview.heading('Item Name', text='Item Name', anchor=CENTER)
treeview.heading('Qty', text='Qty', anchor=CENTER)

tree_scroll.config(command=treeview.yview)
treeview.grid(column=0, row=0)
tree_scroll.grid(column=1, row=0, rowspan=1, sticky='ns')

bill_area.create_window(30, 85, anchor=NW, window=tree_frame)
bill_area.create_text(15, 450, anchor=NW, text='Total Amount :', fill='#ffffff', font=('HP Simplifie
d Hans', 16))
#  important  details in the billing area
amount = bill_area.create_text(155, 450, anchor=NW, text='', fill='#ffffff', font=('HP Simplified Ha
ns', 16))
ph_no_value = bill_area.create_text(120, 45, anchor=NW, text='', fill='#ffffff', font=('HP Simplifie
d Hans', 16))
customer_name_value = bill_area.create_text(175, 25, anchor=NW, text='', fill='#ffffff', font=('HP 
Simplified Hans', 16))
bill_no_value = bill_area.create_text(90, 5, anchor=NW, text='', fill='#ffffff', font=('HP Simplified 
Hans', 16))

header.pack()
bill_area.pack()
canvas.create_window(920, 170, anchor=NW, window=bill)

#  Buttons
def clear():
    '''This function helps us to clear all the selections, and all existing content of the screen. It is the s
ame as a reset button.'''
    #  Clearing the  bill part
    for i in treeview.get_children():
        treeview.delete(i)
        
    #  Clearing the  amount(if exists)
    bill_area.itemconfig(amount, text='')
    bill_area.itemconfig(ph_no_value, text='')
    bill_area.itemconfig(customer_name_value, text='')
    bill_area.itemconfig(bill_no_value, text='')
    
    #  Resetting everything
    starters_prod_1_spin_var.set(0)
    starters_prod_2_spin_var.set(0)
    starters_prod_3_spin_var.set(0)
    drinks_prod_1_spin_var.set(0)
    drinks_prod_2_spin_var.set(0)
    drinks_prod_3_spin_var.set(0)
    dessert_prod_1_spin_var.set(0)
    dessert_prod_2_spin_var.set(0)
    dessert_prod_3_spin_var.set(0)
    pasta_prod_1_spin_var.set(0)
    pasta_prod_2_spin_var.set(0)
    pasta_prod_3_spin_var.set(0)
    pizza_prod_1_spin_var.set(0)
    pizza_prod_2_spin_var.set(0)
    pizza_prod_3_spin_var.set(0)
    sandwich_prod_1_spin_var.set(0)
    sandwich_prod_2_spin_var.set(0)
    sandwich_prod_3_spin_var.set(0)

    #  Clearing the  customer details also


    name_e_var.set(''),
    contact_no_e_var.set(''),
    bill_no_e_var.set('')
        
def validate():
    #BillName and  Number
    details_list = [
        name_e_var.get(),
        contact_no_e_var.get(),
        bill_no_e_var.get()
    ]
    
    capture = 0
    for i in details_list:
        if i != '':
            capture += 1 
            
    
    if capture == 3:
        for i in treeview.get_children():
            treeview.delete(i)
        generate()
    else:
        tkm.showerror('Error', 'Please complete all the fields of customer details.')

def generate():
    '''This function allows us to generate the bill after making proper selections'''
    
    menu_items = {
        'Nuggets' : [int(starters_prod_1_spin_var.get()), int(starters_prod_1_cost.cget('text')[1:])],
        'Peri Peri Fries' : [int(starters_prod_2_spin_var.get()), int(starters_prod_2_cost.cget('text')
[1:])],
        'Cheesy Fries' : [int(starters_prod_3_spin_var.get()), int(starters_prod_3_cost.cget('text')[1:])],
        'Oreo shake' : [int(drinks_prod_1_spin_var.get()), int(drinks_prod_1_cost.cget('text')[1:])],
        'Chocolate Shake' : [int(drinks_prod_2_spin_var.get()), int(drinks_prod_2_cost.cget('text')
[1:])],
        'Cold Coffee' : [int(drinks_prod_3_spin_var.get()), int(drinks_prod_3_cost.cget('text')[1:])],
        'Brownie with Ice-Cream' : [int(dessert_prod_1_spin_var.get()), in
t(dessert_prod_1_cost.cget('text')[1:])],
        'Red Velvet Ice-Cream' : [int(dessert_prod_2_spin_var.get()), in
t(dessert_prod_2_cost.cget('text')[1:])],
        'Choc. Dungeon Waffle' : [int(dessert_prod_3_spin_var.get()), int(dessert_prod_3_cost.cget('te
xt')[1:])],
        'Alferdo Pasta' : [int(pasta_prod_1_spin_var.get()), int(pasta_prod_1_cost.cget('text')[1:])],
        'Mac n Cheese' : [int(pasta_prod_2_spin_var.get()), int(pasta_prod_2_cost.cget('text')[1:])],
        'Pasta Bologanesh' : [int(pasta_prod_3_spin_var.get()), int(pasta_prod_3_cost.cget('text')[1:])],
        'Veg Overload' : [int(pizza_prod_1_spin_var.get()), int(pizza_prod_1_cost.cget('text')[1:])],
        'Paneer Tikka' : [int(pizza_prod_2_spin_var.get()), int(pizza_prod_2_cost.cget('text')[1:])],
        'Mushroom Maze' : [int(pizza_prod_3_spin_var.get()), int(pizza_prod_3_cost.cget('text')[1:])],
        'Spl Club' : [int(sandwich_prod_1_spin_var.get()), int(sandwich_prod_1_cost.cget('text')[1:])],
        'Paneer Xtreme' : [int(sandwich_prod_2_spin_var.get()), int(sandwich_prod_2_cost.cget('text')
[1:])],
        'Cheese Chaos' : [int(sandwich_prod_3_spin_var.get()), int(sandwich_prod_3_cost.cget('text')
[1:])]
    }
    
    #  Inserting  into treeview
    count = 0
    cost = 0
    for data in menu_items.items():
        if data[1][0] != 0:
            count += 1
            item = data[0]
            quantity = data[1][0]
            cost += data[1][0] * data[1][1]
            data_set = (count, item, quantity)
            treeview.insert(parent='', index='end', iid=count-1, text='', value=data_set)
    
    bill_area.itemconfig(amount, text=f'${cost}')
    bill_area.itemconfig(ph_no_value, text=f'{contact_no_e_var.get()}')
    bill_area.itemconfig(customer_name_value, text=f'{name_e_var.get()}')
    bill_area.itemconfig(bill_no_value, text=f'{bill_no_e_var.get()}')
    
#  controller Setup
btn_frame = LabelFrame(canvas, text='Controller', font=('HP Simplified', 23, 'bold'), fg='red', bg='#
000000', border=4)

generate_bill_btn = Button(btn_frame, text='Generate Bill', width=16, font=('HP Simplified Hans', 
16, 'bold'), bg='red', fg='white', relief=FLAT, border=0, activebackground='white', activeforegroun
d='red', command=validate)
clear_btn = Button(btn_frame, text='Clear', width=16, font=('HP Simplified Hans', 16, 'bold'), bg='r
ed', fg='white', relief=FLAT, border=0, activebackground='white', activeforeground='red', comman
d=clear)
exit_btn = Button(btn_frame, text='Exit', width=16, font=('HP Simplified Hans', 16, 'bold'), bg='red
', fg='white', relief=FLAT, border=0, activebackground='white', activeforeground='red', command=
quit)

generate_bill_btn.grid(column=0, row=0, padx=10, pady=5)
clear_btn.grid(column=1, row=0, padx=10, pady=5)
exit_btn.grid(column=2, row=0, padx=10, pady=5)

canvas.create_window(20, height-80, anchor=SW, window=btn_frame)
#  Pack and loop
canvas.pack()
root.mainloop()

PAYSLIP:

import time
import tkinter.messagebox
from tkinter import *

root = Tk()
root.title("Central Perk")
root.geometry('1366x1200')
root.maxsize(width=1366, height=768)
root.minsize(width=1366, height=768)
root.configure(background="Black")

Tops = Frame(root, width=1350, height=50, bd=8, bg="pink")
Tops.pack(side=TOP)

f1 = Frame(root, width=600, height=600, bd=8, bg="black")
f1.pack(side=LEFT)
f2 = Frame(root, width=300, height=700, bd=8, bg="black")
f2.pack(side=RIGHT)

fla = Frame(f1, width=600, height=200, bd=8, bg="black")
fla.pack(side=TOP)
flb = Frame(f1, width=300, height=600, bd=8, bg="black")
flb.pack(side=TOP)

lbl_information = Label(Tops, font=('arial', 45, 'bold'), text="Central Perk ", relief=GROOVE,  bd=
10, bg="Red", fg="Black")
lbl_information.grid(row=0, column=0)

def Exit():
    wayOut = tkinter.messagebox.askyesno("Central Perk", "Do you want to exit the system")
    if wayOut > 0:
        root.destroy()
        return

def Reset():
    FullName.set("")
    Address.set("")
    Salary.set("")
    Payable.set("")
    NetPayable.set("")
    GrossPayable.set("")
    Date.set("")
    EmployeeID.set("")
    Designation.set("")
    txtPaymentSlip.delete("1.0", END)

def InformationEntry():
    txtPaymentSlip.delete("1.0", END)
    txtPaymentSlip.insert(END, "\t\tPay Slip\n\n")
    txtPaymentSlip.insert(END, "Full Name :\t\t" + FullName.get() + "\n\n")
    txtPaymentSlip.insert(END, " EmployeeID :\t\t" + EmployeeID.get() + "\n\n")
    txtPaymentSlip.insert(END, "Date :\t\t" + Date.get() + "\n\n")
    txtPaymentSlip.insert(END, "Designation :\t\t" + Designation.get() + "\n\n")
    txtPaymentSlip.insert(END, "Salary :\t\t" + Salary.get() + "\n\n")

#   Variables
FullName = StringVar()
Address = StringVar()
EmployeeID = StringVar()
Salary = StringVar()
Payable = StringVar()
NetPayable = StringVar()
GrossPayable = StringVar()
Date = StringVar()
Designation = StringVar()
TimeOfOrder = StringVar()
DateOfOrder = StringVar()
DateOfOrder.set(time.strftime("%d/%m/%Y"))

#  Label  Widget

labelFirstName = Label(fla, text="Full Name", font=('arial', 20, 'bold'), bd=20, fg="Red", bg="Blac
k").grid(row=0, column=0)

labelAddress = Label(fla, text="Employee ID", font=('arial', 20, 'bold'), bd=20, fg="Red", bg="Blac
k").grid(row=0, column=2)

labelCompanyAgency = Label(fla, text="Date", font=('arial', 20, 'bold'), bd=20, fg="Red", bg="Bla
ck").grid(row=1,
                                                                                                              column=0)
labelPhoneNumber = Label(fla, text="Designation", font=('arial', 20, 'bold'), bd=20, fg="Red", bg=
"Black").grid(row=1,
                                                                                                               column=2)
labelHoursWorked = Label(fla, text="Salary", font=('arial', 20, 'bold'), bd=20, fg="Red", bg="Blac
k").grid(
    row=2, column=0)
#  Entry Widget

txtFullname = Entry(fla, textvariable=FullName, font=('arial', 16, 'bold'), bd=5, width=22, justify='l
eft')
txtFullname.grid(row=0, column=1)
txtAddress = Entry(fla, textvariable=EmployeeID, font=('arial', 16, 'bold'), bd=5, width=22, justify
='left')
txtAddress.grid(row=0, column=3)

txtCompanyAgency = Entry(fla, textvariable=Date, font=('arial', 16, 'bold'), bd=5, width=22, justify
='left')
txtCompanyAgency.grid(row=1, column=1)

txtSalary = Entry(fla, textvariable=Salary, font=('arial', 16, 'bold'), bd=5, width=22, justify='left')
txtSalary.grid(row=2, column=1)

txtPhoneNumber = Entry(fla, textvariable=Designation, font=('arial', 16, 'bold'), bd=5, width=22, ju
stify='left')
txtPhoneNumber.grid(row=1, column=3)

#  Text Widget

payslip = Label(f2, textvariable=DateOfOrder, font=('arial', 21, 'bold'), fg="white", bg="black").gri
d(row=0,
                                                                                                           column=0)
txtPaymentSlip = Text(f2, height=22, width=40, bd=16, font=('arial', 13, 'bold'), fg="black", bg="w
hite")
txtPaymentSlip.grid(row=2, column=0)

#  buttons

ButtonReset = Button(flb, text='Reset', padx=10, pady=16, bd=15, font=('arial', 16, 'bold'), width=1
4, command=Reset,
                  fg="Red", bg="black").grid(row=0, column=1)

ButtonPaySlip = Button(flb, text='View Payslip', padx=10, pady=16, bd=15, font=('arial', 16, 'bold'
), width=14,
                    command=InformationEntry, fg="Red", bg="black").grid(row=0, column=2)

ButtonReset = Button(flb, text='Exit', padx=10, pady=16, bd=15, font=('arial', 16, 'bold'), width=20
, command=Reset,
                  fg="Red", bg="black").grid(row=0, column=10)

root.mainloop()

MYSQL CONNECTOR:

from os import waitpid
import mysql.connector as sql
connectdb = sql.connect(host='localhost',
    user='root',
    passwd='vmrtw123',
    database='central_perk')

cursor = connectdb.cursor()

cursor.execute('SELECT * FROM employees')
data = cursor.fetchall()

for datas in data:
    print (datas)

GRIEVANCE:

from tkinter import *
from tkinter import ttk
import tkinter.messagebox as tkm
import ctypes as c

'''Validating Entry Widgets'''
def valid_characters(character):
    '''Validating characters allowed for username and password entries.'''
    text = character
    
    if text.isdigit():          
        #  Cheking for alphanumeric  character
        return True                
    elif text == '':           
        #  Checking is  the string is empty
        return True
    else:
        #  Not  validating special characters and spaces.
        tkm.showerror('Invalid Character Type', 'Only numbers are allowed')
        return False
    
def clicker():
    grievence = Toplevel(root, bg='black')
    grievence.title('Grievence Window')
    grievence.resizable(0, 0)
    
    customer_name = Label(grievence, text='Customer Name:', font=('HP Simplified Hans', 20, 'bold
'), relief=FLAT, bg='black', fg='red', anchor='w')
    cusstomer_name_entry = StringVar()
    customer_name_entry = Entry(grievence, border=4, font=('HP Simplified Hans', 20, 'bold'), relie
f=RAISED, bg='black', fg='white', insertbackground='red')
    phone = Label(grievence, text='Phone Number:', font=('HP Simplified Hans', 20, 'bold'), relief=F
LAT, bg='black', fg='red', anchor='w')
    phone_entry_var = StringVar()
    phone_entry =  Entry(grievence, border=4, font=('HP Simplified Hans', 20, 'bold'), relief=RAISE
D, bg='black', fg='white', insertbackground='red')
    phone_entry.config(validate ="key", validatecommand =(reg, '%P'))
    grievence_box = Label(grievence, text='Your Grievence Here Please:', font=('HP Simplified Han
s', 20, 'bold'), relief=FLAT, bg='black', fg='red', anchor='w')
    grievence_box_entry = Text(grievence, border=4, font=('HP Simplified Hans', 12, 'bold'), relief=
RAISED, bg='black', fg='white', insertbackground='red')
    
    customer_name.grid(column=0, row=0, pady=2)
    customer_name_entry.grid(column=1, row=0, pady=2)
    phone.grid(column=0, row=1, pady=2)
    phone_entry.grid(column=1, row=1, pady=2)
    grievence_box.grid(column=0, row=2, columnspan=2, pady=2)
    grievence_box_entry.grid(column=0, row=3, columnspan=2, padx=5, pady=2)
    
root = Tk()
reg = root.register(valid_characters)
btn = Button(root, text='Click Me', command=clicker)
btn.pack()
root.mainloop()
OUTPUT
OUTPUT

LOGIN SCREEN:

This is the static login screen where the Manager ID and password are entered to get
into the main screen.

It also displays the current time on the top and also different quotes are displayed on
a time to time basis below the login and quit button.
HOME PAGE:

This is the main page used to access the features of the project. When any
button is clicked, it leads to the corresponding page of that button.

EMPLOYEES:

This button opens the employee section of the home page where all the details
of the employee is present.
On clicking the view button next to each employee, we get access to their personal
data.
Data that is displayed on clicking the view button:

Database used to store the employee data:


MENU:
The image of the menu is displayed on clicking the button
BILLING:

The billing page is opened when the billing button is clicked.

The billing page will not operate when the customer details are not entered
correctly.
This is the billing page when details are entered correctly and generated:
PAYSLIP:

This button opens the payslip window where the employees can generate receipts for
their salary.
Entering details of the employee

Generating the bill of the salary


Resetting the payslip program

Window that has been reset


Grievance:

On clicking this button, the grievance panel opens up where the admin can enter customer
grievances.
INVENTORY:
This button directs us to the inventory of stock of the café on given date.
CONCLUSION
CONCLUSION

The “CAFE MANAGEMENT SYSTEM” is a very useful application and


designed with ample foresight keeping the user in mind. Some important
features at a glance:
⮚ Well-developed and simple to use GUI that is very attractive for the user.

⮚ Highly user-friendly.

⮚ It is also very intuitive for they user. They don’t have read any kind of
instructions to use the application.
⮚ Helps the admin to check the management data easily.
⮚ Integrated with a backend having user and room details that is helpful for the
administrators.
⮚ It helps the user to not only check the data but also print the bills for
customer orders and receipt for employee salary payslip.

Thus, this application helps in the easy use and efficient administration of a
café without much effort or discomfort to both the employee and admin. It is
also easy to update and is highly capable of backwards compatibility especially
when future enhancements a
nd updates are made.
FUTURE
ENHANCEMENTS
FUTURE ENHANCEMENTS

The following enhancements can be made in the future:

● In the future, this program can be enhanced by converting it into and

independent application that can run without the terminal or python shell.

● Also, an additional feature to enable the administrator to add or modify

the details from the program itself could be added.

● Features to help the customer provide ratings and reviews can also be

added in the future enhancements. This will help in more interaction and

user-friendliness.

● We can also add more screens to maintain a professional database of the

employee attendance, ratings and customer friendliness. The same can

also be done to track the current orders in line at the café and also access

to past or online orders.

● To make it more user friendly, we can add icons to each button for users

to correctly locate and use the program.


BIBLIOGRAPHY
BIBLIOGRAPHY

⮚ Computer Science with Python for Class11 by Sumita Arora

⮚ Computer Science with Python for Class12 by Sumita Arora

⮚ https://www.tutorialspoint.com/python_data_access/python_mysql
_introduction.htm

⮚ https://www.javatpoint.com/python-tkinter

⮚ https://tkdocs.com/shipman/

⮚ https://stackoverflow.com/

⮚ https://www.geeksforgeeks.org/python-tkinter-messagebox-widget/

You might also like