Esempio n. 1
0
def joinEvents(eventid):
    cursor = connsql.initCursor()
    connsql.joinEvent(cursor, eventid, session['individual_id'])
    if (session['userStatus'] == 'I'):
        connsql.updateCoinsIndividual(cursor)
    else:
        connsql.updateCoinsBusiness(cursor)
    return redirect(url_for('events'))
Esempio n. 2
0
def businesses():
    """Renders the about page."""
    cursor = connsql.initCursor()
    connsql.updateCoinsBusiness(cursor)
    return render_template('businesses.html',
                           title='Businesses',
                           year=datetime.now().year,
                           message='Your application description page.')
Esempio n. 3
0
def purchase(itemid):
    cursor = connsql.initCursor()

    if (session['userStatus'] == 'I'):
        connsql.purchaseIndiv(cursor, itemid, session['individual_id'])
        connsql.updateCoinsIndividual(cursor)
    else:
        connsql.purchaseBus(cursor, itemid, session['business_id'])
        connsql.updateCoinsBusiness(cursor)
    return redirect(url_for('marketplace'))
Esempio n. 4
0
def events():
    cursor = connsql.initCursor()
    if (session['userStatus'] == 'I'):
        connsql.updateCoinsIndividual(cursor)
    else:
        connsql.updateCoinsBusiness(cursor)
    cursor.execute("Select * from Events")
    return render_template('events.html',
                           title='Events',
                           year=datetime.now().year,
                           events=cursor,
                           intohtml=intohtml)
Esempio n. 5
0
def createEvent():
    """Renders the register page. Recieves register page and sends to sql db"""
    form = EventRegistrationForm(request.form)
    if request.method == 'POST' and form.validate():
        cursor = connsql.initCursor()
        connsql.insertEvent(cursor, form.eventName.data,
                            form.eventDescription.data, form.eventCoins.data,
                            form.eventDate.data, session['business_id'],
                            form.eventLength.data)
        connsql.updateCoinsBusiness(cursor)
        return redirect(url_for('home'))
    return render_template('createevents.html', form=form)