Professional Documents
Culture Documents
SYSTEM
by
SANKARANARAYANAN V
STD. XII, Reg. No._____________________
BONAFIDE CERTIFICATE
Earth Public School, Kundrathur, Chennai 600069 who carried out this
project work during the academic session 2022 – 23
SANKARANARAYAN V
(Reg.No._________________)
DECLARATION
SANKARANARAYANAN V
(Reg. No.________________)
ABSTRACT
1|Page
INTRODUCTION
Student management System is usually used in schools/colleges for
storing records of students. All student information can be stored and
different operations can be performed through database.
This project is aimed to store student details, project entitled as
student management system. This project is developed mainly to
administrate the student’s mark records and courses. The purpose of the
project is to computerize the student Management of student’s records in
colleges, schools and coaching’s, to develop software which is user
friendly, simple, fast and cost-effective. Traditionally, it was done
manually. The main function of the system is to add or update student’s
marks and retrieve these details when required, and also to manipulate
these details meaningfully. SQL stands for Structured Query
Language and is a widely used programming language for managing
relational databases. Python is an interpreted, high-level and general-
purpose programming language. Python's design philosophy
emphasizes code readability with its notable use of significant
indentation. Its language constructs and object-oriented approach aim to
help programmers write clear, logical code for small and large-scale
projects. Python was created in the late 1980s, and first released in 1991,
by Guido van Rossum as a successor to the python programming
language.
2|Page
SCOPE
The proposed software product is the student Management system. This
system will be used in any School, College and coaching institute to get
the information of the student’s marks details and then storing that data
for future usage. The current system in use is a paper-based system. It is
too slow and cannot provide update lists of students within a reasonable
timeframe. The intentions of the system are to reduce over-time pay and
increase the productivity. Requirements statements in this document are
both functional and non-functional.
3|Page
SYSTEM REQUIREMENTS
4|Page
TECHNICAL DESCRIPTION
FRONT END DESCRIPTION LANGUAGE (ABOUT PYTHON
WITH TKINTER):
Python is widely used general-purpose, high level programming
language. Tkinter is a Python binding to the Tk GUI toolkit. It is the
standard Python interface to the Tk GUI toolkits and is Python’s de facto
standard GUI. Tkinter is included in standard Linux, Microsoft Window
and Mac OS X installs of Python.
5|Page
CODE
(code)
#MAIN PAGE
from tkinter import *
from tkinter import ttk,messagebox
from PIL import Image,ImageTk # FROM PILLOW LIBARIRY WE TAKE FOR
IMAGES
import mysql.connector as sl #FOR DATABASE
class MAINPAGE:
def __init__(self,root):
self.root=root
self.root.title("MAIN PAGE") #WINDOW NAME
self.root.geometry("1920x700+0+0") #WINDOW SIZE
from PIL import Image,ImageTk
img1=Image.open("C:\\Users\\PGEPS01\\Desktop\\Student-Database-
Management-System-main\\IMG\\MAINPAGE.jpg")
img2=Image.open("IMG/sclogo.png")
img1.paste(img2,(995,720))
#FOR BACKGROUND IMAGE
self.bg=ImageTk.PhotoImage(img1)
bg=Label(self.root,image=self.bg).place(x=0, y=0, relwidth=1, relheight=1)
#TITLE BAR
title=Label(self.root,text="WELCOME TO OUR STUDENT
MANAGEMENT SYSTEM - PGEPS", font=("times new roman",20,"bold"),
bg="orange").place(x=0, y=0, relwidth=1, height=50)
aboutus_btn=Button(self.root, text="ABOUT US", font=("times new
roman",15,"bold"), bg="orange", fg="white", cursor="hand2",
command=self.aboutus).place(x=1200, y=10, width=150, height=30)
contactus_btn=Button(self.root, text="CONTACT US", font=("times new
roman",15,"bold"), bg="orange", fg="white", cursor="hand2",
command=self.contactus).place(x=1370, y=10, width=150, height=30)
6|Page
def aboutus(self):
messagebox.showinfo("ABOUT US","THIS IS OUR STUDENT
MANAGEMENT SYSTEM ", parent=self.root)
def contactus(self):
messagebox.showinfo("CONTACT US","IF YOU WANT TO CONTACT
US THEN HERE IS OUR INFO \n EMAIL : abc@gmail.com \n PHONE
NUMBER: 01.........", parent=self.root)
def loginpage(self):
self.root.destroy()
import LOGIN
def signuppage(self):
self.root.destroy()
import SIGNUP
root=Tk()
obj=MAINPAGE(root)
root.mainloop()
#SIGNUP PAGE
from tkinter import *
from tkinter import ttk, messagebox
from PIL import Image, ImageTk # FROM PILLOW LIBARIRY WE TAKE
FOR IMAGES
import mysql.connector as l # FOR DATABASE
from tkcalendar import * # FOR CALENDAR
class DASHBOARD:
def __init__(self, root):
self.root = root
self.root.title("DASHBOARD") # WINDOW NAME
self.root.geometry("2000x700+0+0") # WINDOW SIZE
# FOR BACKGROUND IMAGE
self.bg = ImageTk.PhotoImage(file="IMG/STUDENT.jpg")
bg = Label(self.root, image=self.bg).place(x=0, y=0, relwidth=1, relheight=1)
# TITLE BAR
title = Label(self.root, text="WELCOME TO OUR STUDENT
MANAGEMENT SYSTEM", font=("times new roman", 20, "bold"),
bg="orange").place(x=0, y=0, relwidth=1, height=50)
aboutus_btn = Button(self.root, text="ABOUT US", font=("times new
roman", 15, "bold"), bg="orange", fg="white",
7|Page
cursor="hand2", command=self.aboutus).place(x=1200, y=10,
width=150, height=30)
contactus_btn = Button(self.root, text="CONTACT US", font=("times new
roman", 15, "bold"), bg="orange",
fg="white", cursor="hand2",
command=self.contactus).place(x=1370, y=10, width=150,
height=30)
# MENU BAR
Menu = LabelFrame(self.root, text="MENU BAR", font=("times new
roman", 18, "bold"), bg="salmon")
Menu.place(x=15, y=80, width=1335, height=80)
# MENU BUTTONS
btn_student = Button(Menu, text="STUDENT", font=("times new roman",
15, "bold"), bg="salmon", fg="white",
cursor="hand2", command=self.studentpage).place(x=20, y=5,
width=200, height=40)
btn_teacher = Button(Menu, text="TEACHER", font=("times new roman",
15, "bold"), bg="salmon", fg="white",
cursor="hand2", command=self.teacherpage).place(x=240, y=5,
width=200, height=40)
btn_result = Button(Menu, text="ADD RESULT", font=("times new roman",
15, "bold"), bg="salmon", fg="white",
cursor="hand2", command=self.resultpage).place(x=460, y=5,
width=200, height=40)
btn_viewresult = Button(Menu, text="VIEW RESULT", font=("times new
roman", 15, "bold"), bg="salmon", fg="white",
cursor="hand2", command=self.viewresultpage).place(x=680,
y=5, width=220, height=40)
btn_logout = Button(Menu, text="LOGOUT", font=("times new roman", 15,
"bold"), bg="salmon", fg="white",
cursor="hand2", command=self.logout).place(x=920, y=5,
width=200, height=40)
# CALENDER
date = Label(self.root, text="TO DAYS DATE IS: ", font=("times new
roman", 12, "bold"), bg="aqua").place(x=15,
y=180)
mycalendar = Calendar(root, setmode="day", date_pattern='d/m/yy')
mycalendar.place(x=15, y=200, width=480, height=480)
# UPDATE DETAILS STUDENT NUMBER TEACHER NUMBER
self.tStudent = Label(self.root, text="TOTAL STUDENT \n [ 0 ]",
font=("times new roman", 20, "bold"), bd=15,
relief=RIDGE, bg="seagreen", cursor="hand2", fg="white")
self.tStudent.place(x=550, y=180, width=300, height=100)
8|Page
self.tTeacher = Label(self.root, text="TOTAL TEACHER \n [ 0 ]",
font=("times new roman", 20, "bold"), bd=15,
relief=RIDGE, bg="seagreen", cursor="hand2", fg="white")
self.tTeacher.place(x=940, y=180, width=300, height=100)
self.update_details_student()
self.update_details_teacher()
def aboutus(self):
messagebox.showinfo("ABOUT US", "THIS IS OUR STUDENT
MANAGEMENT SYSTEM", parent=self.root)
def contactus(self):
messagebox.showinfo("CONTACT US",
"IF YOU WANT TO CONTACT US THEN HERE IS OUR
INFO \n EMAIL : abc@gmail.com \n PHONE NUMBER: 01.........",
parent=self.root)
def update_details_student(self):
con = l.connect(host="localhost", user="root", password="sankar@95",
database="STUDENT")
cur = con.cursor()
cur.execute("select * from stu")
cr = cur.fetchall()
self.tStudent.config(text=f"TOTAL STUDENT\n[{str(len(cr))}]")
def update_details_teacher(self):
con = l.connect(host="localhost", user="root", password="sankar@95",
database="TEACHER")
cur = con.cursor()
cur.execute("select * from teacher")
cr = cur.fetchall()
self.tTeacher.config(text=f"TOTAL TEACHER\n[{str(len(cr))}]")
def logout(self):
self.root.destroy()
import LOGIN
def studentpage(self):
self.root.destroy()
import STUDENT
def teacherpage(self):
self.root.destroy()
import TEACHER
def resultpage(self):
self.root.destroy()
import RESULT
def viewresultpage(self):
self.root.destroy()
9|Page
import VIEWRESULT
root = Tk()
obj = DASHBOARD(root)
root.mainloop()
from tkinter import *
from tkinter import ttk,messagebox
from PIL import Image,ImageTk # FROM PILLOW LIBARIRY WE TAKE FOR
IMAGES
import mysql.connector as sl #FOR DATABASE
class SIGNUP:
def __init__(self,root):
self.root=root
self.root.title("SIGNUP PAGE") #WINDOW NAME
self.root.geometry("1920x1280+0+0") #WINDOW SIZE
#FOR BACKGROUND IMAGE
self.bg=ImageTk.PhotoImage(file="IMG/LOGIN.jpg")
bg=Label(self.root,image=self.bg).place(x=0, y=0, relwidth=1, relheight=1)
#IF HAVE ACCOUNT LOGIN
frame2 = Frame(self.root,bg="green")
frame2.place(x=80,y=100, width=800, height=600)
title=Label(frame2,text="ALREADY SIGNUP", font=("times new
roman",20,"bold"), bg="green").place(x=50, y=30)
title=Label(frame2,text="I ALREADY HAVE AN ACCOUNT",
font=("times new roman",15,"bold"), bg="green").place(x=50, y=150)
#BUTTON
btn=Button(frame2,text="LOGIN", bg="white", font=("times new
roman",20,"bold"), border="0",cursor="hand2",
command=self.loginpage).place(x=80, y=200, width=150)
#REGEESTATION BOX
frame1 = Frame(self.root,bg="salmon")
frame1.place(x=480,y=100, width=800, height=600)
title=Label(frame1,text="WELCOME...", font=("times new
roman",20,"bold"), bg="salmon").place(x=50, y=30)
#LABELS
#FIRST & LAST NAME
10 | P a g e
f_name=Label(frame1,text="FIRST NAME", font=("times new
roman",18,"bold"), bg="salmon").place(x=50, y=100)
self.txt_fname=Entry(frame1, font=("times new
roman",15,"bold"),bg="lightgray")
self.txt_fname.place(x=50, y=130, width=250)
elif self.txt_password.get()!=self.txt_cpassword.get():
messagebox.showerror("ERROR!!!","PASSWORD IS NOT MATCH",
parent=self.root)
elif self.var_cbox.get()==0:
messagebox.showerror("ERROR!!!","PLEASE AGREE WITH OUR
TERMS AND CONDITION", parent=self.root)
else:
try:
con=sl.connect(host="localhost", user="root", password="sankar@95",
database="teacher")
cur=con.cursor()
cur.execute("select * from signup where
email=%s",(self.txt_email.get(),))
row=cur.fetchone()
#print(row)
if row!=None:
messagebox.showerror("ERROR!!!","USER ALREADY HAS EXIT,
PLEASE TRY WITH ANOTHER EMAIL OR LOGIN", parent=self.root)
else:
try:
cur.execute("insert into signup values(%s,%s,%s,%s,%s,%s)",
(
self.txt_fname.get(),
self.txt_lname.get(),
self.txt_cont.get(),
self.txt_email.get(),
self.cmbo_gender.get(),
self.txt_password.get()
12 | P a g e
))
con.commit()
except:
con.rollback()
con.close()
self.clear()
self.root.destroy()
import LOGIN
except Exception as es:
messagebox.showerror("ERROR!!!",f"ERROR FOR: {str(es)}",
parent=self.root)
def clear(self):
self.txt_fname.delete(0,END)
self.txt_lname.delete(0,END)
self.txt_cont.delete(0,END)
self.txt_email.delete(0,END)
self.cmbo_gender.current(0)
self.txt_password.delete(0,END)
self.txt_cpassword.delete(0,END)
self.txt_fname.delete(0,END)
def loginpage(self):
self.root.destroy()
import LOGIN
root=Tk()
obj=SIGNUP(root)
root.mainloop()
from tkinter import *
from tkinter import ttk,messagebox
from PIL import Image,ImageTk # FROM PILLOW LIBARIRY WE TAKE FOR
IMAGES
import mysql.connector as sl #FOR DATABASE
class LOGIN:
def __init__(self,root):
self.root=root
self.root.title("LOGIN PAGE") #WINDOW NAME
self.root.geometry("1920x1280+0+0") #WINDOW SIZE
#FOR BACKGROUND IMAGE
13 | P a g e
self.bg=ImageTk.PhotoImage(file="IMG/LOGIN.jpg")
bg=Label(self.root,image=self.bg).place(x=0, y=0, relwidth=1, relheight=1)
#IF HAVE NOT ACCOUNT LOGIN
frame2 = Frame(self.root,bg="green")
frame2.place(x=480,y=100, width=800, height=425)
title=Label(frame2,text="NOT SIGNUP", font=("times new
roman",20,"bold"), bg="green").place(x=500, y=30)
title=Label(frame2,text="I DON'T HAVE ANY ACCOUNT", font=("times
new roman",15,"bold"), bg="green").place(x=500, y=150)
#BUTTON
btn=Button(frame2,text="SIGNUP", bg="white", font=("times new
roman",20,"bold"),
border="0",cursor="hand2",command=self.signuppage).place(x=500, y=200,
width=150)
#login BOX
frame1 = Frame(self.root,bg="salmon")
frame1.place(x=80,y=100, width=800, height=425)
title=Label(frame1,text="WELCONE BACK...", font=("times new
roman",20,"bold"), bg="salmon").place(x=100, y=30)
#LABELS
#FIRST & LAST NAME
u_name=Label(frame1,text="EMAIL ID", font=("times new
roman",18,"bold"), bg="salmon").place(x=200, y=100)
self.txt_uname=Entry(frame1, font=("times new
roman",15,"bold"),bg="lightgray")
self.txt_uname.place(x=200, y=130, width=250)
#PASSWORD
password=Label(frame1,text="PASSWORD", font=("times new
roman",18,"bold"), bg="salmon").place(x=200, y=170)
self.txt_password=Entry(frame1, font=("times new
roman",15,"bold"),bg="lightgray")
self.txt_password.place(x=200, y=200, width=250)
#FORGET PASSWORD
fp=Button(frame1,text="forget password", bg="salmon", font=("times new
roman",15), cursor="hand2").place(x=200, y=260)
#BUTTON
14 | P a g e
btn=Button(frame1,text="LOGIN", bg="white", font=("times new
roman",20,"bold"), border="0",cursor="hand2",
command=self.login_data).place(x=320, y=330, width=150)
def login_data (self):
if self.txt_uname.get()=="" or self.txt_password.get()=="":
messagebox.showerror("ERROR!!!","PLEASE FILL THE ALL INPUT
FIELD", parent=self.root)
else:
try:
con=sl.connect(host="localhost", user="root", password="sankar@95",
database="teacher")
cur=con.cursor()
cur.execute("select * from signup where email=%s and pass=%s",
(self.txt_uname.get(), self.txt_password.get()))
row=cur.fetchone()
if row==None:
messagebox.showerror("ERROR!!!","INVALID USERNAME OR
PASSWORD", parent=self.root)
else:
self.clear()
root=Tk()
obj=LOGIN(root)
root.mainloop()
from tkinter import *
15 | P a g e
from tkinter import ttk,messagebox
from PIL import Image,ImageTk # FROM PILLOW LIBARIRY WE TAKE FOR
IMAGES
import mysql.connector as sl
class STUDENT:
def __init__(self,root):
self.root=root
self.root.title("STUDENT") #WINDOW NAME
self.root.geometry("1920x700+0+0") #WINDOW SIZE
#FOR BACKGROUND IMAGE
self.bg=ImageTk.PhotoImage(file="IMG/STUDENT.jpg")
bg=Label(self.root,image=self.bg).place(x=0, y=0, relwidth=1, relheight=1)
#variable
self.SLNO=StringVar()
self.ID=StringVar()
self.NAME=StringVar()
self.EMAIL=StringVar()
self.CONTACT=StringVar()
self.DOB=StringVar()
self.GENDER=StringVar()
self.SEARCH_BY=StringVar()
self.SEARCH_TXT=StringVar()
#TITLE
title=Label(self.root, text="STUDENT MANAGEMENT SYSTEM ---
STUDENT", font=("times new roman",40,"bold"), bg="orange").pack(side=TOP,
fill=X)
#FROM
From=Frame(self.root, bd=5, relief=RIDGE, bg="salmon").place(x=20,
y=100, width=425, height=580)
From_title=Label(From, text="STUDENT DETAILS: ", bg="salmon",
fg="green", font=("times new roman",20,"bold")).place(x=30, y=110)
slno=Label(From, text="SLNO NUMBER: ", bg="salmon", fg="black",
font=("times new roman",16,"bold")).place(x=25, y=155, width=200, height=20)
txt_slno=Entry(From,textvariable=self.SLNO, font=("times new
roman",15,"bold"), bd=5).place(x=220, y=150, width=200, height=30)
Id=Label(From, text="ID NUMBER: ", bg="salmon", fg="black",
font=("times new roman",16,"bold")).place(x=25, y=205, width=200, height=20)
txt_Id=Entry(From, font=("times new roman",15,"bold"),textvariable=self.ID,
bd=5).place(x=220, y=200, width=200, height=30)
name=Label(From, text="NAME: ", bg="salmon", fg="black", font=("times
new roman",16,"bold")).place(x=30, y=255, width=200, height=20)
16 | P a g e
txt_name=Entry(From, font=("times new roman",15,"bold"),
bd=5,textvariable=self.NAME).place(x=220, y=250, width=200, height=30)
email=Label(From, text="EMAIL: ", bg="salmon", fg="black", font=("times
new roman",16,"bold")).place(x=30, y=305, width=200, height=20)
txt_email=Entry(From, font=("times new roman",15,"bold"),
bd=5,textvariable=self.EMAIL).place(x=220, y=300, width=200, height=30)
cont=Label(From, text="CONTACT NO.: ", bg="salmon", fg="black",
font=("times new roman",16,"bold")).place(x=30, y=355, width=200, height=20)
txt_cont=Entry(From, font=("times new roman",15,"bold"),
bd=5,textvariable=self.CONTACT).place(x=220, y=350, width=200, height=30)
dob=Label(From, text="DOB: ", bg="salmon", fg="black", font=("times new
roman",16,"bold")).place(x=30, y=405, width=200, height=20)
txt_dob=Entry(From, font=("times new roman",15,"bold"), bd=5,
textvariable=self.DOB).place(x=220, y=400, width=200, height=30)
address=Label(From, text="ADDRESS: ", bg="salmon", fg="black",
font=("times new roman",16,"bold")).place(x=30, y=455, width=200, height=20)
self.txt_address=Entry(From, font=("times new roman",15,"bold"), bd=5)
self.txt_address.place(x=220, y=450, width=200, height=50)
gender=Label(From, text="GENDER: ", bg="salmon", fg="black",
font=("times new roman",16,"bold")).place(x=30, y=525, width=200, height=20)
self.comb_gender=ttk.Combobox(From, font=("times new roman",15,"bold"),
state='readonly',justify=CENTER,textvariable=self.GENDER)
self.comb_gender['values']=("Select One","MALE","FEMALE","OTHER")
self.comb_gender.place(x=220, y=520, width=200, height=30)
self.comb_gender.current(0)
#BUTTON
btn=Frame(From, bd=5, relief=RIDGE, bg="aqua").place(x=30, y=600,
width=470) #BAR
addbtn=Button(btn, text="Add", font=("times new roman",15,"bold"),
bg="green", fg="white",cursor="hand2", command=self.add_data).place(x=60,
y=620, width=85, height=32)
updatebtn=Button(btn, text="Update", font=("times new roman",15,"bold"),
bg="black", fg="white", cursor="hand2",
command=self.update_data).place(x=150, y=620, width=85, height=32)
deletebtn=Button(btn, text="Delete", font=("times new roman",15,"bold"),
bg="red", fg="white", cursor="hand2", command=self.delete_data).place(x=240,
y=620, width=85, height=32)
clearbtn=Button(btn, text="Clear", font=("times new roman",15,"bold"),
bg="black", fg="white", cursor="hand2", command=self.clear_data).place(x=330,
y=620, width=85, height=32)
#VIEW DETAILS
17 | P a g e
details=Frame(self.root, bd=5, relief=RIDGE, bg="coral").place(x=455,
y=100, width=980, height=580)
search=Label(details, text="SEARCH BY: ", font=("time new
roman",12,"bold"),bg="coral",fg="white",).place(x=475, y=115)
self.comb_search=ttk.Combobox(details, font=("times new
roman",12,"bold"), state='readonly',justify=CENTER,
textvariable=self.SEARCH_BY)
self.comb_search['values']=("ID","NAME","CONTACT")
self.comb_search.place(x=590, y=114, width=150, height=25)
self.comb_search.current(0)
txt_search=Entry(details, font=("times new roman",14,"bold"), bd=5,
textvariable=self.SEARCH_TXT).place(x=760, y=114, width=190, height=25)
searchbtn=Button(btn, text="SEARCH", font=("times new
roman",15,"bold"), bg="black", fg="white",cursor="hand2",
command=self.search_data).place(x=960, y=112, width=100, height=30)
showallbtn=Button(btn, text="SHOW ALL", font=("times new
roman",13,"bold"), bg="black", fg="white", cursor="hand2",
command=self.fetch_data).place(x=1070, y=112, width=100, height=30)
exitbtn=Button(btn, text="EXIT", font=("times new roman",15,"bold"),
bg="black", fg="white", cursor="hand2",
command=self.exit).place(x=1180,y=112, width=80, height=30)
#TABLE SECTION
table=Frame(details, bd=5, relief=RIDGE, bg="seagreen")
table.place(x=475, y=150, width=880, height=520)
#SCROOLBAR
scrollx=Scrollbar(table,orient=HORIZONTAL)
scrolly=Scrollbar(table,orient=VERTICAL)
self.student_table=ttk.Treeview(table,column=("SLNO", "ID", "NAME",
"EMAIL", "CONTACT NO", "DOB", "ADDRESS",
"GENDER"),xscrollcommand=scrolly,yscrollcommand=scrollx)
scrollx.pack(side=BOTTOM, fill=X)
scrolly.pack(side=RIGHT, fill=Y)
scrollx.config(command=self.student_table.xview)
scrolly.config(command=self.student_table.yview)
self.student_table.heading("SLNO",text="SL NO")
self.student_table.heading("ID",text="ID")
self.student_table.heading("NAME",text="NAME")
self.student_table.heading("EMAIL",text="EMAIL")
self.student_table.heading("CONTACT NO",text="CONTACT NO.")
self.student_table.heading("DOB",text="DATE OF BIRTH")
self.student_table.heading("ADDRESS",text="ADDRESS")
18 | P a g e
self.student_table.heading("GENDER",text="GENDER")
self.student_table['show']='headings'
self.student_table.column("SLNO", width=95)
self.student_table.column("ID", width=95)
self.student_table.column("NAME", width=95)
self.student_table.column("EMAIL", width=110)
self.student_table.column("CONTACT NO", width=95)
self.student_table.column("DOB", width=95)
self.student_table.column("ADDRESS", width=170)
self.student_table.column("GENDER", width=95)
self.student_table.pack(fill=BOTH, expand=1)
self.student_table.bind("<ButtonRelease-1>",self.get_cursor)
self.fetch_data()
#DATABASE WORK
def add_data(self):
if self.ID.get()=="" or self.NAME.get()=="":
messagebox.showerror("ERROR!!!","NAME AND ID MUST
REQUIRED")
else:
h = sl.connect(host="localhost", user="root", password="sankar@95",
database="student")
c= h.cursor()
try:
c.execute("insert into stu
values(%s,%s,%s,%s,%s,%s,%s,%s)",(self.SLNO.get(),self.ID.get(),self.NAME.ge
t(),str(self.EMAIL.get()),str(self.CONTACT.get()),str(self.DOB.get()),self.txt_add
ress.get(),self.GENDER.get()))
h.commit()
except:
h.rollback()
self.fetch_data()
self.clear_data()
h.close()
messagebox.showinfo("SUCCESS","DATA ADDED SUCCESSFULL")
def fetch_data(self):
con = sl.connect(host="localhost", user="root", password="sankar@95",
database="STUDENT")
cur= con.cursor()
cur.execute("select * from stu order by ID asc")
rows=cur.fetchall()
if len(rows)!=0:
self.student_table.delete(*self.student_table.get_children())
for row in rows:
self.student_table.insert('',END,values=row)
con.commit()
con.close()
19 | P a g e
def get_cursor(self,ev):
cursor_row = self.student_table.focus()
contents = self.student_table.item(cursor_row)
row = contents['values']
self.SLNO.set(row[0])
self.ID.set(row[1])
self.NAME.set(row[2])
self.EMAIL.set(row[3])
self.CONTACT.set(row[4])
self.DOB.set(row[5])
self.txt_address.insert(END, row[6])
self.GENDER.set(row[7])
def update_data(self):
con = sl.connect(host="localhost", user="root", password="sankar@95",
database="STUDENT")
cur= con.cursor()
try:
cur.execute("update stu set
ID=%s,NAME=%s,EMAIL=%s,num=%s,DOB=%s,ADDR=%s,GEN=%s where
SLNO=%s", (
self.ID.get(),self.N
AME.get(),str(self.EMAIL.get()),str(self.CONTACT.get()),str(self.DOB.get()),self
.txt_address.get(),self.GENDER.get(),self.SLNO.get()
))
con.commit()
except:
con.rollback()
self.fetch_data()
self.clear_data()
con.close()
messagebox.showinfo("SUCCESS","DATA UPDATE SUCCESSFULL")
def delete_data(self):
con = sl.connect(host="localhost", user="root", password="sankar@95",
database="STUDENT")
cur= con.cursor()
try:
cur.execute("delete from stu where id=%s",(int(self.ID.get()),))
con.commit()
except:
con.rollback()
con.close()
self.fetch_data()
self.clear_data()
def clear_data(self):
self.SLNO.set("")
self.ID.set("")
self.NAME.set("")
self.EMAIL.set("")
self.CONTACT.set("")
20 | P a g e
self.DOB.set("")
self.txt_address.delete(0,END)
self.comb_gender.current(0)
def search_data(self):
con = sl.connect(host="localhost", user="root", password="sankar@95",
database="STUDENT")
cur= con.cursor()
if self.SEARCH_BY.get()=='CONTACT':
z='num'
else:
z=self.SEARCH_BY.get()
cur.execute("select * from stu where "+ str(z) +" Like
'%"+str(self.SEARCH_TXT.get())+"%'")
rows=cur.fetchall()
if len(rows)!=0:
self.student_table.delete(*self.student_table.get_children())
for row in rows:
self.student_table.insert('',END, values=row)
con.commit()
con.close()
def exit(self):
self.root.destroy()
import DASHBOARD
root=Tk()
obj=STUDENT(root)
root.mainloop()
from tkinter import *
from tkinter import ttk,messagebox
from PIL import Image,ImageTk # FROM PILLOW LIBARIRY WE TAKE FOR
IMAGES
import mysql.connector as sl #FOR DATABASE
class TEACHER:
def __init__(self,root):
self.root=root
self.root.title("STUDENT") #WINDOW NAME
self.root.geometry("1920x700+0+0") #WINDOW SIZE
21 | P a g e
#FOR BACKGROUND IMAGE
self.bg=ImageTk.PhotoImage(file="IMG/TEACHER.jpg")
bg=Label(self.root,image=self.bg).place(x=0, y=0, relwidth=1, relheight=1)
#variable
self.SLNO=StringVar()
self.ID=StringVar()
self.NAME=StringVar()
self.EMAIL=StringVar()
self.QINFO=StringVar()
self.DEPT=StringVar()
self.SEARCH_BY=StringVar()
self.SEARCH_TXT=StringVar()
#TITLE
title=Label(self.root, text="STUDENT MANAGEMENT SYSTEM ---
TEACHER", font=("times new roman",40,"bold"), bg="orange").pack(side=TOP,
fill=X)
#FROM
From=Frame(self.root, bd=5, relief=RIDGE, bg="salmon").place(x=20,
y=100, width=425, height=580)
From_title=Label(From, text="TEACHER FROM: ", bg="salmon",
fg="green", font=("times new roman",20,"bold")).place(x=30, y=110)
slno=Label(From, text="SLNO NUMBER: ", bg="salmon", fg="black",
font=("times new roman",16,"bold")).place(x=25, y=155, width=200, height=20)
txt_slno=Entry(From,textvariable=self.SLNO, font=("times new
roman",15,"bold"), bd=5).place(x=220, y=150, width=200, height=30)
Id=Label(From, text="ID NUMBER: ", bg="salmon", fg="black",
font=("times new roman",16,"bold")).place(x=25, y=205, width=200, height=20)
txt_Id=Entry(From, font=("times new roman",15,"bold"),textvariable=self.ID,
bd=5).place(x=220, y=200, width=200, height=30)
name=Label(From, text="NAME: ", bg="salmon", fg="black", font=("times
new roman",16,"bold")).place(x=30, y=255, width=200, height=20)
txt_name=Entry(From, font=("times new roman",15,"bold"),
bd=5,textvariable=self.NAME).place(x=220, y=250, width=200, height=30)
email=Label(From, text="EMAIL: ", bg="salmon", fg="black", font=("times
new roman",16,"bold")).place(x=30, y=305, width=200, height=20)
txt_email=Entry(From, font=("times new roman",15,"bold"),
bd=5,textvariable=self.EMAIL).place(x=220, y=300, width=200, height=30)
qinfo=Label(From, text="QUALIFICATION: ", bg="salmon", fg="black",
font=("times new roman",16,"bold")).place(x=30, y=355, width=200, height=20)
txt_qinfo=Entry(From, font=("times new roman",15,"bold"), bd=5,
textvariable=self.QINFO).place(x=220, y=350, width=200, height=30)
dept=Label(From, text="DEPARTMENT: ", bg="salmon", fg="black",
font=("times new roman",16,"bold")).place(x=30, y=405, width=200, height=20)
22 | P a g e
txt_dept=Entry(From, font=("times new roman",15,"bold"), bd=5,
textvariable=self.DEPT).place(x=220, y=400, width=200, height=30)
#BUTTON
btn=Frame(From, bd=5, relief=RIDGE, bg="aqua").place(x=30, y=600,
width=470) #BAR
addbtn=Button(btn, text="Add", font=("times new roman",15,"bold"),
bg="green", fg="white",cursor="hand2", command=self.add_data).place(x=60,
y=620, width=85, height=32)
updatebtn=Button(btn, text="Update", font=("times new roman",15,"bold"),
bg="black", fg="white", cursor="hand2",
command=self.update_data).place(x=150, y=620, width=85, height=32)
deletebtn=Button(btn, text="Delete", font=("times new roman",15,"bold"),
bg="red", fg="white", cursor="hand2", command=self.delete_data).place(x=240,
y=620, width=85, height=32)
clearbtn=Button(btn, text="Clear", font=("times new roman",15,"bold"),
bg="black", fg="white", cursor="hand2", command=self.clear_data).place(x=330,
y=620, width=85, height=32)
#VIEW DETAILS
details=Frame(self.root, bd=5, relief=RIDGE, bg="coral").place(x=455,
y=100, width=980, height=580)
search=Label(details, text="SEARCH BY: ", font=("time new
roman",12,"bold"),bg="coral",fg="white",).place(x=475, y=115)
self.comb_search=ttk.Combobox(details, font=("times new
roman",12,"bold"), state='readonly',justify=CENTER,
textvariable=self.SEARCH_BY)
self.comb_search['values']=("ID","NAME")
self.comb_search.place(x=590, y=114, width=150, height=25)
self.comb_search.current(0)
txt_search=Entry(details, font=("times new roman",14,"bold"), bd=5,
textvariable=self.SEARCH_TXT).place(x=760, y=114, width=190, height=25)
searchbtn=Button(btn, text="SEARCH", font=("times new
roman",15,"bold"), bg="black", fg="white",cursor="hand2",
command=self.search_data).place(x=960, y=112, width=100, height=30)
showallbtn=Button(btn, text="SHOW ALL", font=("times new
roman",13,"bold"), bg="black", fg="white", cursor="hand2",
command=self.fetch_data).place(x=1070, y=112, width=100, height=30)
exitbtn=Button(btn, text="EXIT", font=("times new roman",15,"bold"),
bg="black", fg="white", cursor="hand2",
command=self.exit).place(x=1180,y=112, width=80, height=30)
23 | P a g e
#TABLE SECTION
table=Frame(details, bd=5, relief=RIDGE, bg="seagreen")
table.place(x=475, y=150, width=880, height=520)
#SCROOLBAR
scrollx=Scrollbar(table,orient=HORIZONTAL)
scrolly=Scrollbar(table,orient=VERTICAL)
self.teacher_table=ttk.Treeview(table,column=("SLNO", "ID", "NAME",
"EMAIL", "QINFO", "DEPT"),xscrollcommand=scrolly,yscrollcommand=scrollx)
scrollx.pack(side=BOTTOM, fill=X)
scrolly.pack(side=RIGHT, fill=Y)
scrollx.config(command=self.teacher_table.xview)
scrolly.config(command=self.teacher_table.yview)
self.teacher_table.heading("SLNO",text="SL NO")
self.teacher_table.heading("ID",text="ID")
self.teacher_table.heading("NAME",text="NAME")
self.teacher_table.heading("EMAIL",text="EMAIL")
self.teacher_table.heading("QINFO",text="QUIALITY INFO")
self.teacher_table.heading("DEPT",text="DEPERTMENT")
self.teacher_table['show']='headings'
self.teacher_table.column("SLNO", width=100)
self.teacher_table.column("ID", width=100)
self.teacher_table.column("NAME", width=100)
self.teacher_table.column("EMAIL", width=150)
self.teacher_table.column("QINFO", width=150)
self.teacher_table.column("DEPT", width=100)
self.teacher_table.pack(fill=BOTH, expand=1)
self.teacher_table.bind("<ButtonRelease-1>",self.get_cursor)
self.fetch_data()
def add_data(self):
if self.ID.get()=="" or self.NAME.get()=="":
messagebox.showerror("ERROR!!!","NAME AND ID MUST
REQUIRED")
else:
con = sl.connect(host="localhost", user="root", password="sankar@95",
database="TEACHER")
cur= con.cursor()
try:
cur.execute("insert into teacher values(%s,%s,%s,%s,%s,%s)",
(self.SLNO.get(),self.ID.get(),self.NAME.get(),str(self.EMAIL.get()),self.QINFO.
get(),self.DEPT.get()))
con.commit()
except:
24 | P a g e
con.rollback()
self.fetch_data()
self.clear_data()
con.close()
messagebox.showinfo("SUCCESS","DATA ADDED SUCCESSFULL")
def fetch_data(self):
con = sl.connect(host="localhost", user="root", password="sankar@95",
database="TEACHER")
cur= con.cursor()
cur.execute("select * from teacher order by id asc")
rows=cur.fetchall()
if len(rows)!=0:
self.teacher_table.delete(*self.teacher_table.get_children())
for row in rows:
self.teacher_table.insert('',END,values=row)
con.commit()
con.close()
def get_cursor(self,ev):
cursor_row = self.teacher_table.focus()
contents = self.teacher_table.item(cursor_row)
row = contents['values']
self.SLNO.set(row[0])
self.ID.set(row[1])
self.NAME.set(row[2])
self.EMAIL.set(row[3])
self.QINFO.set(row[4])
self.DEPT.set(row[5])
def update_data(self):
con = sl.connect(host="localhost", user="root", password="sankar@95",
database="TEACHER")
cur= con.cursor()
try:
cur.execute("update teacher set
ID=%s,NAME=%s,EMAIL=%s,QI=%s,DEPT=%s where SLNO=%s", (
self.ID.get(),
self.NAME.get(),
self.EMAIL.get(),
self.QINFO.get(),
self.DEPT.get(),
self.SLNO.get()
))
con.commit()
except:
con.rollback()
self.fetch_data()
self.clear_data()
con.close()
messagebox.showinfo("SUCCESS","DATA UPDATE SUCCESSFULL")
def delete_data(self):
25 | P a g e
con = sl.connect(host="localhost", user="root", password="sankar@95",
database="TEACHER")
cur= con.cursor()
try:
cur.execute("delete from teacher where ID=%s",(int(self.ID.get()),))
con.commit()
except:
con.rollback()
con.close()
self.fetch_data()
self.clear_data()
def clear_data(self):
self.SLNO.set("")
self.ID.set("")
self.NAME.set("")
self.EMAIL.set("")
self.QINFO.set("")
self.DEPT.set("")
def search_data(self):
con = sl.connect(host="localhost", user="root", password="sankar@95",
database="TEACHER")
cur= con.cursor()
cur.execute("select * from teacher where "+ str(self.SEARCH_BY.get()) +"
Like '%"+str(self.SEARCH_TXT.get())+"%'")
rows=cur.fetchall()
if len(rows)!=0:
self.teacher_table.delete(*self.teacher_table.get_children())
for row in rows:
self.teacher_table.insert('',END, values=row)
con.commit()
con.close()
def exit(self):
self.root.destroy()
import DASHBOARD
root=Tk()
obj=TEACHER(root)
root.mainloop()
#VIEW RESULT
from tkinter import *
from tkinter import ttk,messagebox
26 | P a g e
from PIL import Image,ImageTk # FROM PILLOW LIBARIRY WE TAKE FOR
IMAGES
import mysql.connector as sl #FOR DATABASE
from tkcalendar import * #FOR CALENDAR
class RESULT:
def __init__(self,root):
self.root=root
self.root.title("RESULT") #WINDOW NAME
self.root.geometry("2000x700+0+0") #WINDOW SIZE
#FOR BACKGROUND IMAGE
self.bg=ImageTk.PhotoImage(file="IMG/RESULT.jpg")
bg=Label(self.root,image=self.bg).place(x=0, y=0, relwidth=1, relheight=1)
#TITLE BAR
title=Label(self.root, text="SCHOOL MANAGEMENT SYSTEM ---
RESULT", font=("times new roman",40,"bold"), bg="orange").pack(side=TOP,
fill=X)
#VARIABLE
self.ID=StringVar()
self.NAME=StringVar()
self.COURSE=StringVar()
self.MARKS=StringVar()
self.FULLMARKS=StringVar()
select=Label(self.root, text="Select Student ID: ", font=("times new
roman",20,"bold"), bg="aqua", fg="black").place(x=50, y=100)
name=Label(self.root, text="NAME: ", font=("times new roman",20,"bold"),
bg="aqua", fg="black").place(x=50, y=160)
course=Label(self.root, text="COURSE: ", font=("times new
roman",20,"bold"), bg="aqua", fg="black").place(x=50, y=220)
marks=Label(self.root, text="MARKS: ", font=("times new
roman",20,"bold"), bg="aqua", fg="black").place(x=50, y=280)
fullmarks=Label(self.root, text="FULL MARKS: ", font=("times new
roman",20,"bold"), bg="aqua", fg="black").place(x=50, y=340)
txt_search=Entry(self.root, font=("times new roman",14,"bold"), bd=5,
textvariable=self.ID).place(x=320, y=100, width=200, height=25)
searchbtn=Button(self.root, text="SEARCH", font=("times new
roman",15,"bold"), bg="salmon", fg="white",cursor="hand2",
command=self.search_data).place(x=550, y=100, width=120, height=30)
name=Entry(self.root, textvariable=self.NAME, font=("times new
roman",15,"bold"),bg="lightgray", state='readonly').place(x=280, y=160,
width=400)
course=Entry(self.root, textvariable=self.COURSE, font=("times new
roman",15,"bold"),bg="lightgray").place(x=280, y=220, width=400)
marks=Entry(self.root, textvariable=self.MARKS, font=("times new
roman",15,"bold"),bg="lightgray").place(x=280, y=280, width=400)
fullmarks=Entry(self.root, textvariable=self.FULLMARKS, font=("times new
roman",15,"bold"),bg="lightgray").place(x=280, y=340, width=400)
27 | P a g e
#BUTTON
add=Button(self.root, text="SAVE", font=("times new roman",15,"bold"),
bg="salmon", fg="white",cursor="hand2", command=self.add_data).place(x=500,
y=420, width=120, height=30)
def fetch_ID(self):
con = sl.connect(host="localhost", user="root", password="sankar@95",
database="STUDENT")
cur= con.cursor()
cur.execute("select ID from student")
rows=cur.fetchall()
def search_data(self):
con = sl.connect(host="localhost", user="root", password="sankar@95",
database="STUDENT")
cur= con.cursor()
root=Tk()
obj=RESULT(root)
root.mainloop()
#VIEW RESULT
from tkinter import *
from tkinter import ttk,messagebox
from PIL import Image,ImageTk # FROM PILLOW LIBARIRY WE TAKE FOR
IMAGES
import mysql.connector as sl #FOR DATABASE
from tkcalendar import * #FOR CALENDAR
class VIEWRESULT:
def __init__(self,root):
29 | P a g e
self.root=root
self.root.title("VIEW RESULT") #WINDOW NAME
self.root.geometry("2000x700+0+0") #WINDOW SIZE
#FOR BACKGROUND IMAGE
self.bg=ImageTk.PhotoImage(file="IMG/VIEWRESULT.jpg")
bg=Label(self.root,image=self.bg).place(x=0, y=0, relwidth=1, relheight=1)
#TITLE BAR
title=Label(self.root, text="STUDENT MANAGEMENT SYSTEM --- VIEW
RESULT", font=("times new roman",40,"bold"), bg="orange").pack(side=TOP,
fill=X)
#VARIABLE
self.SEARCH_TXT=StringVar()
30 | P a g e
lbl_per=Label(self.root, text="PERSENTAGE", font=("times new
roman",15,"bold"), bg="white", fg="black", bd=3, relief=GROOVE).place(x=900,
y=230, width=150, height=50)
self.id=Label(self.root, font=("times new roman",15,"bold"), bg="white",
fg="black", bd=3, relief=GROOVE)
self.id.place(x=150, y=280, width=150, height=50)
self.name=Label(self.root, font=("times new roman",15,"bold"), bg="white",
fg="black", bd=3, relief=GROOVE)
self.name.place(x=300, y=280, width=150, height=50)
self.course=Label(self.root, font=("times new roman",15,"bold"), bg="white",
fg="black", bd=3, relief=GROOVE)
self.course.place(x=450, y=280, width=150, height=50)
self.marks=Label(self.root, font=("times new roman",15,"bold"), bg="white",
fg="black", bd=3, relief=GROOVE)
self.marks.place(x=600, y=280, width=150, height=50)
self.fullmarks=Label(self.root, font=("times new roman",15,"bold"),
bg="white", fg="black", bd=3, relief=GROOVE)
self.fullmarks.place(x=750, y=280, width=150, height=50)
self.per=Label(self.root, font=("times new roman",15,"bold"), bg="white",
fg="black", bd=3, relief=GROOVE)
self.per.place(x=900, y=280, width=150, height=50)
root=Tk()
obj=VIEWRESULT(root)
root.mainloop()
32 | P a g e
OUTPUT
(Screenshot)
33 | P a g e
34 | P a g e
35 | P a g e
36 | P a g e
IMAGE USED
37 | P a g e
38 | P a g e
BENEFITS:
Software provides easy management of student records.
Software has user friendly interface which is very easy to handle and
understand.
39 | P a g e
LIMITATIONS:
Software is limited to Desktop only.
40 | P a g e
FUTURE ENHANCEMENT:
This software may available for MacOS
Higher Security features can be included in this software.
Program scheduling can also be included in this software.
This software can be implemented with OS to reduce overhead of
installing and running interface of each and every tool at different
place.
Verification message to logging (incase user forgot their password)
Extracting student report in pdf, xml file format
41 | P a g e
CONCLUSION
The project titled “Student Management System” is developed using
Python Tkinter as frontend and MYSQL database in back end to
computerize the process of management of student details. This project
covers only basic needs of student management system.
42 | P a g e
BIBILIOGRAPHY
https://docs.python.org/3/library/smtplib.html
https://python-docx.readthedocs.io/en/latest/
https://www.youtube.com/c/Freecodecamp
43 | P a g e