diff --git a/ascii_print_hotel b/ascii_print_hotel new file mode 100644 index 0000000..bda8632 --- /dev/null +++ b/ascii_print_hotel @@ -0,0 +1,51 @@ + + THE + + G R A N D + +'||'''|, '|| || '||'''|. /.\ '||'''|, ||''''| .|'''` '''||''' + || || || || || || // \\ || || || . || || + ||;;;; || || || || //___\\ ||___|' ||''' `|'''|, || + || || || || || || // \\ || || || || +.||___|' `|___|' .||___|' .// \\. .|| ||____| ,___|' .||. + + |_| /\ ''|'' |'' | + | | \/ | |'_ |_ + + + + | + | | + || | + / \ v^v || + ( ( )) __/___\__ / \ + |....| ......../ ||| \........ ( ( )) + | | / |_|_| ||| |_|_| \ |....| + |____| __/__|_|_|__||_____||__|_|_|__\__ | | + .----. |.---.---.---.---.---.---.---.| |____| + |.--.| -.------. .------. .------. .------.- |.--.| + |:/\:| || :/\: | | :/\: | | :/\: | | :/\: || |:/\:| + |(__)| -| (__) | | (__) | | (__) | | (__) |- |(__)| + |'--'| || '--' | | '--' | | '--' | | '--' || |'--'| + /`----' `------' `------' `------' `------' `----'\ + _/________________________________________________________\_ + ---------------------------------------------------------- + - .------. .------. .------. .------. .------. .------. - + | | .--. | | .--. | | .--. | | .--. | | .--. | | .--. | | + - | :/\: | | :/\: | | :/\: | | :/\: | | :/\: | | :/\: | - + | | (__) | | (__) | | (__) | | (__) | | (__) | | (__) | | + - | '--' | | '--' | | '--' | | '--' | | '--' | | '--' | - + | `------' `------' `------' `------' `------' `------' | + _____________________________________________________________ + ---------------------------------------------------------- + ---------------------------------------------------------- + - .------. .------. .------. .------. .------. .------. - + | | .--. | | .--. | | .--. | | .--. | | .--. | | .--. | | + - | :/\: | | :/\: | | :/\: | | :/\: | | :/\: | | :/\: | - + | | (__) | | (__) | | (__) | | (__) | | (__) | | (__) | | + - | '--' | | '--' | | '--' | | '--' | | '--' | | '--' | - + | `------' `------' `------' `------' `------' `------' | + _____________________________________________________________ + ---------------------------------------------------------- + + diff --git a/client_test.py b/client_test.py index f94bdcb..3ba7f56 100644 --- a/client_test.py +++ b/client_test.py @@ -1,4 +1,7 @@ import math +import os +import sys +import time #----------------CLASS---KEY------------------------------------------ @@ -103,7 +106,7 @@ class Client(): # Same month if stay_period[1] == stay_period[3]: days = int(stay_period[0]) - int(stay_period[2]) - month_num = int(stay_period[1]) + 1 + month_num = int(stay_period[1]) - 1 month_print = Client.months[month_num] print("Der Kunde bleibt", abs(days), "Tage.") print("Vom", stay_period[0], "bis", stay_period[2], month_print) @@ -153,8 +156,8 @@ class Client(): -w43 = Client("David", "Gebert", "w43", "Suite", "01,02,03,03", 22, (51,61,77), False) -w43.period_print() +#w43 = Client("David", "Gebert", "w43", "Suite", "01,02,03,03", 22, (51,61,77), False) +#w43.period_print() #----------------CLASS--ROOM------------------------------------------ @@ -211,8 +214,7 @@ for i in room_types: exec(tmp) tmp = "room_list.append(" + str(i[0]) + ")" exec(tmp) - -print("roomlist", room_list) + #----------------CLASS--ACCOUNTING---------------------------- @@ -266,7 +268,7 @@ class Accounting(): # Stay period else: days = 28 - int(stay_period[0]) + int(stay_period[2]) - + days = abs(days) costs = int(days) * int(self.room) """_______________________________________________________________________""" @@ -299,9 +301,10 @@ class Accounting(): #r43 = Accounting("Karl", "Otto", 16, 21,"2,3,4,5", "", False) -bill_list = [] #-------------YOU---ARE--LEAVING--CLASS--ACCOUNTING---------------------------- +#-------------ADDITIONAL--ACCOUNTING--METHODS-------------------------- +bill_list = [] def add_bill(name, surname, client_num, room, period): @@ -313,7 +316,10 @@ str(surname) + '"' + "," + '"' + str(client_num) + '"' + "," + '"' + str(room bill_list.append(bill_numb) return c + def show_single_bill(): + print("Volgenden Rechnungsnummern stehen zur Auswahl:") + print(bill_list) while True: k = input("Rechnungsnummer? ") if k in bill_list: @@ -321,10 +327,196 @@ def show_single_bill(): c = str(k) + ".show_bill()" exec(c) +def pay_your_bill(): + print("Folgenden Rechnungsnummern stehen zur Auswahl:") + print(bill_list) + print("Rechungsnummer? ") + while True: + bill =input().strip().lower() + if bill in bill_list: + break + c = str(bill) + ".pay_bill()" + exec(c) + def delete_bill(): input_ = input("Rechnungsnummer: ") delete = "del " + input_ exec(delete) -k = w43.check_in("Suite",31) + + + +#-------------ADDITIONAL---CLIENT---METHODS------------------------- + +client_list = [] + +def clear(): + if os.name == "posix": + os.system("clear") + elif os.name in ("nt", "dos", "ce"): + os.system('cls') + else: + print(80 * "\n") + + +def add_client(): + name = input("Name : ") + surname = input("Nachname :") + client_num = "c" + str(Client.clients) + room_num = None + period = input("Aufenthaltszeitraum :") + key_num = None + c = str(client_num) + " = Client(" + '"' + str(name) + '"' + "," + '"' + \ +str(surname) + '"' + "," + '"' + str(client_num) + '"' + "," + '"' + str(room_num) \ ++ '"' + "," + '"' + str(period) + '"' + "," + '"'+ str(key_num) + '"' + ",[], False)" + print(c) + client_list.append(client_num) + return c + + +k = add_client() exec(k) + +j = c0.check_in("Suite",31) +exec(j) +clear() + + + +system_list = ["buchhaltung", "kundenverwaltung", "zimmerverfaltung", "schlüsselverwaltung", "dienstpläne", "b", "k", "z", "s", "d"] + + + +"""-------------START-----METHOD--------------------""" + +dir_path = os.path.dirname(os.path.realpath(__file__)) + + +imported = True +try: + import simpleaudio +except ModuleNotFoundError: + imported = False + + + + +import sys, time + + +def play_sound(): + if imported: + wave_obj = simpleaudio.WaveObject.from_wave_file\ +(os.path.join(dir_path, "grandhotel.wav")) + play_obj = wave_obj.play() + return play_obj + return None + +def stop_sound(play_obj): + if play_obj is not None: + play_obj.stop() + + +def print1by1(text, delay=0.1): + for c in text: + sys.stdout.write(c) + sys.stdout.flush() + time.sleep(delay) + print + + + + +def ascii_print(): + with open('ascii_print_hotel', 'r', encoding='utf8') as ascii_: + for line in ascii_: + sys.stdout.write(line) + time.sleep(0.1) +input("Start?") +clear() +play_obj = play_sound() +ascii_print() + + + + +print("WELCOME TO THE GRAND BUDAPEST HOTEL SYSTEM") +input("Press enter to continue") +clear() + +while True: + print("Im System stehen Ihnen verschiedene Funktionen zur Verfügung.\n") + + while True: + print(""" +Buchhaltung +Kundenverwaltung +Zimmerverwaltung +Schlüsselverwaltung +Dienstpläne\n""") + + print("Welches der folgenden Systeme möchten Sie öffnen?") + system = input().strip().lower() + if system in system_list: + break + else: + clear() + print("Bitte wählen Sie aus einem der bestehenden Systeme aus.") + print(""" +Buchhaltung +Kundenverwaltung +Zimmerverwaltung +Schküsselverwaltung +Dienstpläne\n""") + + if system == system_list[0]: #Accounting + clear() + + while True: + print("Willkommen in der Buchhaltung") + print("Welche der folgenen Aktionen möchten Sie ausführen") + print(""" +1. Rechnung anzeigen +2. Rechnung bezahlen +3. Rechnung löschen +Abbrechen + +""") + account = input().strip().lower() + if account == "1": + print("Rechnung anzeigen\n") + show_single_bill() + clear() + if account == "2": + print("Rechung bezahlen\n") + pay_your_bill() + clear() + else: + clear() + break + + + if system == system_list[1]: #Client + pass + + if system == system_list[2]: #Room + pass + + if system == system_list[3]: #Key + pass + + if system == system_list[4]: #duty_roster + pass + + + + + + + + + + + + + #break diff --git a/grandhotel.wav b/grandhotel.wav new file mode 100644 index 0000000..96f0547 Binary files /dev/null and b/grandhotel.wav differ