from tkinter import *
import random
import time;
root=Tk()
root.geometry("1600x800+0+0")
root.title("Restaurant Management System")
text_Input=StringVar()
operator=" "
tops=Frame(root,width=1600,height=50,relief=SUNKEN)
tops.pack(side=TOP)
f1=Frame(root,width=800,height=700,relief=SUNKEN)
f1.pack(side=LEFT)
f2=Frame(root,width=300,height=700,relief=SUNKEN)
f2.pack(side=RIGHT)
#==============Time==========================
localtime=time.asctime(time.localtime(time.time()))
#==============INFORMATION=====================
lblinfo=Label(tops,font=('arial',50,'bold'),text="Siva Krishna Restaurant",fg="Steel Blue",bd=10,anchor='w')
lblinfo.grid(row=0,column=0)
lblinfo=Label(tops,font=('arial',20,'bold'),text=localtime,fg="Steel Blue",bd=10,anchor='w')
lblinfo.grid(row=1,column=0)
#=================calculator=======================
def buttonClick(numbers):
global operator
operator=operator + str(numbers)
text_Input.set(operator)
def buttonClearDisplay():
global operator
operator=""
text_Input.set("")
def buttonEqualClick():
global operator
res=str(eval(operator))
text_Input.set(res)
operator=""
def Ref():
x=random.randint(10908,500876)
randomRef=str(x)
rand.set(randomRef)
cof=float(Fries.get())
cod=float(Drinks.get())
cob=float(Burger.get())
cofi=float(Filet.get())
cocb=float(Chicken_Burger.get())
cocheeseb=float(Cheese_Burger.get())
costoffries=cof*0.99
costofdrinks=cod*1.00
costoffilet=cofi*2.99
costofburger=cob*2.87
costofchickenburger=cocb*2.89
costofcheeseburger=cocheeseb*2.69
cost="Rs",str('%.2f' %(costoffries + costofdrinks + costoffilet + costofburger + costofchickenburger + costofcheeseburger))
paytax=((costoffries + costofdrinks + costoffilet + costofburger + costofchickenburger + costofcheeseburger)*0.2)
subtotal=(costoffries + costofdrinks + costoffilet + costofburger + costofchickenburger + costofcheeseburger)
ser_charge=((costoffries + costofdrinks + costoffilet + costofburger + costofchickenburger + costofcheeseburger)/99)
service_charge="Rs",str('%.2f' %ser_charge)
total="Rs",str('%.2f' %(paytax + ser_charge + subtotal))
paidtax="Rs",str('%.2f' %paytax)
Service_Charge.set(service_charge)
Cost.set(cost)
Tax.set(paidtax)
SubTotal.set(subtotal)
Total.set(total)
def Exit():
root.destroy()
def Reset():
rand.set(" ")
Fries.set(" ")
Burger.set(" ")
Filet.set(" ")
Drinks.set(" ")
Chicken_Burger.set(" ")
Cheese_Burger.set(" ")
Cost.set(" ")
Tax.set(" ")
Service_Charge.set(" ")
SubTotal.set(" ")
Total.set(" ")
txtDisplay=Entry(f2,font=('arial',20,'bold'),textvariable=text_Input,bd=30,insertwidth=4,bg="powder blue",justify='right')
txtDisplay.grid(columnspan=4)
btn7=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="7",bg="powder blue",command=lambda:buttonClick(7)).grid(row=2,column=0)
btn8=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="8",bg="powder blue",command=lambda:buttonClick(8)).grid(row=2,column=1)
btn9=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="9",bg="powder blue",command=lambda:buttonClick(9)).grid(row=2,column=2)
addition=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="+",bg="powder blue",command=lambda:buttonClick("+")).grid(row=2,column=3)
btn4=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="4",bg="powder blue",command=lambda:buttonClick(4)).grid(row=3,column=0)
btn5=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="5",bg="powder blue",command=lambda:buttonClick(5)).grid(row=3,column=1)
btn6=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="6",bg="powder blue",command=lambda:buttonClick(6)).grid(row=3,column=2)
subtraction=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="-",bg="powder blue",command=lambda:buttonClick("-")).grid(row=3,column=3)
btn1=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="1",bg="powder blue",command=lambda:buttonClick(1)).grid(row=4,column=0)
btn2=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="2",bg="powder blue",command=lambda:buttonClick(2)).grid(row=4,column=1)
btn3=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="3",bg="powder blue",command=lambda:buttonClick(3)).grid(row=4,column=2)
multiplication=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="*",bg="powder blue",command=lambda:buttonClick("*")).grid(row=4,column=3)
btnClear=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="c",bg="powder blue",command=buttonClearDisplay).grid(row=5,column=0)
btn0=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="0",bg="powder blue",command=lambda:buttonClick(0)).grid(row=5,column=1)
btnEqual=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="=",bg="powder blue",command=buttonEqualClick).grid(row=5,column=2)
divison=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="/",bg="powder blue",command=lambda:buttonClick("/")).grid(row=5,column=3)
#==================================RESTAURANT MENU================================================
rand=StringVar()
Fries=StringVar()
Burger=StringVar()
Filet=StringVar()
Drinks=StringVar()
Chicken_Burger=StringVar()
Cheese_Burger=StringVar()
Cost=StringVar()
Tax=StringVar()
Service_Charge=StringVar()
SubTotal=StringVar()
Total=StringVar()
lblReference=Label(f1,font=('arial',16,'bold'),text="Reference",bd=16,anchor='w')
lblReference.grid(row=0,column=0)
txtReference=Entry(f1,font=('arial',16,'bold'),textvariable=rand,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtReference.grid(row=0,column=1)
lblFries=Label(f1,font=('arial',16,'bold'),text="Fries",bd=16,anchor='w')
lblFries.grid(row=1,column=0)
txtFries=Entry(f1,font=('arial',16,'bold'),textvariable=Fries,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtFries.grid(row=1,column=1)
lblBurger=Label(f1,font=('arial',16,'bold'),text="Burger",bd=16,anchor='w')
lblBurger.grid(row=2,column=0)
txtBurger=Entry(f1,font=('arial',16,'bold'),textvariable=Burger,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtBurger.grid(row=2,column=1)
lblFilet=Label(f1,font=('arial',16,'bold'),text="Filet",bd=16,anchor='w')
lblFilet.grid(row=3,column=0)
txtFilet=Entry(f1,font=('arial',16,'bold'),textvariable=Filet,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtFilet.grid(row=3,column=1)
lblDrinks=Label(f1,font=('arial',16,'bold'),text="Drinks",bd=16,anchor='w')
lblDrinks.grid(row=4,column=0)
txtDrinks=Entry(f1,font=('arial',16,'bold'),textvariable=Drinks,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtDrinks.grid(row=4,column=1)
lblChicken_Burger=Label(f1,font=('arial',16,'bold'),text="Chicken_Burger",bd=16,anchor='w')
lblChicken_Burger.grid(row=5,column=0)
txtChicken_Burger=Entry(f1,font=('arial',16,'bold'),textvariable=Chicken_Burger,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtChicken_Burger.grid(row=5,column=1)
lblCheese_Burger=Label(f1,font=('arial',16,'bold'),text="Cheese_Burger",bd=16,anchor='w')
lblCheese_Burger.grid(row=6,column=0)
txtCheese_Burger=Entry(f1,font=('arial',16,'bold'),textvariable=Cheese_Burger,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtCheese_Burger.grid(row=6,column=1)
lblCost=Label(f1,font=('arial',16,'bold'),text="Cost",bd=16,anchor='w')
lblCost.grid(row=2,column=2)
txtCost=Entry(f1,font=('arial',16,'bold'),textvariable=Cost,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtCost.grid(row=2,column=3)
lblTax=Label(f1,font=('arial',16,'bold'),text="Tax",bd=16,anchor='w')
lblTax.grid(row=3,column=2)
txtTax=Entry(f1,font=('arial',16,'bold'),textvariable=Tax,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtTax.grid(row=3,column=3)
lblService_Charge=Label(f1,font=('arial',16,'bold'),text="Service_Charge",bd=16,anchor='w')
lblService_Charge.grid(row=4,column=2)
txtService_Charge=Entry(f1,font=('arial',16,'bold'),textvariable=Service_Charge,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtService_Charge.grid(row=4,column=3)
lblSubTotal=Label(f1,font=('arial',16,'bold'),text="SubTotal",bd=16,anchor='w')
lblSubTotal.grid(row=5,column=2)
txtSubTotal=Entry(f1,font=('arial',16,'bold'),textvariable=SubTotal,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtSubTotal.grid(row=5,column=3)
lblTotal=Label(f1,font=('arial',16,'bold'),text="Total",bd=16,anchor='w')
lblTotal.grid(row=6,column=2)
txtTotal=Entry(f1,font=('arial',16,'bold'),textvariable=Total,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtTotal.grid(row=6,column=3)
#==============Buttons========================
btnTotal=Button(f1,padx=16,pady=8,bd=16,fg="black",font=('arial',16,'bold'),width=10,text="Total",bg="powder blue",command=Ref).grid(row=7,column=1)
btnReset=Button(f1,padx=16,pady=8,bd=16,fg="black",font=('arial',16,'bold'),width=10,text="Reset",bg="powder blue",command=Reset).grid(row=7,column=2)
btnExit=Button(f1,padx=16,pady=8,bd=16,fg="black",font=('arial',16,'bold'),width=10,text="Exit",bg="powder blue",command=Exit).grid(row=7,column=3)
root.mainloop()
import random
import time;
root=Tk()
root.geometry("1600x800+0+0")
root.title("Restaurant Management System")
text_Input=StringVar()
operator=" "
tops=Frame(root,width=1600,height=50,relief=SUNKEN)
tops.pack(side=TOP)
f1=Frame(root,width=800,height=700,relief=SUNKEN)
f1.pack(side=LEFT)
f2=Frame(root,width=300,height=700,relief=SUNKEN)
f2.pack(side=RIGHT)
#==============Time==========================
localtime=time.asctime(time.localtime(time.time()))
#==============INFORMATION=====================
lblinfo=Label(tops,font=('arial',50,'bold'),text="Siva Krishna Restaurant",fg="Steel Blue",bd=10,anchor='w')
lblinfo.grid(row=0,column=0)
lblinfo=Label(tops,font=('arial',20,'bold'),text=localtime,fg="Steel Blue",bd=10,anchor='w')
lblinfo.grid(row=1,column=0)
#=================calculator=======================
def buttonClick(numbers):
global operator
operator=operator + str(numbers)
text_Input.set(operator)
def buttonClearDisplay():
global operator
operator=""
text_Input.set("")
def buttonEqualClick():
global operator
res=str(eval(operator))
text_Input.set(res)
operator=""
def Ref():
x=random.randint(10908,500876)
randomRef=str(x)
rand.set(randomRef)
cof=float(Fries.get())
cod=float(Drinks.get())
cob=float(Burger.get())
cofi=float(Filet.get())
cocb=float(Chicken_Burger.get())
cocheeseb=float(Cheese_Burger.get())
costoffries=cof*0.99
costofdrinks=cod*1.00
costoffilet=cofi*2.99
costofburger=cob*2.87
costofchickenburger=cocb*2.89
costofcheeseburger=cocheeseb*2.69
cost="Rs",str('%.2f' %(costoffries + costofdrinks + costoffilet + costofburger + costofchickenburger + costofcheeseburger))
paytax=((costoffries + costofdrinks + costoffilet + costofburger + costofchickenburger + costofcheeseburger)*0.2)
subtotal=(costoffries + costofdrinks + costoffilet + costofburger + costofchickenburger + costofcheeseburger)
ser_charge=((costoffries + costofdrinks + costoffilet + costofburger + costofchickenburger + costofcheeseburger)/99)
service_charge="Rs",str('%.2f' %ser_charge)
total="Rs",str('%.2f' %(paytax + ser_charge + subtotal))
paidtax="Rs",str('%.2f' %paytax)
Service_Charge.set(service_charge)
Cost.set(cost)
Tax.set(paidtax)
SubTotal.set(subtotal)
Total.set(total)
def Exit():
root.destroy()
def Reset():
rand.set(" ")
Fries.set(" ")
Burger.set(" ")
Filet.set(" ")
Drinks.set(" ")
Chicken_Burger.set(" ")
Cheese_Burger.set(" ")
Cost.set(" ")
Tax.set(" ")
Service_Charge.set(" ")
SubTotal.set(" ")
Total.set(" ")
txtDisplay=Entry(f2,font=('arial',20,'bold'),textvariable=text_Input,bd=30,insertwidth=4,bg="powder blue",justify='right')
txtDisplay.grid(columnspan=4)
btn7=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="7",bg="powder blue",command=lambda:buttonClick(7)).grid(row=2,column=0)
btn8=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="8",bg="powder blue",command=lambda:buttonClick(8)).grid(row=2,column=1)
btn9=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="9",bg="powder blue",command=lambda:buttonClick(9)).grid(row=2,column=2)
addition=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="+",bg="powder blue",command=lambda:buttonClick("+")).grid(row=2,column=3)
btn4=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="4",bg="powder blue",command=lambda:buttonClick(4)).grid(row=3,column=0)
btn5=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="5",bg="powder blue",command=lambda:buttonClick(5)).grid(row=3,column=1)
btn6=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="6",bg="powder blue",command=lambda:buttonClick(6)).grid(row=3,column=2)
subtraction=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="-",bg="powder blue",command=lambda:buttonClick("-")).grid(row=3,column=3)
btn1=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="1",bg="powder blue",command=lambda:buttonClick(1)).grid(row=4,column=0)
btn2=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="2",bg="powder blue",command=lambda:buttonClick(2)).grid(row=4,column=1)
btn3=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="3",bg="powder blue",command=lambda:buttonClick(3)).grid(row=4,column=2)
multiplication=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="*",bg="powder blue",command=lambda:buttonClick("*")).grid(row=4,column=3)
btnClear=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="c",bg="powder blue",command=buttonClearDisplay).grid(row=5,column=0)
btn0=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="0",bg="powder blue",command=lambda:buttonClick(0)).grid(row=5,column=1)
btnEqual=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="=",bg="powder blue",command=buttonEqualClick).grid(row=5,column=2)
divison=Button(f2,padx=16,pady=16,bd=8,fg="black",font=('arial',20,'bold'),text="/",bg="powder blue",command=lambda:buttonClick("/")).grid(row=5,column=3)
#==================================RESTAURANT MENU================================================
rand=StringVar()
Fries=StringVar()
Burger=StringVar()
Filet=StringVar()
Drinks=StringVar()
Chicken_Burger=StringVar()
Cheese_Burger=StringVar()
Cost=StringVar()
Tax=StringVar()
Service_Charge=StringVar()
SubTotal=StringVar()
Total=StringVar()
lblReference=Label(f1,font=('arial',16,'bold'),text="Reference",bd=16,anchor='w')
lblReference.grid(row=0,column=0)
txtReference=Entry(f1,font=('arial',16,'bold'),textvariable=rand,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtReference.grid(row=0,column=1)
lblFries=Label(f1,font=('arial',16,'bold'),text="Fries",bd=16,anchor='w')
lblFries.grid(row=1,column=0)
txtFries=Entry(f1,font=('arial',16,'bold'),textvariable=Fries,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtFries.grid(row=1,column=1)
lblBurger=Label(f1,font=('arial',16,'bold'),text="Burger",bd=16,anchor='w')
lblBurger.grid(row=2,column=0)
txtBurger=Entry(f1,font=('arial',16,'bold'),textvariable=Burger,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtBurger.grid(row=2,column=1)
lblFilet=Label(f1,font=('arial',16,'bold'),text="Filet",bd=16,anchor='w')
lblFilet.grid(row=3,column=0)
txtFilet=Entry(f1,font=('arial',16,'bold'),textvariable=Filet,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtFilet.grid(row=3,column=1)
lblDrinks=Label(f1,font=('arial',16,'bold'),text="Drinks",bd=16,anchor='w')
lblDrinks.grid(row=4,column=0)
txtDrinks=Entry(f1,font=('arial',16,'bold'),textvariable=Drinks,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtDrinks.grid(row=4,column=1)
lblChicken_Burger=Label(f1,font=('arial',16,'bold'),text="Chicken_Burger",bd=16,anchor='w')
lblChicken_Burger.grid(row=5,column=0)
txtChicken_Burger=Entry(f1,font=('arial',16,'bold'),textvariable=Chicken_Burger,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtChicken_Burger.grid(row=5,column=1)
lblCheese_Burger=Label(f1,font=('arial',16,'bold'),text="Cheese_Burger",bd=16,anchor='w')
lblCheese_Burger.grid(row=6,column=0)
txtCheese_Burger=Entry(f1,font=('arial',16,'bold'),textvariable=Cheese_Burger,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtCheese_Burger.grid(row=6,column=1)
lblCost=Label(f1,font=('arial',16,'bold'),text="Cost",bd=16,anchor='w')
lblCost.grid(row=2,column=2)
txtCost=Entry(f1,font=('arial',16,'bold'),textvariable=Cost,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtCost.grid(row=2,column=3)
lblTax=Label(f1,font=('arial',16,'bold'),text="Tax",bd=16,anchor='w')
lblTax.grid(row=3,column=2)
txtTax=Entry(f1,font=('arial',16,'bold'),textvariable=Tax,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtTax.grid(row=3,column=3)
lblService_Charge=Label(f1,font=('arial',16,'bold'),text="Service_Charge",bd=16,anchor='w')
lblService_Charge.grid(row=4,column=2)
txtService_Charge=Entry(f1,font=('arial',16,'bold'),textvariable=Service_Charge,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtService_Charge.grid(row=4,column=3)
lblSubTotal=Label(f1,font=('arial',16,'bold'),text="SubTotal",bd=16,anchor='w')
lblSubTotal.grid(row=5,column=2)
txtSubTotal=Entry(f1,font=('arial',16,'bold'),textvariable=SubTotal,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtSubTotal.grid(row=5,column=3)
lblTotal=Label(f1,font=('arial',16,'bold'),text="Total",bd=16,anchor='w')
lblTotal.grid(row=6,column=2)
txtTotal=Entry(f1,font=('arial',16,'bold'),textvariable=Total,bd=10,insertwidth=4,bg="powder blue",justify="right")
txtTotal.grid(row=6,column=3)
#==============Buttons========================
btnTotal=Button(f1,padx=16,pady=8,bd=16,fg="black",font=('arial',16,'bold'),width=10,text="Total",bg="powder blue",command=Ref).grid(row=7,column=1)
btnReset=Button(f1,padx=16,pady=8,bd=16,fg="black",font=('arial',16,'bold'),width=10,text="Reset",bg="powder blue",command=Reset).grid(row=7,column=2)
btnExit=Button(f1,padx=16,pady=8,bd=16,fg="black",font=('arial',16,'bold'),width=10,text="Exit",bg="powder blue",command=Exit).grid(row=7,column=3)
root.mainloop()
No comments:
Post a Comment