diff --git a/GUI.py b/GUI.py index 8d085a0824a07cc08dabfd7d2d8a9fda9e7bb977..c555654617472306651b38950ed243f0b3762cee 100644 --- a/GUI.py +++ b/GUI.py @@ -1,4 +1,5 @@ from tkinter import Tk, Frame, Label, Entry, Button, messagebox +from main import * # Initialize main window window = Tk() @@ -51,10 +52,13 @@ def apply_theme(): def login(): username = username_entry.get() password = password_entry.get() + # check form not empty if not username or not password: messagebox.showwarning("Warning", "Please fill in both fields.") else: + messagebox.showinfo("Login", "Login successful!") + # Make rows and columns in the main window expand to center the form frame window.grid_rowconfigure(0, weight=1) @@ -78,22 +82,20 @@ login_button = Button(form_frame, text="Login", command=login, bg=current_theme[ theme_toggle_button = Button(form_frame, text="Toggle Light/Dark Mode", command=toggle_theme, bg=current_theme["button_bg"], fg=current_theme["button_fg"]) -def main(): - # Place widgets on the screen - login_label.grid(row=0, column=0, columnspan=2, pady=(10, 10)) - username_label.grid(row=1, column=0, padx=5, pady=5, sticky="e") - username_entry.grid(row=1, column=1, padx=5, pady=5, sticky="w") - password_label.grid(row=2, column=0, padx=5, pady=5, sticky="e") - password_entry.grid(row=2, column=1, padx=5, pady=5, sticky="w") - login_button.grid(row=3, column=0, columnspan=2, pady=(10, 10)) - theme_toggle_button.grid(row=4, column=0, columnspan=2, pady=(10, 10)) +# Place widgets on the screen +login_label.grid(row=0, column=0, columnspan=2, pady=(10, 10)) +username_label.grid(row=1, column=0, padx=5, pady=5, sticky="e") +username_entry.grid(row=1, column=1, padx=5, pady=5, sticky="w") +password_label.grid(row=2, column=0, padx=5, pady=5, sticky="e") +password_entry.grid(row=2, column=1, padx=5, pady=5, sticky="w") +login_button.grid(row=3, column=0, columnspan=2, pady=(10, 10)) +theme_toggle_button.grid(row=4, column=0, columnspan=2, pady=(10, 10)) + +# Enable to use theme +apply_theme() - # Enable to use theme - apply_theme() - window.mainloop() - # app will only launch if run directly from this file. if __name__ == "__main__": - main() \ No newline at end of file + window.mainloop() \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000000000000000000000000000000000000..905ec359c27776998efa68a26ffca36c54747969 --- /dev/null +++ b/main.py @@ -0,0 +1,25 @@ +from src import * + +""" +_summary_ +- logic should be seprate from the GUI +- this file handles interfacing with the database and classes. + +'idealy there should be a sort of intermeditary between the GUI and database, for example last year most groups queried the database directly from tkintet, although thats not ideal.' - lecturer idk there name +'you should be able to make python classes directly from your class diagram' - same lecturer + +""" + + + + + + + + +def main() -> None: + pass + +if __name__ == "__main__": + #main() + pass \ No newline at end of file diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..57bcd328a111622564b8bfda784cf3409110d867 --- /dev/null +++ b/src/__init__.py @@ -0,0 +1,7 @@ +from adminUser import * +from cinemaObj import * +from managerUser import * +from reciptObj import * +from reportObj import * +from staffUser import * +from userClass import * \ No newline at end of file diff --git a/src/adminUser.py b/src/adminUser.py new file mode 100644 index 0000000000000000000000000000000000000000..1113af6d7feca0e509eaae6688dd8413fe01c976 --- /dev/null +++ b/src/adminUser.py @@ -0,0 +1,20 @@ +from . import userClass + +class AdminUser(userClass.User): + pass + + + + + + + + + + + +# following code will only execute if run directly from this file. +if __name__ == "__main__": + # test + user1 = AdminUser() + print(user1) diff --git a/src/cinemaObj.py b/src/cinemaObj.py new file mode 100644 index 0000000000000000000000000000000000000000..86d21b97909e418399256740d3c29a198ec219fa --- /dev/null +++ b/src/cinemaObj.py @@ -0,0 +1,21 @@ +class Cinema(object): + """_summary_ + + Args: + object (_type_): _description_ + """ + def addScreen(self): + pass + + def updateScreen(self): + pass + + def operation3(self): + pass + + + + +if __name__ == "__main__": + #test() + pass \ No newline at end of file diff --git a/src/filmObj.py b/src/filmObj.py new file mode 100644 index 0000000000000000000000000000000000000000..c520910a40552af52d3f7c0581980556eb4183b8 --- /dev/null +++ b/src/filmObj.py @@ -0,0 +1,15 @@ +class Film(object): + """_summary_ + + Args: + object (_type_): _description_ + """ + + def addListing(self): + pass + + def updateListing(self): + pass + + def removeListing(self): + pass \ No newline at end of file diff --git a/src/managerUser.py b/src/managerUser.py new file mode 100644 index 0000000000000000000000000000000000000000..1c21ee12aecd326b11f27c80779ee8798e5d0f70 --- /dev/null +++ b/src/managerUser.py @@ -0,0 +1,28 @@ +from . import userClass + +class ManagerUser(userClass.User): + """ + + Args: + userClass (_type_): _description_ + """ + + def expandBuisness(self): + # creates new cinemaObj and adds it to db. + pass + + + + + + + + + + + +# following code will only execute if run directly from this file. +if __name__ == "__main__": + # test + user1 = ManagerUser() + print(user1) diff --git a/src/reciptObj.py b/src/reciptObj.py new file mode 100644 index 0000000000000000000000000000000000000000..23676420744b50019cbe1487edfeb5ecea9ce8cd --- /dev/null +++ b/src/reciptObj.py @@ -0,0 +1,22 @@ +class Recipt(object): + """_summary_ + + Args: + object (_type_): _description_ + """ + + def __str__(self): + # output attributes in readable format + pass + + def displayFormat(self): + # output attributes in format for GUI.py + pass + + + + + +if __name__ == "__main__": + #test() + pass \ No newline at end of file diff --git a/src/reportObj.py b/src/reportObj.py new file mode 100644 index 0000000000000000000000000000000000000000..63e93787c2b06b8e72eaa0e27cbad64fdb01b682 --- /dev/null +++ b/src/reportObj.py @@ -0,0 +1,17 @@ +class Report(object): + """_summary_ + + Args: + object (_type_): _description_ + """ + def generateRevenueReport(self): + pass + + + + + + +if __name__ == "__main__": + #test() + pass \ No newline at end of file diff --git a/src/staffUser.py b/src/staffUser.py new file mode 100644 index 0000000000000000000000000000000000000000..2a7ec89c39c2fcb9adee7f55367b29b7c503d428 --- /dev/null +++ b/src/staffUser.py @@ -0,0 +1,30 @@ +from . import userClass + +class StaffUser(userClass.User): + """_summary_ + + Args: + userClass (_type_): _description_ + """ + + def veiwFilmListing(self): + pass + + def manageBooking(): + pass + + + + + + + + + + + +# following code will only execute if run directly from this file. +if __name__ == "__main__": + # test + user1 = StaffUser() + print(user1) diff --git a/src/userClass.py b/src/userClass.py new file mode 100644 index 0000000000000000000000000000000000000000..79564fcbb37d679fab1e404ce1d001bd679212e1 --- /dev/null +++ b/src/userClass.py @@ -0,0 +1,30 @@ +import random +from . import dbfunc + +class User(object): + def __init__(self): + + self.userID:int = random.randint(0,10000) + self.userName:str = self.encrypt("") + self.userPass:str = self.encrypt("") + + def __str__(self): + return f"'User' Object(userID={self.userID}, userName={self.userName}, userPass={self.userPass})" + + def login(self): + pass + + def logout(self): + pass + + def encrypt(self, inputString): + return inputString + + + + +# following code will only execute if run directly from this file. +if __name__ == "__main__": + # test + user1 = User() + print(user1) \ No newline at end of file