예제 #1
0
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)
예제 #2
0
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')
예제 #3
0
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
예제 #4
0
def edit(id):
    gymsession = gymsession_repository.view(id)
    return render_template('gymsessions/edit.html',
                           title='Edit Gymsession',
                           gymsession=gymsession)
예제 #5
0
def delete_gymsession(id):
    gymsession = gymsession_repository.view(id)
    return render_template('gymsessions/delete.html',
                           title='Delete Session',
                           gymsession=gymsession)
예제 #6
0
def view(id):
    gymsession = gymsession_repository.view(id)
    return render_template('gymsessions/gymsession.html',
                           title='Session Details',
                           gymsession=gymsession)