Ejemplo n.º 1
0
    def __init__(self, master, conn):
        self.master = master
        master.configure(bg='dodgerblue')
        master.title("Customer")

        #database
        self.conn = conn
        self.dcustomer = Customer(self.conn)

        labelfont = ('algerian', 20, 'underline', 'bold')

        self.label = Label(master, text='BlueBox', bg='dodgerblue', fg='navy')
        self.label.config(font=labelfont)

        self.button1 = Button(self.master,
                              text='Update',
                              bg='lightsteelblue',
                              fg='navy',
                              command=self.update)

        self.button1.grid(row=12, column=1, ipadx=15, pady=20, sticky=W)

        self.tree = ttk.Treeview(master)
        self.tree["columns"] = ("ID", "First Name", "Middle Name", "Last Name",
                                "Date of Birth", "Email", "Rented",
                                "Max Rented", "Credit Card #", "Password",
                                "Username", "Can Rent")

        self.tree.column("ID", width=90, minwidth=90, stretch=False)
        self.tree.column("First Name", width=90, minwidth=90, stretch=False)
        self.tree.column("Middle Name", width=90, minwidth=90, stretch=False)
        self.tree.column("Last Name", width=90, minwidth=90, stretch=False)
        self.tree.column("Date of Birth", width=90, minwidth=90, stretch=False)
        self.tree.column("Email", width=90, minwidth=90, stretch=False)
        self.tree.column("Rented", width=90, minwidth=90, stretch=False)
        self.tree.column("Max Rented", width=90, minwidth=90, stretch=False)
        self.tree.column("Credit Card #", width=90, minwidth=90, stretch=False)
        self.tree.column("Password", width=90, minwidth=90, stretch=False)
        self.tree.column("Username", width=90, minwidth=90, stretch=False)
        self.tree.column("Can Rent", width=90, minwidth=90, stretch=False)

        self.tree.heading("ID", text="ID", anchor=tk.W)
        self.tree.heading("First Name", text="First Name", anchor=tk.W)
        self.tree.heading("Middle Name", text="Middle Name", anchor=tk.W)
        self.tree.heading("Last Name", text="Last Name", anchor=tk.W)
        self.tree.heading("Date of Birth", text="Date of Birth", anchor=tk.W)
        self.tree.heading("Email", text="Email", anchor=tk.W)
        self.tree.heading("Rented", text="Rented", anchor=tk.W)
        self.tree.heading("Max Rented", text="Max Rented", anchor=tk.W)
        self.tree.heading("Credit Card #", text="Credit Card #", anchor=tk.W)
        self.tree.heading("Password", text="Password", anchor=tk.W)
        self.tree.heading("Username", text="Username", anchor=tk.W)
        self.tree.heading("Can Rent", text="Can Rent", anchor=tk.W)
        self.tree.grid(row=13, column=1, ipadx=0, pady=5, sticky=tk.W)
Ejemplo n.º 2
0
class SignInGUI:
    def __init__(self,master,conn):
        self.master = master 
        master.configure(bg='dodgerblue')
        master.title("Customer")
        self.top = Toplevel()
        
        #database
        self.conn = conn
        self.dcustomer = Customer(self.conn)
        
        labelfont = ('algerian', 20,'underline','bold')
        
        self.label= Label(master,text='BlueBox',bg='dodgerblue',fg='navy')
        self.label_1= Label(master,text='User Name',bg='dodgerblue',fg='navy')
        self.label_2= Label(master,text='Password',bg='dodgerblue',fg='navy')
       
        
        self.entry_1= Entry(master,bg='lightsteelblue')
        self.entry_2= Entry(master,bg='lightsteelblue',show = '*')

        self.label.grid(row=0,column=1,ipady=25,ipadx=30,padx=30,pady=5,sticky=W)

        self.label_1.grid(row=1,sticky=E,pady=5)
        self.label_2.grid(row=3,sticky=E,pady=5)
        
        
        self.entry_1.grid(row=1,column=1,ipadx=30,padx=30,pady=5,sticky=W)
        self.entry_2.grid(row=3,column=1,ipadx=30,padx=30,pady=5,sticky=W)
        

        self.label.config(font=labelfont)

        self.button1= Button(self.master,text='Sign in',bg='lightsteelblue',fg='navy', command=self.signin)
        self.button2= Button(self.master,text='Clear',bg='lightsteelblue',fg='navy', command=self.clear)
        self.button3= Button(self.master,text='Guest checkout',bg='lightsteelblue',fg='navy', command=self.signup)
        self.button1.grid(row=11,column=0,ipadx=15,pady=20)
        self.button2.grid(row=11,column=1,ipadx=15,pady=20)
        self.button3.grid(row=11,column=2,ipadx=15,pady=20)


    def clear(self):
        self.entry_1.delete(0,END)
        self.entry_2.delete(0,END)
    def signup(self):
        newwindow = SignupGUI(self.top,self.conn) 

    def signin(self):
        signedin = self.dcustomer.signin(self.entry_1.get(),self.entry_2.get())
        if(signedin):
            messagebox.showinfo("Success",'Welcome! Processing Rental!' )
            newwindow = HouseGUI(self.top,self.conn) 
            return True
        else:
            messagebox.showinfo("Failure",'Invalid Username and password' )
            return False    
Ejemplo n.º 3
0
    def __init__(self, master, conn):
        self.master = master

        master.configure(bg='dodgerblue')
        master.title("Return")

        #database
        self.conn = conn
        self.dbcustomer = Customer(conn)
        self.drent = RENT(conn)
        self.dpayment = PAYMENT(conn)

        labelfont = ('algerian', 20, 'underline', 'bold')

        self.label = Label(master, text='BlueBox', bg='dodgerblue', fg='navy')
        self.label_1 = Label(master,
                             text='ID MOVIE',
                             bg='dodgerblue',
                             fg='navy')
        self.label_2 = Label(master, text='Type', bg='dodgerblue', fg='navy')
        self.entry_1 = Entry(master, bg='lightsteelblue')
        self.entry_2 = Entry(master, bg='lightsteelblue')

        self.label.grid(row=0,
                        column=1,
                        ipady=25,
                        ipadx=30,
                        padx=30,
                        pady=5,
                        sticky=W)

        self.label_1.grid(row=1, sticky=E, pady=5)
        self.label_2.grid(row=2, sticky=E, pady=5)

        self.entry_1.grid(row=1, column=1, ipadx=30, padx=30, pady=5, sticky=W)
        self.entry_2.grid(row=2, column=1, ipadx=30, padx=30, pady=5, sticky=W)

        self.label.config(font=labelfont)

        self.button1 = Button(self.master,
                              text='RETURN',
                              bg='lightsteelblue',
                              fg='navy',
                              command=self.update)
        self.button2 = Button(self.master,
                              text='CLEAR',
                              bg='lightsteelblue',
                              fg='navy',
                              command=self.clear)

        self.button1.grid(row=12, column=1, ipadx=15, pady=20, sticky=W)
        self.button2.grid(row=13, column=1, ipadx=15, pady=20, sticky=W)
Ejemplo n.º 4
0
    def __init__(self,master,conn):
        self.master = master 
        master.configure(bg='dodgerblue')
        master.title("Customer")
        self.top = Toplevel()
        
        #database
        self.conn = conn
        self.dcustomer = Customer(self.conn)
        
        labelfont = ('algerian', 20,'underline','bold')
        
        self.label= Label(master,text='BlueBox',bg='dodgerblue',fg='navy')
        self.label_1= Label(master,text='User Name',bg='dodgerblue',fg='navy')
        self.label_2= Label(master,text='Password',bg='dodgerblue',fg='navy')
       
        
        self.entry_1= Entry(master,bg='lightsteelblue')
        self.entry_2= Entry(master,bg='lightsteelblue',show = '*')

        self.label.grid(row=0,column=1,ipady=25,ipadx=30,padx=30,pady=5,sticky=W)

        self.label_1.grid(row=1,sticky=E,pady=5)
        self.label_2.grid(row=3,sticky=E,pady=5)
        
        
        self.entry_1.grid(row=1,column=1,ipadx=30,padx=30,pady=5,sticky=W)
        self.entry_2.grid(row=3,column=1,ipadx=30,padx=30,pady=5,sticky=W)
        

        self.label.config(font=labelfont)

        self.button1= Button(self.master,text='Sign in',bg='lightsteelblue',fg='navy', command=self.signin)
        self.button2= Button(self.master,text='Clear',bg='lightsteelblue',fg='navy', command=self.clear)
        self.button3= Button(self.master,text='Guest checkout',bg='lightsteelblue',fg='navy', command=self.signup)
        self.button1.grid(row=11,column=0,ipadx=15,pady=20)
        self.button2.grid(row=11,column=1,ipadx=15,pady=20)
        self.button3.grid(row=11,column=2,ipadx=15,pady=20)
Ejemplo n.º 5
0
class CustomerGUI:
    def __init__(self, master, conn):
        self.master = master
        master.configure(bg='dodgerblue')
        master.title("Customer")

        #database
        self.conn = conn
        self.dcustomer = Customer(self.conn)

        labelfont = ('algerian', 20, 'underline', 'bold')

        self.label = Label(master, text='BlueBox', bg='dodgerblue', fg='navy')
        self.label.config(font=labelfont)

        self.button1 = Button(self.master,
                              text='Update',
                              bg='lightsteelblue',
                              fg='navy',
                              command=self.update)

        self.button1.grid(row=12, column=1, ipadx=15, pady=20, sticky=W)

        self.tree = ttk.Treeview(master)
        self.tree["columns"] = ("ID", "First Name", "Middle Name", "Last Name",
                                "Date of Birth", "Email", "Rented",
                                "Max Rented", "Credit Card #", "Password",
                                "Username", "Can Rent")

        self.tree.column("ID", width=90, minwidth=90, stretch=False)
        self.tree.column("First Name", width=90, minwidth=90, stretch=False)
        self.tree.column("Middle Name", width=90, minwidth=90, stretch=False)
        self.tree.column("Last Name", width=90, minwidth=90, stretch=False)
        self.tree.column("Date of Birth", width=90, minwidth=90, stretch=False)
        self.tree.column("Email", width=90, minwidth=90, stretch=False)
        self.tree.column("Rented", width=90, minwidth=90, stretch=False)
        self.tree.column("Max Rented", width=90, minwidth=90, stretch=False)
        self.tree.column("Credit Card #", width=90, minwidth=90, stretch=False)
        self.tree.column("Password", width=90, minwidth=90, stretch=False)
        self.tree.column("Username", width=90, minwidth=90, stretch=False)
        self.tree.column("Can Rent", width=90, minwidth=90, stretch=False)

        self.tree.heading("ID", text="ID", anchor=tk.W)
        self.tree.heading("First Name", text="First Name", anchor=tk.W)
        self.tree.heading("Middle Name", text="Middle Name", anchor=tk.W)
        self.tree.heading("Last Name", text="Last Name", anchor=tk.W)
        self.tree.heading("Date of Birth", text="Date of Birth", anchor=tk.W)
        self.tree.heading("Email", text="Email", anchor=tk.W)
        self.tree.heading("Rented", text="Rented", anchor=tk.W)
        self.tree.heading("Max Rented", text="Max Rented", anchor=tk.W)
        self.tree.heading("Credit Card #", text="Credit Card #", anchor=tk.W)
        self.tree.heading("Password", text="Password", anchor=tk.W)
        self.tree.heading("Username", text="Username", anchor=tk.W)
        self.tree.heading("Can Rent", text="Can Rent", anchor=tk.W)
        self.tree.grid(row=13, column=1, ipadx=0, pady=5, sticky=tk.W)

    def update(self):
        #read from database
        data = self.dcustomer.readAll()
        #clear tree
        self.clearTree()
        #add to tree
        for x in data:
            self.tree.insert('', 'end', values=x)
        return True

    def clearTree(self):
        for i in self.tree.get_children():
            self.tree.delete(i)
Ejemplo n.º 6
0
    def __init__(self, master, conn):
        self.master = master
        master.configure(bg='dodgerblue')
        master.title("SIGN UP")

        self.conn = conn
        self.ucustomer = Customer(self.conn)

        labelfont = ('algerian', 20, 'underline', 'bold')

        self.label = Label(master, text='BlueBox', bg='dodgerblue', fg='navy')
        self.label_1 = Label(master,
                             text='First Name',
                             bg='dodgerblue',
                             fg='navy')
        self.label_10 = Label(master,
                              text='Middle Name',
                              bg='dodgerblue',
                              fg='navy')
        self.label_2 = Label(master,
                             text='Last Name',
                             bg='dodgerblue',
                             fg='navy')
        self.label_3 = Label(master,
                             text='Date of birth',
                             bg='dodgerblue',
                             fg='navy')
        self.label_11 = Label(master, text='Email', bg='dodgerblue', fg='navy')
        self.label_4 = Label(master,
                             text='Credit Card #',
                             bg='dodgerblue',
                             fg='navy')
        self.label_7 = Label(master,
                             text='Username',
                             bg='dodgerblue',
                             fg='navy')
        self.label_8 = Label(master,
                             text='Password',
                             bg='dodgerblue',
                             fg='navy')
        self.label_9 = Label(master,
                             text='WELCOME TO BLUE BOX',
                             bg='dodgerblue',
                             fg='navy')

        self.entry_1 = Entry(master, bg='lightsteelblue')
        self.entry_10 = Entry(master, bg='lightsteelblue')
        self.entry_2 = Entry(master, bg='lightsteelblue')
        self.entry_3 = Entry(master, bg='lightsteelblue')
        self.entry_11 = Entry(master, bg='lightsteelblue')
        self.entry_4 = Entry(master, bg='lightsteelblue')
        self.entry_5 = Entry(master, bg='lightsteelblue')

        self.entry_7 = Entry(master, bg='lightsteelblue')
        self.entry_8 = Entry(master, bg='lightsteelblue', show='*')

        self.label.grid(row=0,
                        column=1,
                        ipady=25,
                        ipadx=30,
                        padx=30,
                        pady=5,
                        sticky=W)

        self.label_1.grid(row=1, sticky=E, pady=5)
        self.label_10.grid(row=2, sticky=E, pady=5)
        self.label_2.grid(row=3, sticky=E, pady=5)
        self.label_3.grid(row=4, sticky=E, pady=5)
        self.label_11.grid(row=5, sticky=E, pady=5)
        self.label_4.grid(row=6, sticky=E, pady=5)
        self.label_7.grid(row=9, sticky=E, pady=5)
        self.label_8.grid(row=10, sticky=E, pady=5)

        self.entry_1.grid(row=1, column=1, ipadx=30, padx=30, pady=5, sticky=W)
        self.entry_10.grid(row=2,
                           column=1,
                           ipadx=30,
                           padx=30,
                           pady=5,
                           sticky=W)
        self.entry_2.grid(row=3, column=1, ipadx=30, padx=30, pady=5, sticky=W)
        self.entry_3.grid(row=4, column=1, ipadx=30, padx=30, pady=5, sticky=W)
        self.entry_11.grid(row=5,
                           column=1,
                           ipadx=30,
                           padx=30,
                           pady=5,
                           sticky=W)
        self.entry_4.grid(row=6, column=1, ipadx=30, padx=30, pady=5, sticky=W)

        self.entry_7.grid(row=9, column=1, ipadx=30, padx=30, pady=5, sticky=W)
        self.entry_8.grid(row=10,
                          column=1,
                          ipadx=30,
                          padx=30,
                          pady=5,
                          sticky=W)

        self.label.config(font=labelfont)

        self.button1 = Button(self.master,
                              text='Sign up',
                              bg='lightsteelblue',
                              fg='navy',
                              command=self.add)
        self.button2 = Button(self.master,
                              text='Clear',
                              bg='lightsteelblue',
                              fg='navy',
                              command=self.clear)
        self.button1.grid(row=11, column=1, ipadx=15, pady=20)
        self.button2.grid(row=11, column=2, ipadx=15, pady=20)