Exemplo n.º 1
0
label_location.grid(row=1, column=0, pady=5)
entry_lat = Entry(root, width=15)
entry_lat.grid(row=1, column=1)
entry_lon = Entry(root, width=15)
entry_lon.grid(row=1, column=2)
b = Button(root,
           text="Show Weather",
           width=15,
           bg='blue',
           fg='black',
           command=show)
b.grid(row=2, column=1)
city = Label(root, text="", font=30, bg='#%02x%02x%02x' % (160, 184, 208))
city.grid(row=3, column=1, pady=4)
date = Label(root, text="", font=30, bg='#%02x%02x%02x' % (160, 184, 208))
date.grid(row=4, column=1, pady=4)
temp = Label(root, text="Temperature  :-", font=20, bg='orange')
temp.grid(row=5, column=0)
l = Label(root, text="", bg='orange')
l.grid(row=5, column=1)
wind = Label(root, text="Wind Speed  :-", font=20, bg='orange')
wind.grid(row=6, column=0)
l1 = Label(root, text="", bg='orange')
l1.grid(row=6, column=1)
latitude = Label(root, text="Latitude  :-", font=20, bg='orange')
latitude.grid(row=7, column=0)
l2 = Label(root, text="", bg='orange')
l2.grid(row=7, column=1)
longitude = Label(root, text="Longitude  :-", font=20, bg='orange')
longitude.grid(row=8, column=0)
l3 = Label(root, text="", bg='orange')
Exemplo n.º 2
0
entry_city.grid(row=0, column=1)
enter_lat = Entry(root, width=30)
enter_lat.grid(row=1, column=1)
enter_lon = Entry(root, width=30)
enter_lon.grid(row=2, column=1)
b = Button(root,
           text="Show Weather",
           width=15,
           bg='red',
           fg='black',
           command=show)
b.grid(row=3, column=1, pady=4)
city = Label(root, text="", font=30, bg='#%02x%02x%02x' % (240, 160, 237))
city.grid(row=4, column=1, pady=5)
date = Label(root, text="", font=30, bg='#%02x%02x%02x' % (240, 160, 237))
date.grid(row=5, column=1, pady=5)
temp = Label(root, text="Temperature  :-", font=10, bg='red')
temp.grid(row=6, column=0)
la = Label(root, text="", bg='red')
la.grid(row=6, column=1)
wind = Label(root, text="Wind Speed  :-", font=10, bg='red')
wind.grid(row=7, column=0)
la1 = Label(root, text="", bg='red')
la1.grid(row=7, column=1)
latitude = Label(root, text="Latitude  :-", font=10, bg='red')
latitude.grid(row=8, column=0)
la2 = Label(root, text="", bg='red')
la2.grid(row=8, column=1)
longitude = Label(root, text="Longitude  :-", font=10, bg='red')
longitude.grid(row=9, column=0)
la3 = Label(root, text="", bg='red')
Exemplo n.º 3
0
def homepage(pk):
    wnd = Tk()
    wnd.attributes("-fullscreen", True)
    wnd.configure(bg="#FFE5B4")
    wnd.bind("<Escape>", lambda event: wnd.attributes("-fullscreen", False))
    wnd.title("Day-Task Planner")
    wnd.iconbitmap('logo.ico')

    title_frame = Frame(wnd, bg="#FFE5B4")
    for i in range(3):
        Label(title_frame, text="\t\t\t\t\t\t\t", bg="#FFE5B4").grid(row=0,
                                                                     column=i,
                                                                     pady=5)
    title_font = ('Calistoga', 40, "bold")
    with open('date.txt', 'r') as f:
        date = f.read().strip().split("\n")[0]

    def today_view():
        old_homepage(pk,
                     date=datetime.today().strftime(r'%Y-%m-%d'),
                     tasks=get_todays_events(pk))

    today = Button(wnd,
                   text="Today",
                   font=('Calistoga', 20, "bold"),
                   bg="#FF2A00",
                   fg="white",
                   command=today_view,
                   width=15)
    today.grid(row=1, column=0)

    title = Label(title_frame,
                  text=" DayPlanner",
                  font=('Calistoga', 40, "bold underline"),
                  bg="#FFE5B4",
                  fg="black")
    title.grid(row=1, column=1)

    close_img = PhotoImage(master=wnd, file="close.png")
    close = Button(wnd, command=lambda cur=wnd: login(cur), relief="groove")
    close.config(image=close_img)
    close.grid(row=1, column=2)

    Label(title_frame, text="\n", bg="#FFE5B4").grid(row=2, columnspan=3)

    title_frame.grid(row=0, columnspan=3, padx=50)
    Label(wnd, text=" ", bg="#FFE5B4").grid(row=1, columnspan=3)

    #Profile Panel
    profile_pane = Frame(wnd, bg="#FFE5B4", borderwidth=4, relief="groove")
    profile_font = ('Calistoga', 20, "bold")
    data = retrieve_data()
    name = Label(profile_pane,
                 text=data[pk]["name"],
                 font=profile_font,
                 bg="#FFE5B4",
                 fg="black")
    name.grid(row=0, column=0)
    time = Label(profile_pane,
                 text=str(datetime.time(datetime.now())).split(".")[0],
                 font=profile_font,
                 bg="#FFE5B4",
                 fg="black")
    time.grid(row=1, column=0)
    date = Label(profile_pane,
                 text=date_conversion(datetime.today().strftime(r'%Y-%m-%d')),
                 font=profile_font,
                 bg="#FFE5B4",
                 fg="black")
    date.grid(row=2, column=0)
    day = Label(profile_pane,
                text=datetime.today().strftime("%A"),
                font=profile_font,
                bg="#FFE5B4",
                fg="black")
    day.grid(row=3, column=0)
    profile_pane.grid(row=2, column=0, pady=15)

    Label(wnd, bg="#FFE5B4", text=" ").grid(row=3, column=0)
    Label(wnd, bg="#FFE5B4", text="\n\n").grid(row=4, column=0)

    profile_pane_down = Frame(wnd,
                              bg="#FFE5B4",
                              borderwidth=4,
                              relief="groove")
    text = "You Have/Had {} \n Tasks/Events Planned.".format(
        len(data[pk]["data"]))
    reminder = Label(profile_pane_down,
                     text=text,
                     font=profile_font,
                     bg="#FFE5B4",
                     fg="black")
    reminder.grid(row=1, column=0)
    profile_pane_down.grid(row=5, column=0)

    #TASKS PANEL
    def tasks_display(tasks):
        task_panel = Frame(wnd, bg="#FFE5B4", borderwidth=2, relief="solid")
        Label(task_panel,
              text="\tYour Tasks\t",
              bg="#FFE5B4",
              fg="black",
              font=("Heletivca", 25, "bold")).grid(row=0, column=0)

        task_font = ("Heletivca", 15, "bold")
        task_info_font = ("Heletivca", 16, "bold")
        task_number_font = ("Times", 20, "bold")
        cur = 1
        for task in tasks:
            taskwise_panel = Frame(task_panel,
                                   bg="#FFE5B4",
                                   borderwidth=4,
                                   relief="solid")
            Label(taskwise_panel,
                  text="Task {}".format(data[pk]["data"].index(task) + 1),
                  bg="#FFE5B4",
                  font=task_number_font,
                  fg="black").grid(row=0, column=0)
            task_name = Label(taskwise_panel,
                              text=task["task_name"],
                              bg="#FFE5B4",
                              fg="black",
                              font=("Heletivca", 25, "bold underline"))
            task_name.grid(row=1, column=0)

            length = len(task["task"])
            original = task["task"]
            final = ""
            if length > 50:
                task["task"] = (task["task"][:51] + "...")
            if length > 25:
                while length > 25:
                    if length > 50:
                        final += task["task"][:25] + "\n"
                        task["task"] = task["task"][25:]
                        length -= 25
                    else:
                        final += task["task"][:25]
                        task["task"] = task["task"][25:]
                        length -= 25
            else:
                final = task["task"]
            final = final.rstrip()
            task["task"] = original

            task_info = Label(taskwise_panel,
                              text=final,
                              bg="#FFE5B4",
                              fg="black",
                              font=task_info_font)
            task_info.grid(row=2, column=0)
            task_date = Label(taskwise_panel,
                              text=date_conversion(task["date"]),
                              bg="#FFE5B4",
                              fg="black",
                              font=task_font)
            task_date.grid(row=3, column=0)
            task_time = Label(taskwise_panel,
                              text=task["time"],
                              bg="#FFE5B4",
                              fg="black",
                              font=task_font)
            task_time.grid(row=4, column=0)

            def confirm_task(pk, val):
                data = retrieve_data()
                for t in data[pk]["data"]:
                    if int(t["id"]) == int(val):
                        cur = data[pk]["data"][data[pk]["data"].index(t)]
                        break

                rem = data[pk]["data"][:data[pk]["data"].index(t)]
                if cur["status"] == "Yes":
                    messagebox.showinfo(
                        "Task Incomplete.",
                        "Page will be updated upon app restart.")
                    cur["status"] = "No"
                else:
                    messagebox.showinfo(
                        "Task Complete!",
                        "Page will be updated upon app restart.")
                    cur["status"] = "Yes"

                rem.append(cur)
                rem.extend(data[pk]["data"][data[pk]["data"].index(t) + 1:])
                data[pk]["data"] = rem

                with open("data.txt", "w") as f:
                    for user in data:
                        f.write(str(user) + "\n")
                        f.write(r"%%//%%" + "\n")

            done = Checkbutton(
                taskwise_panel,
                text="Completed?",
                variable=task["id"],
                command=lambda pk=pk, val=task["id"]: confirm_task(pk, val),
                bg="#FFE5B4")
            if task["status"] == "Yes":
                done.select()
            else:
                done.deselect()

            done.grid(row=5, column=0)
            taskwise_panel.grid(row=cur, column=0, pady=10)
            cur += 1

        def page_based_task(page_number):
            change = data[pk]["data"][2 * page_number - 2:2 * page_number]
            task_panel.grid_forget()
            wnd.update()
            tasks_display(change)

        #page nav
        for i in range(1, ceil(len(data[pk]["data"]) / 2) + 1):
            but = Button(task_panel,
                         text=i,
                         bg="red",
                         fg="white",
                         font=('Helevitica', 10, "bold"),
                         command=lambda e=i: page_based_task(e))
            but.grid(row=cur, column=i)

        task_panel.grid(row=1, column=1, rowspan=10)

    tasks_display(data[pk]["data"][:2])

    buttons_frame = Frame(wnd, bg="#FFE5B4")

    def help_func():
        wnd = Tk()
        wnd.config(bg="#FFE5B4")
        wnd.geometry("400x400+200+200")
        wnd.iconbitmap('logo.ico')
        wnd.title("Help")

        def passme():
            pass

        add_tsk = PhotoImage(master=wnd, file="planner.png")
        add_tsk_btn = Button(wnd,
                             bg="#FFE5B4",
                             relief="groove",
                             command=passme)
        add_tsk_btn.config(image=add_tsk)
        add_tsk_btn.grid(row=0, column=0, padx=30, pady=15)
        add_tsk_label = Label(wnd,
                              text="Allows user to add a task.",
                              bg="#FFE5B4",
                              fg="black",
                              font=('Helevitica', 13, "bold"))
        add_tsk_label.grid(row=0, column=1)

        change_date_img = PhotoImage(master=wnd, file='calendar.png')
        change_date = Button(wnd, command=passme, relief="groove")
        change_date.config(image=change_date_img)
        change_date.grid(row=1, column=0, pady=15)
        change_date_label = Label(
            wnd,
            text="Allows user to search for tasks\non a particular date.",
            bg="#FFE5B4",
            fg="black",
            font=('Helevitica', 13, "bold"))
        change_date_label.grid(row=1, column=1)

        graph = PhotoImage(master=wnd, file="productivity.png")
        graph_button = Button(wnd, command=passme, relief="groove")
        graph_button.config(image=graph)
        graph_button.grid(row=2, column=0, pady=15)
        graph_button_label = Label(
            wnd,
            text=
            "Allows user to find analytics\nregarding their productivtiy over\na certain time frame.",
            bg="#FFE5B4",
            fg="black",
            font=('Helevitica', 13, "bold"))
        graph_button_label.grid(row=2, column=1)

        close_img = PhotoImage(master=wnd, file="close.png")
        close = Button(wnd, command=passme, relief="groove")
        close.config(image=close_img)
        close.grid(row=3, column=0, pady=15)
        close_label = Label(wnd,
                            text="Allows user to logout.",
                            bg="#FFE5B4",
                            fg="black",
                            font=('Helevitica', 13, "bold"))
        close_label.grid(row=3, column=1)

        wnd.mainloop()

    Label(buttons_frame, text="\n\n", bg="#FFE5B4").grid(row=0, column=0)
    help_img = PhotoImage(master=wnd, file="help.png")
    help_btn = Button(buttons_frame, command=help_func, relief="groove")
    help_btn.config(image=help_img)
    help_btn.grid(row=1, column=0)
    Label(buttons_frame, text="\n\n", bg="#FFE5B4").grid(row=2, column=0)
    add_tsk_img = PhotoImage(master=wnd, file="planner.png")
    add_tsk = Button(buttons_frame,
                     command=lambda pk=pk: add_task(pk),
                     relief="groove")
    add_tsk.config(image=add_tsk_img)
    add_tsk.grid(row=3, column=0)
    Label(buttons_frame, text="\n\n", bg="#FFE5B4").grid(row=4, column=0)
    change_date_img = PhotoImage(master=wnd, file='calendar.png')
    change_date = Button(buttons_frame,
                         command=lambda var=pk: date_selection(var),
                         relief="groove")
    change_date.config(image=change_date_img)
    change_date.grid(row=5, column=0)
    Label(buttons_frame, text="\n\n", bg="#FFE5B4").grid(row=6, column=2)
    graph = PhotoImage(master=wnd, file="productivity.png")
    graph_button = Button(wnd,
                          command=lambda var=pk: graph_display(var),
                          relief="groove")
    graph_button.config(image=graph)
    graph_button.grid(row=7, column=2)

    buttons_frame.grid(row=1, column=2, rowspan=10)
    wnd.mainloop()
Exemplo n.º 4
0
expiredItemFrame.configure(bg=bgcolor)

expiredItemFrameA = Frame(expiredItemFrame)
expiredItemFrameA.configure(bg=bgcolor)
expiredItemFrameB = Frame(expiredItemFrame)
expiredItemFrameB.configure(bg=bgcolor)

# title
title = tk.Label(expiredItemFrameA, text="Expired Inventory Report",
                 bg=bgcolor, fg="black", font="Times 32")
title.grid(column=0, row=0)

# current date and time
date = tk.Label(expiredItemFrameA, text=date.today().strftime("%B %d, %Y"),
                bg=bgcolor, fg="black", font="Times 18")
date.grid(column=0, row=1)
time = tk.Label(expiredItemFrameA, text=datetime.now().strftime("%I:%M %p"),
                bg=bgcolor, fg="black", font="Times 18")
time.grid(column=1, row=1)


def list_expired():
    cur.execute(
        "SELECT i.item_no, i.category, i.description, p.due_date, i.amount, "
        "r.interest_rate FROM item i, pawn_ticket p, risk r, inventory_tag t "
        "WHERE i.item_no=t.item_no AND t.ticket_no=p.ticket_no AND "
        "i.risk_level=r.risk_level AND p.due_date <= CURRENT_DATE AND "
        "p.payment_date IS NULL;")

    rows = cur.fetchall()
Exemplo n.º 5
0
#fill='y',
#Insert()

tree.place(x=35, y=200, height=350, width=400)
vsb = ttk.Scrollbar(root, orient="vertical", command=tree.yview)
vsb.place(x=16, y=200, height=350)

tree.configure(yscrollcommand=vsb.set)

IPNumber = tk.Label(root, text="detail")
IPNumber.grid(row=4, column=3)

today = date.today()
date = tk.Label(root, text=today)
date.grid(row=2, column=2)

now = datetime.now()
current_time = now.strftime("%H:%M:%S")
time = tk.Label(root, text=current_time)
time.grid(row=1, column=2)

MASSAGE = tk.Label(root, text="subject")
MASSAGE.grid(row=6, column=3)

enterIP = tk.Entry(root, width=20)
enterIP.grid(row=5, column=3)

enterMassge = tk.Entry(root, width=50)
enterMassge.grid(row=7, column=3)
Exemplo n.º 6
0
    l8.config(text=humidity)
    l9.config(text=country)
    l10.config(text=wind_direction)



label_city=Label(root,text="City",width=10,font=90)
label_city.grid(row=0,column=0,pady=6)
entry_city=Entry(root,width=30)
entry_city.grid(row=0,column=1)
b=Button(root,text="Show Weather",width=15,bg='red',fg='black',command=show)
b.grid(row=1,column=1)
city=Label(root,text="",font=20)
city.grid(row=2,column=1,pady=4)
date=Label(root,text="",font=20)
date.grid(row=3,column=1,pady=4)
temp=Label(root,text="Temperature  :-")
temp.grid(row=4,column=0)
l=Label(root,text="")
l.grid(row=4,column=1)
wind=Label(root,text="Wind Speed  :-")
wind.grid(row=5,column=0)
l1=Label(root,text="")
l1.grid(row=5,column=1)
latitude=Label(root,text="Latitude  :-")
latitude.grid(row=6,column=0)
l2=Label(root,text="")
l2.grid(row=6,column=1)
longitude=Label(root,text="Longitude  :-")
longitude.grid(row=7,column=0)
l3=Label(root,text="")