Bakery Management System
Bakery Management System
Bakery Management System
import mysql.connector
con=mysql.connector.connect(host='localhost', user='root',password='12345')
cur=con.cursor()
cur.execute("use items")
sql="select*from cs"
cur.execute(sql)
res-cur.fetchall()
if res==[]:
con.commit()
cur.execute("create table if not exists worker(Sno int, Name varchar(20), Salary int)")
sql="select*from worker"
cur.execute(sql)
res=cur.fetchall()
if res==[]:
con.commit()
ch=' '
print("\n\nPLEASE CHOOSE \n1 FOR ADMIN \n2 FOR COSTUMER\n3 for EXIT:\n")
if choice==3:
break
if choice==1:
admin=input("USERNAME:")
password=int(input("ENTER PASSWORD:"))
if password==1234:
print('__________________________________________’)
if c==1:
def add():
sno=int(input("Enter sno:"))
d1=(sno.product1.cost)
cur.execute(s1,d1)
con.commit()
print('…………………………………………………………………….’)
add()
elif c==2:
def items():
sql="select*from cs"
cur.execute(sql)
res-cur.fetchall()
t=(['serial_no','products','cost'])
print(serial_no,":","\t",products,":\t\t",'cost',cost)
items()
elif c==3:
def money():
con.commit()
sq="select*from cs"
cur.execute(sq)
res=cur.fetchall()
t=(['sno','products', 'cost'])
print(sno,":","\t",products,":","\t",'Cost',cost)
money()
elif c==4:
der variety():
sno=input("Enter sno:")
varieties=input("Enter variety:")
d2=(sno,varieties)
cur.execute(s2,d2)
con.commit()
variety()
elif c==5:
def ad():
sno=int(input("Enter sno:"))
emp=input("Enter name:")
dx=(sno,emp,salary)
cur.execute(sy,dx)
con.commit()
print('………………………………………………………………………………………..’)
ad()
elif c==6:
der workers():
sql="select*from worker"
cur.execute(sql)
res=cur.fetchall()
t=(['serial_no','name','salary'])
print(serial_no,":","\t",name,":","\t",'cost', salary)
workers()
elif c==7:
def up():
print("Choose 2 to decrease:")
if sig==1:
con.commit()
sq="select*from worker"
cur.execute(sq)
res=cur.fetchall()
t=(['sno','name','salary'])
print(sno,":","\t",name,":","\t",salary)
if sig==2:
con.commit()
sq="select*from worker"
cur.execute(sq)
res=cur.fetchall()
t=(['sno','name','salary'])
print(sno,":","\t",name,":","\t", salary)
up()
else:
elif choice==2:
if c==1:
def items():
sql="select*from cs"
cur.execute(sql)
res-cur.fetchall()
t=(['serial_no','products','cost'])
print(serial_no,":","\t",products,":","\t",'cost', cost)
items()
elif c==2:
sql="select*from cs"
cur.execute(sql)
res=cur.fetchall()
t=(['serial_no','products','cost'])
print(serial_no,":","\t",products,":","\t",'cost',cost)
cur.execute(sql)
res=cur.fetchall()
print(res)
1=[]
for i in range(len(res)):
l.append(res[i][0])
print(1)
if d==1:
def items():
kl="select*from vip"
cur.execute(kl)
srh-cur.fetchall()
f=(['sno', 'varieties'])
print(sno,".","\t\t", varieties)
ck=int(input("Enter choice:"))
if ck==1:
qty=int(input("Enter Qty."))
for i in cur:
c=i[2]
con.commit()
print("\n")
print("………………………………………………………………………………………………..”)
print("YOUR BILL")
print("………………………………………………………………………………………………….”)
print("Contact no.:",phone)
print("\t\t\t\t\t\t\t\t\t\tDate:",datetime.now())
if ck==2:
qty=int(input("Enter Qty."))
for i in cur:
L=i[2]
print("\n")
print(".....................................................................................................”)
print("YOUR BILL")
print("…………………………………………………………………………………………………….”)
print("Contact no.:",phone)
print("No. of cakes:",qty)
print("\t\t\t\t\t\t\t\t\t\tDate:",datetime.now())
if ck==3:
for i in cur:
N=i[2]
print("\n")
print(".....................................................................................................”)
print("YOUR BILL")
print("…………………………………………………………………………………………………….”)
print("Contact no.:",phone)
print("No. of cakes:",qty)
print("\t\t\t\t\t\t\t\t\t\tDate:",datetime.now())
if ck==4:
qty=int(input("Enter Qty."))
for i in cur:
M=i[2]
print("\n")
print(".....................................................................................................”)
print("YOUR BILL")
print("…………………………………………………………………………………………………….”)
print("Costumer's name:", name)
print("Contact no.:",phone)
print("No. of cakes:",qty)
print("\t\t\t\t\t\t\t\t\t\tDate:",datetime.now())
items()
elif d==2:
for i in cur:
c=i[2]
print("\n")
print("YOUR BILL")
print("…………………………………………………………………………..”)
print("Contact no.:",phone)
print("No. of pastry:",past)
print("\t\t\t\t\t\t\t\t\t\tDate:",datetime.now())
elif d==3:
for i in cur:
c=i[2]
print("Total amount=",mlk*c)
print("\n")
print("...............................................................................................”)
print("YOUR BILL")
print("…………………………………………………………………………………………..”)
print("Contact no.:",phone)
print("Quantity of milk:",mlk)
elif d==4:
for i in cur:
c=i[2]
print("Total amount:",but*c)
print("\n")
print("................................................................................................................”)
print("YOUR BILL")
print(“……………………………………………………………………………………………………………...”)
print("Contact no.:",phone)
print("Quantity of butter:",but)
print("Total amount:",but*c)
elif d==5:
for i in cur:
c=i[2]
print("Total amount:",chs*c)
print("\n")
print("...........................................................................................................”)
print("YOUR BILL")
print("…………………………………………………………………………………………………………”)
print("Contact no.:",phone)
print("Quantity of cheese:",chs)
for i in cur:
print("\n")
print("..............................................................................................................”)
print("YOUR BILL")
print("…………………………………………………………………………………………………………”)
print("Contact no.:",phone)
print("Quantity:",qty)
print("\t\t\t\t\t\t\t\t\t\tDate:",datetime.now())
else:
print("Wrong Input")
else:
print("\t\t\t\t\t\t\t*************************************Wrong Password”)
if ch=='n' or ch=="Y":
exit()