from student import Student
from tkinter import*
from tkinter import ttk
from student import Student
from PIL import Image, ImageTk
class face_recognition_system():
    def __init__(self,root):
        self.root=root
        self.root.geometry("1530x790+0+0")
        self.root.title("face Recognition System")

        img=Image.open(r"C:\Users\ASUS\Desktop\python3\faceR\system_attendance\medtech.jpg")
        img=img.resize((500,130), Image.ANTIALIAS)
        self.photoimg=ImageTk.PhotoImage(img)

        f_lbl=Label(self.root,image=self.photoimg)
        f_lbl.place(x=0,y=0,width=500,height=130)


        img1=Image.open(r"C:\Users\ASUS\Desktop\python3\faceR\system_attendance\download.jpg")
        img1=img1.resize((500,130), Image.ANTIALIAS)
        self.photoimg1=ImageTk.PhotoImage(img1)

        f_lbl=Label(self.root,image=self.photoimg1)
        f_lbl.place(x=500,y=0,width=500,height=130)

        img2=Image.open(r"C:\Users\ASUS\Desktop\python3\faceR\system_attendance\smu.jpg")
        img2=img2.resize((500,130), Image.ANTIALIAS)
        self.photoimg2=ImageTk.PhotoImage(img2)

        f_lbl=Label(self.root,image=self.photoimg2)
        f_lbl.place(x=1000,y=0,width=550,height=130)


        img3=Image.open(r"C:\Users\ASUS\Desktop\python3\faceR\system_attendance\att.jpg")
        img3=img3.resize((1530,710), Image.ANTIALIAS)
        self.photoimg3=ImageTk.PhotoImage(img3)

        bg_img=Label(self.root,image=self.photoimg3)
        bg_img.place(x=0,y=130,width=1530,height=710)

        title_lbl = Label(bg_img,text="FACE RECOGNITION ATTENDANCE SYSTEM", font=("time new roman", 35 , "bold"), bg ="white", fg="red")
        title_lbl.place(x=0 , y=0,width=1530, height=45)

        #student button
        img4=Image.open(r"C:\Users\ASUS\Desktop\python3\faceR\system_attendance\student.jpg")
        img4=img4.resize((220,220), Image.ANTIALIAS)
        self.photoimg4=ImageTk.PhotoImage(img4)

        b1=Button(bg_img, image=self.photoimg4, command=self.student_details, cursor="hand2")
        b1.place(x=200,y=100,width=220,height=220)

        b1_1=Button(bg_img, text="Student Details",command=self.student_details,cursor="hand2",font=("time new roman", 15 , "bold"), bg ="darkblue", fg="white")
        b1_1.place(x=200,y=300,width=220,height=40)

        #face detection button
        img5=Image.open(r"C:\Users\ASUS\Desktop\python3\faceR\system_attendance\face.jpg")
        img5=img5.resize((220,220), Image.ANTIALIAS)
        self.photoimg5=ImageTk.PhotoImage(img5)

        b1=Button(bg_img, image=self.photoimg5, cursor="hand2")
        b1.place(x=500,y=100,width=220,height=220)

        b1_1=Button(bg_img, text="Face Detector", cursor="hand2",font=("time new roman", 15 , "bold"), bg ="darkblue", fg="white")
        b1_1.place(x=500,y=300,width=220,height=40)

        #Attendance face button
        img6=Image.open(r"C:\Users\ASUS\Desktop\python3\faceR\system_attendance\face.jpg")
        img6=img6.resize((220,220), Image.ANTIALIAS)
        self.photoimg6=ImageTk.PhotoImage(img6)

        b1=Button(bg_img, image=self.photoimg6, cursor="hand2")
        b1.place(x=800,y=100,width=220,height=220)

        b1_1=Button(bg_img, text="Attendance", cursor="hand2",font=("time new roman", 15 , "bold"), bg ="darkblue", fg="white")
        b1_1.place(x=800,y=300,width=220,height=40)

         #help face button
        img7=Image.open(r"C:\Users\ASUS\Desktop\python3\faceR\system_attendance\help.jpg")
        img7=img7.resize((220,220), Image.ANTIALIAS)
        self.photoimg7=ImageTk.PhotoImage(img7)

        b1=Button(bg_img, image=self.photoimg7, cursor="hand2")
        b1.place(x=1100,y=100,width=220,height=220)

        b1_1=Button(bg_img, text="Help", cursor="hand2",font=("time new roman", 15 , "bold"), bg ="darkblue", fg="white")
        b1_1.place(x=1100,y=300,width=220,height=40)


         #Train face button
        img8=Image.open(r"C:\Users\ASUS\Desktop\python3\faceR\system_attendance\train.jpg")
        img8=img8.resize((220,220), Image.ANTIALIAS)
        self.photoimg8=ImageTk.PhotoImage(img8)

        b1=Button(bg_img, image=self.photoimg8, cursor="hand2")
        b1.place(x=200,y=380,width=220,height=220)

        b1_1=Button(bg_img, text="Train Data", cursor="hand2",font=("time new roman", 15 , "bold"), bg ="darkblue", fg="white")
        b1_1.place(x=200,y=528,width=220,height=40)


          #photo face button
        img9=Image.open(r"C:\Users\ASUS\Desktop\python3\faceR\system_attendance\photos.jpg")
        img9=img9.resize((220,220), Image.ANTIALIAS)
        self.photoimg9=ImageTk.PhotoImage(img9)

        b1=Button(bg_img, image=self.photoimg9, cursor="hand2")
        b1.place(x=500,y=380,width=220,height=220)

        b1_1=Button(bg_img, text="photos", cursor="hand2",font=("time new roman", 15 , "bold"), bg ="darkblue", fg="white")
        b1_1.place(x=500,y=528,width=220,height=40)



          #developer face button
        img10=Image.open(r"C:\Users\ASUS\Desktop\python3\faceR\system_attendance\dev.jpg")
        img10=img10.resize((220,220), Image.ANTIALIAS)
        self.photoimg10=ImageTk.PhotoImage(img10)

        b1=Button(bg_img, image=self.photoimg10, cursor="hand2")
        b1.place(x=800,y=380,width=220,height=220)

        b1_1=Button(bg_img, text="Developer", cursor="hand2",font=("time new roman", 15 , "bold"), bg ="darkblue", fg="white")
        b1_1.place(x=800,y=528,width=220,height=40)


          #Exit button
        img11=Image.open(r"C:\Users\ASUS\Desktop\python3\faceR\system_attendance\Exit.jpg")
        img11=img11.resize((220,220), Image.ANTIALIAS)
        self.photoimg11=ImageTk.PhotoImage(img11)

        b1=Button(bg_img, image=self.photoimg11, cursor="hand2")
        b1.place(x=1100,y=380,width=220,height=220)

        b1_1=Button(bg_img, text="Exit", cursor="hand2",font=("time new roman", 15 , "bold"), bg ="darkblue", fg="white")
        b1_1.place(x=1100,y=528,width=220,height=40)
    # Function buttons
    def student_details(self):
        self.new_window=Toplevel(self.root)
        self.app=Student(self.new_window)








if __name__ == "__main__":
    root=Tk()
    obj=face_recognition_system(root)
    root.mainloop()
