示例#1
0
    def GET(self):
        session = web.config._session
        if (session.roleid == 2):
            return waiter.make_waiter_page()
        elif (session.roleid == 1):
            raise web.seeother('/manager')
        elif (session.roleid == 3):
            raise web.seeother('/active_orders')
        elif (session.roleid == 4):
            raise web.seeother('/customer_login')

        return render_page(None)
示例#2
0
 def POST(self):
     pdata = web.input(order_id=0, action=None)
     session = web.config._session
     if(session.roleid == 2):
         mess = ""
         if str(pdata.action) == "accept":
             accept_receipt(int(pdata.order_id))
             mess = update_status(int(pdata.order_id), status=1)
         else:
             mess = reject_receipt(int(pdata.order_id))
         return waiter.make_waiter_page(message = mess)
     else:
         pay_receipt(int(pdata.order_id))
         return print_receipt(int(pdata.order_id))
示例#3
0
	def POST(self):
		waiter_id = web.config._session.userid
		order = create_new_order(waiter_id)
		return waiter.make_waiter_page(message = "Order: "+str(order)+" has been created.")
示例#4
0
	def POST(self):
		item = web.input(name=None, order_no=None, quantity=None)
		update_quantity(int(item.order_no), item.name, int(item.quantity))
		return waiter.make_waiter_page(message = item.quantity+" of Item: "+item.name+" added to order "+item.order_no)
示例#5
0
	def POST(self):
		item = web.input(name=None, order_no=None, quantity=None)
		add_item(int(item.order_no), item.id, int(item.quantity))
		return waiter.make_waiter_page(message = "Item successfully added to order "+item.order_no)
示例#6
0
 def POST(self):
     pdata = web.input(order_id = 0)
     rec_message = make_receipt(pdata.order_id)
     return waiter.make_waiter_page(message = rec_message)