Restaurant Management Coding
Restaurant Management Coding
Restaurant Management Coding
password=''
def login():
global password
print('='*15+'welcome to login'+'='*15)
password=input('enter password:')
login()
try:
mycon=con.connect(host='127.0.0.1',
user='root',passwd=password)
cursor=mycon.cursor()
except:
print('='*15+'invalid password'+'='*15,'\n')
login()
mycon=con.connect(host='127.0.0.1',
user='root',passwd=password)
cursor=mycon.cursor()
def create():
cursor.execute("use resturant_managment")
mycon.commit()
def menu():
print('='*15+'main menu'+'='*15)
print('1.staff details')
print('2.inventory details')
print('3.bill details')
print('4.exit')
if menu_input==1:
staff()
elif menu_input==2:
inventory()
elif menu_input==3:
bill()
elif menu_input==4:
exitt()
else:
menu()
def staff():
print('='*15+'staff menu'+'='*15)
print('5.bacK to menu')
if staff_input==1:
add_staff()
elif staff_input==2:
update_staff()
elif staff_input==3:
remove_staff()
elif staff_input==4:
show_staff()
else:
menu()
def add_staff():
dic=['n','n','no','no','no']
ans=''
cursor=mycon.cursor()
mycon.commit()
staff()
def update_staff():
print('1.update name')
print('2.update contact')
print('3.update age')
print('4.update post')
print('5.update salary')
print('bacK')
if update_input==1:
update_staff_name()
elif update_input==2:
update_staff_contact()
elif update_input==3:
update_staff_age()
elif update_input==4:
update_staff_post()
elif update_input==5:
update_staff_salary()
else:
staff()
def update_staff_name():
mycon.commit()
update_staff()
def update_staff_contact():
mycon.commit()
update_staff()
def update_staff_age():
mycon.commit()
update_staff()
def update_staff_post():
mycon.commit()
update_staff()
def update_staff_salary():
mycon.commit()
update_staff()
def remove_staff():
cursor=mycon.cursor()
mycon.commit()
staff()
def show_staff():
detail=cursor.fetchall()
print(row)
staff()
def inventory():
print('='*15+'inventory menu'+'='*15)
print('1.add item')
print('2.update item')
print('3.remove item')
print('4.show item')
print('bacK to menu')
if inventory_input==1:
add_item()
elif inventory_input==2:
update_item()
elif inventory_input==3:
remove_item()
elif inventory_input==4:
show_item()
else:
menu()
def add_item():
dic=['n','n','no','no','no']
ans=''
cursor=mycon.cursor()
mycon.commit()
inventory()
def update_item():
print('1.update name')
print('2.update quantity')
print('3.update rate')
print('bacK')
if update_input==1:
update_item_name()
elif update_input==2:
update_item_quantity()
elif update_input==3:
update_input_rate()
else:
inventory()
def update_item_name():
mycon.commit()
update_item()
def update_item_quantity():
mycon.commit()
update_item()
def update_staff_age():
mycon.commit()
update_item()
def remove_item():
cursor=mycon.cursor()
mycon.commit()
inventory()
def show_item():
detail=cursor.fetchall()
print(row)
inventory()
def bill():
print('='*15+'bill menu'+'='*15)
print('1.add bill')
print('2.remove bill')
print('3.show bill')
print('bacK to menu')
if bill_input==1:
add_bill()
elif bill_input==2:
remove_bill()
elif bill_input==3:
show_bill()
else:
bill()
def add_bill():
dic=['n','n','no','no','no']
ans=''
cursor=mycon.cursor()
mycon.commit()
bill()
def remove_bill():
cursor=mycon.cursor()
cursor.execute("delete from bill where
bill_no={}".format(remove_input))
mycon.commit()
bill()
def show_bill():
detail=cursor.fetchall()
print(row)
bill()
def exitt():
print('='*15+'exit'+'='*15)
sys.exit(0)
if __name__=='__main__':
create()
menu()