def addStall(): stall_no = request.form['stallNo'] price = request.form['stallPrice'] stall_size = request.form['stallSize'] isBooked = 0 event_name = request.form['stallEvent'] event_id = tfb.eventID(event_name) tfb.addStall(stall_no, price, stall_size, isBooked, event_id) return redirect('/')
def updateStall(): stall_id = request.form['modifyStall'][0] stall_no = request.form['stallNo'] price = request.form['stallPrice'] stall_size = request.form['stallSize'] event_name = request.form['stallEvent'] event_id = tfb.eventID(event_name) tfb.updateStall(stall_id, stall_no, price, stall_size, event_id) return redirect('/')
def updateBooking(): booking_date = request.form['bookingDate'] event = request.form['bookingEvent'] exhibitor = request.form['bookingExhibitor'] stall = request.form['bookingStall'] event_id = tfb.eventID(event) exhibitor_id = tfb.exhibitorID(exhibitor) stall_id = tfb.stallId(stall, event_id) booking_id = request.form['modifyBooking'][0] tfb.updateBooking(booking_id, booking_date, event_id, exhibitor_id, stall_id) return redirect('/')
def addTransaction(): spend = request.form['transactionSpend'] spend_date = request.form['transactionSpendDate'] payment_method = request.form['transactionPaymentMethod'] event = request.form['transactionEvent'] exhibitor = request.form['transactionExhibitor'] visitor_id = request.form['transactionVisitor'][0] event_id = tfb.eventID(event) exhibitor_id = tfb.exhibitorID(exhibitor) tfb.addTransaction(spend, spend_date, payment_method, event_id, exhibitor_id, visitor_id) return redirect("/")
def addBooking(): global message booking_date = request.form['bookingDate'] event = request.form['bookingEvent'] exhibitor = request.form['bookingExhibitor'] stall = request.form['bookingStall'] event_id = tfb.eventID(event) exhibitor_id = tfb.exhibitorID(exhibitor) stall_id = tfb.stallId(stall, event_id) if tfb.addBooking(booking_date, event_id, exhibitor_id, stall_id) == -1: message = "Stall already Booked" return redirect('/')
def updateTransaction(): transaction_id = request.form['modifyTransaction'][0] spend = request.form['transactionSpend'] spend_date = request.form['transactionSpendDate'] payment_method = request.form['transactionPaymentMethod'] event = request.form['transactionEvent'] exhibitor = request.form['transactionExhibitor'] visitor_id = request.form['transactionVisitor'][0] event_id = tfb.eventID(event) exhibitor_id = tfb.exhibitorID(exhibitor) tfb.updateTransaction(transaction_id, spend, spend_date, payment_method, event_id, exhibitor_id, visitor_id) return redirect('/')