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'))
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.')
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'))
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)
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)