예제 #1
0
def ftickets():
    with dbapi2.connect(app.config['dsn']) as connection:
        _ticketList = dbmanager.getTickets(connection)
        _sponsorList = dbmanager.getSponsor(connection)
        _channelList = dbmanager.getChannels(connection)
        _info = layoutInfo('If you go step by step, with confidence, you can go far.','RONNIE O-SULLIVAN','static/img/players.jpg')
        return render_template('ftickets.html', ticketList = _ticketList, info = _info, sponsorList = _sponsorList, channelList = _channelList)
예제 #2
0
def ticket():
    with dbapi2.connect(app.config['dsn']) as connection:
        if(request.method == 'GET'):
            _ticketList = dbmanager.getTickets(connection)
            return render_template('ticket.html', ticketList = _ticketList)

        if(request.form["action"] == "add_ticket_action"):
            dbmanager.addTicket(request.form['add_ticket_venue'], request.form['add_ticket_title'], request.form['add_ticket_content'],request.form['add_ticket_price'], request.form['add_ticket_exturl'], request.form['add_ticket_date'],connection)
            return redirect(url_for('ticket'))

        if(request.form["action"] == "delete_ticket_action"):
            dbmanager.deleteTicket(request.form['id'], connection)
            return redirect(url_for('ticket'))