Beispiel #1
0
def alldetail(frame):
    frame.destroy()
    conn = sq.connect('bank.db')
    cur = conn.execute('''select * from banking''')
    frame5 = Frame(root, width=1400, height=700)
    frame5.pack(expand=True)
    img = ImageTk.PhotoImage(Image.open('C:\\images\\pixal.jpg'))
    lgs1 = Label(frame5, image=img)
    lgs1.image = img
    lgs1.place(x=0, y=0)
    bgs1 = Button(frame5,
                  text='Back',
                  bg='dark gray',
                  bd=9,
                  command=lambda: exit1(egs1, egs2, frame7),
                  fg='black',
                  font=('times', 19, 'bold'),
                  width=7)
    bgs1.place(x=80, y=580)
    scl = scrolling_area.Scrolling_Area(frame5, height=700, width=1400)
    scl.place(x=10, y=10)
    table = scrolling_area.Table(
        scl.innerframe, [
            'Name', 'fathers name', 'email', 'Mobile no', 'Address', 'Gender',
            'Password', 'Confirm Password', 'field'
        ],
        column_minwidths=[130, 130, 130, 130, 130, 130, 130, 130, 130])
    table.pack(expand=True, fill=X)
    table.on_change_data(scl.update_viewport)

    data = []
    for row in cur:
        column = []
        data.append(column)

        for r in row:
            column.append(r)

    table.set_data(data)
    frame5.mainloop()
def show(root, frame, e3):
    n = e3.get()
    frame.destroy()
    frame = Frame(root, width=1366, height=768, bg='pink')
    frame.place(x=0, y=0)
    l = Label(frame,
              text="show data",
              font=("algerian", 50, 'bold', 'underline'),
              fg='white',
              bg='gray10',
              bd=10,
              width=33)
    l.place(x=0, y=10)
    scl = scrolling_area.Scrolling_Area(frame, width=1366, height=768)
    scl.place(x=33, y=140)
    table = scrolling_area.Table(scl.innerframe, [
        'Sub_1', 'Tot_M1', 'Ob_m1', 'Sub_2', 'Tot_M2', 'Ob_m2', 'Sub_3',
        'Tot_M3', 'Ob_m', 'Sub_4', 'Tot_M4', 'Ob_m4', 'Sub_5', 'Tot_M5',
        'Ob_m5', 'Sub_6', 'Tot_M6', 'Ob_m6'
    ],
                                 column_minwidths=[
                                     50, 60, 60, 50, 60, 60, 50, 60, 60, 50,
                                     60, 60, 50, 60, 60, 50, 60, 0
                                 ])
    table.pack(expand=True, fill=X)
    table.on_change_data(scl.update_viewport)
    conn = sqlite3.connect("table.db")
    cursor = conn.execute(
        "select Sub_1,Tot_Marks1,Ob_marks1,Sub_2,Tot_Marks2,Ob_marks2,Sub_3,Tot_Marks3,Ob_marks3,Sub_4,Tot_Marks4,Ob_marks4,Sub_5,Tot_Marks5,Ob_marks5,Sub_6,Tot_Marks6,Ob_marks6 from table3 where Rollnumber=%s"
        % n)
    data = []
    for row in cursor:
        column = []
        data.append(column)
        for r in row:
            column.append(r)
    table.set_data(data)
    frame.mainloop()
def show_mem(foot2, e1, e2, z=0):
    def Logout(e):
        member(root, foot32)
        messagebox.showinfo('Title', 'Logout Sucess...')

    a = e1
    b = e2

    if (a == '' or b == ''):
        messagebox.showinfo('Title', 'INCOMPLETE INFORMATION...')
    else:

        con = sq.connect('data_aut.db')
        cor = con.execute(
            'select name,books,catagory from books_aut where name = "%s"' % a)
        pas = con.execute('select Password from books_aut where name="%s"' % a)
        word = str(pas.fetchall()[1][0])
        print(pas.fetchall())
        con.commit()

        if (word != b):
            messagebox.showinfo('Title', 'INVALID USERNAME OR PASSWORD...')
        else:
            if (z == 1):
                messagebox.showinfo('Title', 'LOGIN SUCESS...')
            foot2.destroy()
            foot32 = Frame(root, height=1080, width=1000)
            foot32.place(x=0, y=0)
            im = PhotoImage(file='ytr.gif')
            lab = Label(foot32, image=im)
            lab.image = im
            lab.pack(expand=True)
            scl = scrolling_area.Scrolling_Area(foot32, height=420, width=800)
            scl.place(x=120, y=5)
            table = scrolling_area.Table(scl.innerframe,
                                         ['NAME', 'BOOKS', 'CATAGORY'],
                                         column_minwidths=[222, 222, 222])

            #table=scrolling_area.Table(scl.innerframe,
            #           ['NAME','DOB','MOB NO.','CATAGORY','EMAIL','QUALIFICATION','ADDRESS','BOOKS'],
            #           column_minwidths=[152,122,122,222,222,222]
            #         )
            table.pack(expand=True, fill=X)
            table.on_change_data(scl.update_viewport)
            data = []
            for row in cor:
                column = []
                data.append(column)
                for r in row:
                    print(r)
                    column.append(r)

            table.set_data(data)
            b = Button(
                foot32,
                text=
                '                          Add a new Book.....                    ',
                font=('times', 17, 'italic'),
                command=lambda: add(foot32, root, e1, e2, y=1),
                fg='black',
                bg='lightgray')
            b.place(x=200, y=500)
            b1 = Button(foot32,
                        text='Logout...',
                        font=('times', 19, 'italic'),
                        command=lambda: back(foot32, x=3),
                        bg='#A7DBE1',
                        fg='black')
            b1.bind('<Button-1>', Logout)
            b1.place(x=30, y=650)
def search(foot1, root, a):
    con = sq.connect('data.db')
    com = con.execute('Select * from books where Books="%s"' % a)
    our = com.fetchall()
    con.commit()

    if (our == []):
        lb = Label(
            foot1,
            font=('times', 21, 'italic'),
            text='        No Such Book Found.......      ',
            bg='black',
            fg='lightgray',
        )
        lb.place(x=300, y=500)

    else:
        foot1.destroy()
        foot11 = Frame(root, height=1080, width=1000)
        foot11.pack(expand=True)
        if (a != 'Shiva Trilogy'):

            im = PhotoImage(file='ytr.gif')
            lab = Label(foot11, image=im)
            lab.image = im
            lab.pack(expand=True)
            la = Label(foot11,
                       text='  We Found Them........ ',
                       font=('times', 37, 'italic'),
                       fg='#1A1A19',
                       bg='lightgray')
            la.place(x=150, y=1)
        else:
            im = PhotoImage(file='uy.gif')
            lab = Label(foot11, image=im)
            lab.image = im
            lab.pack(expand=True)
            la = Label(foot11,
                       text='   Our BestSellers........   ',
                       font=('times', 37, 'italic'),
                       fg='#507D7A',
                       bg='lightgray')
            la.place(x=150, y=1)
        scl = scrolling_area.Scrolling_Area(foot11, height=300, width=7500)
        scl.place(x=150, y=67)
        table = scrolling_area.Table(scl.innerframe,
                                     ['BOOK', 'AUTHOR', 'CATAGORY'],
                                     column_minwidths=[222, 222, 222])

        table.pack(expand=True, fill=X)
        table.on_change_data(scl.update_viewport)
        b2 = Button(foot11,
                    text='Back',
                    font=('times', 17, 'italic'),
                    command=lambda: back(foot11, x=5),
                    bg='#AFB8BA',
                    fg='white')
        b2.place(x=80, y=670)
        com = con.execute('Select * from books where Books="%s"' % a)
        data = []
        for row in com:
            column = []
            data.append(column)
            for r in row:
                print(r)
                column.append(r)
        table.set_data(data)