def btn_click_bookFlight( label , btn ):#............................................................................. print("Book FLIGHT") if css.global_user=="please log-in": messagebox.showerror("Error", "You must log in first in Main Menu") return if messagebox.askokcancel("Book", "Are you sure you want to book this flight?"): #label.config(text="Flight Booked!") btn.config(state='disabled') btn.config(text="Flight Booked!") ########################################################### print("USER NAME:" + css.global_user) print("ENTERED FLIGHT NUMBER:" + str(entered_Flight_ID_numb)) #conn = db.db_connect() #sqlcode_custflight= "INSERT INTO CUST_FLIGHT VALUES(?,?,?)" #sqlcode_updatecapacity = "UPDATE FLIGHTS SET CAPACITY = CAPACITY - 1 WHERE FLIGHT_ID = ?" #conn.execute(sqlcode_custflight, (css.global_user, entered_Flight_ID_numb, "SEARCH_ENGINE")) #conn.execute(sqlcode_updatecapacity, (entered_Flight_ID_numb,)) #conn.close() db.book_a_flight(css.global_user, entered_Flight_ID_numb, "SEARCH_ENGINE")
def btn_click_bookFlight( label, btn ): # ............................................................................. print("Book FLIGHT") if css.global_user == "please log-in": messagebox.showerror("Error", "You must log in first in Main Menu") return if messagebox.askokcancel("Book", "Are you sure you want to book this flight?"): # label.config(text="Flight Booked!") btn.config(state='disabled') btn.config(text="Flight Booked!") print(css.global_user) print(entered_Flight_ID_numb) db.book_a_flight(css.global_user, entered_Flight_ID_numb, "AIRLINE_GUI")