SHARE
TWEET

Untitled

a guest Nov 12th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import tkinter as tk
  2. from tkinter import ttk
  3. from tkinter import font
  4. from datetime import datetime,time
  5. from MenuItems import *
  6. import time
  7.  
  8.  
  9. # click and unclick for window and back
  10. def click(window):
  11.     window()
  12.  
  13. def unclick(window):
  14.     root.lift(window)
  15.     window.destroy()
  16.  
  17. root = tk.Tk()
  18. root.title("North Spine Canteen App")
  19. root.state("zoomed")
  20. background_image = tk.PhotoImage(file = "food.png")
  21. background_label = tk.Label(root, image = background_image)
  22. background_label.place(x = 0, y = 0, relheight = 1.0, relwidth = 1.0)
  23. welcomelabel = tk.Label(background_label, text = "Welcome to the North Spine Canteen App", fg = "white", bg = "black", font = ("Gill Sans MT Ext Condensed Bold", 40))
  24. welcomelabel.place(relwidth = 0.5, relheight = 0.2, relx = 0.25, rely = 0.2)
  25. optionlabel = tk.Label(background_label, text = "Select stores here:", fg = "white", bg = "black", font = ("Gill Sans MT Ext Condensed Bold", 35))
  26. optionlabel.place(relwidth = 0.5, relheight = 0.2, relx = 0.25, rely = 0.4)
  27.  
  28. # current date and time function
  29. now = datetime.now()
  30. current_date = now.strftime("%B %d, %Y  %H:%M:%S" )
  31. current_time = datetime.now()
  32. weekday = current_time.strftime('%A')
  33.  
  34. # get queue time function
  35. def get_queue_time(queue_entry):
  36.     try:
  37.         queue_time = int(queue_entry)*2
  38.         queue_time_output['text'] = 'The estimated queue time is: ' + str(queue_time) + ' min'
  39.     except:
  40.         queue_time_output['text'] = 'please key in integer only'
  41.  
  42. def checktime1():
  43.     try:
  44.         day = int(DD.get())
  45.         month = int(MM.get())
  46.         year = int(YYYY.get())
  47.         hour = int(hr.get())
  48.         minute = int(min.get())
  49.         day = datetime(year, month, day).weekday()
  50.         if (hour <= 8 and minute < 30) or (hour >= 22 and minute > 30):
  51.             special_meal_of_day['text'] = 'Canteen is Closed. Canteen opens from 08:30am to 10:30pm'
  52.         else:
  53.             special_meal_of_day['text'] = date_special_meal1(day)
  54.     except ValueError:
  55.         special_meal_of_day['text'] = 'Please key in integers only and in DD/MM/YYYY Hr/Min format'
  56.  
  57. def checktime2():
  58.     try:
  59.         day = int(DD.get())
  60.         month = int(MM.get())
  61.         year = int(YYYY.get())
  62.         hour = int(hr.get())
  63.         minute = int(min.get())
  64.         day = datetime(year, month, day).weekday()
  65.         if (hour <= 8 and minute < 30) or (hour >= 22 and minute > 30):
  66.             special_meal_of_day['text'] = 'Canteen is Closed. Canteen opens from 08:30am to 10:30pm'
  67.         else:
  68.             special_meal_of_day['text'] = date_special_meal2(day)
  69.     except ValueError:
  70.         special_meal_of_day['text'] = 'Please key in integers only and in DD/MM/YYYY Hr/Min format'
  71.  
  72. def checktime3():
  73.     try:
  74.         day = int(DD.get())
  75.         month = int(MM.get())
  76.         year = int(YYYY.get())
  77.         hour = int(hr.get())
  78.         minute = int(min.get())
  79.         day = datetime(year, month, day).weekday()
  80.         if (hour <= 8 and minute < 30) or (hour >= 22 and minute > 30):
  81.             special_meal_of_day['text'] = 'Canteen is Closed. Canteen opens from 08:30am to 10:30pm'
  82.         else:
  83.             special_meal_of_day['text'] = date_special_meal3(day)
  84.     except ValueError:
  85.         special_meal_of_day['text'] = 'Please key in integers only and in DD/MM/YYYY Hr/Min format'
  86.  
  87. def checktime4():
  88.     try:
  89.         day = int(DD.get())
  90.         month = int(MM.get())
  91.         year = int(YYYY.get())
  92.         hour = int(hr.get())
  93.         minute = int(min.get())
  94.         day = datetime(year, month, day).weekday()
  95.         if (hour <= 8 and minute < 30) or (hour >= 22 and minute > 30):
  96.             special_meal_of_day['text'] = 'Canteen is Closed. Canteen opens from 08:30am to 10:30pm'
  97.         else:
  98.             special_meal_of_day['text'] = date_special_meal4(day)
  99.     except ValueError:
  100.         special_meal_of_day['text'] = 'Please key in integers only and in DD/MM/YYYY Hr/Min format'
  101.  
  102. def checktime5():
  103.     try:
  104.         day = int(DD.get())
  105.         month = int(MM.get())
  106.         year = int(YYYY.get())
  107.         hour = int(hr.get())
  108.         minute = int(min.get())
  109.         day = datetime(year, month, day).weekday()
  110.         if (hour == 7 and minute == 00) or (hour < 7):
  111.             special_meal_of_day['text'] = 'MacDonalds is Closed. MacDonalds opens from 07:00am to 12:00am'
  112.         else:
  113.             special_meal_of_day['text'] = date_hr_special_meal5(day,hour)
  114.     except ValueError:
  115.         special_meal_of_day['text'] = 'Please key in integers only and in DD/MM/YYYY Hr/Min format'
  116.  
  117. time1_w = ''
  118. def tick_window():
  119.     global time1_w
  120.     # get the current local time from the PC
  121.     time2_w = time.strftime('%B %d, %Y  %H:%M:%S')
  122.     # if time string has changed, update it
  123.     if time2_w != time1:
  124.         time1_w = time2_w
  125.         clock.config(text=time2_w)
  126.     # calls itself every 200 milliseconds
  127.     # to update the time display as needed
  128.     # could use >200 ms, but display gets jerky
  129.     clock.after(200, tick_window)
  130.     date_label['text'] = time2_w
  131.  
  132. time1 = ''
  133. def tick():
  134.     global time1
  135.     # get the current local time from the PC
  136.     time2 = time.strftime('%B %d, %Y  %H:%M:%S')
  137.     # if time string has changed, update it
  138.     if time2 != time1:
  139.         time1 = time2
  140.         clock.config(text=time2)
  141.     # calls itself every 200 milliseconds
  142.     # to update the time display as needed
  143.     # could use >200 ms, but display gets jerky
  144.     clock.after(200, tick)    
  145.  
  146. clock = tk.Label(root, text = current_date, fg ='white', bg='black')
  147. clock.place(relwidth = 1.0, relheight = 0.05, relx = 0.0, rely = 0.95)
  148. tick()
  149.  
  150. def window1():
  151.     window1 = tk.Toplevel(root)
  152.     window1.title("Vegetarian Food")
  153.     window1.state("withdrawn")
  154.  
  155. # picture of store
  156.     pic1_image = tk.PhotoImage(file = "Veg stall.png")
  157.     background_label1 = tk.Label(window1, image=pic1_image)
  158.     background_label1.place(relwidth = 0.5, relheight = 0.55, relx = 0.05, rely = 0.02)
  159.     background_label1.image=pic1_image
  160.  
  161. # queue frame with functions
  162.     queue_frame = tk.Frame(window1, bg = "black")
  163.     queue_frame.place(relheight = 0.4, relwidth = 0.4, relx = 0.55, rely = 0.0)
  164.  
  165.     wait_label = tk.Label(queue_frame, text = "WAIT TIME CALCULATOR", fg = "white", bg = "black", font = ("Gill Sans MT Ext Condensed Bold", 20))
  166.     wait_label.place(relheight = 0.2, relwidth = 0.7, relx = 0.2, rely = 0.0)
  167.  
  168.     queue_label = tk.Label(queue_frame, text = "Enter no. of pax in queue: ", fg = "white", bg = "black", font = ("Gill Sans MT Ext Condensed Bold", 20))
  169.     queue_label.place(relheight = 0.2, relwidth = 0.5, relx = 0.0, rely = 0.2)
  170.  
  171.     queue_entry = tk.Entry(queue_frame, bg = "white", fg = "black")
  172.     queue_entry.place(relheight = 0.1, relwidth = 0.4, relx = 0.1, rely = 0.4)
  173.  
  174.     queue_button = tk.Button(queue_frame, text = "Calculate", fg = "black", bg = "orange", command=lambda : get_queue_time(queue_entry.get()))
  175.     queue_button.place(relheight = 0.1, relwidth = 0.3, relx = 0.6, rely = 0.4)
  176.  
  177.     global queue_time_output
  178.     queue_time_output = tk.Label(queue_frame, bg = 'white', fg = 'black')
  179.     queue_time_output.place(relheight = 0.2, relwidth = 0.8, relx = 0.5, rely = 0.6, anchor = 'n')
  180.  
  181.  
  182.  
  183. #  bottom date time box with funtions
  184.     global date_label
  185.     date_label = tk.Label(window1, text = current_date, fg = "white", bg = "black" )
  186.     date_label.place(relheight = 0.05, relwidth = 1, relx = 0.0, rely = 0.95)
  187.     tick_window()
  188.  
  189. #  special meal box according to date
  190.     special_meal_frame = tk.Frame(window1, bg = "black")
  191.     special_meal_frame.place(relheight = 0.2, relwidth = 0.47, relx = 0.05, rely = 0.7)
  192.  
  193.     special_meal_title = tk.Label(special_meal_frame, text = 'Meal of the Day', fg = "white", bg = "black", font = ("Gill Sans MT Ext Condensed Bold", 20))
  194.     special_meal_title.place(relheight = 0.2, relwidth = 0.4, relx = 0.3, rely = 0.0)
  195.  
  196. #Vegetarian Food Special Meal
  197.     global special_meal_of_day
  198.     special_meal_of_day = tk.Label(special_meal_frame, bg = 'black', fg = 'white', text = weekday + ' : ' + special_meal1(weekday.upper()))
  199.     special_meal_of_day.place(relheight = 0.3, relwidth = 1, relx = 0.5, rely = 0.35, anchor = 'n')
  200.  
  201. #  menu frame with contents
  202.     normal_menu_frame = tk.Frame(window1, bg = "black")
  203.     normal_menu_frame.place(relheight = 0.45, relwidth = 0.4, relx = 0.55, rely = 0.45)
  204.  
  205.     normal_menu_title = tk.Label(normal_menu_frame, text = "MENU", fg = "white", bg = "black", font = ("Gill Sans MT Ext Condensed Bold", 20))
  206.     normal_menu_title.place(relheight = 0.2, relwidth = 0.4, relx = 0.35, rely = 0.0)
  207.  
  208.     normal_menu1 = tk.Label(normal_menu_frame, text = "White Rice \n\n Brown Rice \n\n Bee Hoon \n\n Fried Rice \n\n Vegetable \n\n Vegetarian Meat \n\n Hor Fun/Crispy Noodle", fg = "white", bg = "black", font = ("Times New Roman", 10))
  209.     normal_menu1.place(relheight = 0.8, relwidth = 0.4, relx = 0.1, rely = 0.2)
  210.  
  211.     normal_menu_price = tk.Label(normal_menu_frame, text = "$0.50 \n\n $0.80 \n\n $1.00 \n\n $1.00 \n\n $0.70 \n\n $1.00 \n\n $3.00/$4.00", fg = "white", bg = "black", font = ("Times New Roman", 10))
  212.     normal_menu_price.place(relheight = 0.8, relwidth = 0.4, relx = 0.6, rely = 0.2)
  213.  
  214.  
  215. #Frame for user input time and date###################################################################################################
  216.     timeframe = tk.Frame(window1, bg= "black")
  217.     timeframe.place(relheight = 0.1, relwidth = 0.47, relx = 0.05, rely = 0.58)
  218.  
  219.     datelabel = tk.Label(timeframe, text = "Date:", fg = "white", bg = "black" )
  220.     datelabel.place(relheight = 0.35, relwidth = 0.1, relx = 0.2, rely = 0.35)
  221.    
  222.     global DD
  223.     DD = tk.Entry(timeframe, bg = 'white', fg = 'black')
  224.     DD.insert(0, 'DD')
  225.     DD.place(relheight = 0.3, relwidth = 0.05, relx = 0.3, rely = 0.35)
  226.    
  227.     global MM
  228.     MM = tk.Entry(timeframe, bg = 'white', fg = 'black')
  229.     MM.insert(0, 'MM')
  230.     MM.place(relheight = 0.3, relwidth = 0.05, relx = 0.37, rely = 0.35)
  231.    
  232.     global YYYY
  233.     YYYY = tk.Entry(timeframe, bg = 'white', fg = 'black')
  234.     YYYY.insert(0, 'YYYY')
  235.     YYYY.place(relheight = 0.3, relwidth = 0.07, relx = 0.44, rely = 0.35)
  236.  
  237.  
  238.     timelabel = tk.Label(timeframe, text = "Time:", fg = "white", bg = "black" )
  239.     timelabel.place(relheight = 0.35, relwidth = 0.1, relx = 0.6, rely = 0.35)
  240.  
  241.     tk.Label(timeframe, text = ":", fg = "white", bg = "black" ).place(relheight = 0.15, relwidth = 0.05, relx = 0.735, rely = 0.4)
  242.  
  243.     global hr
  244.     hr = tk.Entry(timeframe, bg = 'white', fg = 'black')
  245.     hr.insert(0, 'hr')
  246.     hr.place(relheight = 0.3, relwidth = 0.05, relx = 0.7, rely = 0.35)
  247.  
  248.     global min
  249.     min = tk.Entry(timeframe, bg = 'white', fg = 'black')
  250.     min.insert(0, 'min')
  251.     min.place(relheight = 0.3, relwidth = 0.05, relx = 0.77, rely = 0.35)
  252.  
  253.  
  254.     checkbutton = tk.Button(timeframe, text = "Check", command = lambda : checktime1()).place(relheight = 0.3, relwidth = 0.1, relx = 0.88, rely = 0.35)
  255.  
  256.  
  257.     ####################################################################################################################################
  258.    
  259.     window1.lift(root)
  260.     window1.state("normal")
  261.     window1.state("zoomed")
  262.     button1a = tk.Button(window1, text = "Back", command=lambda : unclick(window1))
  263.     button1a.place(relwidth = 0.05, relheight = 0.1, relx = 0, rely = 0)
  264.  
  265. def window2():
  266.     window2 = tk.Toplevel(root)
  267.     window2.title("Mini Wok")
  268.     window2.state("withdrawn")
  269.  
  270. # picture of store
  271.     pic2_image = tk.PhotoImage(file = "Mini Wok.png")
  272.     background_label2 = tk.Label(window2, image=pic2_image)
  273.     background_label2.place(relwidth = 0.5, relheight = 0.55, relx = 0.05, rely = 0.02)
  274.     background_label2.image=pic2_image
  275.  
  276. # queue frame with functions
  277.     queue_frame = tk.Frame(window2, bg = "black")
  278.     queue_frame.place(relheight = 0.4, relwidth = 0.4, relx = 0.55, rely = 0.0)
  279.  
  280.     wait_label = tk.Label(queue_frame, text = "WAIT TIME CALCULATOR", fg = "white", bg = "black", font = ("Gill Sans MT Ext Condensed Bold", 20))
  281.     wait_label.place(relheight = 0.2, relwidth = 0.7, relx = 0.2, rely = 0.0)
  282.  
  283.     queue_label = tk.Label(queue_frame, text = "Enter no. of pax in queue: ", fg = "white", bg = "black", font = ("Gill Sans MT Ext Condensed Bold", 20))
  284.     queue_label.place(relheight = 0.2, relwidth = 0.5, relx = 0.0, rely = 0.2)
  285.  
  286.     queue_entry = tk.Entry(queue_frame, bg = "white", fg = "black")
  287.     queue_entry.place(relheight = 0.1, relwidth = 0.4, relx = 0.1, rely = 0.4)
  288.  
  289.     queue_button = tk.Button(queue_frame, text = "Calculate", fg = "black", bg = "orange", command=lambda : get_queue_time(queue_entry.get()))
  290.     queue_button.place(relheight = 0.1, relwidth = 0.3, relx = 0.6, rely = 0.4)
  291.  
  292.     global queue_time_output
  293.  
  294.     queue_time_output = tk.Label(queue_frame, bg = 'white', fg = 'black')
  295.     queue_time_output.place(relheight = 0.2, relwidth = 0.8, relx = 0.5, rely = 0.6, anchor = 'n')
  296.  
  297. #  bottom date time box with funtions
  298.     global date_label
  299.     date_label = tk.Label(window2, text = current_date, fg = "white", bg = "black" )
  300.     date_label.place(relheight = 0.05, relwidth = 1, relx = 0.0, rely = 0.95)
  301.     tick_window()
  302. #  special meal box according to date
  303.     special_meal_frame = tk.Frame(window2, bg = "black")
  304.     special_meal_frame.place(relheight = 0.2, relwidth = 0.47, relx = 0.05, rely = 0.7)
  305.  
  306.     special_meal_title = tk.Label(special_meal_frame, text = 'Meal of the Day', fg = "white", bg = "black", font = ("Gill Sans MT Ext Condensed Bold", 20))
  307.     special_meal_title.place(relheight = 0.2, relwidth = 0.4, relx = 0.3, rely = 0.0)
  308.  
  309.     global special_meal_of_day
  310.     special_meal_of_day = tk.Label(special_meal_frame, bg = 'black', fg = 'white', text = weekday + ' : ' + special_meal2(weekday.upper()))
  311.     special_meal_of_day.place(relheight = 0.3, relwidth = 1, relx = 0.5, rely = 0.35, anchor = 'n')
  312. #  menu frame with contents
  313.     normal_menu_frame = tk.Frame(window2, bg = "black")
  314.     normal_menu_frame.place(relheight = 0.45, relwidth = 0.4, relx = 0.55, rely = 0.45)
  315.  
  316.     normal_menu_title = tk.Label(normal_menu_frame, text = "MENU", fg = "white", bg = "black", font = ("Gill Sans MT Ext Condensed Bold", 20))
  317.     normal_menu_title.place(relheight = 0.2, relwidth = 0.4, relx = 0.35, rely = 0.0)
  318.  
  319.     normal_menu1 = tk.Label(normal_menu_frame, text = "Chicken Fried Rice \n\n Fried Rice with Fillet \n\n Fried Rice with Prawn \n\n Pan Fried Chicken Rice \n\n Sambal Fish Fillet Rice \n\n Mixed Veg Toufu \n\n Kung Bao Chicken Rice", fg = "white", bg = "black", font = ("Times New Roman", 10))
  320.     normal_menu1.place(relheight = 0.8, relwidth = 0.4, relx = 0.1, rely = 0.2)
  321.  
  322.     normal_menu_price = tk.Label(normal_menu_frame, text = "$3.80 \n\n $3.80 \n\n $3.80 \n\n $4.20 \n\n $4.20 \n\n $4.00 \n\n $4.20", fg = "white", bg = "black", font = ("Times New Roman", 10))
  323.     normal_menu_price.place(relheight = 0.8, relwidth = 0.4, relx = 0.6, rely = 0.2)
  324.  
  325. #Frame for user input time and date###################################################################################################
  326.     timeframe = tk.Frame(window2, bg= "black")
  327.     timeframe.place(relheight = 0.1, relwidth = 0.47, relx = 0.05, rely = 0.58)
  328.  
  329.     datelabel = tk.Label(timeframe, text = "Date:", fg = "white", bg = "black" )
  330.     datelabel.place(relheight = 0.35, relwidth = 0.1, relx = 0.2, rely = 0.35)
  331.    
  332.     global DD
  333.     DD = tk.Entry(timeframe, bg = 'white', fg = 'black')
  334.     DD.insert(0, 'DD')
  335.     DD.place(relheight = 0.3, relwidth = 0.05, relx = 0.3, rely = 0.35)
  336.    
  337.     global MM
  338.     MM = tk.Entry(timeframe, bg = 'white', fg = 'black')
  339.     MM.insert(0, 'MM')
  340.     MM.place(relheight = 0.3, relwidth = 0.05, relx = 0.37, rely = 0.35)
  341.    
  342.     global YYYY
  343.     YYYY = tk.Entry(timeframe, bg = 'white', fg = 'black')
  344.     YYYY.insert(0, 'YYYY')
  345.     YYYY.place(relheight = 0.3, relwidth = 0.07, relx = 0.44, rely = 0.35)
  346.  
  347.  
  348.     timelabel = tk.Label(timeframe, text = "Time:", fg = "white", bg = "black" )
  349.     timelabel.place(relheight = 0.35, relwidth = 0.1, relx = 0.6, rely = 0.35)
  350.  
  351.     tk.Label(timeframe, text = ":", fg = "white", bg = "black" ).place(relheight = 0.15, relwidth = 0.05, relx = 0.735, rely = 0.4)
  352.  
  353.     global hr
  354.     hr = tk.Entry(timeframe, bg = 'white', fg = 'black')
  355.     hr.insert(0, 'hr')
  356.     hr.place(relheight = 0.3, relwidth = 0.05, relx = 0.7, rely = 0.35)
  357.  
  358.     global min
  359.     min = tk.Entry(timeframe, bg = 'white', fg = 'black')
  360.     min.insert(0, 'min')
  361.     min.place(relheight = 0.3, relwidth = 0.05, relx = 0.77, rely = 0.35)
  362.  
  363.  
  364.     checkbutton = tk.Button(timeframe, text = "Check", command = lambda : checktime2()).place(relheight = 0.3, relwidth = 0.1, relx = 0.88, rely = 0.35)
  365.  
  366.  
  367.     ####################################################################################################################################
  368.  
  369.     window2.lift(root)
  370.     window2.state("normal")
  371.     window2.state("zoomed")
  372.     button2a = tk.Button(window2, text = "Back", command=lambda : unclick(window2))
  373.     button2a.place(relwidth = 0.05, relheight = 0.1, relx = 0, rely = 0)
  374.  
  375. #Chicken Rice
  376.  
  377. def window3():
  378.     window3 = tk.Toplevel(root)
  379.     window3.title("Chicken Rice")
  380.     window3.state("withdrawn")
  381.  
  382. # picture of store
  383.     pic3_image = tk.PhotoImage(file = "Chicken Rice.png")
  384.     background_label3 = tk.Label(window3, image=pic3_image)
  385.     background_label3.place(relwidth = 0.5, relheight = 0.55, relx = 0.05, rely = 0.02)
  386.     background_label3.image=pic3_image
  387.  
  388. # queue frame with functions
  389.     queue_frame = tk.Frame(window3, bg = "black")
  390.     queue_frame.place(relheight = 0.4, relwidth = 0.4, relx = 0.55, rely = 0.0)
  391.  
  392.     wait_label = tk.Label(queue_frame, text = "WAIT TIME CALCULATOR", fg = "white", bg = "black", font = ("Gill Sans MT Ext Condensed Bold", 20))
  393.     wait_label.place(relheight = 0.2, relwidth = 0.7, relx = 0.2, rely = 0.0)
  394.  
  395.     queue_label = tk.Label(queue_frame, text = "Enter no. of pax in queue: ", fg = "white", bg = "black", font = ("Gill Sans MT Ext Condensed Bold", 20))
  396.     queue_label.place(relheight = 0.2, relwidth = 0.5, relx = 0.0, rely = 0.2)
  397.  
  398.     queue_entry = tk.Entry(queue_frame, bg = "white", fg = "black")
  399.     queue_entry.place(relheight = 0.1, relwidth = 0.4, relx = 0.1, rely = 0.4)
  400.  
  401.     queue_button = tk.Button(queue_frame, text = "Calculate", fg = "black", bg = "orange", command=lambda : get_queue_time(queue_entry.get()))
  402.     queue_button.place(relheight = 0.1, relwidth = 0.3, relx = 0.6, rely = 0.4)
  403.  
  404.     global queue_time_output
  405.  
  406.     queue_time_output = tk.Label(queue_frame, bg = 'white', fg = 'black')
  407.     queue_time_output.place(relheight = 0.2, relwidth = 0.8, relx = 0.5, rely = 0.6, anchor = 'n')
  408.  
  409. #  bottom date time box with funtions
  410.     global date_label
  411.     date_label = tk.Label(window3, text = current_date, fg = "white", bg = "black" )
  412.     date_label.place(relheight = 0.05, relwidth = 1, relx = 0.0, rely = 0.95)
  413.     tick_window()
  414. #  special meal box according to date
  415.     special_meal_frame = tk.Frame(window3, bg = "black")
  416.     special_meal_frame.place(relheight = 0.2, relwidth = 0.47, relx = 0.05, rely = 0.7)
  417.  
  418.     special_meal_title = tk.Label(special_meal_frame, text = 'Meal of the Day', fg = "white", bg = "black", font = ("Gill Sans MT Ext Condensed Bold", 20))
  419.     special_meal_title.place(relheight = 0.2, relwidth = 0.4, relx = 0.3, rely = 0.0)
  420.    
  421.     global special_meal_of_day
  422.     special_meal_of_day = tk.Label(special_meal_frame, bg = 'black', fg = 'white', text = weekday + ' : ' + special_meal3(weekday.upper()))
  423.     special_meal_of_day.place(relheight = 0.3, relwidth = 1, relx = 0.5, rely = 0.35, anchor = 'n')
  424. #  menu frame with contents
  425.     normal_menu_frame = tk.Frame(window3, bg = "black")
  426.     normal_menu_frame.place(relheight = 0.45, relwidth = 0.4, relx = 0.55, rely = 0.45)
  427.  
  428.     normal_menu_title = tk.Label(normal_menu_frame, text = "MENU", fg = "white", bg = "black", font = ("Gill Sans MT Ext Condensed Bold", 20))
  429.     normal_menu_title.place(relheight = 0.2, relwidth = 0.4, relx = 0.35, rely = 0.0)
  430.  
  431.     normal_menu1 = tk.Label(normal_menu_frame, text = "Steamed Chicken Rice\n\n Steamed Chicken Rice Set \n\n Roasted Chicken Rice \n\n Lemon Chicken Rice \n\n Curry Chicken Noodle \n\n Soya Sauce Veg \n\n Thai Style Beancurd", fg = "white", bg = "black", font = ("Times New Roman", 10))
  432.     normal_menu1.place(relheight = 0.8, relwidth = 0.4, relx = 0.1, rely = 0.2)
  433.  
  434.     normal_menu_price = tk.Label(normal_menu_frame, text = "$3.00 \n\n $4.50 \n\n $3.00 \n\n $3.00 \n\n $3.00 \n\n $2.00 \n\n $2.00", fg = "white", bg = "black", font = ("Times New Roman", 10))
  435.     normal_menu_price.place(relheight = 0.8, relwidth = 0.4, relx = 0.6, rely = 0.2)
  436.  
  437. #Frame for user input time and date###################################################################################################
  438.     timeframe = tk.Frame(window3, bg= "black")
  439.     timeframe.place(relheight = 0.1, relwidth = 0.47, relx = 0.05, rely = 0.58)
  440.  
  441.     datelabel = tk.Label(timeframe, text = "Date:", fg = "white", bg = "black" )
  442.     datelabel.place(relheight = 0.35, relwidth = 0.1, relx = 0.2, rely = 0.35)
  443.  
  444.     global DD
  445.     DD = tk.Entry(timeframe, bg = 'white', fg = 'black')
  446.     DD.insert(0, 'DD')
  447.     DD.place(relheight = 0.3, relwidth = 0.05, relx = 0.3, rely = 0.35)
  448.  
  449.     global MM
  450.     MM = tk.Entry(timeframe, bg = 'white', fg = 'black')
  451.     MM.insert(0, 'MM')
  452.     MM.place(relheight = 0.3, relwidth = 0.05, relx = 0.37, rely = 0.35)
  453.  
  454.     global YYYY
  455.     YYYY = tk.Entry(timeframe, bg = 'white', fg = 'black')
  456.     YYYY.insert(0, 'YYYY')
  457.     YYYY.place(relheight = 0.3, relwidth = 0.07, relx = 0.44, rely = 0.35)
  458.  
  459.  
  460.     timelabel = tk.Label(timeframe, text = "Time:", fg = "white", bg = "black" )
  461.     timelabel.place(relheight = 0.35, relwidth = 0.1, relx = 0.6, rely = 0.35)
  462.  
  463.     tk.Label(timeframe, text = ":", fg = "white", bg = "black" ).place(relheight = 0.15, relwidth = 0.05, relx = 0.735, rely = 0.4)
  464.  
  465.     global hr
  466.     hr = tk.Entry(timeframe, bg = 'white', fg = 'black')
  467.     hr.insert(0, 'hr')
  468.     hr.place(relheight = 0.3, relwidth = 0.05, relx = 0.7, rely = 0.35)
  469.  
  470.     global min
  471.     min = tk.Entry(timeframe, bg = 'white', fg = 'black')
  472.     min.insert(0, 'min')
  473.     min.place(relheight = 0.3, relwidth = 0.05, relx = 0.77, rely = 0.35)
  474.  
  475.     checkbutton = tk.Button(timeframe, text = "Check", command = lambda : checktime3()).place(relheight = 0.3, relwidth = 0.1, relx = 0.88, rely = 0.35)
  476.  
  477.  
  478.     ####################################################################################################################################
  479.  
  480.     window3.lift(root)
  481.     window3.state("normal")
  482.     window3.state("zoomed")
  483.     button3a = tk.Button(window3, text = "Back", command=lambda : unclick(window3))
  484.     button3a.place(relwidth = 0.05, relheight = 0.1, relx = 0, rely = 0)
  485.  
  486.  
  487. def window4():
  488.     window4 = tk.Toplevel(root)
  489.     window4.title("Handmade Noodles")
  490.     window4.state("withdrawn")
  491.  
  492. # picture of store
  493.     pic4_image = tk.PhotoImage(file = "Handmade Noodle.png")
  494.     background_label4 = tk.Label(window4, image=pic4_image)
  495.     background_label4.place(relwidth = 0.5, relheight = 0.55, relx = 0.05, rely = 0.02)
  496.     background_label4.image=pic4_image
  497.  
  498. # queue frame with functions
  499.     queue_frame = tk.Frame(window4, bg = "black")
  500.     queue_frame.place(relheight = 0.4, relwidth = 0.4, relx = 0.55, rely = 0.0)
  501.  
  502.     wait_label = tk.Label(queue_frame, text = "WAIT TIME CALCULATOR", fg = "white", bg = "black", font = ("Gill Sans MT Ext Condensed Bold", 20))
  503.     wait_label.place(relheight = 0.2, relwidth = 0.7, relx = 0.2, rely = 0.0)
  504.  
  505.     queue_label = tk.Label(queue_frame, text = "Enter no. of pax in queue: ", fg = "white", bg = "black", font = ("Gill Sans MT Ext Condensed Bold", 20))
  506.     queue_label.place(relheight = 0.2, relwidth = 0.5, relx = 0.0, rely = 0.2)
  507.  
  508.     queue_entry = tk.Entry(queue_frame, bg = "white", fg = "black")
  509.     queue_entry.place(relheight = 0.1, relwidth = 0.4, relx = 0.1, rely = 0.4)
  510.  
  511.     queue_button = tk.Button(queue_frame, text = "Calculate", fg = "black", bg = "orange", command=lambda : get_queue_time(queue_entry.get()))
  512.     queue_button.place(relheight = 0.1, relwidth = 0.3, relx = 0.6, rely = 0.4)
  513.  
  514.     global queue_time_output
  515.  
  516.     queue_time_output = tk.Label(queue_frame, bg = 'white', fg = 'black')
  517.     queue_time_output.place(relheight = 0.2, relwidth = 0.8, relx = 0.5, rely = 0.6, anchor = 'n')
  518. #  bottom date time box with funtions
  519.     global date_label
  520.     date_label = tk.Label(window4, text = current_date, fg = "white", bg = "black" )
  521.     date_label.place(relheight = 0.05, relwidth = 1, relx = 0.0, rely = 0.95)
  522.     tick_window()
  523. #  special meal box according to date
  524.     special_meal_frame = tk.Frame(window4, bg = "black")
  525.     special_meal_frame.place(relheight = 0.2, relwidth = 0.47, relx = 0.05, rely = 0.7)
  526.  
  527.     special_meal_title = tk.Label(special_meal_frame, text = 'Meal of the Day', fg = "white", bg = "black", font = ("Gill Sans MT Ext Condensed Bold", 20))
  528.     special_meal_title.place(relheight = 0.2, relwidth = 0.4, relx = 0.3, rely = 0.0)
  529.  
  530.     global special_meal_of_day
  531.     special_meal_of_day = tk.Label(special_meal_frame, bg = 'black', fg = 'white', text = weekday + ' : ' + special_meal4(weekday.upper()))
  532.     special_meal_of_day.place(relheight = 0.3, relwidth = 1, relx = 0.5, rely = 0.35, anchor = 'n')
  533. #  menu frame with contents
  534.     normal_menu_frame = tk.Frame(window4, bg = "black")
  535.     normal_menu_frame.place(relheight = 0.45, relwidth = 0.4, relx = 0.55, rely = 0.45)
  536.  
  537.     normal_menu_title = tk.Label(normal_menu_frame, text = "MENU", fg = "white", bg = "black", font = ("Gill Sans MT Ext Condensed Bold", 20))
  538.     normal_menu_title.place(relheight = 0.2, relwidth = 0.4, relx = 0.35, rely = 0.0)
  539.  
  540.     normal_menu1 = tk.Label(normal_menu_frame, text = "U Mian \n\n Mee Sua \n\n Thin Bee Hoon \n\n Dumpling Ban Mian \n\n Tom Yam Ban Mian  \n\n Spicy & Sour Noodle \n\n Zha Jiang Mian", fg = "white", bg = "black", font = ("Times New Roman", 10))
  541.     normal_menu1.place(relheight = 0.8, relwidth = 0.4, relx = 0.1, rely = 0.2)
  542.  
  543.     normal_menu_price = tk.Label(normal_menu_frame, text = "$3.00 \n\n $3.00 \n\n $3.00 \n\n $3.50 \n\n $3.80 \n\n $3.50 \n\n $3.50", fg = "white", bg = "black", font = ("Times New Roman", 10))
  544.     normal_menu_price.place(relheight = 0.8, relwidth = 0.4, relx = 0.6, rely = 0.2)
  545.  
  546. #Frame for user input time and date###################################################################################################
  547.     timeframe = tk.Frame(window4, bg= "black")
  548.     timeframe.place(relheight = 0.1, relwidth = 0.47, relx = 0.05, rely = 0.58)
  549.  
  550.     datelabel = tk.Label(timeframe, text = "Date:", fg = "white", bg = "black" )
  551.     datelabel.place(relheight = 0.35, relwidth = 0.1, relx = 0.2, rely = 0.35)
  552.  
  553.     global DD
  554.     DD = tk.Entry(timeframe, bg = 'white', fg = 'black')
  555.     DD.insert(0, 'DD')
  556.     DD.place(relheight = 0.3, relwidth = 0.05, relx = 0.3, rely = 0.35)
  557.    
  558.     global MM
  559.     MM = tk.Entry(timeframe, bg = 'white', fg = 'black')
  560.     MM.insert(0, 'MM')
  561.     MM.place(relheight = 0.3, relwidth = 0.05, relx = 0.37, rely = 0.35)
  562.  
  563.     global YYYY
  564.     YYYY = tk.Entry(timeframe, bg = 'white', fg = 'black')
  565.     YYYY.insert(0, 'YYYY')
  566.     YYYY.place(relheight = 0.3, relwidth = 0.07, relx = 0.44, rely = 0.35)
  567.  
  568.  
  569.     timelabel = tk.Label(timeframe, text = "Time:", fg = "white", bg = "black" )
  570.     timelabel.place(relheight = 0.35, relwidth = 0.1, relx = 0.6, rely = 0.35)
  571.  
  572.     tk.Label(timeframe, text = ":", fg = "white", bg = "black" ).place(relheight = 0.15, relwidth = 0.05, relx = 0.735, rely = 0.4)
  573.  
  574.     global hr
  575.     hr = tk.Entry(timeframe, bg = 'white', fg = 'black')
  576.     hr.insert(0, 'hr')
  577.     hr.place(relheight = 0.3, relwidth = 0.05, relx = 0.7, rely = 0.35)
  578.  
  579.     global min
  580.     min = tk.Entry(timeframe, bg = 'white', fg = 'black')
  581.     min.insert(0, 'min')
  582.     min.place(relheight = 0.3, relwidth = 0.05, relx = 0.77, rely = 0.35)
  583.  
  584.     checkbutton = tk.Button(timeframe, text = "Check", command = lambda : checktime4()).place(relheight = 0.3, relwidth = 0.1, relx = 0.88, rely = 0.35)
  585.  
  586.  
  587.     ####################################################################################################################################
  588.     window4.lift(root)
  589.     window4.state("normal")
  590.     window4.state("zoomed")
  591.     button4a = tk.Button(window4, text = "Back", command=lambda : unclick(window4))
  592.     button4a.place(relwidth = 0.05, relheight = 0.1, relx = 0, rely = 0)
  593.  
  594.  
  595. def window5():
  596.     window5 = tk.Toplevel(root)
  597.     window5.title("McDonald's")
  598.     window5.state("withdrawn")
  599.  
  600. # picture of store
  601.     pic5_image = tk.PhotoImage(file = "McDonald's.png")
  602.     background_label5 = tk.Label(window5, image=pic5_image)
  603.     background_label5.place(relwidth = 0.5, relheight = 0.55, relx = 0.05, rely = 0.02)
  604.     background_label5.image=pic5_image
  605.  
  606. # queue frame with functions
  607.     queue_frame = tk.Frame(window5, bg = "black")
  608.     queue_frame.place(relheight = 0.4, relwidth = 0.4, relx = 0.55, rely = 0.0)
  609.  
  610.     wait_label = tk.Label(queue_frame, text = "WAIT TIME CALCULATOR", fg = "white", bg = "black", font = ("Gill Sans MT Ext Condensed Bold", 20))
  611.     wait_label.place(relheight = 0.2, relwidth = 0.7, relx = 0.2, rely = 0.0)
  612.  
  613.     queue_label = tk.Label(queue_frame, text = "Enter no. of pax in queue: ", fg = "white", bg = "black", font = ("Gill Sans MT Ext Condensed Bold", 20))
  614.     queue_label.place(relheight = 0.2, relwidth = 0.5, relx = 0.0, rely = 0.2)
  615.  
  616.     queue_entry = tk.Entry(queue_frame, bg = "white", fg = "black")
  617.     queue_entry.place(relheight = 0.1, relwidth = 0.4, relx = 0.1, rely = 0.4)
  618.  
  619.     queue_button = tk.Button(queue_frame, text = "Calculate", fg = "black", bg = "orange", command=lambda : get_queue_time(queue_entry.get()))
  620.     queue_button.place(relheight = 0.1, relwidth = 0.3, relx = 0.6, rely = 0.4)
  621.  
  622.     global queue_time_output
  623.    
  624.     queue_time_output = tk.Label(queue_frame, bg = 'white', fg = 'black')
  625.     queue_time_output.place(relheight = 0.2, relwidth = 0.8, relx = 0.5, rely = 0.6, anchor = 'n')
  626. #  bottom date time box with funtions
  627.     global date_label
  628.     date_label = tk.Label(window5, text = current_date, fg = "white", bg = "black" )
  629.     date_label.place(relheight = 0.05, relwidth = 1, relx = 0.0, rely = 0.95)
  630.     tick_window()
  631. #  special meal box according to date
  632.     special_meal_frame = tk.Frame(window5, bg = "black")
  633.     special_meal_frame.place(relheight = 0.2, relwidth = 0.47, relx = 0.05, rely = 0.7)
  634.  
  635.     special_meal_title = tk.Label(special_meal_frame, text = 'Meal of the Day', fg = "white", bg = "black", font = ("Gill Sans MT Ext Condensed Bold", 20))
  636.     special_meal_title.place(relheight = 0.2, relwidth = 0.4, relx = 0.3, rely = 0.0)
  637.  
  638.     global special_meal_of_day
  639.     special_meal_of_day = tk.Label(special_meal_frame, bg = 'black', fg = 'white', text = weekday + ' : ' + special_meal5(weekday.upper()))
  640.     special_meal_of_day.place(relheight = 0.3, relwidth = 1, relx = 0.5, rely = 0.35, anchor = 'n')
  641. #  menu frame with contents
  642.     normal_menu_frame = tk.Frame(window5, bg = "black")
  643.     normal_menu_frame.place(relheight = 0.45, relwidth = 0.4, relx = 0.55, rely = 0.45)
  644.  
  645.     normal_menu_title = tk.Label(normal_menu_frame, text = "MENU", fg = "white", bg = "black", font = ("Gill Sans MT Ext Condensed Bold", 20))
  646.     normal_menu_title.place(relheight = 0.2, relwidth = 0.4, relx = 0.35, rely = 0.0)
  647.  
  648.     normal_menu1 = tk.Label(normal_menu_frame, text = "Fillet O Fish \n\n Double Fillet O Fish \n\n Big Mac \n\n McSpicy \n\n Double McSpicy \n\n McWings (4 pcs) \n\n McChicken", fg = "white", bg = "black", font = ("Times New Roman", 10))
  649.     normal_menu1.place(relheight = 0.8, relwidth = 0.4, relx = 0.1, rely = 0.2)
  650.  
  651.     normal_menu_price = tk.Label(normal_menu_frame, text = "$2.50 \n\n $5.80 \n\n $5.60 \n\n $5.25 \n\n $7.20 \n\n $4.00 \n\n $2.00", fg = "white", bg = "black", font = ("Times New Roman", 10))
  652.     normal_menu_price.place(relheight = 0.8, relwidth = 0.4, relx = 0.6, rely = 0.2)
  653.  
  654. #Frame for user input time and date###################################################################################################
  655.     timeframe = tk.Frame(window5, bg= "black")
  656.     timeframe.place(relheight = 0.1, relwidth = 0.47, relx = 0.05, rely = 0.58)
  657.  
  658.     datelabel = tk.Label(timeframe, text = "Date:", fg = "white", bg = "black" )
  659.     datelabel.place(relheight = 0.35, relwidth = 0.1, relx = 0.2, rely = 0.35)
  660.  
  661.     global DD
  662.     DD = tk.Entry(timeframe, bg = 'white', fg = 'black')
  663.     DD.insert(0, 'DD')
  664.     DD.place(relheight = 0.3, relwidth = 0.05, relx = 0.3, rely = 0.35)
  665.    
  666.     global MM
  667.     MM = tk.Entry(timeframe, bg = 'white', fg = 'black')
  668.     MM.insert(0, 'MM')
  669.     MM.place(relheight = 0.3, relwidth = 0.05, relx = 0.37, rely = 0.35)
  670.  
  671.     global YYYY
  672.     YYYY = tk.Entry(timeframe, bg = 'white', fg = 'black')
  673.     YYYY.insert(0, 'YYYY')
  674.     YYYY.place(relheight = 0.3, relwidth = 0.07, relx = 0.44, rely = 0.35)
  675.  
  676.     timelabel = tk.Label(timeframe, text = "Time:", fg = "white", bg = "black" )
  677.     timelabel.place(relheight = 0.35, relwidth = 0.1, relx = 0.6, rely = 0.35)
  678.  
  679.     tk.Label(timeframe, text = ":", fg = "white", bg = "black" ).place(relheight = 0.15, relwidth = 0.05, relx = 0.735, rely = 0.4)
  680.  
  681.     global hr
  682.     hr = tk.Entry(timeframe, bg = 'white', fg = 'black')
  683.     hr.insert(0, 'hr')
  684.     hr.place(relheight = 0.3, relwidth = 0.05, relx = 0.7, rely = 0.35)
  685.  
  686.     global min
  687.     min = tk.Entry(timeframe, bg = 'white', fg = 'black')
  688.     min.insert(0, 'min')
  689.     min.place(relheight = 0.3, relwidth = 0.05, relx = 0.77, rely = 0.35)
  690.  
  691.     checkbutton = tk.Button(timeframe, text = "Check", command = lambda : checktime5()).place(relheight = 0.3, relwidth = 0.1, relx = 0.88, rely = 0.35)
  692.  
  693.  
  694.     ####################################################################################################################################
  695.  
  696.     window5.lift(root)
  697.     window5.state("normal")
  698.     window5.state("zoomed")
  699.     button5a = tk.Button(window5, text = "Back", command=lambda : unclick(window5))
  700.     button5a.place(relwidth = 0.05, relheight = 0.1, relx = 0, rely = 0)
  701.  
  702. # Buttons
  703. button1 = tk.Button(root, text = "Vegetarian Food", command=lambda : click(window1))
  704. button1.place(relwidth = 0.1, relheight = 0.1, relx = 0.25, rely = 0.6)
  705.  
  706. button2 = tk.Button(root, text = "Mini Wok", command=lambda : click(window2))
  707. button2.place(relwidth = 0.1, relheight = 0.1, relx = 0.35, rely = 0.6)
  708.  
  709. button3 = tk.Button(root, text = "Chicken Rice", command=lambda : click(window3))
  710. button3.place(relwidth = 0.1, relheight = 0.1, relx = 0.45, rely = 0.6)
  711.  
  712. button4 = tk.Button(root, text = "Handmade Noodle", command=lambda : click(window4))
  713. button4.place(relwidth = 0.1, relheight = 0.1, relx = 0.55, rely = 0.6)
  714.  
  715. button5 = tk.Button(root, text = "McDonald's", command=lambda : click(window5))
  716. button5.place(relwidth = 0.1, relheight = 0.1, relx = 0.65, rely = 0.6)
  717.  
  718. canteen_information = ('Operating hours: 8.30-10.30pm \n 76 Nanyang Drive, Singapore 637331 Nanyang Drive, Singapore 637331')
  719.  
  720. label_canteen = tk.Label(root, text = canteen_information, bg = 'black', fg = 'white', font = ("Gill Sans MT Ext Condensed Bold", 20))
  721. label_canteen.place(relwidth = 0.4, relheight = 0.1, relx = 0.3 , rely = 0.7)
  722.  
  723. root.mainloop()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top