Пример #1
0
def insertSeats():
    modelCode = request.form.get('modelCode')
    seatClass = request.form.get('seatClass')
    model = PlaneModel.SelectPlaneModelsID(modelCode)
    Seat = Seats("NULL", model, seatClass)
    Seat.InsertSeats()
    return redirect('/seats')
Пример #2
0
def editSeats():
    seatNumber = request.form.get('seatNumber')
    modelCode = request.form.get('modelCode')
    seatClass = request.form.get('seatClass')
    model = PlaneModel.SelectPlaneModelsID(modelCode)
    Seat = Seats.SelectSeatsID(seatNumber)
    Seat.UpdateSeats(model, seatClass)
    return redirect('/seats')
Пример #3
0
def insertFlightUser():
    idFlight = request.form.get('idFlight')
    idUser = request.form.get('idUser')
    seatNumber = request.form.get('seatNumber')
    flight = Flight.SelectFlightsID(idFlight)
    user = User.SelectUserID(idUser)
    seat = Seats.SelectSeatsID(seatNumber)
    flightUser = FlightUser(flight, user, seat)
    flightUser.InsertFlightUser()
    return redirect('/flightUser')
Пример #4
0
def reservarViaje():
    idFlight = request.form.get('idFlight')
    idSeat = request.form.get('idSeat')
    flight = Flight.SelectFlightsID(idFlight)
    user = User.SelectUserID(session['idUser'])
    seat = Seats.SelectSeatsID(idSeat)
    flightUser = FlightUser(flight, user, seat)
    if flightUser not in FlightUser.SelectFlightUser():
        flightUser.InsertFlightUser()
    return redirect('home')
Пример #5
0
def editFlightUser():
    oldIDFlight = request.form.get('oldIDFlight')
    oldIDUser = request.form.get('oldIDUser')
    idFlight = request.form.get('idFlight')
    idUser = request.form.get('idUser')
    seatNumber = request.form.get('seatNumber')
    flight = Flight.SelectFlightsID(idFlight)
    user = User.SelectUserID(idUser)
    seat = Seats.SelectSeatsID(seatNumber)
    flightUser = FlightUser.SelectFlightUserID(oldIDFlight, oldIDUser)
    flightUser.UpdateFlightUser(flight, user, seat)
    return redirect('/flightUser')
Пример #6
0
def elegirAsiento():
    salida = request.form.get('salida')
    llegada = request.form.get('llegada')
    fechaIda = request.form.get('fechaIda')
    fechaVuelta = request.form.get('fechaVuelta')
    listaFlight = Flight.BuscarSalidaLLegadaFechaIdaFechaVuelta(
        salida, llegada, fechaIda, fechaVuelta)
    asientos = Seats.SelectSeats()
    listaAsientos = []
    for item in listaFlight:
        for item2 in asientos:
            if item2.Model.code == item.Plane.Model.code:
                listaAsientos.append(item2)
    return render_template('elegirAsiento.html',
                           listaAsientos=listaAsientos,
                           salida=salida,
                           llegada=llegada,
                           fechaIda=fechaIda,
                           fechaVuelta=fechaVuelta)
Пример #7
0
def deleteSeats():
    seatNumber = request.args.get('seatNumber')
    Seats.DeleteSeats(seatNumber)
    return redirect('/seats')
Пример #8
0
def seat():
    seatLista = Seats.SelectSeats()
    return render_template('Seats.html', seatLista=seatLista)
 def GetFlightUser(dic):
     flight = Flight.SelectFlightsID(dic["idFlight"])
     user = User.SelectUserID(dic["idUser"])
     seat = Seats.SelectSeatsID(dic["seatNumber"])
     return flight, user, seat