Beispiel #1
0
def fadd():
    riders = ridersClass(dsn = app.config['dsn'])
    personal = personalClass(dsn = app.config['dsn'])
    result = fansClass(dsn = app.config['dsn'])
    now = datetime.datetime.now()
    if 'adddefault' in request.form:
        NAME = request.form['name']
        SURNAME = request.form['surname']
        MAIL = request.form['mail']
        BIRTH = request.form['birth']
        FANSID = request.form['fansid']
        result.add_fans_default(NAME, SURNAME, MAIL, BIRTH, FANSID)
    return render_template('/riders/addfan.html', riders=riders.load_riders(), personal=personal.load_personal(), current_time=now.ctime())
Beispiel #2
0
def fans():
    riders = ridersClass(dsn = app.config['dsn'])
    personal = personalClass(dsn = app.config['dsn'])
    result = fansClass(dsn = app.config['dsn'])
    now = datetime.datetime.now()
    if 'adddefault' in request.form:
        NAME = request.form['name']
        SURNAME = request.form['surname']
        MAIL = request.form['mail']
        BIRTH = request.form['birth']
        FANSID = request.form['fansid']
        result.add_fans_default(NAME, SURNAME, MAIL, BIRTH, FANSID)
    elif 'updatebymail' in request.form:
        CMAIL = request.form['cmail']
        NAME = request.form['name']
        SURNAME = request.form['surname']
        MAIL = request.form['mail']
        BIRTH = request.form['birth']
        result.update_fans_by_mail(NAME, SURNAME, MAIL, BIRTH, CMAIL)
    elif 'updatebynum' in request.form:
        NUM = request.form['num']
        NAME = request.form['name']
        SURNAME = request.form['surname']
        MAIL = request.form['mail']
        BIRTH = request.form['birth']
        FANSID = request.form['fansid']
        result.update_fans_by_rider(NUM, NAME, SURNAME, MAIL, BIRTH, FANSID)
    elif 'searchdefault' in request.form:
        NAME = request.form['name']
        SURNAME = request.form['name']
        MAIL = request.form['mail']
        FANSID = request.form['fansid']
        return render_template('/riders/fans.html', result=result.search_fans_default(NAME, SURNAME, MAIL, FANSID),riders=riders.load_riders(), personal=personal.load_personal(), current_time=now.ctime())
    elif 'delbymail' in request.form:
        MAIL = request.form['mail']
        result.del_fans_by_mail(MAIL)
    elif 'delbynum' in request.form:
        NUM = request.form['num']
        result.del_fans_by_num(NUM)
    return render_template('/riders/fans.html', result=result.load_fans(),riders=riders.load_riders(), personal=personal.load_personal(), current_time=now.ctime())
Beispiel #3
0
def reset():
    with dbapi2.connect(app.config['dsn']) as connection:
            cursor = connection.cursor()
            query = """DROP TABLE IF EXISTS FANS"""
            cursor.execute(query)
            cursor = connection.cursor()
            query = """DROP TABLE IF EXISTS PERSONAL"""
            cursor.execute(query)
            cursor = connection.cursor()
            query = """DROP TABLE IF EXISTS YEARSTATS"""
            cursor.execute(query)
            cursor = connection.cursor()
            query = """DROP TABLE IF EXISTS RIDERS"""
            cursor.execute(query)
    riders = ridersClass(dsn = app.config['dsn'])
    riders.fill()
    stats = yearstatsClass(dsn = app.config['dsn'])
    stats.fill()
    personal = personalClass(dsn = app.config['dsn'])
    personal.fill()
    fans = fansClass(dsn = app.config['dsn'])
    return redirect(url_for('home_page'))
Beispiel #4
0
def personal():
    riders = ridersClass(dsn = app.config['dsn'])
    result = personalClass(dsn = app.config['dsn'])
    now = datetime.datetime.now()
    if 'adddefault' in request.form:
        BIRTH = request.form['birth']
        WEIGHT = request.form['weight']
        HEIGHT = request.form['height']
        FAVCIR = request.form['favcir']
        WEBSITE = request.form['website']
        FACEB = request.form['faceb']
        TWIT = request.form['twit']
        INSTA = request.form['insta']
        PERSID = request.form['persid']
        result.add_personal_default(BIRTH, WEIGHT, HEIGHT, FAVCIR, WEBSITE, FACEB, TWIT, INSTA, PERSID)
    elif 'updatebyrider' in request.form:
        BIRTH = request.form['birth']
        WEIGHT = request.form['weight']
        HEIGHT = request.form['height']
        FAVCIR = request.form['favcir']
        WEBSITE = request.form['website']
        FACEB = request.form['faceb']
        TWIT = request.form['twit']
        INSTA = request.form['insta']
        PERSID = request.form['persid']
        result.update_personal_by_rider(BIRTH, WEIGHT, HEIGHT, FAVCIR, WEBSITE, FACEB, TWIT, INSTA, FANS, PERSID)
    elif 'searchdefault' in request.form:
        PERSID = request.form['persid']
        return render_template('/riders/personal.html', result=result.search_personal_default(PERSID),riders=riders.load_riders(), current_time=now.ctime())
    elif 'delbyrider' in request.form:
        PERSID = request.form['persid']
        result.del_personal_by_rider(PERSID)
    elif 'delbynum' in request.form:
        NUM = request.form['num']
        result.del_personal_by_num(NUM)
    return render_template('/riders/personal.html', result=result.load_personal(),riders=riders.load_riders(), current_time=now.ctime())