def admin_menue(): admin1 = Admin.sign_in() menu_admin = int( input("Enter\n" "1-create event\n" "2-show event\n" "3-choose event\n" "4-chang total capacity\n" "5-buy ticket\n " "6-Back to previous menu\n " "Enter here:")) if menu_admin == 1: event = Event.event_() elif menu_admin == 2: show_event() elif menu_admin == 3: event_id = input("Enter id of event you want to select:") choose_event(event_id) elif menu_admin == 4: update_capacity() # elif menu_admin == 5: # Customer.buy_ticket() elif menu_admin == 6: menue() else: print("The entered option is not correct!!") admin_menue()
def menue(): print( Fore.YELLOW + "welcome to online sale ticket\n" " \n" " 1-login:\n" " 2-register:\n" " 3-exist:\n") choice = int(input("please enter your choice :")) if choice == 1: print(Fore.YELLOW + "1-admin:\n" "2-customer:\n") user_menue = int(input("enter your choice :")) if user_menue == 1: security = input("enter admin security code:") if security == "1234": admin1 = Admin.sign_in() if admin1 == 0: # print("you have entered wrong password and username") menue() else: admin_menu() else: print( Fore.YELLOW + "sorry! your security code is wrong! you can not login as an admin!" ) menue() elif user_menue == 2: user = Customer.sign_in() if user == 0: menue() else: customer_menue() else: menue() elif choice == 2: Customer.sign_up() menue() elif choice == 3: sys.exit() else: menue()