Exemple #1
0
def cars():
    if session['type'] == 'c':
        mark = []
        cars = mainEngine.listAvailableCars()
        for car in cars:
            print(car[5])
            x = car[5].split(",")
            mark.append((float(x[1]), float(x[2]), car[1]))
        gmap = Map(
            identifier="gmap",
            varname="gmap",
            #MELBOURNE COORDINATE
            lat=-37.8136,
            lng=144.9631,
            markers={
                icons.dots.blue: mark,
            },
            style=
            "height:300px;width:300px;margin:0;margin-left:auto;margin-right:auto;",
        )
        return render_template("customer/carlist.html", cars=cars, gmap=gmap)
    elif session['type'] == 'a':
        mark = []
        cars = mainEngine.listCars()
        for car in cars:
            x = car[5].split(",")
            mark.append((float(x[1]), float(x[2]), car[1]))
        gmap = Map(
            identifier="gmap",
            varname="gmap",
            #MELBOURNE COORDINATE
            lat=-37.8136,
            lng=144.9631,
            markers={
                icons.dots.blue: mark,
            },
            style=
            "height:300px;width:300px;margin:0;margin-left:auto;margin-right:auto;",
        )
        return render_template("admin/carlist.html", cars=cars, gmap=gmap)
    elif session['type'] == 'e':
        mark = []
        cars = mainEngine.listBrokenCars()
        for car in cars:
            x = car[5].split(",")
            mark.append((float(x[1]), float(x[2]), car[1]))
        gmap = Map(
            identifier="gmap",
            varname="gmap",
            #MELBOURNE COORDINATE
            lat=-37.8136,
            lng=144.9631,
            markers={
                icons.dots.blue: mark,
            },
            style=
            "height:300px;width:300px;margin:0;margin-left:auto;margin-right:auto;",
        )
        return render_template("engineer/carlist.html", cars=cars, gmap=gmap)
Exemple #2
0
def repair():
    repairs = mainEngine.listPersonalOngoingRepairs(session['userID'])
    cars = mainEngine.listCars()
    return render_template("engineer/repair.html", cars=cars, repairs=repairs)
Exemple #3
0
def repairhistory():
    repairs = mainEngine.listPersonalRepairsHistory(session['userID'])
    cars = mainEngine.listCars()
    return render_template("engineer/repairhistory.html",
                           cars=cars,
                           repairs=repairs)
Exemple #4
0
def booking():
    bookings = mainEngine.listPersonalOngoingBooking(session['userID'])
    cars = mainEngine.listCars()
    return render_template("customer/booking.html",
                           cars=cars,
                           bookings=bookings)
Exemple #5
0
def history():
    bookings = mainEngine.listPersonalBookingHistory(session['userID'])
    cars = mainEngine.listCars()
    return render_template("customer/bookhistory.html",
                           cars=cars,
                           bookings=bookings)