def check_bookings(id): gymsession = gymsession_repository.view(id) bookings = gymsession_repository.bookings(gymsession) return render_template('gymsessions/participants.html', title='Participants', gymsession=gymsession, bookings=bookings)
def confirm_booking(): member_id = request.form['member_id'] gymsession_id = request.form['gymsession_id'] member = member_repository.view(member_id) gymsession = gymsession_repository.view(gymsession_id) new_booking = Booking(member, gymsession) booking_repository.add_new(new_booking) return render_template('bookings/confirm_booking.html')
def view_all(): bookings = [] sql = 'SELECT * FROM bookings' results = run_sql(sql) for row in results: member = member_repository.view(row['member_id']) gymsession = gymsession_repository.view(row['gymsession_id']) booking = Booking(member, gymsession, row['attended'], row['id']) bookings.append(booking) return bookings
def edit(id): gymsession = gymsession_repository.view(id) return render_template('gymsessions/edit.html', title='Edit Gymsession', gymsession=gymsession)
def delete_gymsession(id): gymsession = gymsession_repository.view(id) return render_template('gymsessions/delete.html', title='Delete Session', gymsession=gymsession)
def view(id): gymsession = gymsession_repository.view(id) return render_template('gymsessions/gymsession.html', title='Session Details', gymsession=gymsession)