def ride_status_window(self,ride_details): if(ride_details!=0): if ride_details[0][7]=="PENDING": alert.showinfo("Info","Searching for the drivers.\nPlease wait for few seconds") else: def ok_clicked(): customer_ride_status_window.destroy() customer_ride_status_window = Tk.Tk() customer_ride_status_window.geometry("500x330") customer_ride_status_window.title("Ride") ride_info = "RIDE ID: "+ride_details[0][6]+"\nPICK-UP LOCATION: "+ride_details[0][0] +"\nDESTINATION: "+ride_details[0][1] +"\n" +"NO OF PEOPLE: " +ride_details[0][2] + "\n" +"LUGGAGE QUANTITY: "+ ride_details[0][3] \ + "\n" + "RIDE TYPE: "+ride_details[0][4]+"\n\n" driver_details=DbManager.fetch_user_details(self,ride_details[0][8]) driver_info="Driver Name: "+driver_details[0]+", "+driver_details[1]+"\n" +"Driver Contact No: "+ str(driver_details[3]) ride_status_info=ride_info+"\n"+driver_info status = Tk.Label(customer_ride_status_window, text="STATUS: "+ride_details[0][7]) status.config(font=("Courier", 20)) status.place(x=70, y=40) heading = Tk.Label(customer_ride_status_window, text="Ride Status") heading.place(x=220, y=10) ride_info_field = Tk.Label(customer_ride_status_window, text=ride_status_info) ride_info_field.place(x=140, y=90) ok_button = Tk.Button(customer_ride_status_window, text="OK", width=15, height=2,command=ok_clicked) ok_button.place(x=180, y=270) customer_ride_status_window.mainloop() else: alert.showinfo("Info","No ride booked!")
def verify_customer(): ride_id_to_verify_customer = DbManager.get_ride_id_to_verify_customer( self, username) if (ride_id_to_verify_customer == 0): ride_id_to_verify_customer_status = DbManager.fetch_ride_status_verification( self, username) if (ride_id_to_verify_customer_status == 0 or ride_id_to_verify_customer_status[0][0] == "COMPLETED"): alert.showinfo("Info", "No rides accepted to verify!") elif (ride_id_to_verify_customer_status[0][0] == "RUNNING"): alert.showinfo("Info", "You are already running a ride!") else: ride_details = DbManager.fetch_ride_details( self, ride_id_to_verify_customer[0][0]) user_Details = DbManager.fetch_user_details( self, ride_details[5]) driver_window.withdraw() Ride_acceptance_window.verify_customer_window( self, ride_details, user_Details, driver_window)