Example #1
0
class destinationUI:
    def __init__(self):
        self.general = GeneralUI()
        self.logicAPI = LogicAPI()
        self.destination_menu()
        # self.ui_print_type()

    #Prints UI for new destination
    def ui_new_destination(self):
        destinationFieldnames = [
            "country", "city", "airport", "phone_number", "opening_time",
            "closing_time", "main_contact"
        ]
        inputList = []
        print("\nPress 'q' and hit 'enter' to cancel at any time.")
        print(
            "\nPlease enter the following details to create a new destination:"
        )
        user_input = ""
        user_input = ""
        for field in destinationFieldnames:
            if user_input.lower() == "q":
                return self.destination_menu()
            user_input = input(f"Enter {field}: ")
            inputList.append(user_input)
        return inputList

    #Request new value from user
    def value_input(self):
        return input("Enter new value: ")

    #Creates the Edit menu layout and returns the destination Instance after edit
    def ui_edit_destination(self):
        self.ui_all_destinations()
        destination = self.ui_single_destination_ID(
        )  #prints specific destination
        selection = ""

        while selection != "9":
            self.ui_print_edit_menu()  #ask user what he would like to edit
            selection = self.general.ui_edit_input()
            if selection == "1":
                destination.country = self.value_input()
            elif selection == "2":
                destination.city = self.value_input()
            elif selection == "3":
                destination.airport = self.value_input()
            elif selection == "4":
                destination.phone_number = self.value_input()
            elif selection == "5":
                destination.opening_time = self.value_input()
            elif selection == "6":
                destination.closing_time = self.value_input()
            elif selection == "7":
                destination.main_contact = self.value_input()
            elif selection == "8":
                destination.state = self.value_input()
            elif selection == "9":
                return destination

    #Prints the destination Edit menu options
    def ui_print_edit_menu(self):
        '''Prints options for Edit menu and accepts input'''
        self.general.ui_menu_header("Edit destination")
        print("\nSelect field to edit:")
        print("1. Country")
        print("2. City")
        print("3. Airport")
        print("4. Phone Number")
        print("5. Opening Time")
        print("6. Closing Time")
        print("7. Main Contact")
        print("8. State")
        print("9. Exit")
        self.general.ui_menu_footer()

    #Print Destination Table Header
    def ui_destination_table_header(self):
        print(
            f"{'Unique ID':<20}{'Country':<20}{'City':<20}{'Airport':<20}{'Phone Number':<20}{'Opening Time':<20}{'Closing Time':<20}{'Main Contact':<20}"
        )
        print("-" * 200)

    #Print destination Table Footer
    def ui_destination_table_footer(self):
        print("-" * 200)
        print()

    #Prints all destinations
    def ui_all_destinations(self):
        results = self.logicAPI.all_destinations()
        print("\nAll destinations:")
        self.ui_destination_table_header()
        for destination in results:
            print(destination)
        self.ui_destination_table_footer()

    #Prints destination with unique ID
    def ui_single_destination_ID(self):
        '''Prints a single destination with a unique ID'''
        destination_ID = input(">> Please enter destination ID: ")
        destination = self.logicAPI.search_destinations_by_id(destination_ID)
        print("\ndestination by ID: " + destination_ID)
        self.ui_destination_table_header()
        for destination in destination:
            print(destination)
        self.ui_destination_table_footer()
        return destination

    ### search function ###

    def ui_country_available_print(self):
        '''Prints all destination type categories'''
        print("\nAvailable Options:")
        destinations = self.logicAPI.available_country()
        for destination in destinations:
            print("\t" + destination)
        print()

    def ui_city_available_print(self):
        '''Prints all destination type categories'''
        print("\nAvailable Options:")
        destinations = self.logicAPI.available_city()
        for destination in destinations:
            print("\t" + destination)
        print()

    def ui_airport_available_print(self):
        '''Prints all destination type categories'''
        print("\nAvailable Options:")
        destinations = self.logicAPI.available_airport()
        for destination in destinations:
            print("\t" + destination)
        print()

    def ui_phone_number_available_print(self):
        '''Prints all destination type categories'''
        print("\nAvailable Options:")
        destinations = self.logicAPI.available_phone_number()
        for destination in destinations:
            print("\t" + destination)
        print()

    def ui_opening_time_available_print(self):
        '''Prints all destination type categories'''
        print("\nAvailable Options:")
        destinations = self.logicAPI.available_opening_time()
        for destination in destinations:
            print("\t" + destination)
        print()

    def ui_closing_time_available_print(self):
        '''Prints all destination type categories'''
        print("\nAvailable Options:")
        destinations = self.logicAPI.available_closing_time()
        for destination in destinations:
            print("\t" + destination)
        print()

    def ui_main_contact_available_print(self):
        '''Prints all destination type categories'''
        print("\nAvailable Options:")
        destinations = self.logicAPI.available_main_contact()
        for destination in destinations:
            print("\t" + destination)
        print()

    def ui_print_country(self):
        self.ui_country_available_print()
        country = input(">> Please enter destination Country: ")
        results = self.logicAPI.search_destination_by_country(country)
        print("\nSearch results for " + country + ": ")
        self.ui_destination_table_header()
        for destination in results:
            print(destination)
        self.ui_destination_table_footer()

    def ui_print_city(self):
        self.ui_city_available_print()
        city = input(">> Please enter destination City: ")
        results = self.logicAPI.search_destination_by_city(city)
        print("\nSearch results for " + city + ": ")
        self.ui_destination_table_header()
        for destination in results:
            print(destination)
        self.ui_destination_table_footer()

    def ui_print_airport(self):
        self.ui_airport_available_print()
        airport = input(">> Please enter destination Airport: ")
        results = self.logicAPI.search_destination_by_city(airport)
        print("\nSearch results for " + airport + ": ")
        self.ui_destination_table_header()
        for destination in results:
            print(destination)
        self.ui_destination_table_footer()

    def ui_print_phone_number(self):
        self.ui_phone_number_available_print()
        phone_number = input(">> Please enter destination Phone number: ")
        results = self.logicAPI.search_destination_by_phone_number(
            phone_number)
        print("\nSearch results for " + phone_number + ": ")
        self.ui_destination_table_header()
        for destination in results:
            print(destination)
        self.ui_destination_table_footer()

    def ui_print_opening_time(self):
        self.ui_opening_time_available_print()
        opening_time = input(">> Please enter destination Opening time: ")
        results = self.logicAPI.search_destination_by_opening_time(
            opening_time)
        print("\nSearch results for " + opening_time + ": ")
        self.ui_destination_table_header()
        for destination in results:
            print(destination)
        self.ui_destination_table_footer()

    def ui_print_closing_time(self):
        self.ui_closing_time_available_print()
        closing_time = input(">> Please enter destination Closing time: ")
        results = self.logicAPI.search_destination_by_closing_time(
            closing_time)
        print("\nSearch results for " + closing_time + ": ")
        self.ui_destination_table_header()
        for destination in results:
            print(destination)
        self.ui_destination_table_footer()

    def ui_print_main_contact(self):
        self.ui_main_contact_available_print()
        main_contact = input(">> Please enter destination Main contact: ")
        results = self.logicAPI.search_destination_by_main_contact(
            main_contact)
        print("\nSearch results for " + main_contact + ": ")
        self.ui_destination_table_header()
        for destination in results:
            print(destination)
        self.ui_destination_table_footer()

    ### search function ###

    #Prints the search menu for destinations
    def ui_search_menu(self):
        self.general.ui_menu_header("Destination Search")
        print("\nPlease select a search option:")
        self.UI_numbered_menu([
            "Country", "City", "Airport", "Phone Number", "Opening Time",
            "Closing Time", "Main Contact", "Exit"
        ])
        self.general.ui_menu_footer()
        selection = input("\n>> Select option: ")
        return selection

    #Prints any UI menu in order
    def UI_numbered_menu(self, a_list):
        '''Takes a list as parameter and prints all the items of a list in an order from 1. list[0], 2. list[1] and so on'''
        for i in range(0, (len(a_list))):
            print(f"{i+1}. {a_list[i]}")

    #Prints the destination Main Menu
    def destination_menu(self):
        while True:
            self.general.ui_menu_header("Destination Menu")
            print(
                "\nSelect an option...\n1. Create new destination \n2. Search destinations \n3. View all destinations \n4. Edit destination \n5. Delete destination \n6. Main Menu"
            )
            self.general.ui_menu_footer()
            command = input(">> Select option: ")
            command = command.lower()
            if command == "1":
                new_destination = self.ui_new_destination()
                self.logicAPI.create_destination(*new_destination)
            elif command == "2":
                selection = self.ui_search_menu()
                if selection == "1":
                    self.ui_print_country()
                elif selection == "2":
                    self.ui_print_city()
                elif selection == "3":
                    self.ui_print_airport()
                elif selection == "4":
                    self.ui_print_phone_number()
                elif selection == "5":
                    self.ui_print_opening_time()
                elif selection == "6":
                    self.ui_print_closing_time()
                elif selection == "7":
                    self.ui_print_main_contact()
                elif selection == "8":
                    return
            elif command == "3":
                self.ui_all_destinations()
            elif command == "4":
                new_destination = self.ui_edit_destination()
                self.logicAPI.edit_destination(new_destination)
            elif command == "5":
                self.ui_all_destinations()
                destination_id = input(">> Enter destination ID to delete: ")
                destination = self.logicAPI.delete_destination(destination_id)
                for result in destination:
                    print(result)
            elif command == "6":
                return
            else:
                print("Invalid command, try again")
Example #2
0
class ContractUI:
    def __init__(self):
        self.general = GeneralUI()
        self.logic = LogicAPI()
        self.contract_main_menu()

    ### GENERAL FUNCTIONS ###

    #Prints any UI menu in numbered list
    def ui_numbered_menu(self, a_list):
        '''Takes a list as parameter and prints all the items of a list in an order from 1. list[0], 2. list[1] and so on'''
        for i in range(0, (len(a_list))):
            print(f"{i+1}. {a_list[i]}")

    def print_select_option(self):
        return input(">> Select option: ").lower()

    def print_table_header(self):
        print()
        print(
            f'{"Contract ID":<15}{"Customer Name":<15}{"Customer SSN":<15}{"Vehicle ID":<15}{"Contract Duration":<25}{"Country":<15}{"Employee":<15}{"Total price":<15}{"Creation Date":<15}{"Check-out Date":<15}{"Check-in Date":<15}{"Check-in Location":<25}{"State":<15}'
        )
        print("=" * 260)

    #Print Contract Table Footer
    def print_table_footer(self):
        print("-" * 260)
        print()

    def validate(self, date_text):
        try:
            datetime.datetime.strptime(date_text, '%d.%m.%y')
            return True
        except ValueError:
            print("\nIncorrect input, make sure the format is DD.MM.YY\n")
            return False

    def ui_country_available_print(self):
        '''Prints all destination type categories'''
        print("\nAvailable Options:")
        destinations = self.logic.available_country()
        for destination in destinations:
            print("\t" + destination)
        print()
        return destinations

    #Prints UI for new contract
    def new_contract(self):
        contractFieldnames = [
            "Customer name", "Customer Social Security No.", "Vehicle ID",
            "Start date of rental period (dd.mm.yy)",
            "End date of rental period (dd.mm.yy)", "Country", "Employee name",
            "Total price"
        ]  # + "Contract Creation Date"
        inputList = []
        print("\nPress 'q' and hit 'enter' to cancel at any time.")
        print("\nPlease enter the following details to create a new contract:")
        user_input = ""
        for field in contractFieldnames:
            if field == "Country":
                destinations = self.ui_country_available_print()
                user_input = ""
                while user_input not in destinations:
                    user_input = input(f"Enter {field}: ")
                    if user_input == "q":
                        break
            else:
                user_input = input(f"Enter {field}: ")
                if user_input.lower() == "q":
                    return self.contract_main_menu()
                #Checks start date format
                if contractFieldnames.index(field) == 3:
                    date_check = False
                    while user_input != "q":
                        date_check = self.validate(user_input)
                        if date_check == False:
                            user_input = input(f"Enter {field}: ")
                        else:
                            start_date = datetime.datetime.strptime(
                                user_input, '%d.%m.%y')
                            yesterday = datetime.datetime.today(
                            ) - datetime.timedelta(days=1)
                            if start_date <= yesterday:
                                print("Dates before today are invalid")
                                user_input = input(f"Enter {field}: ")
                            else:
                                break
                #Checks end date format
                elif contractFieldnames.index(field) == 4:
                    date_check = False
                    while user_input != "q":
                        date_check = self.validate(user_input)
                        if date_check == False:
                            user_input = input(f"Enter {field}: ")
                        else:
                            end_date = datetime.datetime.strptime(
                                user_input, '%d.%m.%y')
                            if start_date > end_date:
                                print("Dates before start date are invalid.")
                                user_input = input(f"Enter {field}: ")
                            else:
                                break
            inputList.append(user_input)
        #Add Contract creation date "Contract Creation Date"
        contract_creation_date = datetime.datetime.today()
        contract_creation_date = contract_creation_date.strftime('%d.%m.%y')
        inputList.append(contract_creation_date)
        return inputList

    ### CONTRACT MAIN MENU ###
    def contract_main_menu(self):
        while True:
            self.general.ui_menu_header("Contract Menu")
            print("\nPlease select a an option:")
            self.ui_numbered_menu([
                "Create contract", "Search contracts", "View all contracts",
                "Edit contract", "Cancel contract", "Delete contract",
                "Main menu"
            ])
            self.general.ui_menu_footer()
            command = self.print_select_option()
            if command == "1":  #1. Create contract
                contract_param = self.new_contract()
                print(self.logic.create_new_contract(contract_param))
            elif command == "2":  # 2. Search contracts
                self.contract_search_menu()
            elif command == "3":  # 3. View all contracts
                self.print_table_header()
                for item in self.logic.all_contracts():
                    print(item)
                self.print_table_footer()
            elif command == "4":  # 4. Edit contracts
                self.ui_all_contracts()
                edited_contract = self.ui_edit_contract()
                self.print_table_header()
                print(edited_contract)
                self.print_table_footer()
            elif command == "5":  # 5. Cancel contract
                self.ui_all_contracts()
                self.canceled_contract()
            elif command == "6":  # 6. Delete contract
                contract_id = input(">> Enter contract ID to delete: ")
                result_list = self.logic.delete_contract(contract_id)
                for item in result_list:
                    print(item, end="")
            elif command == "7":
                return
            else:
                print("Invalid command, try again")

    ### CONTRACT SEARCH MENU ###

    def contract_search_menu(self):
        while True:
            self.general.ui_menu_header("Contract Search")
            print("\nPlease select search option:")
            self.ui_numbered_menu([
                "Search by Contract ID", "Search by Customer name",
                "Search by Vehicle ID", "Main menu"
            ])
            self.general.ui_menu_footer()
            command = self.print_select_option()
            if command == "1":
                contract_id = input(">> Enter Contract ID: ")
                a_list = self.logic.search_contracts_by_id(contract_id)
                self.print_table_header()
                for item in a_list:
                    print(item)
            elif command == "2":
                vehicle_id = input(">> Enter Customer name: ")
                a_list = self.logic.search_contracts_by_customer(vehicle_id)
                self.print_table_header()
                for item in a_list:
                    print(item)
            elif command == "3":
                vehicle_id = input(">> Enter vehicle ID: ")
                a_list = self.logic.search_contract_by_vin(vehicle_id)
                self.print_table_header()
                for item in a_list:
                    print(item)
            elif command == "4":
                return
            else:
                print("Invalid command, try again")

    def canceled_contract(self):
        contract_ID = input(">> Enter contract ID: ")
        while True:
            command = input(
                "Are you sure you want to cancel contract? (Y)es or (N)o? ")
            command = command.lower()
            if command == "y":
                contracts = self.logic.search_contracts_by_id(contract_ID)
                for contract in contracts:
                    contract.state = "CANCELED"
                    return self.logic.edit_contract(contract)
            elif command == "n":
                return
            else:
                print("\n*** Please select either (Y)es or (N)o ***\n")

    #Creates the Edit menu layout and returns the Contract Instance after edit
    def ui_edit_contract(self):
        contracts = self.ui_single_contract_ID(
        )  #returns a list of contracts, in this case only one contract
        selection = ""
        while selection != "8":
            self.ui_print_edit_menu()  #ask user what he would like to edit
            selection = self.general.ui_edit_input()
            if selection == "1":
                for contract in contracts:
                    contract.customer = self.value_input()
            elif selection == "2":
                for contract in contracts:
                    contract.vehicle_unique_id = self.value_input()
            elif selection == "3":
                for contract in contracts:
                    contract.start_date = self.value_input()
            elif selection == "4":
                for contract in contracts:
                    contract.end_date = self.value_input()
            elif selection == "5":
                for contract in contracts:
                    contract.country = self.value_input()
            elif selection == "6":
                for contract in contracts:
                    contract.employee = self.value_input()
            elif selection == "7":
                for contract in contracts:
                    contract.total_price = self.value_input()
            elif selection == "8":
                return contract

    #Prints the Vehicle Edit menu options
    def ui_print_edit_menu(self):
        '''Prints options for Edit menu and accepts input'''
        self.general.ui_menu_header("Edit vehicle")
        print("\nSelect field to edit:")
        print("1. Customer name")
        print("2. Vehicle ID")
        print("3. Start date")
        print("4. End date")
        print("5. Country")
        print("6. Employee name")
        print("7. Total price")
        print("8. Exit")
        self.general.ui_menu_footer()

    #Prints contract with unique ID
    def ui_single_contract_ID(self):
        '''Prints a single vehicle with a unique ID'''
        contract_ID = input(">> Enter contract ID: ")
        contract = self.logic.search_contracts_by_id(contract_ID)
        print("\Contract by ID: " + contract_ID)
        self.print_table_header()
        for single_contract in contract:
            print(single_contract)
        self.print_table_footer()
        return contract

    #Request new value from user
    def value_input(self):
        return input("Enter new value: ")

    #Prints all contracts
    def ui_all_contracts(self):
        contracts = self.logic.all_contracts()
        print("\nAll Contracts:")
        self.print_table_header()
        for contract in contracts:
            print(contract)
        self.print_table_footer()
Example #3
0
class VehicleUI:
    def __init__(self):
        self.general = GeneralUI()
        self.logic = LogicAPI()
        self.vehicle_menu()
        # self.ui_print_type()

    #Prints UI for new vehicle
    def ui_new_vehicle(self):
        vehicleFieldnames = [
            "Manufacturer", "Model", "Vehicle type", "Status",
            "Manufacturing year", "Color", "License Requirement", "Location",
            "Rate"
        ]
        inputList = []
        print("\nPress 'q' and hit 'enter' to cancel at any time.")
        print("\nPlease enter the following details to create a new vehicle:")
        user_input = ""
        for field in vehicleFieldnames:
            if user_input.lower() == "q":
                return self.vehicle_menu()
            if field == "Location":
                user_input = ""
                destinations = self.ui_country_available_print()
                while user_input not in destinations:
                    user_input = input(f"Enter {field}: ")
            else:
                user_input = input(f"Enter {field}: ")
            inputList.append(user_input)
        return inputList

    #Request new value from user
    def value_input(self):
        return input("Enter new value: ")

    #Creates the Edit menu layout and returns the Vehicle Instance after edit
    def ui_edit_vehicle(self):
        vehicle = self.ui_single_vehicle_ID()  #prints specific vehicle
        selection = ""
        while selection != "9":
            self.ui_print_edit_menu()  #ask user what he would like to edit
            selection = self.general.ui_edit_input()
            if selection == "1":
                vehicle.manufacturer = self.value_input()
            elif selection == "2":
                vehicle.model = self.value_input()
            elif selection == "3":
                vehicle.vehicle_type = self.value_input()
            elif selection == "4":
                vehicle.status = self.value_input()
            elif selection == "5":
                vehicle.man_year = self.value_input()
            elif selection == "6":
                vehicle.color = self.value_input()
            elif selection == "7":
                vehicle.license_type = self.value_input()
            elif selection == "8":
                vehicle.location = self.value_input()
            elif selection == "9":
                vehicle.rate = self.value_input()
            elif selection == "q":
                return vehicle

    #Prints the Vehicle Edit menu options
    def ui_print_edit_menu(self):
        '''Prints options for Edit menu and accepts input'''
        self.general.ui_menu_header("Edit vehicle")
        print("\nSelect field to edit:")
        print("1. Manufacturer")
        print("2. Model")
        print("3. Vehicle type")
        print("4. Status")
        print("5. Manufacturing year")
        print("6. Color")
        print("7. License Requirement")
        print("8. Location")
        print("9. Rate")
        print("q. Exit")
        self.general.ui_menu_footer()

    #Print Vehicle Table Header
    def ui_vehicle_table_header(self):
        print(
            f"{'Unique ID':<20}{'Manufacturer':<20}{'Model':<20}{'Vehicle type':<20}{'Status':<20}{'Manufac. year':<20}{'Color':<20}{'License Req.':<20}{'Location':<20}{'Rate':<20}"
        )
        print("-" * 200)

    #Print Vehicle Table Footer
    def ui_vehicle_table_footer(self):
        print("-" * 200)
        print()

    #Prints all vehicles
    def ui_all_vehicles(self):
        results = self.logic.all_vehicles()
        print("\nAll vehicles:")
        self.ui_vehicle_table_header()
        for vehicle in results:
            print(vehicle)
        self.ui_vehicle_table_footer()

    #Prints vehicle with unique ID
    def ui_single_vehicle_ID(self):
        '''Prints a single vehicle with a unique ID'''
        vehicle_ID = input(">> Please enter vehicle ID: ")
        vehicles = self.logic.search_vehicle_by_ID(vehicle_ID)
        print("\nVehicle by ID: " + vehicle_ID)
        self.ui_vehicle_table_header()
        for vehicle in vehicles:
            print(vehicle)
        self.ui_vehicle_table_footer()
        return vehicle

####################################################Search Menus##########################################################################

    def ui_manufacturer_available_print(self):
        print("\nAvailable Options:")
        vehicles = self.logic.available_manufacturers()
        for vehicle in vehicles:
            print("\t" + vehicle)
        print()

    def ui_model_available_print(self):
        print("\nAvailable Options:")
        vehicles = self.logic.available_model()
        for vehicle in vehicles:
            print("\t" + vehicle)
        print()

    def ui_vehicle_type_available_print(self):
        print("\nAvailable Options:")
        vehicles = self.logic.available_vehicle_type()
        for vehicle in vehicles:
            print("\t" + vehicle)
        print()

    def ui_status_available_print(self):
        print("\nAvailable Options:")
        vehicles = self.logic.available_status()
        for vehicle in vehicles:
            print("\t" + vehicle)
        print()

    def ui_manufacturing_year_available_print(self):
        print("\nAvailable Options:")
        vehicles = self.logic.available_manufacturing_year()
        for vehicle in vehicles:
            print("\t" + vehicle)
        print()

    def ui_color_available_print(self):
        print("\nAvailable Options:")
        vehicles = self.logic.available_color()
        for vehicle in vehicles:
            print("\t" + vehicle)
        print()

    def ui_license_type_available_print(self):
        print("\nAvailable Options:")
        vehicles = self.logic.available_license_type()
        for vehicle in vehicles:
            print("\t" + vehicle)
        print()

    def ui_location_available_print(self):
        print("\nAvailable Options:")
        vehicles = self.logic.available_location()
        for vehicle in vehicles:
            print("\t" + vehicle)
        print()

    def ui_print_manufacturer(self):
        self.ui_manufacturer_available_print()
        manufacturer = input(">> Please enter vehicle manufacturer: ")
        results = self.logic.search_vehicle_by_manufacturer(manufacturer)
        print("\nAll vehicles by manufacturer " + manufacturer + ": ")
        self.ui_vehicle_table_header()
        for vehicle in results:
            print(vehicle)
        self.ui_vehicle_table_footer()

    def ui_print_model(self):
        self.ui_model_available_print()
        model = input(">> Please enter vehicle model: ")
        results = self.logic.search_vehicle_by_model(model)
        print("\nAll vehicles by model " + model + ": ")
        self.ui_vehicle_table_header()
        for vehicle in results:
            print(vehicle)
        self.ui_vehicle_table_footer()

    def ui_print_vehicle_type(self):
        self.ui_vehicle_type_available_print()
        vehicle_type = input(">> Please enter vehicle type: ")
        results = self.logic.search_vehicle_by_vehicle_type(vehicle_type)
        print("\nAll vehicles by type " + vehicle_type + ": ")
        self.ui_vehicle_table_header()
        for vehicle in results:
            print(vehicle)
        self.ui_vehicle_table_footer()

    def ui_print_status(self):
        self.ui_status_available_print()
        status = input(">> Please enter vehicle status: ")
        results = self.logic.search_vehicle_by_status(status)
        print("\nAll vehicles by type " + status + ": ")
        self.ui_vehicle_table_header()
        for vehicle in results:
            print(vehicle)
        self.ui_vehicle_table_footer()

    def ui_print_manufacturing_year(self):
        self.ui_manufacturing_year_available_print()
        manufacturing_year = input(
            ">> Please enter vehicle manufacturing year: ")
        results = self.logic.search_vehicle_by_manufacturing_year(
            manufacturing_year)
        print("\nAll vehicles by manufacturing year " + manufacturing_year +
              ": ")
        self.ui_vehicle_table_header()
        for vehicle in results:
            print(vehicle)
        self.ui_vehicle_table_footer()

    def ui_print_color(self):
        self.ui_color_available_print()
        color = input(">> Please enter vehicle color: ")
        results = self.logic.search_vehicle_by_color(color)
        print("\nAll vehicles by color " + color + ": ")
        self.ui_vehicle_table_header()
        for vehicle in results:
            print(vehicle)
        self.ui_vehicle_table_footer()

    def ui_print_license_type(self):
        self.ui_license_type_available_print()
        license_type = input(">> Please enter vehicle license requirement: ")
        results = self.logic.search_vehicle_by_license_type(license_type)
        print("\nAll vehicles by type " + license_type + ": ")
        self.ui_vehicle_table_header()
        for vehicle in results:
            print(vehicle)
        self.ui_vehicle_table_footer()

    def ui_print_location(self):
        self.ui_location_available_print()
        location = input(">> Please enter vehicle location: ")
        results = self.logic.search_vehicle_by_location(location)
        print("\nAll vehicles by type " + location + ": ")
        self.ui_vehicle_table_header()
        for vehicle in results:
            print(vehicle)
        self.ui_vehicle_table_footer()

#########################################################################################################################

#Prints the search menu for vehicles

    def ui_search_menu(self):
        self.general.ui_menu_header("Vehicle Search")
        print("\nPlease select a search option:")
        self.UI_numbered_menu([
            "Manufacturer", "Model", "Vehicle type", "Status",
            "Manufacturing year", "Color", "License Requirement", "Location",
            "Exit"
        ])
        self.general.ui_menu_footer()
        selection = input("\n>> Select option: ")
        return selection

    #Prints any UI menu in order
    def UI_numbered_menu(self, a_list):
        '''Takes a list as parameter and prints all the items of a list in an order from 1. list[0], 2. list[1] and so on'''
        for i in range(0, (len(a_list))):
            print(f"{i+1}. {a_list[i]}")

    def ui_country_available_print(self):
        '''Prints all destination type categories'''
        print("\nAvailable Options:")
        destinations = self.logic.available_country()
        for destination in destinations:
            print("\t" + destination)
        print()
        return destinations

    #Prints the Vehicle Main Menu
    def vehicle_menu(self):
        while True:
            self.general.ui_menu_header("Vehicle Menu")
            print(
                "\nSelect an option...\n1. Create new vehicle \n2. Search vehicles \n3. Check availability \n4. Check in/check out vehicle. \n5. View all vehicles \n6. Edit vehicle \n7. Delete vehicle \n8. Main Menu"
            )
            self.general.ui_menu_footer()
            command = input(">> Select option: ")
            command = command.lower()
            if command == "1":
                new_vehicle = self.ui_new_vehicle()
                self.logic.create_vehicle(*new_vehicle)
            elif command == "2":
                selection = self.ui_search_menu()
                if selection == "1":
                    self.ui_print_manufacturer()
                elif selection == "2":
                    self.ui_print_model()
                elif selection == "3":
                    self.ui_print_vehicle_type()
                elif selection == "4":
                    self.ui_print_status()
                elif selection == "5":
                    self.ui_print_manufacturing_year()
                elif selection == "6":
                    self.ui_print_color()
                elif selection == "7":
                    self.ui_print_license_type()
                elif selection == "8":
                    self.ui_print_location()
                elif selection == "9":
                    self.vehicle_menu()
            elif command == "3":
                self.ui_all_vehicles()
            elif command == "4":
                self.ui_checkin_menu()
            elif command == "5":
                self.ui_all_vehicles()
            elif command == "6":
                new_vehicle = self.ui_edit_vehicle()
                self.logic.edit_vehicle(new_vehicle)
            elif command == "7":
                vehicle_id = input(">> Enter vehicle ID to delete: ")
                vehicle = self.logic.delete_vehicle(vehicle_id)
                for result in vehicle:
                    print(result)
            elif command == "8":
                return
            else:
                print("Invalid command, try again")

    def ui_checkin_menu(self):
        self.general.ui_menu_header('Check-in Menu')
        print(
            "Select an option...\n1.Check out vehicle.\n2.Check in vehicle.\n3.Return."
        )
        self.general.ui_menu_footer()
        choice = input(">> Select option: ")
        if choice == '3':
            return
        elif choice == '1':
            vehicle = input("Enter contract ID: ")
            print(self.logic.vehicle_check_out(vehicle))
        elif choice == '2':
            vehicle = input("Enter contract ID: ")
            print(self.logic.vehicle_check_in(vehicle))
        elif choice == '3':
            return