-
Notifications
You must be signed in to change notification settings - Fork 0
/
ViewAttendance.py
83 lines (59 loc) · 2.26 KB
/
ViewAttendance.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
from tkinter import *
import os
import threading
from PIL import Image
from PIL import ImageTk
LARGEFONT = ("Verdana", 13)
start_page = Tk()
def g_markAttendance_thread():
os.system('')
def g_MarkAttendance():
t2 = threading.Thread(target=g_markAttendance_thread())
t2.start()
os.system('python graphs.py')
def i_markAttendance_thread():
os.system('python individual.py')
def i_MarkAttendance():
t2 = threading.Thread(target=i_markAttendance_thread)
t2.start()
def backbtn_thread():
os.system('python dashboard.py')
def Backbutton():
t2 = threading.Thread(target=backbtn_thread)
t2.start()
def close_windows():
start_page.destroy()
start_page.title("View Attendance")
start_page.geometry("300x250")
p1 = PhotoImage(file='appicon.png')
start_page.iconphoto(False, p1)
# Background Image
bgi = Image.open("Capture1.png")
bgi.image = bgi
bgi1 = bgi.resize((300, 250), Image.ANTIALIAS)
bgi2 = ImageTk.PhotoImage(bgi1)
canvas1 = Canvas(start_page, width=300, height=250)
canvas1.pack(fill="both", expand=True)
canvas1.create_image(0, 0, image=bgi2, anchor="nw")
IA = Image.open("IA.png")
IA.image = IA
IA1 = IA.resize((185, 45), Image.ANTIALIAS)
IA2 = ImageTk.PhotoImage(IA1)
button1 = Button(start_page, image=IA2, bg="black", borderwidth=0, activebackground="black",
command=lambda: [close_windows(), i_MarkAttendance()])
GA = Image.open("GA.png")
GA.image = GA
GA1 = GA.resize((185, 45), Image.ANTIALIAS)
GA2 = ImageTk.PhotoImage(GA1)
button2 = Button(start_page, image=GA2, bg="black", borderwidth=0, activebackground="black",
command=lambda: [close_windows(), g_MarkAttendance()])
icon = Image.open("back-button.ico")
icon1 = icon.resize((40, 40), Image.ANTIALIAS)
icon2 = ImageTk.PhotoImage(icon1)
button3 = Button(start_page, image=icon2, bg="black", command=lambda: [close_windows(), Backbutton()],
activebackground="black", borderwidth=0)
canvas1.create_text(150, 30, text="Chose Operation", fill='white', font=("Verdana", 13, 'bold'))
button1_canvas = canvas1.create_window(60, 60, anchor="nw", window=button1)
button2_canvas = canvas1.create_window(60, 130, anchor="nw", window=button2)
button3_canvas = canvas1.create_window(10, 190, anchor="nw", window=button3)
start_page.mainloop()