Jinti Project Report Ip
Jinti Project Report Ip
KHANAPARA
PROJECT REPORT
ON
1
TABLE OF CONTENTS
2
ACKNOWLEDGEMENT
3
CERTIFICATE BY GUIDE
Anubhuti Gautam,XII D
Jinti Moni Kalita,XII D
Mriganka Goswami,XII D
The report is the result of his/her consistent efforts and endeavors. The report is
found worthy of acceptance as final project for the subject INFORMATICS
PRACTICES (065) of Class XII Session 2022-23.
KV Khanapara
4
CERTIFICATE BY EXAMINER
Examiner
5
INTRODUCTION TO THE
PROJECT
This project is basically made for the management of restaurants.The
features of this project are designed to help in managing data of a
restaurant in an efficient way.The admin can add,delete,fetch or
update customer data,item data and employee data.Apart from
that,the admin can also keep a track of the items sold and stocks
available through bargraphs.This is just an example of using python
in real life scenerios.
It is made by using pandas,Python-mysql
connector,Csv and matplotlib.
ABOUT PYTHON:
Python is an interpreted, object-oriented, high-level programming
language with dynamic semantics. It's high-level built- in data
structures, combined with dynamic typing and dynamic binding,
makes it very attractive for Rapid Application Development, as well
as for use as a scripting or glue language to connect existing
components together. Python's simple, easy to learn syntax
emphasizes readability and therefore reduces the cost of program
maintenance. Python supports modules and packages, which
encourages program modularity and code reuse. The Python
interpreter and the extensive standard library are available in source or
binary form without charge for all major platforms, and can be freely
distributed.
ABOUT MYSQL:
What is MySQL?
MySQL is the world’s most popular open source
database. According to DB-Engines, MySQL ranks as
the second-most-popular database, behind Oracle
Database. MySQL powers many of the most accessed
applications, including Facebook, Twitter, Netflix,
Uber, Airbnb, Shopify, and Booking.com.
Since MySQL is open source, it includes numerous
features developed in close cooperation with users over
more than 25 years. So it’s very likely that your favorite
application or programming language is supported by
MySQL Database.
MySQL is a relational database management system
Databases are the essential data repository for all
software applications. For example, whenever
someone conducts a web search, logs in to an account,
or completes a transaction, a database system is
storing the information so it can be accessed in the
future.
7
A relational database stores data in separate tables
rather than putting all the data in one big storeroom.
The database structure is organized into physical files
optimized for speed. The logical data model, with
objects such as data tables, views, rows, and columns,
offers a flexible programming environment. You set up
rules governing the relationships between different
data fields, such as one to one, one to many, unique,
required, or optional, and “pointers” between different
tables. The database enforces these rules so that with
a well-designed database your application never sees
data that’s inconsistent, duplicated, orphaned, out of
date, or missing.
The “SQL” part of “MySQL” stands for “Structured
Query Language.” SQL is the most common
standardized language used to access databases.
Depending on your programming environment, you
might enter SQL directly (for example, to generate
reports), embed SQL statements into code written in
another language, or use a language-specific API that
hides the SQL syntax.
ABOUT MATPLOTLIB
9
DETAILS OF FEATURES OF THE
PROJECT
10
PROJECT SPECIFICATIONS
Python Module(s) used in the project –
1. Pandas
2. MySql.connector
3.Matplotlib
2.item_details
3.employee_details
11
4.sales
12
PROJECT CODE
import pandas as pd
import matplotlib.pyplot as plt
import mysql.connector as sql
def admin():
print(""" *********************************************************
* *
* Welcome to LAZEEZ RESTAURANT management system") *
* *
*********************************************************""")
user_id=input('Enter user Id:')
user_password=input('Enter user password:')
if user_id=='jinti' and user_password=='kalita':
print()
lop()
else:
print('Enter correct userid or password')
print()
a=int(input('Press 1 to try again or press 2 to exit:'))
if a==1:
admin()
print()
else:
print()
print('exit')
exit()
def lop():
print('choose any number to continue:')
print("""*********************************
*Press 1 customer details*
*********************************""")
print(" ")
print("""*********************************
*Press 2 item details*
*********************************""")
print(" ")
print("""*********************************
*Press 3 employee details*
*********************************""")
13
print(" ")
print("""*********************************
*Press 4 entry of items sold in a day*
*********************************""")
print(" ")
print("""*********************************
*Press 5 Visual representation of items sold in a day*
*********************************""")
print("""*********************************
*Press 6 Visual representation of stocks *
*********************************""")
print(" ")
choice=int(input('Enter your choice:'))
if choice==1:
customer()
elif choice==2:
item()
elif choice==3:
employee()
elif choice==4:
entry()
elif choice==5:
bar()
elif choice==6:
stock()
else:
exit()
def customer():
print('choose any number to continue:')
print("""*********************************
*Press 1 add new customer detail*
*********************************""")
print(" ")
print("""*********************************
*Press 2 delete customer detail*
*********************************""")
print(" ")
print("""*********************************
*Press 3 see all customer detail*
*********************************""")
print(" ")
print("""*********************************
*Press 4 see one customer detail*
*********************************""")
print(" ")
print("""*********************************
*Press 5 update customer detail*
*********************************""")
print(" ")
14
choice=int(input('Enter your choice:'))
#TO ADD CUSTOMER DEATAILS
if choice==1:
cust_name=input('Enter customer name:')
identity_no=int(input('Enter identity_no:'))
cust_phonenumber=int(input('Enter phone number:'))
cust_address=input('Enter customer address:')
sql_insert="insert into customer_details values(' "+cust_name+" '," +str(identity_no )+",
"+str(cust_phonenumber)+" ,' "+cust_address+ " ');"
c.execute(sql_insert)
conn.commit()
print('Data is updated')
m()
#TO DELETE CUSTOMER DETAILS
elif choice==2:
identity_no=int(input('Enter identity_no:'))
c.execute("delete from customer_details where identity_no=" +str(identity_no)+" ")
print('Data updated successfully')
m()
#TO SELECT ALL CUSTOMER DETAILS
elif choice==3:
c.execute("select * from customer_details;")
record=c.fetchall()
if record == []:
print('No data')
else:
for i in record:
print('name',i[0])
print('number',i[1])
print('address',i[2])
m()
#TO SELECT ONE CUSTOMER DETAILS
elif choice==4:
identity_no=int(input('Enter identity_no:'))
c.execute("select * from customer_details where identity_no= "+str(identity_no)+" ")
v=c.fetchall()
if v== []:
print('No data')
else:
for i in v:
print(i)
m()
#TO UPDATE CUSTOMER DETAILS
elif choice==5:
print("press 1 to update customer name")
print(" ")
print("press 2 to update customer phone number")
print(" ")
print("press 3 to update customer address")
print(" ")
ch1=int(input("Enter your choice:"))
15
if ch1==1:
identity=int(input("Enter customer identity:"))
name=str(input("Enter new name:"))
c.execute("update customer_details set cust_name='"+name+"' where
identity_no="+str(identity)+" ")
conn.commit()
print("*Name has been updated*")
c.execute("select * from customer_details")
for i in c:
print(i)
m()
if ch1==2:
identity=int(input("Enter customer identity:"))
p=int(input("Enter new phonenumber:"))
c.execute("update customer_details set cust_phonenumber='"+p+"' where
identity_no="+str(identity)+" ")
conn.commit()
print("*Phone number has been updated*")
c.execute("select * from customer_details")
for i in c:
print(i)
m()
if ch1==3:
identity=int(input("Enter customer identity:"))
address=str(input("Enter new address:"))
c.execute("update customer_details set cust_address='"+address+"' where
identity_no="+str(identity)+" ")
conn.commit()
print("*Address has been updated*")
c.execute("select * from customer_details")
for i in c:
print(i)
m()
#ITEM DETAILS
def item():
print('choose any number to continue:')
print("""*********************************
*Press 1 add new item detail*
*********************************""")
print(" ")
print("""*********************************
*Press 2 delete item detail*
*********************************""")
print(" ")
print("""*********************************
*Press 3 see all item detail*
*********************************""")
print(" ")
print("""*********************************
16
*Press 4 see one item detail*
*********************************""")
print(" ")
print("""*********************************
*Press 5 update item detail*
*********************************""")
print(" ")
choice=int(input('Enter your choice:'))
#TO ADD ITEM DETAILS
if choice==1:
item_name=input('Enter item name:')
item_price=int(input('Enter item price:'))
sql_insert="insert into item_details values(' "+item_name+" ' ," +str(item_price) +");"
c.execute(sql_insert)
conn.commit()
print('Data is updated')
m()
#TO DELETE ITEM DETAILS
elif choice==2:
a=input('Enter item name:')
c.execute("delete from item_details where item_name=' " +a+" ' ")
conn.commit()
print('Data updated successfully')
m()
#TO SELECT ALL ITEM DETAILS
elif choice==3:
c.execute("select * from item_details;")
record=c.fetchall()
if record == []:
print('No data')
else:
for i in record:
print('item',i[0])
print('price',i[1])
m()
# TO SELECT ONE ITEM DETAIL
elif choice==4:
a=input('Enter item name:')
c.execute("select * from item_details where item_name=' " +a+" ' ")
v=c.fetchall()
if v == []:
print('No data')
else:
for i in v:
print(i)
m()
17
c.execute("update item_details set item_price="+str(p)+" where item_name = ' "+a+" ' ")
conn.commit()
print("*Item price has been updated*")
c.execute("select * from item_details")
for i in c:
print(i)
m()
def employee():
print("""*********************************
*Press 1 add staff detail*
*********************************""")
print(" ")
print("""*********************************
*Press 2 delete staff detail*
*********************************""")
print(" ")
print("""*********************************
*Press 3 see all employee detail*
*********************************""")
print(" ")
print("""*********************************
*Press 4 see one employee detail*
*********************************""")
print(" ")
print("""*********************************
*Press 5 update employee detail*
*********************************""")
print(" ")
choice=int(input('Enter your choice'))
if choice==1:
print("Asked information is mandatory to be filled")
name = str(input("Enter the name of employee:"))
surname = str(input("Enter the surname of employee:"))
identity = str(input("Enter a 4 digit number which has not been used before:"))
dob = str(input("Enter date of birth of employee in yyyy-mm-dd:"))
post = str(input("Enter the post which the employee applied
for(chef,waiter,executive,management staff,cleaner, security personal,delevary boy):"))
salary = str(input("Enter the salary to be given to the employee:"))
c.execute("insert into employee_details
values('"+name+"','"+surname+"','"+identity+"','"+dob+"','"+post+"','"+salary+"')")
conn.commit()
print("Employee details has been successfully added")
m()
elif choice==2:
a=int(input('Enter employee identity_no :'))
c.execute("delete from employee _details where identity_no =' " +a+" ' ")
print('Data updated successfully')
m()
elif choice==3:
18
print("""_____________________________________
Enter 1 to view details of all chefs
_____________________________________""")
print("""_____________________________________
Enter 2 to view details of all waiters
_____________________________________""")
print("""_____________________________________
Enter 3 to view details of all executives
_____________________________________""")
print("""_____________________________________
Enter 4 to view details of all management staff
_____________________________________""")
print("""_____________________________________
Enter 5 to view details of all cleaners
_____________________________________""")
print("""_____________________________________
Enter 6 to view details of all security personal
_____________________________________""")
print("""_____________________________________
Enter 7 to view details of all delevery boys
_____________________________________""")
print("""_____________________________________
Enter 8 to view details of all employees
_____________________________________""")
ch = int(input("Enter your choice:"))
if ch==1:
c.execute("select* from employee_details where post='chef'")
for i in c:
print(i)
m()
if ch==2:
c.execute("select* from employee_details where post='waiter'")
for i in c:
print(i)
m()
if ch==3:
c.execute("select* from employee_details where post='executive'")
for i in c:
print(i)
m()
if ch==4:
c.execute("select* from employee_details where post='management'")
for i in c:
print(i)
m()
if ch==5:
c.execute("select* from employee_details where post='cleaner'")
for i in c:
print(i)
m()
if ch==6:
19
c.execute("select* from employee_details where post='security'")
for i in c:
print(i)
m()
if ch==7:
c.execute("select* from employee_details where post='delevery'")
for i in c:
print(i)
m()
if ch==8:
c.execute('select * from employee_details')
record=c.fetchall()
if record == []:
print('No data')
else:
for i in record:
print(i)
m()
elif choice==4:
a=int(input('Enter employee identity_no :'))
c.execute("select * from employee_details where identity_no =" +str(a)+" ")
v=c.fetchall()
conn.commit()
if v == []:
print('No data')
else:
for i in v:
print(i)
m()
elif choice==5:
print("press 1 to update employee name")
print(" ")
print("press 2 to update surname")
print(" ")
print("press 3 to update dob")
print(" ")
print("press 4 to update post")
print(" ")
print("press 5 to update salary")
print(" ")
ch1=int(input("Enter your choice:"))
if ch1==1:
identity=int(input("Enter identity:"))
name=str(input("Enter new name:"))
c.execute("update employee_details set name='"+name+"' where
identity_no="+str(identity)+" ")
conn.commit()
print("*Name has been updated*")
c.execute("select * from employee_details")
for i in c:
20
print(i)
m()
21
c.execute("select * from employee_details")
for i in c:
print(i)
m()
def entry():
date=str( input("Enter date in yyyy-mm-dd:"))
item=input('Enter item name')
sold=int(input('Enter quantity sold'))
c.execute("insert into sales values(' "+date+" ',' " +item+" ',"+str(sold)+")")
conn.commit()
m()
#BARGRAPH
def bar():
date=str( input("Enter date in yyyy-mm-dd:"))
c.execute("select item from sales where date_of_entry =' "+date+" ' ")
r=c.fetchall()
name=[]
for i in r:
name.append(i[0])
c.execute("select sales from sales where date_of_entry =' "+date+" ' ")
re=c.fetchall()
sales=[]
for i in re:
sales.append(i[0])
plt.bar(name,sales,color='m')
plt.title('ITEMS SOLD IN A DAY')
plt.xlabel('NAME OF ITEMS')
plt.ylabel('QUANTITY')
plt.show()
m()
def stock():
t=pd.read_csv('C:\\Users\lenovo\AppData\Local\Programs\Python\Python310\sale.csv')
df=pd.DataFrame(t)
items=df['item']
quantity=df['quantity']
plt.bar(items,quantity,color='m')
plt.title('STOCKS AVAILABLE')
plt.xlabel('NAME OF ITEMS')
plt.ylabel('PIECE/PLATE WISE STOCKS')
plt.show()
m()
def m():
22
print('Press 1 to return to the customer menu')
print('Press 2 to return to the item menu')
print('Press 3 to return to the employee menu')
print('Press 4 to return to the main menu')
print('Press 5 to exit')
conn=sql.connect(host='localhost',user='root',passwd='root')
c=conn.cursor()
if conn.is_connected():
print()
print('connected successfully')
c.execute('create database if not exists ip;')
c.execute('use ip;')
c.execute("create table if not exists customer_details (cust_name varchar(20),identity_no
varchar(6) primary key,cust_phonenumber varchar(10),cust_address varchar(20));")
c.execute("create table if not exists item_details(item_name varchar(20),item_price
int(10));")
c.execute("create table if not exists employee_details(name varchar(30),surname
varchar(30),identity_no char(4) primary key,dob date,post varchar(10),salary varchar(10))")
c.execute("create table if not exists sales(date_of_entry date,item varchar(20),sales
int(4))")
conn.commit()
admin()
23
OUTPUT
Main menu
24
customer menu
25
Delete customer detail
26
See one customer detail
Update name
27
Update phonenumber
28
Update address
Item menu
29
Add item
Delete item
30
See all item details
31
Update item detail
Employee menu
32
Add employee detail
33
See all employee detail
34
Update employee detail
35
Update dob
Update post
36
Update salary
37
Visual representation of item sold in a day
38
39
CONCLUSION
40
BIBLIOGRAPHY
Websites:
1.https://www.w3schools.com/python/python_intro.asp
2.https://www.geeksforgeeks.org/python-programming-language/
3.https://www.w3resource.com/python/python-tutorial.php
4.https://stackoverflow.blog/2021/07/14/getting-started-with-python/
5.https://www.python.org/about/gettingstarted/
6.https://www.learnpython.org/
Books:
www.cbseportal.com
www.cbseportal.com
41
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
42