run_sql_script(create_db)





clear()
actv_selection = 0
init()
#
# MAIN MENU
#
while True:

    MenuManager.main_menu(actv_selection)

    key = ord(getch())
    if key == ESC:
        print("\n Exiting...")
        time.sleep(1)
        user_input = 7

    elif key == ENTER:
        user_input = actv_selection
        clear()
    elif key == SPECIALKEYSELECTOR:
        key = ord(getch())
        if key == DOWNARROW:
            if actv_selection < 7:
                actv_selection += 1
Beispiel #2
0
    def change_donor_data(data_input):
        with open('Data/donors.csv', 'r') as f:
            donor_list = list(csv.reader(f))
        del (donor_list[0])

        if data_input in [i[6] for i in donor_list]:
            for i, l in enumerate(donor_list):
                if data_input == l[6]:
                    next_donor = Donor()
                    next_donor.name = l[0]
                    next_donor.weight = l[1]
                    next_donor.gender = l[2]
                    next_donor.dateofbirth = l[3]
                    next_donor.lastdonationdate = l[4]
                    next_donor.wassick = l[5]
                    next_donor.uniqueid = l[6]
                    next_donor.expofid = l[7]
                    next_donor.bloodtype = l[8]
                    next_donor.hemoglobin = l[9]
                    next_donor.emailaddress = l[-2]
                    next_donor.mobilnumber = l[-1]
                    line_number = i

        else:
            print("Data entry doesn't exist with that ID.")
            time.sleep(1)
            return None

        input_donor_data_pairs = {
            0: "Name",
            1: "Weight",
            2: "Gender",
            3: "Date of birth",
            4: "Last donation date",
            5: "Health status in last month",
            6: "ID number",
            7: "Expiration of ID",
            8: "Blood Type",
            9: "Hemoglobin",
            10: "e-mail address",
            11: "Mobil number"
        }
        which_donor_data_validation = {
            0: Validate.validate_name,
            1: Validate.validate_positive_int,
            2: Validate.validate_gender,
            3: Validate.validate_date,
            4: Validate.validate_date,
            5: Validate.validate_sickness,
            6: Validate.validate_id,
            7: Validate.validate_date,
            8: Validate.validate_blood_type,
            9: Validate.validate_positive_int,
            10: Validate.validate_email,
            11: Validate.validate_mobilnumber
        }

        actv_selection = 0
        while True:
            MenuManager.change_donor_submenu(actv_selection, next_donor)

            key = ord(getch())
            if key == ESC:
                user_input = 12
                clear()
            elif key == ENTER:
                user_input = actv_selection
                clear()
            elif key == SPECIALKEYSELECTOR:
                key = ord(getch())
                if key == DOWNARROW:
                    if actv_selection < 12:
                        actv_selection += 1
                    continue
                elif key == UPARROW:
                    if actv_selection > 0:
                        actv_selection -= 1
                    continue
                else:
                    print("\n! Wrong key !")
                    time.sleep(1)
                    continue
            else:
                print("\n! Wrong key !")
                time.sleep(1)
                continue

            if user_input in range(12):
                new = ""
                while new == "":
                    clear()
                    print(next_donor)
                    print("------------------------------\n")
                    new = input("\n(0) Cancel\nChanging {} to: ".format(
                        input_donor_data_pairs[user_input]))
                    if new == "0":
                        return None
                    if new.upper() in [donor[6] for donor in donor_list]:
                        print("This ID number already exists! Try again.")
                        time.sleep(2)
                        break
                    if which_donor_data_validation[user_input](new):
                        with open("Data/donors.csv", "w") as f:
                            donor_list[line_number][user_input] = new.upper()
                            f.write(DONORS_ELSOSOR)
                            for line in donor_list:
                                for i in range(len(line)):
                                    f.write(line[i])
                                    if i < len(line) - 1:
                                        f.write(',')
                                f.write('\n')
                        print('\n...Done!')
                        time.sleep(1)
                        break
                    else:
                        print("Wrong input")
                        new = ""
                        time.sleep(1)
            elif user_input == 12:
                clear()
                actv_selection = 0
                return None
    def change_donor_data(data_input, cursor):


        input_donor_data_pairs = {0: "Name", 1: "Weight", 2: "Gender", 3: "DateOfBirth", 4: "LastDonationDate",
                                  5: "Wassick", 6: "UniqueId", 7: "ExpofId", 8: "BloodType",
                                  9: "HemoglobinLevel", 10: "Emailaddress", 11: "Mobilnumber"}
        which_donor_data_validation = {0: Validate.validate_name, 1: Validate.validate_positive_int, 2: Validate.validate_gender, 3: Validate.validate_date, 4: Validate.validate_date,
                                  5: Validate.validate_sickness, 6: Validate.validate_id, 7: Validate.validate_date, 8: Validate.validate_blood_type,
                                  9: Validate.validate_positive_int, 10: Validate.validate_email, 11: Validate.validate_mobilnumber}


        actv_selection = 0
        while True:
            cursor.execute("SELECT * FROM Donor;")
            data = cursor.fetchall()
            sor = []
            donor_list = []
            for i in data:
                sor.append(i[1])
                sor.append(str(i[2]))
                sor.append(i[3])
                sor.append(datetime.date.strftime(i[4], "%Y.%m.%d"))
                sor.append(datetime.date.strftime(i[5], "%Y.%m.%d"))
                sor.append(i[6])
                sor.append(i[0])
                sor.append(datetime.date.strftime(i[8], "%Y.%m.%d"))
                sor.append(i[7])
                sor.append(str(i[11]))
                sor.append(i[9])
                sor.append(i[10])
                donor_list.append(sor)

            cursor.execute("SELECT UniqueId FROM Donor;")
            data = cursor.fetchall()
            ids = [i[0] for i in data]

            if data_input in ids:
                for l in donor_list:
                    next_donor = Donor()
                    next_donor.name = l[0]
                    next_donor.weight = l[1]
                    next_donor.gender = l[2]
                    next_donor.dateofbirth = l[3]
                    next_donor.lastdonationdate = l[4]
                    next_donor.wassick = l[5]
                    next_donor.uniqueid = l[6]
                    next_donor.expofid = l[7]
                    next_donor.bloodtype = l[8]
                    next_donor.hemoglobin = l[9]
                    next_donor.emailaddress = l[-2]
                    next_donor.mobilnumber = l[-1]

            else:
                print("Data entry doesn't exist with that ID.")
                time.sleep(1)
                return None




            MenuManager.change_donor_submenu(actv_selection, next_donor)

            key = ord(getch())
            if key == ESC:
                user_input = 12
                clear()
            elif key == ENTER:
                user_input = actv_selection
                clear()
            elif key == SPECIALKEYSELECTOR:
                key = ord(getch())
                if key == DOWNARROW:
                    if actv_selection < 12:
                        actv_selection += 1
                    continue
                elif key == UPARROW:
                    if actv_selection > 0:
                        actv_selection -= 1
                    continue
                else:
                    print("\n! Wrong key !")
                    time.sleep(1)
                    continue
            else:
                print("\n! Wrong key !")
                time.sleep(1)
                continue

            if user_input in range(12):
                new = ""
                while new == "":
                    clear()

                    print(next_donor)
                    print("------------------------------\n")
                    new = input("\n(0) Cancel\nChanging {} to: ".format(input_donor_data_pairs[user_input]))
                    if new == "0":
                        return None
                    if which_donor_data_validation[user_input](new):
                        cursor.execute("UPDATE donor \
                                        SET \
                                        `{}` = '{}' \
                                        WHERE `UniqueId` = '{}';".format(input_donor_data_pairs[user_input], new, data_input))
                        print('\n...Done!')
                        time.sleep(1)
                        break
                    else:
                        print("Wrong input")
                        new = ""
                        time.sleep(1)
            elif user_input == 12:
                clear()
                actv_selection = 0
                return None
    def change_donor_data(data_input):
        with open("Data/donors.csv", "r") as f:
            donor_list = list(csv.reader(f))
        del (donor_list[0])

        if data_input in [i[6] for i in donor_list]:
            for i, l in enumerate(donor_list):
                if data_input == l[6]:
                    next_donor = Donor()
                    next_donor.name = l[0]
                    next_donor.weight = l[1]
                    next_donor.gender = l[2]
                    next_donor.dateofbirth = l[3]
                    next_donor.lastdonationdate = l[4]
                    next_donor.wassick = l[5]
                    next_donor.uniqueid = l[6]
                    next_donor.expofid = l[7]
                    next_donor.bloodtype = l[8]
                    next_donor.hemoglobin = l[9]
                    next_donor.emailaddress = l[-2]
                    next_donor.mobilnumber = l[-1]
                    line_number = i

        else:
            print("Data entry doesn't exist with that ID.")
            time.sleep(1)
            return None

        input_donor_data_pairs = {
            0: "Name",
            1: "Weight",
            2: "Gender",
            3: "Date of birth",
            4: "Last donation date",
            5: "Health status in last month",
            6: "ID number",
            7: "Expiration of ID",
            8: "Blood Type",
            9: "Hemoglobin",
            10: "e-mail address",
            11: "Mobil number",
        }
        which_donor_data_validation = {
            0: Validate.validate_name,
            1: Validate.validate_positive_int,
            2: Validate.validate_gender,
            3: Validate.validate_date,
            4: Validate.validate_date,
            5: Validate.validate_sickness,
            6: Validate.validate_id,
            7: Validate.validate_date,
            8: Validate.validate_blood_type,
            9: Validate.validate_positive_int,
            10: Validate.validate_email,
            11: Validate.validate_mobilnumber,
        }

        actv_selection = 0
        while True:
            MenuManager.change_donor_submenu(actv_selection, next_donor)

            key = ord(getch())
            if key == ESC:
                user_input = 12
                clear()
            elif key == ENTER:
                user_input = actv_selection
                clear()
            elif key == SPECIALKEYSELECTOR:
                key = ord(getch())
                if key == DOWNARROW:
                    if actv_selection < 12:
                        actv_selection += 1
                    continue
                elif key == UPARROW:
                    if actv_selection > 0:
                        actv_selection -= 1
                    continue
                else:
                    print("\n! Wrong key !")
                    time.sleep(1)
                    continue
            else:
                print("\n! Wrong key !")
                time.sleep(1)
                continue

            if user_input in range(12):
                new = ""
                while new == "":
                    clear()
                    print(next_donor)
                    print("------------------------------\n")
                    new = input("\n(0) Cancel\nChanging {} to: ".format(input_donor_data_pairs[user_input]))
                    if new == "0":
                        return None
                    if new.upper() in [donor[6] for donor in donor_list]:
                        print("This ID number already exists! Try again.")
                        time.sleep(2)
                        break
                    if which_donor_data_validation[user_input](new):
                        with open("Data/donors.csv", "w") as f:
                            donor_list[line_number][user_input] = new.upper()
                            f.write(DONORS_ELSOSOR)
                            for line in donor_list:
                                for i in range(len(line)):
                                    f.write(line[i])
                                    if i < len(line) - 1:
                                        f.write(",")
                                f.write("\n")
                        print("\n...Done!")
                        time.sleep(1)
                        break
                    else:
                        print("Wrong input")
                        new = ""
                        time.sleep(1)
            elif user_input == 12:
                clear()
                actv_selection = 0
                return None
    def change_event(input_id_string, cursor_object):
        event_to_change = []
        cursor_object.execute(QUERY_EVENTS_FROM_SQLDB)
        event_list = cursor_object.fetchall()
        for event in event_list:
            if int(input_id_string) == event[0]:
                event_to_change = list(event)
        if not event_to_change:
            print("\n No entry found with this ID.\n")
            time.sleep(1)
            clear()
            return None

        input_object_data_pairs = {
            0: "DateOfEvent", 1: "StartTime", 2: "EndTime", 3: "ZipCode", 4: "City", 5: "Address",
            6: "AvailableBeds", 7: "PlannedDonorNumber", 8: "Successfull"
        }
        validators_for_data_to_change = {
            0: Validate.validate_date, 1: Validate.validate_time, 2: Validate.validate_time,
            3: Validate.validate_zipcode, 4: Validate.validate_city_name, 5: Validate.validate_address,
            6: Validate.validate_positive_int, 7: Validate.validate_positive_int,
            8: Validate.validate_positive_int
        }
        event_object_for_printing = Event()
        event_object_for_printing.id = str(event_to_change[0])
        event_object_for_printing.date_of_event = event_to_change[1].strftime('%Y.%m.%d')
        delta_to_time_obj = (datetime.min + event_to_change[2]).time()
        event_object_for_printing.start_time = delta_to_time_obj.strftime('%H:%M')
        delta_to_time_obj2 = (datetime.min + event_to_change[3]).time()
        event_object_for_printing.end_time = delta_to_time_obj2.strftime('%H:%M')
        event_object_for_printing.zip_code = str(event_to_change[4])
        event_object_for_printing.city = event_to_change[5]
        event_object_for_printing.address = event_to_change[6]
        event_object_for_printing.available_beds = str(event_to_change[7])
        event_object_for_printing.planned_donor_number = str(event_to_change[8])
        event_object_for_printing.successfull = str(event_to_change[9])

        actv_selection = 0
        while True:
            MenuManager.change_event_submenu(actv_selection, event_object_for_printing)

            key = ord(getch())
            if key == ESC:
                user_input = 9
                clear()
            elif key == ENTER:
                user_input = actv_selection
                clear()
            elif key == SPECIALKEYSELECTOR:
                key = ord(getch())
                if key == DOWNARROW:
                    if actv_selection < 9:
                        actv_selection += 1
                    continue
                elif key == UPARROW:
                    if actv_selection > 0:
                        actv_selection -= 1
                    continue
                else:
                    print("\n! Wrong key !")
                    time.sleep(1)
                    continue
            else:
                print("\n! Wrong key !")
                time.sleep(1)
                continue

            if user_input in range(9):
                data_to_change = ""
                while data_to_change == "":
                    print(event_object_for_printing)
                    print("------------------------------\n")
                    print("\n(0) Cancel\nChanging {} to: ".format(input_object_data_pairs[user_input]))
                    data_to_change = input("\n> ")
                    data_to_change = data_to_change.upper()
                    if data_to_change == "0":
                        return None
                    elif validators_for_data_to_change[user_input](data_to_change):
                        CHANGE_DATA = "UPDATE event SET {} = '{}' WHERE Id = {}".format(input_object_data_pairs[user_input], data_to_change, event_object_for_printing.id)
                        cursor_object.execute(CHANGE_DATA)
                        clear()
                        print("...Done!")
                        time.sleep(1)
                        return None
                    else:
                        print("Wrong {}.".format(input_object_data_pairs[user_input]))
                        data_to_change = ""
                        time.sleep(1)
                        clear()
            elif user_input == 9:
                clear()
                actv_selection = 0
                return None
    def change_donor_data(data_input, cursor):

        input_donor_data_pairs = {
            0: "Name",
            1: "Weight",
            2: "Gender",
            3: "DateOfBirth",
            4: "LastDonationDate",
            5: "Wassick",
            6: "UniqueId",
            7: "ExpofId",
            8: "BloodType",
            9: "HemoglobinLevel",
            10: "Emailaddress",
            11: "Mobilnumber"
        }
        which_donor_data_validation = {
            0: Validate.validate_name,
            1: Validate.validate_positive_int,
            2: Validate.validate_gender,
            3: Validate.validate_date,
            4: Validate.validate_date,
            5: Validate.validate_sickness,
            6: Validate.validate_id,
            7: Validate.validate_date,
            8: Validate.validate_blood_type,
            9: Validate.validate_positive_int,
            10: Validate.validate_email,
            11: Validate.validate_mobilnumber
        }

        actv_selection = 0
        while True:
            cursor.execute("SELECT * FROM Donor;")
            data = cursor.fetchall()
            sor = []
            donor_list = []
            for i in data:
                sor.append(i[1])
                sor.append(str(i[2]))
                sor.append(i[3])
                sor.append(datetime.date.strftime(i[4], "%Y.%m.%d"))
                sor.append(datetime.date.strftime(i[5], "%Y.%m.%d"))
                sor.append(i[6])
                sor.append(i[0])
                sor.append(datetime.date.strftime(i[8], "%Y.%m.%d"))
                sor.append(i[7])
                sor.append(str(i[11]))
                sor.append(i[9])
                sor.append(i[10])
                donor_list.append(sor)

            cursor.execute("SELECT UniqueId FROM Donor;")
            data = cursor.fetchall()
            ids = [i[0] for i in data]

            if data_input in ids:
                for l in donor_list:
                    next_donor = Donor()
                    next_donor.name = l[0]
                    next_donor.weight = l[1]
                    next_donor.gender = l[2]
                    next_donor.dateofbirth = l[3]
                    next_donor.lastdonationdate = l[4]
                    next_donor.wassick = l[5]
                    next_donor.uniqueid = l[6]
                    next_donor.expofid = l[7]
                    next_donor.bloodtype = l[8]
                    next_donor.hemoglobin = l[9]
                    next_donor.emailaddress = l[-2]
                    next_donor.mobilnumber = l[-1]

            else:
                print("Data entry doesn't exist with that ID.")
                time.sleep(1)
                return None

            MenuManager.change_donor_submenu(actv_selection, next_donor)

            key = ord(getch())
            if key == ESC:
                user_input = 12
                clear()
            elif key == ENTER:
                user_input = actv_selection
                clear()
            elif key == SPECIALKEYSELECTOR:
                key = ord(getch())
                if key == DOWNARROW:
                    if actv_selection < 12:
                        actv_selection += 1
                    continue
                elif key == UPARROW:
                    if actv_selection > 0:
                        actv_selection -= 1
                    continue
                else:
                    print("\n! Wrong key !")
                    time.sleep(1)
                    continue
            else:
                print("\n! Wrong key !")
                time.sleep(1)
                continue

            if user_input in range(12):
                new = ""
                while new == "":
                    clear()

                    print(next_donor)
                    print("------------------------------\n")
                    new = input("\n(0) Cancel\nChanging {} to: ".format(
                        input_donor_data_pairs[user_input]))
                    if new == "0":
                        return None
                    if which_donor_data_validation[user_input](new):
                        cursor.execute("UPDATE donor \
                                        SET \
                                        `{}` = '{}' \
                                        WHERE `UniqueId` = '{}';".format(
                            input_donor_data_pairs[user_input], new,
                            data_input))
                        print('\n...Done!')
                        time.sleep(1)
                        break
                    else:
                        print("Wrong input")
                        new = ""
                        time.sleep(1)
            elif user_input == 12:
                clear()
                actv_selection = 0
                return None
    def change_event(input_id_string):
        event_to_change = []
        with open("Data/donations.csv", "r") as f:
            event_list = list(csv.reader(f))
        for event in event_list:
            if input_id_string == event[0]:
                event_to_change = list(event)
        if not event_to_change:
            print("\n No entry found with this ID.\n")
            time.sleep(1)
            clear()
            return None

        input_object_data_pairs = {
            0: "Date of Event",
            1: "Start Time",
            2: "End Time",
            3: "Zip Code",
            4: "City",
            5: "Address",
            6: "Available Beds",
            7: "Planned Donor Number",
            8: "Number of Successful Donations"
        }
        validators_for_data_to_change = {
            0: Validate.validate_date,
            1: Validate.validate_time,
            2: Validate.validate_time,
            3: Validate.validate_zipcode,
            4: Validate.validate_city_name,
            5: Validate.validate_address,
            6: Validate.validate_positive_int,
            7: Validate.validate_positive_int,
            8: Validate.validate_positive_int
        }
        event_object_for_printing = Event()
        event_object_for_printing.id = event_to_change[0]
        event_object_for_printing.date_of_event = event_to_change[1]
        event_object_for_printing.start_time = event_to_change[2]
        event_object_for_printing.end_time = event_to_change[3]
        event_object_for_printing.zip_code = event_to_change[4]
        event_object_for_printing.city = event_to_change[5]
        event_object_for_printing.address = event_to_change[6]
        event_object_for_printing.available_beds = event_to_change[7]
        event_object_for_printing.planned_donor_number = event_to_change[8]
        event_object_for_printing.successfull = event_to_change[9]

        actv_selection = 0
        while True:
            MenuManager.change_event_submenu(actv_selection,
                                             event_object_for_printing)

            key = ord(getch())
            if key == ESC:
                user_input = 9
                clear()
            elif key == ENTER:
                user_input = actv_selection
                clear()
            elif key == SPECIALKEYSELECTOR:
                key = ord(getch())
                if key == DOWNARROW:
                    if actv_selection < 9:
                        actv_selection += 1
                    continue
                elif key == UPARROW:
                    if actv_selection > 0:
                        actv_selection -= 1
                    continue
                else:
                    print("\n! Wrong key !")
                    time.sleep(1)
                    continue
            else:
                print("\n! Wrong key !")
                time.sleep(1)
                continue

            if user_input in range(9):
                data_to_change = ""
                while data_to_change == "":
                    print(event_object_for_printing)
                    print("------------------------------\n")
                    print("\n(0) Cancel\nChanging {} to: ".format(
                        input_object_data_pairs[user_input]))
                    data_to_change = input("\n> ")
                    data_to_change = data_to_change.upper()
                    if data_to_change == "0":
                        return None
                    elif validators_for_data_to_change[user_input](
                            data_to_change):
                        event_to_change[user_input + 1] = data_to_change
                        for number in range(len(event_list)):
                            if event_list[number][0] == event_to_change[0]:
                                event_list[number] = event_to_change
                        with open("Data/donations.csv", "w") as f:
                            donation_database = csv.writer(f,
                                                           delimiter=',',
                                                           lineterminator="\n")
                            donation_database.writerows(event_list)
                        clear()
                        print("...Done!")
                        time.sleep(1)
                        return None
                    else:
                        print("Wrong {}.".format(
                            input_object_data_pairs[user_input]))
                        data_to_change = ""
                        time.sleep(1)
                        clear()
            elif user_input == 9:
                clear()
                actv_selection = 0
                return None
    def change_event(input_id_string, cursor_object):
        event_to_change = []
        cursor_object.execute(QUERY_EVENTS_FROM_SQLDB)
        event_list = cursor_object.fetchall()
        for event in event_list:
            if int(input_id_string) == event[0]:
                event_to_change = list(event)
        if not event_to_change:
            print("\n No entry found with this ID.\n")
            time.sleep(1)
            clear()
            return None

        input_object_data_pairs = {
            0: "DateOfEvent",
            1: "StartTime",
            2: "EndTime",
            3: "ZipCode",
            4: "City",
            5: "Address",
            6: "AvailableBeds",
            7: "PlannedDonorNumber",
            8: "Successfull"
        }
        validators_for_data_to_change = {
            0: Validate.validate_date,
            1: Validate.validate_time,
            2: Validate.validate_time,
            3: Validate.validate_zipcode,
            4: Validate.validate_city_name,
            5: Validate.validate_address,
            6: Validate.validate_positive_int,
            7: Validate.validate_positive_int,
            8: Validate.validate_positive_int
        }
        event_object_for_printing = Event()
        event_object_for_printing.id = str(event_to_change[0])
        event_object_for_printing.date_of_event = event_to_change[1].strftime(
            '%Y.%m.%d')
        delta_to_time_obj = (datetime.min + event_to_change[2]).time()
        event_object_for_printing.start_time = delta_to_time_obj.strftime(
            '%H:%M')
        delta_to_time_obj2 = (datetime.min + event_to_change[3]).time()
        event_object_for_printing.end_time = delta_to_time_obj2.strftime(
            '%H:%M')
        event_object_for_printing.zip_code = str(event_to_change[4])
        event_object_for_printing.city = event_to_change[5]
        event_object_for_printing.address = event_to_change[6]
        event_object_for_printing.available_beds = str(event_to_change[7])
        event_object_for_printing.planned_donor_number = str(
            event_to_change[8])
        event_object_for_printing.successfull = str(event_to_change[9])

        actv_selection = 0
        while True:
            MenuManager.change_event_submenu(actv_selection,
                                             event_object_for_printing)

            key = ord(getch())
            if key == ESC:
                user_input = 9
                clear()
            elif key == ENTER:
                user_input = actv_selection
                clear()
            elif key == SPECIALKEYSELECTOR:
                key = ord(getch())
                if key == DOWNARROW:
                    if actv_selection < 9:
                        actv_selection += 1
                    continue
                elif key == UPARROW:
                    if actv_selection > 0:
                        actv_selection -= 1
                    continue
                else:
                    print("\n! Wrong key !")
                    time.sleep(1)
                    continue
            else:
                print("\n! Wrong key !")
                time.sleep(1)
                continue

            if user_input in range(9):
                data_to_change = ""
                while data_to_change == "":
                    print(event_object_for_printing)
                    print("------------------------------\n")
                    print("\n(0) Cancel\nChanging {} to: ".format(
                        input_object_data_pairs[user_input]))
                    data_to_change = input("\n> ")
                    data_to_change = data_to_change.upper()
                    if data_to_change == "0":
                        return None
                    elif validators_for_data_to_change[user_input](
                            data_to_change):
                        CHANGE_DATA = "UPDATE event SET {} = '{}' WHERE Id = {}".format(
                            input_object_data_pairs[user_input],
                            data_to_change, event_object_for_printing.id)
                        cursor_object.execute(CHANGE_DATA)
                        clear()
                        print("...Done!")
                        time.sleep(1)
                        return None
                    else:
                        print("Wrong {}.".format(
                            input_object_data_pairs[user_input]))
                        data_to_change = ""
                        time.sleep(1)
                        clear()
            elif user_input == 9:
                clear()
                actv_selection = 0
                return None