Exemplo n.º 1
0
def tickets():
    t = ticketList()
    t.getByCustomer(session['user']['UID'])

    #print(c.data)
    #return ''
    return render_template('ticket/tickets.html',
                           title='Ticket List',
                           tickets=t.data)
Exemplo n.º 2
0
def newcustomerticket():
    if checkSession() == False:
        return redirect('login')
    allEvents = eventList()
    allEvents.getAll()
    if request.form.get('section') is None:
        t = ticketList()
        t.set('EventID', '')
        t.set('section', '')
        t.set('row', '')
        t.set('available', '')
        t.set('handicap', '')
        t.set('type', '')
        t.set('box', '')
        t.set('UserID', '')
        t.add()
        return render_template('ticket/newticket.html',
                               title='New Ticket',
                               ticket=t.data[0],
                               el=allEvents.data)
    else:
        t = ticketList()
        t.set('EventID', request.form.get('EventID'))
        t.set('section', request.form.get('section'))
        t.set('row', request.form.get('row'))
        t.set('available', request.form.get('available'))
        t.set('handicap', request.form.get('handicap'))
        t.set('type', request.form.get('type'))
        t.set('box', request.form.get('box'))
        t.set('UserID', session['user']['UID'])
        t.add()
        if t.verifyNew():
            t.insert()
            return render_template('ticket/savedticket.html',
                                   title='Ticket Saved',
                                   ticket=t.data[0],
                                   el=allEvents.data)
        else:
            return render_template('ticket/newticket.html',
                                   title='Ticket Not Saved',
                                   ticket=t.data[0],
                                   msg=t.errorList,
                                   el=allEvents.data)
Exemplo n.º 3
0
def mytickets():
    if checkSession() == False:
        return redirect('login')
    t = ticketList()
    t.getByCustomer(session['user']['UID'])

    print(t.data)
    #return ''
    return render_template('ticket/mytickets.html',
                           title='My tickets',
                           tickets=t.data)
Exemplo n.º 4
0
def customertickets():
    allEvents = eventList()
    allEvents.getAll()
    t = ticketList()
    t.getByCustomer(session['user']['UID'])

    #print(c.data)
    #return ''
    return render_template('ticket/customertickets.html',
                           title='Ticket List',
                           tickets=t.data,
                           el=allEvents.data)
Exemplo n.º 5
0
def alltickets():
    if checkSession() == False:
        return redirect('login')
    allEvents = eventList()
    allEvents.getAll()
    t = ticketList()
    t.getAll()

    print(t.data)
    #return ''
    return render_template('ticket/tickets.html',
                           title='My tickets',
                           tickets=t.data,
                           el=allEvents.data)
Exemplo n.º 6
0
def oneticket():
    if checkSession() == False:
        return redirect('login')
    allEvents = eventList()
    allEvents.getAll()
    t = ticketList()
    if request.args.get('id') is None:
        return render_template('error.html', msg='No ticket id given')

    t.getById(request.args.get('id'))
    if len(t.data) <= 0:
        return render_template('error.html', msg='Ticket not found')

    print(t.data)
    return render_template('ticket/ticket.html',
                           title='Ticket',
                           ticket=t.data[0],
                           el=allEvents.data)
Exemplo n.º 7
0
def saveticket():
    if checkSession() == False:
        return redirect('login')
    t = ticketList()
    t.set('TID', request.form.get('TID'))
    t.set('EventID', request.form.get('EventID'))
    t.set('section', request.form.get('section'))
    t.set('row', request.form.get('row'))
    t.set('available', request.form.get('available'))
    t.set('handicap', request.form.get('handicap'))
    t.set('type', request.form.get('type'))
    t.set('box', request.form.get('box'))
    t.set('UserID', session['user']['UID'])
    t.add()
    t.update()
    print(t.data)
    return render_template('ticket/savedticket.html',
                           title='Ticket Saved',
                           ticket=t.data[0])