Restaurant & Cafe Management With MySQL - Copy
Restaurant & Cafe Management With MySQL - Copy
1
Signature
Signature
Mr. Kapil Saxena
Sr. Annie Rose
( PGT Computer Science )
( Principal )
Acknowledgement
Sarthak Saxena
Class :
12th – A
St.
Francis Convent Sr. Sec. School
3
Case Study
Introduction to Project
This is a Project work constitutes some components used in most professional programs. This project
is undertaken in context of fulfillment of the requirement of AISSCE. I have tried my best to make
the complicated process of “Restaurant & Cafe Management” as simple as possible using Structured
& Modular technique. I have tried to design the software in such a way that user may not have any
difficulty in using this package & further expansion is possible without much effort. Even though I
cannot claim that this work to be entirely exhaustive, the main purpose of my exercise is perform
4
“Restaurant & Cafe Management” in computerized and efficient way rather than manually which is
time consuming.
I am confident that this software package can be readily used by non-programming personal
avoiding human handled chance of error.
The main aim of the entire activity is to automate the process of “Restaurant & Cafe
Management”.
The limited time and resources have restricted us to incorporate, in this project, only the main
activities that are performed in a “Restaurant & Cafe Management”, but utmost care has been taken
to make the system efficient and user friendly. “Restaurant & Cafe Management” has been designed
to computerize the following functions that are performed by the system:
MAINTAINANCE OF STOCK
ADDITION OF PRODUCTS
MODIFICATION OF PRODUCT
SEARCHING OF A PRODUCT
DELETION OF PRODUCT
REGISTER A CUSTOMER
MODIFICATION OF CUSTOMER DETAILS
DELETION OF THE CUSTOMER
DISPLAY LIST OF THE CUSTOMER
SEARCHING RECORDS OF A CUSTOMER
BILLING
CENCELATION
OBJECTIVE
During the past several decades’ personnel function has been transformed from a relatively obscure
record keeping staff to central and top level management function. There are many factors that have
influenced this transformation like technological advances, professionalism, and general
recognition of human beings as most important resources.
A computer based “Restaurant & Cafe Management” is designed to handle the primary
activities of the Restaurant & Cafe Management to maintain the records in an efficient way which
save the time.
This project intends to introduce more user friendliness in the various activities such as addition
of records, editing the information and updation, maintenance, and searching the records.
Similarly, record maintenance and updation can also be accomplished by using the
identification of the id with all the details being automatically generated. These details are also
being promptly automatically updated in the master file thus keeping the record absolutely up-to-
date.
5
The entire information has maintained in the database or Files and whoever wants to retrieve
can’t retrieve, only authorization user can retrieve the necessary information which can be easily be
accessible from the file.
ADVANTAGE:
I have designed the given proposed system in the Python to automate the process of “Book
Library Management” because it is an Object Oriented Language and good for application
softwares. This project is useful for the maintaining the records of the Restaurant & Cafe.
The following steps that give the detailed information of the need of proposed system are:
Performance: During past several decades, the records are supposed to be manually
handled for all activities. The manual handling of the record is time consuming and highly prone to
error. To improve the performance of the “Restaurant & Cafe Management”, the computerized
system is to be undertaken. This project is fully computerized and user friendly.
Efficiency: The basic need of this software is efficiency. The software should be efficient so that
whenever a user performs his/her work the records are updated automatically. This record will be
useful for other transactions instantly.
Security: Security is the main criteria for the proposed system. Since illegal access may corrupt the
database. So security has to be given in this project.
This project can be used in the Restaurant & Cafe Management after adding some more useful
modules in the project.
So there are many things for future enhancement of this project. The future enhancements that
are possible in the project are as follows.
Memory
64 MB Minimum; 128 MB Recommended
(RAM)
1 GB for the database and the client software. This
Hard disk
requirement may increase with the increase in
space
records.
VGA or higher resolution. 800x600 or higher resolution
Monitor
required for the SQL Server graphical tools
Pointing
Microsoft Mouse or compatible
device
Required for installation purposes only. During the life
CD-ROM time of this software it is not at all required. However,
drive it is recommended to use CD-RWs to take periodical
backups.
Software Required
Software Description
Operating
Microsoft Windows or DOS or Linux or Unix
System
Python
Python IDLE / Anaconda / Python 3.7
Interpreter
MS – Office /
Word Processor for Documentation
Open Office
7
Programming
Methodology
8
Python is a high-level, interpreted, interactive and object oriented-scripting language. Python was
designed to be highly readable which uses English keywords frequently where as other languages use
punctuation and it has fewer syntactical constructions than other languages.
Python is interpreted: This means that it is processed at runtime by the interpreter and
you do not need to compile your program before executing it. This is similar to PERL and PHP.
Python is Interactive: This means that you can actually sit at a Python prompt and
interact with the interpreter directly to write your programs.
History of Python:
Python was developed by Guido van Rossum in the late eighties and early nineties ( February 1991 ) at
the National Research Institute for Mathematics and Computer Science in the Netherlands.
Python is derived from many other languages, including ABC, Modula-3, C, C++, Algol-68,
SmallTalk, and UNIX shell and other scripting languages.
Python is now maintained by a core development team at the institute, although Guido van
Rossum still holds a vital role in directing its progress.
Easy-to-read: Python code is much more clearly defined and visible to the eyes.
A broad standard library: One of Python's greatest strengths is the bulk of the library
is very portable and cross-platform compatible on UNIX, Windows, and Macintosh.
Interactive Mode: Support for an interactive mode in which you can enter results from a
terminal right to the language, allowing interactive testing and debugging of snippets of code.
Portable: Python can run on a wide variety of hardware platforms and has the same interface
on all platforms.
Extendable: You can add low-level modules to the Python interpreter. These modules enable
programmers to add to or customize their tools to be more efficient.
9
GUI Programming: Python supports GUI applications that can be created and ported to
many system calls, libraries, and windows systems, such as Windows MFC, Macintosh, and the X
Window system of Unix.
Scalable: Python provides a better structure and support for large programs than shell
scripting.
Apart from the above mentioned features, Python has a big list of good features, few are listed below:
It can be used as a scripting language or can be compiled to byte-code for building large
applications.
Very high-level dynamic data types and supports dynamic type checking.
It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.
MySQL
MySQL is an open-source relational database management system (RDBMS). Its name is a combination of
"My", the name of co-founder Michael Widenius's daughter, and "SQL", the abbreviation for Structured
Query Language.
MySQL is free and open-source software under the terms of the GNU General Public License, and is also
available under a variety of proprietary licenses. MySQL was owned and sponsored by
the Swedish company MySQL AB, which was bought by Sun Microsystems (now Oracle Corporation). In
2010, when Oracle acquired Sun, Widenius forked the open-source MySQL project to create MariaDB.
Sometime, it is important to store the information entered by the user into the database for further use.
After storing the information into the database, later we can retrieve those information from that
database. The latest version of MySQL is one of the world’s most popular databases. It is open source,
reliable, compatible with all major hosting providers, cost-effective, and easy to manage. Many
organizations are leveraging the data security and strong transactional support offered by MySQL to
secure online transactions and enhance customer interactions. However, enterprises using MySQL are
presented with several challenges when their apps experience exponential growth and they need
additional scale.
Along with understanding why MySQL is the go-to solution for high-growth environments, it is equally
important to understand the challenges that can cripple your business operations. Here are 5 major reasons
to use MySQL along with its most common challenges:
On-Demand Scalability
MySQL comes with the advantage of unmatched flexibility that facilitates efficient management of deeply
embedded applications, even in gigantic data centers that stack tremendous amounts of mission-critical
information. It enables complete customization to cater to the unique requirements of eCommerce businesses
with a much smaller footprint.
High Availability
Consistent availability is the stalwart feature of MySQL – enterprises that deploy it can enjoy round-the-
clock uptime. MySQL comes with a wide variety of cluster servers and master-slave replication
configurations that enable instant failover for uninterrupted access.
Rock-Solid Reliability
Protecting sensitive business information is the primary concern of every enterprise. MySQL ensures data
security with exceptional data protection features. Powerful data encryption prevents unauthorized viewing
of data and SSH and SSL supports ensure safer connections. It also features a powerful mechanism that
restricts server access to authorized users and has the ability to block users even at the man-machine level.
Finally, the data backup feature facilitates point-in-time recovery.
Quick-Start Capability
You can go from software download to complete installation in just 15 minutes. MySQL is exceptionally
quick, regardless of the underlying platform. It features self-management capabilities like auto restart, spass
expansion and automatic configuration changes for ease of management. MySQL enables real-time
performance monitoring for timely troubleshooting of operational issues from a single workstation.
Replication
MySQL servers often run into replication conflicts during a manual failover when multi-master setups are
involved.
Query Caches
MySQL server query cache is of little help when handling a high volume of workload, because cache
invalidation cannot be controlled.
11
Python Modules
12
Modules Imported in the Projects
And Their Functions
Other than Python Standard Library modules, some other modules are imported in the
project to perform some specific task. These are :
pickle
dump( ) – To write in a binary file
load( ) – To read from a binary file
os
remove( ) – To remove a file
remame( ) – To rename a file
datetime
mysql.connector
connect( ) – To connect to the MySQL database
close( ) – To close the connection
sys
exit( ) – To terminate execution of the program
13
Coding
14
# ***************** Project on Restaurant & Cafe Management
**********************
import mysql.connector as ms
import datetime as dt
import pickle
import os
import sys
def welcome():
print("---------------------------------------------------------------------------------------")
print("\n\n****************** W E L C O M E *********************\n")
print("RESTAURANT & CAFE MANAGEMENT SYSTEM")
print(" \n D E V E L O P E D B Y :\n")
print(" Sarthak Saxena")
print(" XII - A")
print(" St. Francis Convent Sr. Sec. School")
print(" Bareilly\n")
def ADDPRODUCT():
try:
conobj = ms.connect(host="localhost", user="root", password=pd,
database="store")
cursor = conobj.cursor()
while True:
nm = input("\nEnter Product Name : ")
pr = int(input("Enter Price : "))
st = "insert into stock(name,price) values('{}', {})".format(nm,pr)
cursor.execute(st)
conobj.commit()
print("\n\nPRODUCT ADDED SUCCESSFULLY\n")
ch = input("Press y to add more records : ")
if ch not in 'Yy':
break
conobj.close()
except ms.ProgrammingError:
print('[ NO DATABASE FOUND ]')
return
def DISPLAYPRODUCT():
try:
conobj = ms.connect(host="localhost", user="root", password=pd,
database="store")
cursor = conobj.cursor()
st = "select * from stock order by id"
cursor.execute(st)
d = cursor.fetchone()
f=0
print("\n\t\t\t\tLIST OF ITEMS\n")
while d is not None:
f=1
print("---------------------------------------------------------------------------------------")
print(" Product ID : ", d[0], end = ' ')
print(" Product Name : ", d[1], end = ' ')
print(" Price : ", d[2])
15
print("---------------------------------------------------------------------------------------")
d = cursor.fetchone()
conobj.close()
if f == 0:
print("\n\nNo Record Exist\n")
except ms.ProgrammingError:
print('[ NO DATABASE FOUND ]')
return
def MODIFYPRODUCT():
try:
conobj = ms.connect(host="localhost", user="root", password=pd,
database="store")
cursor = conobj.cursor()
i = int(input("Enter Product ID : "))
st = "select * from stock where id = {}".format(i)
cursor.execute(st)
d = cursor.fetchone()
if d is not None:
print("\n\t\t\t\t[ MODIFYING RECORDS ]\n")
n = input("Enter Name or press 0 to unchange : ")
if n !='0':
st = "update stock set name = '{}' where id = {}".format(n, i)
cursor.execute(st)
conobj.commit()
n = input("Enter new Price or press 0 to unchange : ")
if n !='0':
st = "update stock set price = {} where id = {}".format(int(n), i)
cursor.execute(st)
conobj.commit()
conobj.close()
print("\n\nRecord Modified Successfully\n")
else:
print("\n\nRecord Not Found For This Member ID\n")
except ms.ProgrammingError:
print('[ NO DATABASE FOUND ]')
return
def SEARCHPRODUCT():
try:
conobj = ms.connect(host="localhost", user="root", password=pd,
database="store")
cursor = conobj.cursor()
i = int(input("Enter Product ID : "))
st = "select * from stock where id = {}".format(i)
cursor.execute(st)
d = cursor.fetchone()
if d is not None:
print("\n\t\t\t\t[ SEARCH RESULT ... ]\n")
print("---------------------------------------------------------------------------------------")
print(" Product ID : ", d[0])
print(" Product Name : ", d[1])
print(" Price : ", d[2])
print("---------------------------------------------------------------------------------------")
16
else:
print("\n\nRecord Not Found For This ID\n")
conobj.close()
except ms.ProgrammingError:
print('[ NO DATABASE FOUND ]')
return
def DELETEPRODUCT():
try:
conobj = ms.connect(host="localhost", user="root", password=pd,
database="store")
cursor = conobj.cursor()
i = int(input("Enter Product ID : "))
st = "select * from stock where id = {}".format(i)
cursor.execute(st)
d = cursor.fetchone()
if d is not None:
st = "delete from stock where id = {}".format(i)
cursor.execute(st)
conobj.commit()
conobj.close()
print("\n\nRecord Deleted Successfully\n")
else:
print("\n\nRecord Not Found For This ID\n")
conobj.close()
except ms.ProgrammingError:
print('[ NO DATABASE FOUND ]')
return
def DISPLAYCUSTOMER():
try:
conobj = ms.connect(host="localhost", user="root", password=pd,
database="store")
cursor = conobj.cursor()
st = "select * from customer order by cid"
cursor.execute(st)
d = cursor.fetchone()
f=0
print("\n\t\t\t\tLIST OF Customers\n")
while d is not None:
f=1
print("---------------------------------------------------------------------------------------")
print(" Customer ID : ", d[0], end = ' ')
print(" Mobile No. : ", d[1], end = ' ')
print(" Name : ", d[2])
print("---------------------------------------------------------------------------------------")
d = cursor.fetchone()
conobj.close()
if f == 0:
print("\n\nNo Record Exist\n")
except ms.ProgrammingError:
print('[ NO DATABASE FOUND ]')
return
17
def SEARCHCUSTOMER():
try:
conobj = ms.connect(host="localhost", user="root", password=pd,
database="store")
cursor = conobj.cursor()
m = input("Enter Mobile Number : ")
st = "select * from customer where mob = '{}'".format(m)
cursor.execute(st)
d = cursor.fetchone()
if d is not None:
print("\n\t\t\t\t[ SEARCH RESULT ... ]\n")
print("---------------------------------------------------------------------------------------")
print(" Customer ID : ", d[0])
print(" Mobile Number : ", d[1])
print(" Customer Name : ", d[2])
print("---------------------------------------------------------------------------------------")
else:
print("\n\nRecord Not Found For This ID\n")
conobj.close()
except ms.ProgrammingError:
print('[ NO DATABASE FOUND ]')
return
def DELETECUSTOMER():
try:
conobj = ms.connect(host="localhost", user="root", password=pd,
database="store")
i = input("Enter Mobile Number : ")
st = "select * from customer where mob = '{}'".format(i)
cursor.execute(st)
d = cursor.fetchone()
if d is not None:
st = "delete from customer where mob = '{}'".format(i)
cursor.execute(st)
conobj.commit()
conobj.close()
print("\n\nRecord Deleted Successfully\n")
else:
print("\n\nRecord Not Found For This ID\n")
conobj.close()
except ms.ProgrammingError:
print('[ NO DATABASE FOUND ]')
return
def BILLING():
try:
conobj = ms.connect(host="localhost", user="root", password=pd,
database="store")
cursor = conobj.cursor()
tel = input("Enter Mobile Number : ")
st = "select * from customer where mob = '{}'".format(tel)
cursor.execute(st)
data = cursor.fetchone()
if data is None:
18
nm = input('Enter Name : ')
st = "select max(cid) from customer"
cursor.execute(st)
ci = cursor.fetchone()
if ci[0]==None:
ci = 1
else:
ci = ci[0]+1
st = "insert into customer(cid, mob, cname) values({},'{}','{}')".format(ci,tel,nm)
cursor.execute(st)
conobj.commit()
print("\n\nCUSTOMER ADDED SUCCESSFULLY\n")
ch = input("PROCEED TO BILLING ( Y / N ) : ")
if ch == 'Y' or ch == 'y':
PURCHASING(tel)
else:
return
else:
print('Hello', data[2])
ch = input("PROCEED TO BILLING ( Y / N ) : ")
if ch == 'Y' or ch == 'y':
PURCHASING(tel)
except ms.ProgrammingError:
print('[ NO DATABASE FOUND ]')
return
def PURCHASING(tel):
try:
conobj = ms.connect(host="localhost", user="root", password=pd,
database="store")
cursor = conobj.cursor()
cursor.execute("select max(billno) from item")
b = cursor.fetchone()
if b[0]==None:
b=1
else:
n = n[0]+1
dd = dt.date.today()
while True:
i = input("Enter Product ID : ")
cursor.execute("select * from stock where id = {}".format(i))
d = cursor.fetchone()
if d is not None:
print('Product Name :',d[1],'Price : ',d[2])
ch = input('Press any Y/Y to confirm the product : ')
n = int(input('Enter Quantity : '))
amt = d[2]*n
st = "insert into item(mob,billno,dop,itemname,qty,amt) values({},'{}','{}',
{})".format(tel,b,n,amt)
cursor.execute(st)
conobj.commit()
ch = input('Press N/n to stop purchasing : ')
if ch in 'Nn':
break
19
print('Press 1 to Generate Bill')
print('Press 2 to Cancel Bill')
print('Press 3 to Update Bill')
ch = input('Enter Your Choice : ')
if ch == '1':
PRINTBILL(bn)
elif ch == '2':
CANCELBILL(bn)
elif ch == '3':
UPDATEBILL(bn)
else:
print('Invalid Response...')
conobj.close()
except ms.ProgrammingError:
print('[ NO DATABASE FOUND ]')
return
def PRINTBILL(bn):
try:
conobj = ms.connect(host="localhost", user="root", password=pd,
database="store")
cursor = conobj.cursor()
st = "select * from item where billno = {}".format(bn)
cursor.execute(st)
d = cursor.fetchone()
if d is None:
print('Bill Not Found For This Bill Number...')
return
print("\n\nINDIAN RESTAURANT & CAFE \n")
print(" BILL (GSTN : A93BJ783343)\n")
print(" Bill Number : ", d[2], end = ' ')
print(" Billing Date : ", d[3], end = ' ')
print(" Mobile No. : ", d[1])
print("----------------------------------------------------")
print("LIST OF PURCHASED ITEMS")
f=s=0
while d is not None:
f=1
print("----------------------------------------------------")
print(" Product Name : ", d[4], end = ' ')
print(" Quantity : ", d[5])
try:
print(" Cost Per Unit : ", d[6]/d[5], end = ' ')
except ZeroDivisionError:
print(" Cost Per Unit : ", 0, end = ' ')
print(" Total Price : ", d[6])
s = s + d[6]
d = cursor.fetchone()
print("=====================================================")
print(" Grand Total : ", s)
print("=====================================================")
conobj.close()
except ms.ProgrammingError:
print('[ NO DATABASE FOUND ]')
20
return
def CANCELBILL():
try:
conobj = ms.connect(host="localhost", user="root", password=pd,
database="store")
cursor = conobj.cursor()
print('Press 1 to Cancel the Last Generated Bill')
print('Press 2 to Cancel the Bill Using Bill Number')
ch = input('Enter Your Choice : ')
dd = dt.date.today()
bn = int(input('Enter Bill Number : '))
cursor.execute("select * from item where billno={}".format(bn))
st = "update item set qty = 0, amt = 0, doc = '{}' where billno={}".format(dd,bn)
cursor.execute(st)
conobj.commit()
print('Bill Cancelled Successfully...')
conobj.close()
except ms.ProgrammingError:
print('[ NO DATABASE FOUND ]')
return
def UPDATEBILL():
try:
conobj = ms.connect(host="localhost", user="root", password=pd,
database="store")
cursor = conobj.cursor()
bn = int(input('Enter Bill Number : '))
cursor.execute("select * from item where billno={}".format(bn))
d = cursor.fetchall()
if d !=[]:
for i in d:
print('Item Name :', i[4], ', Quantity : ', i[5])
ch = input('Press Y/y to continue the update....')
if ch in 'Yy':
n = int(input('Enter New Quantity : '))
if n==0:
cursor.execute("select qty from stock where name='{}'".format(i[4]))
a = cursor.fetchone()
st = "update stock set qty={},status='{}' where name= '{}'".format(d[0]
[5]+a[0],'AVAILABLE',i[4])
cursor.execute(st)
conobj.commit()
st = "update item set qty = 0, amt = 0 where sr={}".format(i[0])
cursor.execute(st)
else:
print('No bill is found for this bill number...')
conobj.close()
except ms.ProgrammingError:
print('[ NO DATABASE FOUND ]')
return
def SALESREPORT():
try:
21
conobj = ms.connect(host="localhost", user="root", password=pd,
database="store")
cursor = conobj.cursor()
st = "select dop, sum(amt) from item group by dop"
cursor.execute(st)
d = cursor.fetchone()
print('[ SALES REPORT ]')
print("INDIAN RESTAURANT & CAFE \n")
print("----------------------------------------------------")
while d is not None:
print(" Date : ", d[0], end = ' ')
print(" Total Collection : Rs,", d[1])
print("----------------------------------------------------")
d = cursor.fetchone()
conobj.close()
except ms.ProgrammingError:
print('[ NO DATABASE FOUND ]')
return
def CHANGEPASSWORD():
try:
file = open('pass.dat', 'rb')
except FileNotFoundError:
print("Your OTP is 123")
n = input("Enter OTP : ")
if n == '123':
a = input("Enter New Password : ")
b = input("Re-Enter New Password : ")
if a == b:
d={}
d['pass'] = a
with open('pass.dat', 'wb') as file2:
pickle.dump(d,file2)
print("[ PASSWORD RESET SUCCESSFULLY ]")
file.close()
os.remove('pass.dat')
os.rename('temp.dat','pass.dat')
except EOFError :
file.close()
def SALES():
while True:
print("---------------------------------------------------------------------------------------")
print("[ B I L L I N G D E S K ]\n")
print("1. BILLING")
print("2. PRINT BILL")
print("3. CANCEL BILL")
print("4. UPDATE BILL")
print("5. DISPLAY ITEM LIST")
print("0. MAIN MENU")
ch = input("Enter your choice : ")
print("---------------------------------------------------------------------------------------")
if ch == '1':
22
BILLING()
elif ch == '2':
bn = input("Enter Bill Number : ")
PRINTBILL(bn)
elif ch == '3':
CANCELBILL()
elif ch == '4':
UPDATEBILL()
elif ch == '5':
DISPLAYPRODUCT()
elif ch == '0':
break
else:
print("Invalid Choice")
def ADMIN():
try:
file = open('pass.dat', 'rb')
except FileNotFoundError:
CHANGEPASSWORD()
try:
file = open('pass.dat', 'rb')
d = pickle.load(file)
file.close()
n = input("Enter Password : ")
if n == d['pass']:
while True:
print("---------------------------------------------------------------------------------------")
print("[ A D M I N I S T R A T I O N M E N U ]\n")
print("1. ADD PRODUCT")
print("2. MODIFY PRODUCT")
print("3. SEARCH PRODUCT")
print("4. DISPLAY PRODUCT")
print("5. DELETE PRODUCT")
print("6. DISPLAY CUSTOMER")
print("7. SEARCH CUSTOMER")
print("8. DELETE CUSTOMER")
print("9. CHANGE PASSWORD")
print("S. SALES REPORT")
print("0. MAIN MENU")
ch = input("Enter your choice : ")
print("---------------------------------------------------------------------------------------")
if ch == '1':
ADDPRODUCT()
elif ch == '2':
MODIFYPRODUCT()
elif ch == '3':
SEARCHPRODUCT()
elif ch == '4':
DISPLAYPRODUCT()
elif ch == '5':
DELETEPRODUCT()
elif ch == '6':
DISPLAYCUSTOMER()
23
elif ch == '7':
SEARCHCUSTOMER()
elif ch == '8':
DELETECUSTOMER()
elif ch == '9':
CHANGEPASSWORD()
elif ch in 'Ss':
SALESREPORT()
elif ch == '0':
break
else:
print("Invalid Choice")
else:
print("[ ACCESS DENIED ]")
except EOFError :
file.close()
#-------------------MAIN----------------------------------------
try:
pd = input('Enter Password of Your MySQL Client : ')
conobj = ms.connect(host="localhost", user="root", password=pd)
except ms.errors.ProgrammingError:
sys.exit('Unable to Establish Connection With MySQL Client')
cursor = conobj.cursor()
st = "create database store"
cursor.execute(st)
st = "create table stock(id integer primary key auto_increment, name varchar(100), price
integer default 0, qty integer default 0, dos date)"
st = "create table customer(cid integer, mob varchar(20), cname varchar(100))"
st = "create table item(sr integer primary key auto_increment, mob varchar(20), billno
integer default 0, dop date, itemname varchar(100), qty integer default 0, amt integer
default 0, doc date)"
cursor.execute(st)
conobj.commit()
conobj.close()
welcome()
while True:
print("[ M A I N M E N U ]\n")
print("1. ADMIN DEPARTMENT")
print("2. BILLING DESK")
print("0. EXIT")
ch = input("Enter your choice : ")
print("---------------------------------------------------------------------------------------")
if ch == '1' :
ADMIN()
elif ch == '2':
SALES()
elif ch == '0':
break
else:
print("Invalid Choice")
print("Thank You")
24
Output Screen
Shots
25
Enter Password of Your MySQL Client : pass
--------------------------------------------------------------------------------------------------------------
****************** W E L C O M E *********************
DEVELOPED BY:
Sarthak Saxena
XII A
St. Francis Convent Sr. Sec. School
[MAIN MENU]
1. ADMIN DEPARTMENT
2. BILLING DESK
0. EXIT
Enter your choice : 1
---------------------------------------------------------------------------------------
Your OTP is 123
Enter OTP : 123
Enter New Password : 111
Re-Enter New Password : 111
1. ADD PRODUCT
2. MODIFY PRODUCT
3. SEARCH PRODUCT
4. DISPLAY PRODUCT
5. DELETE PRODUCT
6. DISPLAY CUSTOMER
7. SEARCH CUSTOMER
8. DELETE CUSTOMER
9. CHANGE PASSWORD
S. SALES REPORT
0. MAIN MENU
26
[ADMINISTRATION MENU]
1. ADD PRODUCT
2. MODIFY PRODUCT
3. SEARCH PRODUCT
4. DISPLAY PRODUCT
5. DELETE PRODUCT
6. DISPLAY CUSTOMER
7. SEARCH CUSTOMER
8. DELETE CUSTOMER
9. CHANGE PASSWORD
S. SALES REPORT
0. MAIN MENU
Enter your choice : 1
---------------------------------------------------------------------------------------
27
[ADMINISTRATION MENU]
1. ADD PRODUCT
2. MODIFY PRODUCT
3. SEARCH PRODUCT
4. DISPLAY PRODUCT
5. DELETE PRODUCT
6. DISPLAY CUSTOMER
7. SEARCH CUSTOMER
8. DELETE CUSTOMER
9. CHANGE PASSWORD
S. SALES REPORT
0. MAIN MENU
Enter your choice : 2
---------------------------------------------------------------------------------------
Enter Product ID : 1
[ MODIFYING RECORDS ]
---------------------------------------------------------------------------------------
[ADMINISTRATION MENU]
1. ADD PRODUCT
2. MODIFY PRODUCT
3. SEARCH PRODUCT
4. DISPLAY PRODUCT
5. DELETE PRODUCT
6. DISPLAY CUSTOMER
7. SEARCH CUSTOMER
8. DELETE CUSTOMER
9. CHANGE PASSWORD
S. SALES REPORT
0. MAIN MENU
Enter your choice : 3
---------------------------------------------------------------------------------------
Enter Product ID : 1
---------------------------------------------------------------------------------------
Product ID : 1
Product Name : French Fries
Price : 250
---------------------------------------------------------------------------------------
28
[ADMINISTRATION MENU]
1. ADD PRODUCT
2. MODIFY PRODUCT
3. SEARCH PRODUCT
4. DISPLAY PRODUCT
5. DELETE PRODUCT
6. DISPLAY CUSTOMER
7. SEARCH CUSTOMER
8. DELETE CUSTOMER
9. CHANGE PASSWORD
S. SALES REPORT
0. MAIN MENU
Enter your choice : 2
---------------------------------------------------------------------------------------
Enter Product ID : 1
[ MODIFYING RECORDS ]
---------------------------------------------------------------------------------------
Product ID : 1
Product Name : French Fries
Price : 250
---------------------------------------------------------------------------------------
29
[ADMINISTRATION MENU]
1. ADD PRODUCT
2. MODIFY PRODUCT
3. SEARCH PRODUCT
4. DISPLAY PRODUCT
5. DELETE PRODUCT
6. DISPLAY CUSTOMER
7. SEARCH CUSTOMER
8. DELETE CUSTOMER
9. CHANGE PASSWORD
S. SALES REPORT
0. MAIN MENU
Enter your choice : 4
---------------------------------------------------------------------------------------
LIST OF ITEMS
---------------------------------------------------------------------------------------
Product ID : 1 Product Name : French Fries Price : 250
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
Product ID : 2 Product Name : Spring Roll Price : 150
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
Product ID : 3 Product Name : Momos Price : 80
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
Product ID : 4 Product Name : Soya Chaap Price : 200
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
Product ID : 5 Product Name : Burger Price : 120
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
[ADMINISTRATION MENU]
1. ADD PRODUCT
2. MODIFY PRODUCT
3. SEARCH PRODUCT
4. DISPLAY PRODUCT
5. DELETE PRODUCT
6. DISPLAY CUSTOMER
7. SEARCH CUSTOMER
8. DELETE CUSTOMER
9. CHANGE PASSWORD
S. SALES REPORT
0. MAIN MENU
Enter your choice : 6
---------------------------------------------------------------------------------------
LIST OF Customers
No Record Exist
---------------------------------------------------------------------------------------
30
[ADMINISTRATION MENU]
1. ADD PRODUCT
2. MODIFY PRODUCT
3. SEARCH PRODUCT
4. DISPLAY PRODUCT
5. DELETE PRODUCT
6. DISPLAY CUSTOMER
7. SEARCH CUSTOMER
8. DELETE CUSTOMER
9. CHANGE PASSWORD
S. SALES REPORT
0. MAIN MENU
Enter your choice : 0
---------------------------------------------------------------------------------------
[MAIN MENU]
1. ADMIN DEPARTMENT
2. BILLING DESK
0. EXIT
Enter your choice : 2
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
[BILLING DESK]
1. BILLING
2. PRINT BILL
3. CANCEL BILL
4. UPDATE BILL
5. DISPLAY ITEM LIST
0. MAIN MENU
Enter your choice : 1
---------------------------------------------------------------------------------------
Enter Mobile Number : 7777777777
Enter Name : Seema Singh
LIST OF ITEMS
---------------------------------------------------------------------------------------
Product ID : 1 Product Name : French Fries Price : 250
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
Product ID : 2 Product Name : Spring Roll Price : 150
---------------------------------------------------------------------------------------
31
---------------------------------------------------------------------------------------
Product ID : 3 Product Name : Momos Price : 80
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
Product ID : 4 Product Name : Soya Chaap Price : 200
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
Product ID : 5 Product Name : Burger Price : 120
---------------------------------------------------------------------------------------
Enter Product ID : 1
Product Name : French Fries Price : 250
Press any Y/Y to confirm the product : y
Enter Quantity : 2
Press N/n to stop purchasing : y
Enter Product ID : 4
Product Name : Soya Chaap Price : 200
Press any Y/Y to confirm the product : y
Enter Quantity : 2
Press N/n to stop purchasing : n
Press 1 to Generate Bill
Press 2 to Cancel Bill
Press 3 to Update Bill
Enter Your Choice : 1
32
[BILLING DESK]
1. BILLING
2. PRINT BILL
3. CANCEL BILL
4. UPDATE BILL
5. DISPLAY ITEM LIST
0. MAIN MENU
Enter your choice : 1
---------------------------------------------------------------------------------------
Enter Mobile Number : 9999999999
Hello Rohit Kumar
PROCEED TO BILLING ( Y / N ) : y
[ PRESS Y TO SEE THE ITEM DETAILS ] : n
Enter Product ID : 3
Product Name : Momos Price : 80
Press any Y/Y to confirm the product : 4
Enter Quantity : 4
Press N/n to stop purchasing : y
Enter Product ID : 5
Product Name : Burger Price : 120
Press any Y/Y to confirm the product : y
Enter Quantity : 2
Press N/n to stop purchasing : y
Enter Product ID : 1
Product Name : French Fries Price : 250
Press any Y/Y to confirm the product : y
Enter Quantity : 3
Press N/n to stop purchasing : n
Press 1 to Generate Bill
Press 2 to Cancel Bill
Press 3 to Update Bill
Enter Your Choice : 1
33
[BILLING DESK]
1. BILLING
2. PRINT BILL
3. CANCEL BILL
4. UPDATE BILL
5. DISPLAY ITEM LIST
0. MAIN MENU
Enter your choice : 2
---------------------------------------------------------------------------------------
Enter Bill Number : 1
1. BILLING
2. PRINT BILL
3. CANCEL BILL
4. UPDATE BILL
5. DISPLAY ITEM LIST
0. MAIN MENU
Enter your choice : 4
---------------------------------------------------------------------------------------
Enter Bill Number : 3
Item Name : French Fries , Quantity : 2
Press Y/y to continue the update....y
Enter New Quantity : 3
Bill Updated Successfully...
---------------------------------------------------------------------------------------
BILLING DESK]
1. BILLING
2. PRINT BILL
3. CANCEL BILL
34
[BILLING DESK]
1. BILLING
2. PRINT BILL
3. CANCEL BILL
4. UPDATE BILL
5. DISPLAY ITEM LIST
0. MAIN MENU
Enter your choice : 2
---------------------------------------------------------------------------------------
Enter Bill Number : 3
[ADMINISTRATION MENU]
1. ADD PRODUCT
2. MODIFY PRODUCT
3. SEARCH PRODUCT
4. DISPLAY PRODUCT
5. DELETE PRODUCT
6. DISPLAY CUSTOMER
7. SEARCH CUSTOMER
8. DELETE CUSTOMER
9. CHANGE PASSWORD
S. SALES REPORT
0. MAIN MENU
Enter your choice : 6
---------------------------------------------------------------------------------------
LIST OF Customers
---------------------------------------------------------------------------------------
Customer ID : 1 Mobile No. : 9999999999 Name : Rohit Kumar
---------------------------------------------------------------------------------------
Customer ID : 2 Mobile No. : 8888888888 Name : Puneet Gupta
---------------------------------------------------------------------------------------
Customer ID : 3 Mobile No. : 7777777777 Name : Seema Singh
---------------------------------------------------------------------------------------
35
[ADMINISTRATION MENU]
1. ADD PRODUCT
2. MODIFY PRODUCT
3. SEARCH PRODUCT
4. DISPLAY PRODUCT
5. DELETE PRODUCT
6. DISPLAY CUSTOMER
7. SEARCH CUSTOMER
8. DELETE CUSTOMER
9. CHANGE PASSWORD
S. SALES REPORT
0. MAIN MENU
Enter your choice : 7
---------------------------------------------------------------------------------------
Enter Mobile Number : 9999999999
---------------------------------------------------------------------------------------
Customer ID : 1
Mobile Number : 9999999999
Customer Name : Rohit Kumar
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
[ADMINISTRATION MENU]
1. ADD PRODUCT
2. MODIFY PRODUCT
3. SEARCH PRODUCT
4. DISPLAY PRODUCT
5. DELETE PRODUCT
6. DISPLAY CUSTOMER
7. SEARCH CUSTOMER
8. DELETE CUSTOMER
9. CHANGE PASSWORD
S. SALES REPORT
0. MAIN MENU
Enter your choice : s
---------------------------------------------------------------------------------------
[ SALES REPORT ]
INDIAN RESTAURANT & CAFE
----------------------------------------------------
Date : 2022-12-02 Total Collection : Rs, 2960
----------------------------------------------------
36
[ADMINISTRATION MENU]
1. ADD PRODUCT
2. MODIFY PRODUCT
3. SEARCH PRODUCT
4. DISPLAY PRODUCT
5. DELETE PRODUCT
6. DISPLAY CUSTOMER
7. SEARCH CUSTOMER
8. DELETE CUSTOMER
9. CHANGE PASSWORD
S. SALES REPORT
0. MAIN MENU
Enter your choice : 0
---------------------------------------------------------------------------------------
[MAIN MENU]
1. ADMIN DEPARTMENT
2. BILLING DESK
0. EXIT
Enter your choice : 2
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
[BILLING DESK]
1. BILLING
2. PRINT BILL
3. CANCEL BILL
4. UPDATE BILL
5. DISPLAY ITEM LIST
0. MAIN MENU
Enter your choice : 3
---------------------------------------------------------------------------------------
Press 1 to Cancel the Last Generated Bill
Press 2 to Cancel the Bill Using Bill Number
Enter Your Choice : 2
Enter Bill Number : 2
Bill Cancelled Successfully...
---------------------------------------------------------------------------------------
37
[BILLING DESK]
1. BILLING
2. PRINT BILL
3. CANCEL BILL
4. UPDATE BILL
5. DISPLAY ITEM LIST
0. MAIN MENU
Enter your choice : 2
---------------------------------------------------------------------------------------
Enter Bill Number : 2
S. SALES REPORT
0. MAIN MENU
Enter your choice : s
---------------------------------------------------------------------------------------
[ SALES REPORT ]
INDIAN RESTAURANT & CAFE
----------------------------------------------------
Date : 2022-12-02 Total Collection : Rs, 1650
----------------------------------------------------
38
[ADMINISTRATION MENU]
1. ADD PRODUCT
2. MODIFY PRODUCT
3. SEARCH PRODUCT
4. DISPLAY PRODUCT
5. DELETE PRODUCT
6. DISPLAY CUSTOMER
7. SEARCH CUSTOMER
8. DELETE CUSTOMER
9. CHANGE PASSWORD
S. SALES REPORT
0. MAIN MENU
Enter your choice : 9
---------------------------------------------------------------------------------------
Enter Old Password : 111
Enter New Password : 222
Re-Enter New Password : 222
[ PASSWORD RESET SUCCESSFULLY ]
---------------------------------------------------------------------------------------
[ADMINISTRATION MENU]
1. ADD PRODUCT
2. MODIFY PRODUCT
3. SEARCH PRODUCT
4. DISPLAY PRODUCT
5. DELETE PRODUCT
6. DISPLAY CUSTOMER
7. SEARCH CUSTOMER
8. DELETE CUSTOMER
9. CHANGE PASSWORD
S. SALES REPORT
0. MAIN MENU
Enter your choice : 0
---------------------------------------------------------------------------------------
[MAIN MENU]
1. ADMIN DEPARTMENT
2. BILLING DESK
0. EXIT
Enter your choice : 0
---------------------------------------------------------------------------------------
Thank You
39
Bibliography
Books Referred
www.google.com
www.studytonight.com
www.pythonprogramming.com
40