def newvenue(): if checkSession() == False: return redirect('login') if request.form.get('VenueName') is None: v = venueList() v.set('VenueName', '') v.set('VenueAddress', '') v.set('VenueCollege', '') v.set('VenuePhoneNumber', '') v.add() return render_template('venue/newvenue.html', title='New Venue', venue=v.data[0]) else: v = venueList() v.set('VenueName', request.form.get('VenueName')) v.set('VenueAddress', request.form.get('VenueAddress')) v.set('VenueCollege', request.form.get('VenueCollege')) v.set('VenuePhoneNumber', request.form.get('VenuePhoneNumber')) v.add() if v.verifyNew(): v.insert() return render_template('venue/savedvenue.html', title='Venue Saved', venue=v.data[0]) else: return render_template('venue/newvenue.html', title='Venue Not Saved', venue=v.data[0], msg=v.errorList)
def newevent(): if checkSession() == False: return redirect('login') allVenues = venueList() allVenues.getAll() if request.form.get('name') is None: e = eventList() e.set('VenueID', '') e.set('name', '') e.set('start', '') e.set('end', '') e.add() return render_template('event/newevent.html', title='New Event', event=e.data[0], vl=allVenues.data) else: e = eventList() e.set('VenueID', request.form.get('VenueID')) e.set('name', request.form.get('name')) e.set('start', request.form.get('start')) e.set('end', request.form.get('end')) e.add() if e.verifyNew(): e.insert() return render_template('event/savedevent.html', title='Event Saved', event=e.data[0], vl=allVenues.data) else: return render_template('event/newevent.html', title='Event Not Saved', event=e.data[0], msg=e.errorList, vl=allVenues.data)
def customervenues(): v = venueList() v.getAll() #print(c.data) #return '' return render_template('venue/customervenues.html', title='Venue List', venues=v.data)
def deletevenue(): if checkSession() == False: return redirect('login') print("VenueID:", request.form.get('VenueID')) #return '' v = venueList() v.deleteById(request.form.get('VenueID')) return render_template('confirmaction.html', title='Venue Deleted', msg='Venue deleted.')
def customerevents(): allVenues = venueList() allVenues.getAll() e = eventList() e.getAll() #print(c.data) #return '' return render_template('event/customerevents.html', title='Event List', events=e.data, vl=allVenues.data)
def onevenue(): if checkSession() == False: return redirect('login') v = venueList() if request.args.get('id') is None: return render_template('error.html', msg='No venue id given') v.getById(request.args.get('id')) if len(v.data) <= 0: return render_template('error.html', msg='Venue not found') print(v.data) return render_template('venue/venue.html', title='Venue', venue=v.data[0])
def savevenue(): if checkSession() == False: return redirect('login') v = venueList() v.set('VenueID', request.form.get('VenueID')) v.set('VenueName', request.form.get('VenueName')) v.set('VenueAddress', request.form.get('VenueAddress')) v.set('VenueCollege', request.form.get('VenueCollege')) v.set('VenuePhoneNumber', request.form.get('VenuePhoneNumber')) v.add() v.update() print(v.data) return render_template('venue/savedvenue.html', title='Venue Saved', venue=v.data[0])
def oneevent(): if checkSession() == False: return redirect('login') allVenues = venueList() allVenues.getAll() e = eventList() if request.args.get('id') is None: return render_template('error.html', msg='No event id given') e.getById(request.args.get('id')) if len(e.data) <= 0: return render_template('error.html', msg='Event not found') print(e.data) return render_template('event/event.html', title='Event', event=e.data[0], vl=allVenues.data)