0% found this document useful (0 votes)
99 views36 pages

Restaurant Billing System

Uploaded by

Sksks Sky
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views36 pages

Restaurant Billing System

Uploaded by

Sksks Sky
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

EDISON G AGORAM MEMORIAL SCHOOL

CHIDAMBARAM

PROJECT REPORT
ON
RESTAURANT BILLING SOFTWARE
FOR

AISSCE 2022 EXAMINATION


[As a part of Computer Science Course (083)]

Submitted by
Kedharanathan. C. R. Roll No:
Class: XII
(2023-24)
EDISON G AGORAM MEMORIAL SCHOOL

CERTIFICATE

This is to certify that the project titled “Restaurant Billing Software” is a

bonafide work done by KEDHARANTHAN. C, R. of class XII, session

2021-22 under the guidance of subject teacher MRS. KAMALI. R.

during the partial fulfilment of CBSE’s Computer Science Course (083.

This project work is not plagiarized and has not been submitted

elsewhere.

Principal’s Signature Teacher’s Signature

Signature of External Examiner


ACKNOWLEDGEMENT

I thank God for showering his immense blessings that helped me in each
step of my progress towards the completion of this project.

I would like to thank The Correspondent Mrs. Shammi Ratna. C. , The


Principal Mrs.Kalyani. S. and The Headmistress Mrs. Devaki for their support by
providing the facilities for project completion.

I express my sincere gratitude to my Computer science teacher


Mrs.R.Kamali who has guided me through the design, development and testing of
this project with her valuable suggestions that helped us to overcome the
difficulties throughout the project.

I express my sincere thanks to my parents who have been a constant support


for me. I also thank my friends for their constant encouragement.
CONTENTS

1. Introduction

2. Project Synopsis

3. System Implementation

3.1 Hardware used

3.2 Software used

4. System Design and Development

4.1 Database Design

4.2 Source code

4.3 Sample output

5. References

PROJECT SYNOPSIS
INTRODUCTION

The project has been taken up to automate the existing manual billing
system in restaurants. The billing information can be saved and retrieved easily.

This software is computerizing the traditional restaurant billing system with


some added functionality. This system is built for fast data processing and bill
generation for customers. The billing database is a collection of product name,
price and amount. A dish when billed is searched from the database and its price is
added to the bill based upon the product quantity.

The Restaurant billing system is built to help the operator to calculate and
display bills and serve the customer in a faster and efficient manner. This software
project consists of easy options to help the employee in easy bill calculation and
providing an efficient customer service.
OBJECTIVES

● To create a reliable platform for managing your restaurant billing.

● To reduce operation and maintenance costs.

● To provide gift vouchers for star customers.

● To maintain customers and menu items in a single window.

SCOPE OF THE PROJECT

The proposed system will be helpful to:

● Allows ease of billing transactions to make the process simpler and quicker.

● Easily add a new customer phone number during billing and later edit the details.

● Offer gift vouchers for star customers who have points more than 500.

● Easily add / edit/ delete items in the menu card based on categories.

SCOPE FOR EXPANSION

● Online ordering or drive through takeaway ordering of food will enable the

restaurant to expand.

● Online food ordering needs to include online payment.

● Supplier information may be added so that the customer may be served in a

better way.
SYSTEM IMPLEMENTATION

HARDWARE USED

✔ Intel Core i5 @ 3GHz Processor


✔ 8 GB RAM
✔ 256 GB Hard disk

SOFTWARE USED

✔ Windows 10 (OS)
✔ Python 3.9.1 (Front end)
✔ Mysql 8.0.26 (Backend)
✔ Word 2013 (Documentation)
SYSTEM DESIGN AND DEVELOPMENT

DATABASE DESIGN

Database: Restaurant

Table: Password

Field name Data type Size Constraint


mode Varchar 6
pass_word Varchar 12

Table: Menucard

Field name Data type Size Constraint


itemid varchar 5 Primary key
itemname Varchar 30
price varchar 10
variety varchar 15
v_nv varchar 3

Table: Sales_Report

Field name Data type Size Constraint


bill_no varchar 30
date varchar 10
time varchar 10
itemid varchar 5
dish varchar 30
cost varchar 10
quantity int
price varchar 10

Table: Employee

Field name Data type Size Constraint


empid varchar 5 Primary key
ename varchar 20
gender varchar 1
desig varchar 20
salary varchar 20
email varchar 40
phno varchar 16

Table: Customer

Field name Data type Size Constraint


cname varchar 20
cph varchar 16 Primary Key
caddress varchar 45
itemid varchar 5
cpoints int
cemail varchar 40
SOURCE CODE

import mysql.connector as m # importing python - mysql connector module


import datetime # to get date and time
# connecting python to mysql
C=m.connect(host="localhost",user="root",passwd="1234")
c=C.cursor()
c.execute("create database if not exists Restaurant")
c.execute("Use Restaurant")

# password table
c.execute("create table if not exists password(mode varchar(6),pass_word varchar(12))")
c.execute("insert into password values('admin','admin@2023')")
c.execute("insert into password values('user','user@2023')")

# employee table
c.execute("create table if not exists Empl(Empid varchar(5) primary key, Ename char(20),gender char(1),desig varchar(20), salary
varchar(20), email varchar(40), phno varchar(16))")
c.execute("insert into Empl values('E1','Adarsh','M','Assistant Manager','₹800000','[email protected]','+91 9200394867')")
c.execute("insert into Empl values('E2','Anish','M','CFO','₹3000000','[email protected]','+91 9500394867')")
c.execute("insert into Empl values('E3','Arul','M','Manager','₹1000000','[email protected]','+91 9900394867')")
c.execute("insert into Empl values('E4','Pranav','M','General Manager','₹150000','[email protected]','+91 9990394867')")
c.execute("insert into Empl values('E5','Kedharanathan','M','CEO','₹5000000','[email protected]','+91 9944384833')")

# menu table
c.execute("Drop table if exists menu")
c.execute("create table if not exists menu(itemid varchar(5) primary key,itemname varchar(30),price varchar(10),variety char(15),v_nv
char(3))")
c.execute("insert into menu values('V1','Rava Kesari','₹75.00','sweet','v')")
c.execute("insert into menu values('V2','Carrot Halwa','₹65.00','sweet','v')")
c.execute("insert into menu values('V3','Bread Halwa','₹70.00','sweet','v')")
c.execute("insert into menu values('V4','Kashi Halwa','₹70.00','sweet','v')")
c.execute("insert into menu values('V5','Mysore Pak (3pcs)','₹70.00','sweet','v')")
c.execute("insert into menu values('V6','Badshah (3pcs)','₹65.00','sweet','v')")
c.execute("insert into menu values('V7','Fresh Cream Tomato Soup','₹120.00','soup','v')")
c.execute("insert into menu values('V8','Sweet Corn Soup','₹100.00','soup','v')")
c.execute("insert into menu values('V9','Mushroom Soup','₹85.00','soup','v')")
c.execute("insert into menu values('V10','Hot And Pepper','₹100.00','soup','v')")
c.execute("insert into menu values('N1','French Onion(Chicken)','₹125.00','soup','nv')")
c.execute("insert into menu values('N2','Garlic Chicken Soup','₹120.00','soup','nv')")
c.execute("insert into menu values('N3','Hot And Sour Lobster Soup','₹130.00','soup','nv')")
c.execute("insert into menu values('N4','Mutton Pepper Soup','₹110.00','soup','nv')")
c.execute("insert into menu values('N5','Crab Soup','₹150.00','soup','nv')")
c.execute("insert into menu values('V11','Gobi 65','₹120.00','starter','v')")
c.execute("insert into menu values('V12','Paneer Tikka','₹125.00','starter','v')")
c.execute("insert into menu values('V13','Mushroom Tikka','₹130.00','starter','v')")
c.execute("insert into menu values('V14','Gobi Manchurian','₹125.00','starter','v')")
c.execute("insert into menu values('V15','Honey Potato','₹120.00','sweet','v')")
c.execute("insert into menu values('V16','Paneer 65','₹120.00','starter','v')")
c.execute("insert into menu values('N6','Chicken 65','₹150.00','starter','nv')")
c.execute("insert into menu values('N7','chicken 88','₹190.00','starter','nv')")
c.execute("insert into menu values('N8','chicken 007','₹210.00','starter','nv')")
c.execute("insert into menu values('N9','Chicken Tikka','₹150.00','starter','nv')")
c.execute("insert into menu values('N10','Chicken Tandoori','₹150.00','starter','nv')")
c.execute("insert into menu values('N11','Honey Chicken','₹125.00','starter','nv')")
c.execute("insert into menu values('N12','Crab Lollipop','₹165.00','starter','nv')")
c.execute("insert into menu values('N13','Fish Fingers','₹170.00','starter','nv')")
c.execute("insert into menu values('N14','Golden Prawn','₹190.00','starter','nv')")
c.execute("insert into menu values('N15','Grilled Fish','₹150.00','starter','nv')")
c.execute("insert into menu values('N16','Fish 65','₹150.00','starter','nv')")
c.execute("insert into menu values('N17','Grill Chicken','₹250.00','starter','nv')")
c.execute("insert into menu values('V17','Dosa','₹40.00','maindish','v')")
c.execute("insert into menu values('V18','Idli(2 pcs)','₹25.00','maindish','v')")
c.execute("insert into menu values('V19','Ghee Roast','₹50.00','maindish','v')")
c.execute("insert into menu values('V20','Masala Dosa','₹65.00','maindish','v')")
c.execute("insert into menu values('V21','Podi Dosa','₹55.00','maindish','v')")
c.execute("insert into menu values('V22','Mushroom Dosa','₹65.00','maindish','v')")
c.execute("insert into menu values('V23','Paneer Dosa','₹65.00','maindish','v')")
c.execute("insert into menu values('V24','Onion Dosa','₹60.00','maindish','v')")
c.execute("insert into menu values('V25','Upma','₹40.00','maindish','v')")
c.execute("insert into menu values('V26','Idiyappam','₹50.00','maindish','v')")
c.execute("insert into menu values('V27','Pongal','₹55.00','maindish','v')")
c.execute("insert into menu values('N18','Chicken Dosa','₹70.00','maindish','nv')")
c.execute("insert into menu values('N19','Mutton Dosa','₹90.00','maindish','nv')")
c.execute("insert into menu values('N20','Prawn Dosa','₹120.00','maindish','nv')")
c.execute("insert into menu values('V28','Phulka','₹40.00','roti','v')")
c.execute("insert into menu values('V29','Chapati','₹25.00','roti','v')")
c.execute("insert into menu values('V30','Naan','₹40.00','roti','v')")
c.execute("insert into menu values('V31','Butter Naan','₹50.00','roti','v')")
c.execute("insert into menu values('V32','Paratha','₹20.00','roti','v')")
c.execute("insert into menu values('V33','Tandoori Roti','₹50.00','roti','v')")
c.execute("insert into menu values('V34','Paneer Butter Masala','₹165.00','gravy','v')")
c.execute("insert into menu values('V35','Mushroom Gravy','₹150.00','gravy','v')")
c.execute("insert into menu values('V36','Baby Corn Gravy','₹170.00','gravy','v')")
c.execute("insert into menu values('V37','Malai Cofta (Red/White)','₹190.00','gravy','v')")
c.execute("insert into menu values('V38','Dal Makhani','₹150.00','gravy','v')")
c.execute("insert into menu values('V39','Panneer Lababdar','₹190.00','gravy','v')")
c.execute("insert into menu values('V40','Palak Panneer','₹175.00','gravy','v')")
c.execute("insert into menu values('V41','Mixed Veggie Gravy','₹150.00','gravy','v')")
c.execute("insert into menu values('V42','Mixed Fruits And Veggie Gravy','₹180.00','gravy','v')")
c.execute("insert into menu values('N21','Butter Chicken','₹180.00','gravy','nv')")
c.execute("insert into menu values('N22','Chettinad Chicken','₹190.00','gravy','nv')")
c.execute("insert into menu values('N23','Kadai Chicken','₹170.00','gravy','nv')")
c.execute("insert into menu values('V43','Curd Rice','₹45.00','rice','v')")
c.execute("insert into menu values('V44','Sambar Rice','₹55.00','rice','v')")
c.execute("insert into menu values('V45','Dal Rice','₹50.00','rice','v')")
c.execute("insert into menu values('V46','Rasam Rice','₹45.00','rice','v')")
c.execute("insert into menu values('V47','Podi Rice','₹50.00','rice','v')")
c.execute("insert into menu values('V48','Fried Rice','₹120.00','rice','v')")
c.execute("insert into menu values('V49','Baby Corn Fried Rice','₹135.00','rice','v')")
c.execute("insert into menu values('V50','Paneer Fried Rice','₹170.00','rice','v')")
c.execute("insert into menu values('V51','Mushroom Fried Rice','₹150.00','rice','v')")
c.execute("insert into menu values('N24','Chicken Gravy Rice','₹150.00','rice','nv')")
c.execute("insert into menu values('N25','Mutton Gravy Rice','₹165.00','rice','nv')")
c.execute("insert into menu values('N26','Prawn Thokku Rice','₹150.00','rice','nv')")
c.execute("insert into menu values('N27','Fish Gravy Rice','₹150.00','rice','nv')")
c.execute("insert into menu values('N28','Chicken Fried Rice','₹210.00','rice','nv')")
c.execute("insert into menu values('N29','Mutton Fried rice','₹230.00','rice','nv')")
c.execute("insert into menu values('N30','Prawn Fried rice','₹250.00','rice','nv')")
c.execute("insert into menu values('V52','Paneer Biryani','₹190.00','biryani','v')")
c.execute("insert into menu values('V53','Mushroom Biryani','₹150.00','biryani','v')")
c.execute("insert into menu values('V54','Plain Biryani','₹135.00','biryani','v')")
c.execute("insert into menu values('N31','Chicken Biryani','₹170.00','biryani','nv')")
c.execute("insert into menu values('N32','Mutton Biryani','₹210.00','biryani','nv')")
c.execute("insert into menu values('N33','Prawn Biryani','₹210.00','biryani','nv')")
c.execute("insert into menu values('N34','Egg Omelette','₹15.00','sidedish','nv')")
c.execute("insert into menu values('N35','Egg Kalaki','₹20.00','sidedish','nv')")
c.execute("insert into menu values('N36','Halfboil','₹20.00','sidedish','nv')")
c.execute("insert into menu values('V55','Gulab Jamoon','₹60.00','desert','v')")
c.execute("insert into menu values('V56','Paneer Jamun','₹65.00','desert','v')")
c.execute("insert into menu values('V57','Butterscotch (3 Scoops)','₹60.00','desert','v')")
c.execute("insert into menu values('V58','Chocolate (3 Scoops)','₹55.00','desert','v')")
c.execute("insert into menu values('V59','Vanilla (3 Scoops)','₹50.00','desert','v')")
c.execute("insert into menu values('V60','Strawberry (3 scoops)','₹55.00','desert','v')")
c.execute("insert into menu values('V61','Cranberry (3 scoops)','₹55.00','desert','v')")
c.execute("insert into menu values('V62','Blueberry (3 scoops)','₹55.00','desert','v')")
c.execute("insert into menu values('V63','Black Currant (3 scoops)','₹55.00','desert','v')")
c.execute("insert into menu values('V64','Coffee Choco Crunch (3 scoops)','₹55.00','desert','v')")
c.execute("insert into menu values('V65','Chocolate Milkshake','₹110.00','desert','v')")
c.execute("insert into menu values('V66','Strawberry Milkshake','₹110.00','desert','v')")
c.execute("insert into menu values('V67','Coffee Milkshake','₹110.00','desert','v')")
c.execute("insert into menu values('V68','Butterscotch Milkshake','₹130.00','desert','v')")
c.execute("insert into menu values('V69','Blueberry Milkshake','₹150.00','desert','v')")
c.execute("insert into menu values('V70','Vanilla Milkshake','₹110.00','desert','v')")
c.execute("insert into menu values('V71','Black Current Milkshake','₹120.00','desert','v')")
c.execute("insert into menu values('V72','Fruit Falooda','₹110.00','desert','v')")
c.execute("insert into menu values('V73','Degree Coffee','₹45.00','hot beverages','v')")
c.execute("insert into menu values('V74','Caramel Coffee','₹65.00','hot beverages','v')")
c.execute("insert into menu values('V75','Butter Coffee','₹55.00','hot beverages','v')")
c.execute("insert into menu values('V76','Cappuccino','₹60.00','hot beverages','v')")
c.execute("insert into menu values('V77','Espresso','₹60.00','hot beverages','v')")
c.execute("insert into menu values('V78','Indian Chai','₹45.00','hot beverages','v')")
c.execute("insert into menu values('V79','Butter Chai','₹65.00','hot beverages','v')")
c.execute("insert into menu values('V80','Masala Chai','₹65.00','hot beverages','v')")
c.execute("insert into menu values('V81','Hot Chocolate','₹50.00','hot beverages','v')")

# customer table
c.execute("create table if not exists customer(cname char(20),cph varchar(16) primary key,caddress varchar(45),cpoints int,cemail
char(40))")
c.execute("insert into customer values('Adarsh','+91 7586942130','25,kamaraj nagar,chennai-600028',0,'[email protected]')")
c.execute("insert into customer values('Arul','+91 9874562565','321,main street,vandalur-602324',0,'[email protected]')")
c.execute("insert into customer values('jagan','+91 8025654789','3B,nehru nagar,keelpakkam-601235',0,'[email protected]')")
c.execute("insert into customer values('Marwan','+91 9847542580','17,jaganmahan street,chennai=600025',0,'[email protected]')")

# sales report
c.execute("create table if not exists Sales_Report(bill_no varchar(30),date varchar(10),time varchar(10),itemid varchar(5) , dish
varchar(30),cost varchar(10),quantity int,price varchar(12))")

# header
print()
print()
print()
Header=""" WELLCOME TO
SREE PRANAVA BALAJI BHAVAN
-By Kedharanathan Groups"""
print("-"*(len(Header)-87))
print("-"*(len(Header)-87))
print(Header)
print("-"*(len(Header)-87))
print("-"*(len(Header)-87))
print()
print()
print()

while True:

# choosing profile
P=input("Enter 'C' if you are customer and 'E' if you are employee : ")
print()
print()

if P=='E' or P=='C':

# employee profile
if P=="E":
c.execute("select * from password")
pt=c.fetchall()
uA=pt[0][0]
pA=pt[0][1]
u=pt[1][0]
p=pt[1][1]
# checking mode of employee
while True:
u1=input("Enter User id : ")
print()
p1=input("Enter user password : ")
print()
print()
# admin mode
if (u1==uA or u1==u) and (p1==pA or p1==p) :
if u1==uA and p1==pA:
while True:
# choosing admin options
print("""Admin options:
V: View All The Employees
A: Add Employee
E: Edit Employee
D: Delete Employee
S: View Sales Report
M: Edit Menu card""")
print()
print()
o=input("Enter the options : ")
print()
print()

# view of all employees


if o=="V":
print("Employees : ")
print()
c.execute("Select * from empl")
r=c.fetchall()
e_column_names = ["ID","Name","Gender","Designation","Salary","Email","Phone no"]
e_col="| {:5} | {:13} | {:6} | {:25} | {:8} | {:25} | {:14} |".format(*e_column_names)
print("+"+"-"*(len(e_col)-2)+"+")
print(e_col)
print("+"+"-"*(len(e_col)-2)+"+")
for row in r:
print("| {:5} | {:13} | {:6} | {:25} | {:8} | {:25} | {:14} |".format(*row))
print("+"+"-"*(len(e_col)-2)+"+")
print()
print()

# adding new employees


elif o=="A":
while True:
e_id=input("Enter employee id : ")
print()
n=input("Enter the name : ").lstrip().rstrip()
print()
g=input("Enter the gender : ").lstrip().rstrip()
print()
d=input("Enter the designation : ").lstrip().rstrip()
print()
s=int(input("Enter the salary : "))
s='₹'+str(s)
print()
em=input("Enter email : ")
print()
print("Enter mobile number (with country code : ")
cc=input("Enter country code : ").lstrip().rstrip()
mn=input("Enter mobile number : ").lstrip().rtsrip()
ph=cc+mn
print()
c.execute("insert into empl values('{}','{}','{}','{}',{},'{}','{}')".format(e_id,n,g,d,s,em,ph))
print("! The entered new record is added successfully !")
print()
print()
ch=input('Do you wish to continue in adding records of new employees ? (y/n) : ')
if ch=='n':
print()
print('Breaking...')
print()
break
elif ch=='y':
print()
print()
continue

# editing current employees' details


elif o=="E":
while True:
e_id=input("Enter employee id : ")
print()
while True:
print("""Constraints :
n: Name
d: Designation
s: Salary
em: Email
ph: Phone number""")
print()
co=input("Enter the desired constraints to be changed : ")
print()
if co=="n":
n=input("Enter the new name : ")
print()
c.execute("Update empl set ename='{}' where empid='{}'".format(n,e_id))
print("! The edited new record is added successfully !")
print()
print()
elif co=="d":
d=input("Enter the new designation : ")
print()
c.execute("Update empl set desig='{}' where empid='{}'".format(d,e_id))
print("! The edited new record is added successfully !")
print()
print()
elif co=="s":
s=input(int("Enter the new salary : "))
s='₹'+str(s)
print()
c.execute("Update empl set salary='{}' where empid='{}'".format(s,e_id))
print("! The edited new record is added successfully !")
print()
print()
elif co=="em":
em=input("Enter the new email : ")
print()
c.execute("Update empl set email='{}' where empid='{}'".format(em,e_id))
print("! The edited new record is added successfully !")
print()
print()
elif co=="ph":
ph=input("Enter the new phone number : ")
print()
c.execute("Update empl set phno='{}' where empid='{}'".format(ph,e_id))
print("! The edited new record is added successfully !")
print()
ch=input('Do you wish to continue editting this employee record ? (y/n) : ')
if ch=='n':
print()
print('Breaking...')
print()
break
elif ch=='y':
print()
print()
continue
ch=input('Do you wish to continue in editting records of employees ? (y/n) : ')
if ch=='n':
print()
print('Breaking...')
print()
break
elif ch=='y':
print()
print()
continue

# deleting employees
elif o.upper()=="D":
while True:
e_id=input("Enter employee id : ")
print()
c.execute("delete empl where empid='{}'".format(e_id))
print("! The record is deleted successfully !")
print()
print()
ch=input('Do you wish to continue in deleting records of employees ? (y/n) : ')
if ch=='n':
print()
print('Breaking...')
print()
break
elif ch=='y':
print()
print()
continue

# sales report
elif o=="S":
while True:
O=input("Enter 'V' to view all sales report and 'S' to view with specifications : ")
print()
print()
if O=='V':
c.execute('Select * from sales_Report')
r=c.fetchall()
column_names = ["Bill Number","Date","Time","ID","Dishes","Cost","Quantity","Price"]
col="| {:24} | {:10} | {:5} | {:5} | {:30} | {:7} | {:6} | {:7} |".format(*column_names)
print("+"+"-"*(len(col)-2)+"+")
print(col)
print("+"+"-"*(len(col)-2)+"+")
for row in r:
print("| {:24} | {:10} | {:5} | {:5} | {:30} | {:7} | {:8} | {:7} |".format(*row))
print("+"+"-"*(len(col)-2)+"+")
print()
print()
elif O=='S':
while True:
date=input("Enter date (in proper format or it causes error !) to view sales details : ")
print()
print()
r=c.fetchall()
if r:
c.execute('Select * from sales_Report')
r=c.fetchall()
column_names = ["Bill Number","Date","Time","ID","Dishes","Cost","Quantity","Price"]
col="| {:30} | {:10} | {:5} | {:5} | {:30} | {:7} | {:6} | {:10} |".format(*column_names)
print("+"+"-"*(len(col)-2)+"+")
print(col)
print("+"+"-"*(len(col)-2)+"+")
for row in r:
print("| {:30} | {:10} | {:5} | {:5} | {:30} | {:7} | {:6} | {:10} |".format(*row))
print("+"+"-"*(len(e_col)-2)+"+")
print()
print()
else:
print("SORRY, WRONG INPUT !!!")
print("ENTER CORRECT VALUES !!!")
print()
print()
continue
else:
print("SORRY, WRONG INPUT !!!")
print("ENTER CORRECT VALUES !!!")
print()
print()
continue
ch=input('Do you wish to continue viewing the Sales Report ? (y/n) : ')
if ch=='n':
print()
print('Breaking...')
print()
break
elif ch=='y':
print()
print()
continue

# editing menu card


elif o=='M':
while True:
O=input("Enter E to edit details of menu card and A to add new dish : ")
if O=="E":
while True:
code=input("Enter Dish id : ")
print()
O=input("Enter D to edit dish name and P to edit price : ")
print()
if O=='D':
D=input("Enter the new dish name to be changed : ")
print()
c.execute("update menu set itemname = '{}', where itemid = '{}'".format(D,code))
elif O=='P':
P=float(input("Enter the new price to be changed : "))
print()
P='₹'+str(P)+'0'
c.execute("update menu set itemname = '{}', where itemid = '{}'".format(P,code))
else:
print("SORRY !!! WRONG INPUT !!!")
print()
continue
ch=input("Do you wish to continue editing dishes ? (y/n) : ")
if ch=='n':
print()
print("Breaking...")
print()
break
elif ch=='y':
print()
print()
continue
elif O=='A':
while True:
code=input("Enter dish id : ")
c.execute("select * from menu where itemid = '{}'".format(code))
Code=fetchall()
if Code:
print("SORRY THE ENTRY ALREADY EXISTS !!!")
continue
else:
dish=input("Enter Dish name : ")
print()
price=float(input("Enter Price : "))
print()
price='₹'+str(price)+'0'
v=input("Enter variety : ")
print()
v_=input("Enter v for veg and nv for non-veg : ")
print()
tuple1=(code,dish,price,v,v_)
c.execute("insert into menu values('{},'{}','{}','{},'{}')".format(tuple1))
ch=input("Do you wish to add more dishes ? (y/n) : ")
if ch=='n':
print()
print('Breaking...')
print()
break
elif ch=='y':
print()
print()
continue
else:
print("SORRY, WRONG INPUT !!!")
print()
continue
ch=input("Do you wish to continue editing menu card ? (y/n) : ")
if ch=='n':
print()
print("Breaking...")
print()
break
elif ch=='y':
print()
print()
continue

ch=input('Do you wish to continue to be in the admin account ? (y/n) : ')


if ch=='n':
print()
print('Breaking...')
print()
break
elif ch=='y':
print()
print()
continue

# normal user mode


elif u1==u and p1==p:
# user options
while True:
print("""User options:
V: View All The Emplyees
A: Add Employee
E: Edit Employee
S: View Sales Report""")
print()
print()
o=input("Enter the options : ")
print()
print()

# view of all employees


if o=="V":
print("Employees : ")
print()
c.execute("Select * from empl")
r=c.fetchall()
e_column_names = ["ID","Name","Gender","Designation","Salary","Email","Phone no"]
e_col="| {:5} | {:13} | {:6} | {:25} | {:8} | {:25} | {:14} |".format(*e_column_names)
print("+"+"-"*(len(e_col)-2)+"+")
print(e_col)
print("+"+"-"*(len(e_col)-2)+"+")
for row in r:
print("| {:5} | {:13} | {:6} | {:25} | {:8} | {:25} | {:14} |".format(*row))
print("+"+"-"*(len(e_col)-2)+"+")
print()
print()

# adding new employees


elif o=="A":
while True:
e_id=input("Enter employee id : ")
print()
n=input("Enter the name : ").lstrip().rstrip()
print()
g=input("Enter the gender : ").lstrip().rstrip()
print()
d=input("Enter the designation : ").lstrip().rstrip()
print()
s=int(input("Enter the salary : "))
s='₹'+str(s)
print()
em=input("Enter email : ")
print()
print("Enter mobile number (with country code : ")
cc=input("Enter country code : ").lstrip().rstrip()
mn=input("Enter mobile number : ").lstrip().rtsrip()
ph=cc+mn
print()
c.execute("insert into empl values('{}','{}','{}','{}',{},'{}','{}')".format(e_id,n,g,d,s,em,ph))
print("! The entered new record is added successfully !")
print()
print()
ch=input('Do you wish to continue in adding records of new employees ? (y/n) : ')
if ch=='n':
print()
print('Breaking...')
print()
break
elif ch=='y':
print()
print()
continue

# editing current employees' details


elif o=="E":
while True:
e_id=input("Enter employee id : ")
print()
while True:
print("""Constraints :
n: Name
d: Designation
s: Salary
em: Email
ph: Phone number""")
print()
co=input("Enter the desired constraints to be changed : ")
print()
if co=="n":
n=input("Enter the new name : ")
print()
c.execute("Update empl set ename='{}' where empid='{}'".format(n,e_id))
print("! The edited new record is added successfully !")
print()
print()
elif co=="d":
d=input("Enter the new designation : ")
print()
c.execute("Update empl set desig='{}' where empid='{}'".format(d,e_id))
print("! The edited new record is added successfully !")
print()
print()
elif co=="s":
s=input(int("Enter the new salary : "))
s='₹'+str(s)
print()
c.execute("Update empl set salary='{}' where empid='{}'".format(s,e_id))
print("! The edited new record is added successfully !")
print()
print()
elif co=="em":
em=input("Enter the new email : ")
print()
c.execute("Update empl set email='{}' where empid='{}'".format(em,e_id))
print("! The edited new record is added successfully !")
print()
print()
elif co=="ph":
ph=input("Enter the new phone number : ")
print()
c.execute("Update empl set phno='{}' where empid='{}'".format(ph,e_id))
print("! The edited new record is added successfully !")
print()
ch=input('Do you wish to continue editing this employee record ? (y/n) : ')
if ch=='n':
print()
print('Breaking...')
print()
break
elif ch=='y':
print()
print()
continue
ch=input('Do you wish to continue in editing records of employees ? (y/n) : ')
if ch=='n':
print()
print('Breaking...')
print()
break
elif ch=='y':
print()
print()
continue

# sales report
elif o=="S":
while True:
O=input("Enter 'V' to view all sales report and 'S' to view with specifications : ")
print()
print()
if O=='V':
c.execute('Select * from sales_Report')
r=c.fetchall()
column_names = ["Bill Number","Date","Time","ID","Dishes","Cost","Quantity","Price"]
col="| {:24} | {:10} | {:5} | {:5} | {:30} | {:7} | {:6} | {:7} |".format(*column_names)
print("+"+"-"*(len(col)-2)+"+")
print(col)
print("+"+"-"*(len(col)-2)+"+")
for row in r:
print("| {:24} | {:10} | {:5} | {:5} | {:30} | {:7} | {:6} | {:7} |".format(*row))
print("+"+"-"*(len(col)-2)+"+")
print()
print()
elif O=='S':
while True:
date=input("Enter date (in proper format or it causes error !) to view sales details : ")
print()
print()
r=c.fetchall()
if r:
c.execute('Select * from sales_Report')
r=c.fetchall()
column_names = ["Bill Number","Date","Time","ID","Dishes","Cost","Quantity","Price"]
col="| {:30} | {:10} | {:5} | {:5} | {:30} | {:7} | {:6} | {:10} |".format(*column_names)
print("+"+"-"*(len(col)-2)+"+")
print(col)
print("+"+"-"*(len(col)-2)+"+")
for row in r:
print("| {:30} | {:10} | {:5} | {:5} | {:30} | {:7} | {:8} | {:10} |".format(*row))
print("+"+"-"*(len(col)-2)+"+")
print()
print()
else:
print("SORRY, RECORD NOT FOUND !!!")
print("ENTER CORRECT VALUES !!!")
print()
print()
continue
else:
print("SORRY, WRONG INPUT !!!")
print("ENTER CORRECT VALUES !!!")
print()
print()
continue
ch=input('Do you wish to continue viewing the Sales Report ? (y/n) : ')
if ch=='n':
print()
print('Breaking...')
print()
break
elif ch=='y':
print()
print()
continue

ch=input('Do you wish to continue to be in the user account ? (y/n) : ')


if ch=='n':
print()
print()
break
elif ch=='y':
continue
else:
print("!!! SORRY PLEASE ENTER CORRECT USER ID AND PASSWORD !!!")
print()
print()
continue
ch=input('Do you wish to continue to be in the employee profile ? (y/n) : ')
if ch=='n':
print()
print('Breaking...')
print()
break
elif ch=='y':
print()
print()
continue

# Customer profile
elif P=="C":
# printing menu
print(" Vegetarian : ")
print()
print(" Starters - Sweets : ")
print()
c.execute("Select itemid,itemname,price as 'ID','Dishes','Price' from menu where variety = 'sweet' and v_nv = 'v'")
menu=c.fetchall()
m_column_names = ['ID','Dishes','Price']
m_col="| {:5} | {:30} | {:7} |".format(*m_column_names)
print("+"+"-"*(len(m_col)-2)+"+")
print(m_col)
print("+"+"-"*(len(m_col)-2)+"+")
for row in menu:
print("| {:5} | {:30} | {:7} |".format(*row))
print("+"+"-"*(len(m_col)-2)+"+")
print()
print(" Starters - Soups : ")
print()
c.execute("Select itemid,itemname,price as 'ID','Dishes','Price' from menu where variety = 'soup' and v_nv = 'v'")
menu=c.fetchall()
m_column_names = ['ID','Dishes','Price']
m_col="| {:5} | {:30} | {:7} |".format(*m_column_names)
print("+"+"-"*(len(m_col)-2)+"+")
print(m_col)
print("+"+"-"*(len(m_col)-2)+"+")
for row in menu:
print("| {:5} | {:30} | {:7} |".format(*row))
print("+"+"-"*(len(m_col)-2)+"+")
print()
print(" Starters - Main : ")
print()
c.execute("Select itemid,itemname,price as 'ID','Dishes','Price' from menu where variety = 'starter' and v_nv = 'v'")
menu=c.fetchall()
m_column_names = ['ID','Dishes','Price']
m_col="| {:5} | {:30} | {:7} |".format(*m_column_names)
print("+"+"-"*(len(m_col)-2)+"+")
print(m_col)
print("+"+"-"*(len(m_col)-2)+"+")
for row in menu:
print("| {:5} | {:30} | {:7} |".format(*row))
print("+"+"-"*(len(m_col)-2)+"+")
print()
print(" Mains - South Indian: ")
print()
c.execute("Select itemid,itemname,price as 'ID','Dishes','Price' from menu where variety = 'maindish' and v_nv = 'v'")
menu=c.fetchall()
m_column_names = ['ID','Dishes','Price']
m_col="| {:5} | {:30} | {:7} |".format(*m_column_names)
print("+"+"-"*(len(m_col)-2)+"+")
print(m_col)
print("+"+"-"*(len(m_col)-2)+"+")
for row in menu:
print("| {:5} | {:30} | {:7} |".format(*row))
print("+"+"-"*(len(m_col)-2)+"+")
print()
print(" Mains - Indian Breads : ")
print()
c.execute("Select itemid,itemname,price as 'ID','Dishes','Price' from menu where variety = 'roti' and v_nv = 'v'")
menu=c.fetchall()
m_column_names = ['ID','Dishes','Price']
m_col="| {:5} | {:30} | {:7} |".format(*m_column_names)
print("+"+"-"*(len(m_col)-2)+"+")
print(m_col)
print("+"+"-"*(len(m_col)-2)+"+")
for row in menu:
print("| {:5} | {:30} | {:7} |".format(*row))
print("+"+"-"*(len(m_col)-2)+"+")
print()
print(" Mains - Rice Specials : ")
print()
c.execute("Select itemid,itemname,price as 'ID','Dishes','Price' from menu where variety = 'rice' and v_nv = 'v'")
menu=c.fetchall()
m_column_names = ['ID','Dishes','Price']
m_col="| {:5} | {:30} | {:7} |".format(*m_column_names)
print("+"+"-"*(len(m_col)-2)+"+")
print(m_col)
print("+"+"-"*(len(m_col)-2)+"+")
for row in menu:
print("| {:5} | {:30} | {:7} |".format(*row))
print("+"+"-"*(len(m_col)-2)+"+")
print()
print(" Mains - Gravy : ")
print()
c.execute("Select itemid,itemname,price as 'ID','Dishes','Price' from menu where variety = 'gravy' and v_nv = 'v'")
menu=c.fetchall()
m_column_names = ['ID','Dishes','Price']
m_col="| {:5} | {:30} | {:7} |".format(*m_column_names)
print("+"+"-"*(len(m_col)-2)+"+")
print(m_col)
print("+"+"-"*(len(m_col)-2)+"+")
for row in menu:
print("| {:5} | {:30} | {:7} |".format(*row))
print("+"+"-"*(len(m_col)-2)+"+")
print()
print(" Mains - Biryani : ")
print()
c.execute("Select itemid,itemname,price as 'ID','Dishes','Price' from menu where variety = 'biryani' and v_nv = 'v'")
menu=c.fetchall()
m_column_names = ['ID','Dishes','Price']
m_col="| {:5} | {:30} | {:7} |".format(*m_column_names)
print("+"+"-"*(len(m_col)-2)+"+")
print(m_col)
print("+"+"-"*(len(m_col)-2)+"+")
for row in menu:
print("| {:5} | {:30} | {:7} |".format(*row))
print("+"+"-"*(len(m_col)-2)+"+")
print()
print(" Mains - Desserts : ")
print()
c.execute("Select itemid,itemname,price as 'ID','Dishes','Price' from menu where variety = 'desert' and v_nv = 'v'")
menu=c.fetchall()
m_column_names = ['ID','Dishes','Price']
m_col="| {:5} | {:30} | {:7} |".format(*m_column_names)
print("+"+"-"*(len(m_col)-2)+"+")
print(m_col)
print("+"+"-"*(len(m_col)-2)+"+")
for row in menu:
print("| {:5} | {:30} | {:7} |".format(*row))
print("+"+"-"*(len(m_col)-2)+"+")
print()
print()
print(" Non - Vegetarian (Including Vegetarian) : ")
print()
print(" Starters - Sweets : ")
print()
c.execute("Select itemid,itemname,price as 'ID','Dishes','Price' from menu where variety = 'sweet'")
menu=c.fetchall()
m_column_names = ['ID','Dishes','Price']
m_col="| {:5} | {:30} | {:7} |".format(*m_column_names)
print("+"+"-"*(len(m_col)-2)+"+")
print(m_col)
print("+"+"-"*(len(m_col)-2)+"+")
for row in menu:
print("| {:5} | {:30} | {:7} |".format(*row))
print("+"+"-"*(len(m_col)-2)+"+")
print()
print(" Starters - Soups : ")
print()
c.execute("Select itemid,itemname,price as 'ID','Dishes','Price' from menu where variety = 'soup'")
menu=c.fetchall()
m_column_names = ['ID','Dishes','Price']
m_col="| {:5} | {:30} | {:7} |".format(*m_column_names)
print("+"+"-"*(len(m_col)-2)+"+")
print(m_col)
print("+"+"-"*(len(m_col)-2)+"+")
for row in menu:
print("| {:5} | {:30} | {:7} |".format(*row))
print("+"+"-"*(len(m_col)-2)+"+")
print()
print(" Starters - Main : ")
print()
c.execute("Select itemid,itemname,price as 'ID','Dishes','Price' from menu where variety = 'starter'")
menu=c.fetchall()
m_column_names = ['ID','Dishes','Price']
m_col="| {:5} | {:30} | {:7} |".format(*m_column_names)
print("+"+"-"*(len(m_col)-2)+"+")
print(m_col)
print("+"+"-"*(len(m_col)-2)+"+")
for row in menu:
print("| {:5} | {:30} | {:7} |".format(*row))
print("+"+"-"*(len(m_col)-2)+"+")
print()
print(" Mains - South Indian: ")
print()
c.execute("Select itemid,itemname,price as 'ID','Dishes','Price' from menu where variety = 'maindish'")
menu=c.fetchall()
m_column_names = ['ID','Dishes','Price']
m_col="| {:5} | {:30} | {:7} |".format(*m_column_names)
print("+"+"-"*(len(m_col)-2)+"+")
print(m_col)
print("+"+"-"*(len(m_col)-2)+"+")
for row in menu:
print("| {:5} | {:30} | {:7} |".format(*row))
print("+"+"-"*(len(m_col)-2)+"+")
print()
print(" Mains - Indian Breads : ")
print()
c.execute("Select itemid,itemname,price as 'ID','Dishes','Price' from menu where variety = 'roti'")
menu=c.fetchall()
m_column_names = ['ID','Dishes','Price']
m_col="| {:5} | {:30} | {:7} |".format(*m_column_names)
print("+"+"-"*(len(m_col)-2)+"+")
print(m_col)
print("+"+"-"*(len(m_col)-2)+"+")
for row in menu:
print("| {:5} | {:30} | {:7} |".format(*row))
print("+"+"-"*(len(m_col)-2)+"+")
print()
print(" Mains - Rice Specials : ")
print()
c.execute("Select itemid,itemname,price as 'ID','Dishes','Price' from menu where variety = 'rice'")
menu=c.fetchall()
m_column_names = ['ID','Dishes','Price']
m_col="| {:5} | {:30} | {:7} |".format(*m_column_names)
print("+"+"-"*(len(m_col)-2)+"+")
print(m_col)
print("+"+"-"*(len(m_col)-2)+"+")
for row in menu:
print("| {:5} | {:30} | {:7} |".format(*row))
print("+"+"-"*(len(m_col)-2)+"+")
print()
print(" Mains - Gravy : ")
print()
c.execute("Select itemid,itemname,price as 'ID','Dishes','Price' from menu where variety = 'gravy'")
menu=c.fetchall()
m_column_names = ['ID','Dishes','Price']
m_col="| {:5} | {:30} | {:7} |".format(*m_column_names)
print("+"+"-"*(len(m_col)-2)+"+")
print(m_col)
print("+"+"-"*(len(m_col)-2)+"+")
for row in menu:
print("| {:5} | {:30} | {:7} |".format(*row))
print("+"+"-"*(len(m_col)-2)+"+")
print()
print(" Mains - Biryani : ")
print()
c.execute("Select itemid,itemname,price as 'ID','Dishes','Price' from menu where variety = 'biryani'")
menu=c.fetchall()
m_column_names = ['ID','Dishes','Price']
m_col="| {:5} | {:30} | {:7} |".format(*m_column_names)
print("+"+"-"*(len(m_col)-2)+"+")
print(m_col)
print("+"+"-"*(len(m_col)-2)+"+")
for row in menu:
print("| {:5} | {:30} | {:7} |".format(*row))
print("+"+"-"*(len(m_col)-2)+"+")
print()
print(" Mains - Desserts : ")
print()
c.execute("Select itemid,itemname,price as 'ID','Dishes','Price' from menu where variety = 'desert'")
menu=c.fetchall()
m_column_names = ['ID','Dishes','Price']
m_col="| {:5} | {:30} | {:7} |".format(*m_column_names)
print("+"+"-"*(len(m_col)-2)+"+")
print(m_col)
print("+"+"-"*(len(m_col)-2)+"+")
for row in menu:
print("| {:5} | {:30} | {:7} |".format(*row))
print("+"+"-"*(len(m_col)-2)+"+")
print()
print()

#billing

now = datetime.datetime.now() # for generating unique bill no


now_=str(now)
date=now_[:10]
time=now_[11:16]
l=now_.split()
char='bill'+l[0][0:4]+'_'+l[0][5:7]+'_'+l[0][8:]+'__'+l[1][:2]+'_'+l[1][3:5]+'_'+l[1][6:8]
total=0
TOTAL=[]
while True:
code=input("Enter the code to order the food : ")
print()
c.execute("Select itemname, price from menu where itemid = '{}'".format(code))
list1=c.fetchall()
if list1:
price=float(list1[0][1][1:])
dish=list1[0][0]
cp="₹"+str(price)+"0"
q=int(input("Enter the quantity : "))
print()
print()
ch=input("Are you sure of the quantity ? If you wish to change the quantity enter y or else enter n : ")
if ch=='n':
pass
elif ch=='y':
q=int(input("Enter the new quantity : "))
total+=price*q
sp='₹'+str(price*q)+'0'
c.execute("insert into Sales_report values('{}','{}','{}','{}','{}','{}',{},'{}')".format(char,date,time,code,dish,cp,q,sp))
print()
print()
ch=input('Do you wish to continue ordering ? (y/n) : ')
print()
if ch=='n':
print()
print('Breaking...')
print()
break
elif ch=='y':
print()
print()
continue
else:
print()
print()
print("Sorry wrong input !!! Please enter correct code !!!")
print()
print()
continue
Tot_str="₹"+str(total)+"0"
TOTAL.append(Tot_str)

# for customer points


print("Enter your mobile number with country code without leading and trailing spaces : ")
print()
print()
code_=input("Enter country code with '+' leading : ")
print()
mn_=input("Enter your number : ")
print()
print()
ph_no=code_+' '+mn_
c.execute("Select cname, cpoints from customer where cph = '{}' ".format(ph_no))
list2=c.fetchall()
if list2 :
print("Welcome ",list2[0][0]," !!!")
print()
print()
cpoints=int(list2[0][1])
if total>=10000:
cpoints+=100
c.execute("update customer set cpoints = {} where cph = '{}' ".format(cpoints,ph_no))
elif total>=1000 and total<10000:
cpoints+=50
c.execute("update customer set cpoints = {} where cph = '{}' ".format(cpoints,ph_no))
elif total>=500 and total<1000:
cpoints+=10
c.execute("update customer set cpoints = {} where cph = '{}' ".format(cpoints,ph_no))
elif total<500:
cpoints+=1
c.execute("update customer set cpoints = {} where cph = '{}' ".format(cpoints,ph_no))
# for printing bill
b=input("Would you like to print the bill ? (y/n) : ")
print()
print()
if b=="y":
print(" Bill : ")
print()
title=[' SREE PRANAVA BALAJI BHAVAN (a Kedharanahan Groups of company) ']
c.execute("Select itemid,dish,cost,quantity,price from sales_report")
Bill=c.fetchall()
b_column_names = ['ID','Dishes','Cost','Quantity','Price']
b_col="| {:5} | {:30} | {:7} | {:6} | {:10} |".format(*b_column_names)
print("+"+"-"*(len(b_col)-2)+"+")
print("| {:72} |".format(*title))
print("+"+"-"*(len(b_col)-2)+"+")
print("| {:72} |".format(char))
print("+"+"-"*(len(b_col)-2)+"+")
print(b_col)
print("+"+"-"*(len(b_col)-2)+"+")
for row in Bill:
print("| {:5} | {:30} | {:7} | {:8} | {:10} |".format(*row))
print("+"+"-"*(len(b_col)-2)+"+")
print("| | TOTAL : | {:10} |".format(*TOTAL))
print("+"+"-"*(len(b_col)-2)+"+")
print()
print()
if cpoints>=1000:
print("Congrats!!! You are rewarded with a gift voucher of ₹500 with which you can claim in any of our branch !!!")
print()
print()
elif cpoints>=500 and cpoints<1000:
print("Congrats!!! You are rewarded with a gift voucher of ₹100 with which you can claim in any of our branch !!!")
print()
print()
elif cpoints>=100 and cpoints<500:
print("Congrats!!! You are rewarded with a gift voucher of ₹50 with which you can claim in any of our branch !!!")
print()
print()
else:
print("It seems you are a new customer...")
ch=input("Do you wish to join our premium customer membership with which you will be rewarded gift vouchers according to
your points every time you visit ? (y/n) : ")
print()
if ch=='y':
n=input("Enter your name : ")
a=input("Enter your address : ")
m=input("Enter your email address : ")
list3=[n,ph_no,a,0,m]
c.execute("insert into customer values('{}','{}','{}',{},'{}')".format(*list3))
print()
print("!!! Thank you for joining our membership !!!")
print()
# for printing bill
print()
print()
b=input("Would you like to print the bill ? (y/n) : ")
print()
print()
if b=="y":
print(" Bill : ")
print()
title=[' SREE PRANAVA BALAJI BHAVAN (a Kedharanahan Groups of company) ']
c.execute("Select itemid,dish,cost,quantity,price from sales_report")
Bill=c.fetchall()
b_column_names = ['ID','Dishes','Cost','Quantity','Price']
b_col="| {:5} | {:30} | {:7} | {:6} | {:10} |".format(*b_column_names)
print("+"+"-"*(len(b_col)-2)+"+")
print("| {:72} |".format(*title))
print("+"+"-"*(len(b_col)-2)+"+")
print("| {:72} |".format(char))
print("+"+"-"*(len(b_col)-2)+"+")
print(b_col)
print("+"+"-"*(len(b_col)-2)+"+")
for row in Bill:
print("| {:5} | {:30} | {:7} | {:8} | {:10} |".format(*row))
print("+"+"-"*(len(b_col)-2)+"+")
print("| | TOTAL : | {:10} |".format(*TOTAL))
print("+"+"-"*(len(b_col)-2)+"+")
print()
print()
else:

# for printing bill

b=input("Would you like to print the bill ? (y/n) : ")


print()
print()
if b=="y":
print(" Bill : ")
print()
title=[' SREE PRANAVA BALAJI BHAVAN (a Kedharanahan Groups of company) ']
c.execute("Select itemid,dish,cost,quantity,price from sales_report")
Bill=c.fetchall()
b_column_names = ['ID','Dishes','Cost','Quantity','Price']
b_col="| {:5} | {:30} | {:7} | {:6} | {:10} |".format(*b_column_names)
print("+"+"-"*(len(b_col)-2)+"+")
print("| {:72} |".format(*title))
print("+"+"-"*(len(b_col)-2)+"+")
print("| {:72} |".format(char))
print("+"+"-"*(len(b_col)-2)+"+")
print(b_col)
print("+"+"-"*(len(b_col)-2)+"+")
for row in Bill:
print("| {:5} | {:30} | {:7} | {:8} | {:10} |".format(*row))
print("+"+"-"*(len(b_col)-2)+"+")
print("| | TOTAL : | {:10} |".format(*TOTAL))
print("+"+"-"*(len(b_col)-2)+"+")
print()
print()
C.commit()
C.close()

# footer
print()
print()
print()
Footer=""" THANK YOU
VISIT AGAIN"""
print("-"*(len(Header)-87))
print("-"*(len(Header)-87))
print(Footer)
print("-"*(len(Header)-87))
print("-"*(len(Header)-87))
print()
break
else:
print("!!! SORRY, ENTER CORRECT OPTION !!!")
print()
print()
continue
SAMPLE OUTPUT
REFERENCES

⇨ Computer Science with Python – Sumita Arora


⇨ www.python.org
⇨ www.w3resource.com
⇨ www.techonthenet.com
⇨ www.tutorialspoint.com

You might also like