def UnavailableDayMenu(stallid): #Get Current StallID Menu as a list filteredMenuItems = StallMenu(stallid) #Generate empty list to a unique store special menu items based on current time UnavailableItems = [] #Get Current Day [Monday, Tuesday ....] day = GetDayOnly() for i in range(0, len(filteredMenuItems)): #check for Unavailable day is today if (day == filteredMenuItems[i]["Unavailable"]): UnavailableItems.append(filteredMenuItems[i]) return UnavailableItems
def AvailableMenu(stallid): #Get Current StallID Menu as a list filteredMenuItems = StallMenu(stallid) #Generate empty list to a unique store special menu items based on current time AvailableItems = [] #Get Current Time currenttime = int(GetCurrentTime()) #Get Current Day [Monday, Tuesday ....] day = GetDayOnly() for i in range(0, len(filteredMenuItems)): #Check For Unavailable Day is not today if (day != filteredMenuItems[i]["Unavailable"]): #Check if this item is in the normal menu if (filteredMenuItems[i]["SpecialMenuStartTime"] == 0 or filteredMenuItems[i]["SpecialMenuEndTime"] == 0): AvailableItems.append(filteredMenuItems[i]) #Check For Current Time within stall special menu time slot if filteredMenuItems[i][ "SpecialMenuStartTime"] < currenttime < filteredMenuItems[ i]["SpecialMenuEndTime"]: AvailableItems.append(filteredMenuItems[i]) return AvailableItems
#Import Stall search function as a class function using HTML WTForms Python Framework from form.SearchStallByDate import SearchStallByDate #Import Waiting List function as a class function using HTML WTForms Python Framework from form.QueueSystem import QueueSystem #Import chatbot function from function.chatbot import ChatBotReply #Initialize Flask App app = Flask(__name__) #Calling GetAllStall function in data/stall.py Stall = GetAllStall() #Calling GetDay function in data/time.py (2019-09-10) GetDay = GetDay() #Calling GetDayOnly function in data/time.py (Wednesday) DayOnly = GetDayOnly() #Get Stripe Key used for credit card payment [This is test mode only] key = GetStripeKey() #Whenever user access our website link: https://cz1003.herokuapp.com/ @app.route("/") def HomePage(): #It will give users home.html page return render_template('home.html') #Whenever user access our website link: https://cz1003.herokuapp.com/stall #GET Request happens when you just load the page normally #POST request happens when you send additional data to this page. #For Example: When user search stall function @app.route("/stall", methods=['GET', 'POST']) def StallPage():