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)
def repair(): repairs = mainEngine.listPersonalOngoingRepairs(session['userID']) cars = mainEngine.listCars() return render_template("engineer/repair.html", cars=cars, repairs=repairs)
def repairhistory(): repairs = mainEngine.listPersonalRepairsHistory(session['userID']) cars = mainEngine.listCars() return render_template("engineer/repairhistory.html", cars=cars, repairs=repairs)
def booking(): bookings = mainEngine.listPersonalOngoingBooking(session['userID']) cars = mainEngine.listCars() return render_template("customer/booking.html", cars=cars, bookings=bookings)
def history(): bookings = mainEngine.listPersonalBookingHistory(session['userID']) cars = mainEngine.listCars() return render_template("customer/bookhistory.html", cars=cars, bookings=bookings)