Computer Project
Computer Project
ANAKKARA
(Affiliated to CBSE Delhi)
PROJECT WORK
IN
COMPUTER SCIENCE
SUBMITTED BY
NAME :
CLASS:
ROLLNO:
MONTFORT SCHOOL
ANAKKARA
(Affiliated to CBSE Delhi)
CERTIFICATE
This is to certify that the project work in Computer Science is a
bonafide record carried out by ………………………….......................
Montfort School, Anakkara in the partial fulfillment of study of class
XII CBSE scheme in ‘COMPUTER SCIENCE’.
Name : ……………………………….
Dated : ………………………………
ACKNOWLEDGEMENT
I sincerely express my gratitude on the occasion on the completion
of this project on “COMPUTER SCIENCE”. It was through the
immense grace of the LORD ALMIGHTY that made me complete
this task. So I submit everything before HIM.
I am grateful to Rev. Bro. Joseph Thomas – Principal , Rev. Bro.
Ignatius, Rev.Bro.MP John and the whole management of the
Montfort School, Anakkara for providing all kinds of facilities,
encouragement and all the help I required.
I would wish to express my sincere gratitude to Mrs.Rahana A. of
Montfort School who supervised my project by giving me necessary
suggestion and guidance.
I extend my sincere love and gratitude to all my teachers, staff and
students of Montfort School, Anakkara for their encouragement and
support they gave me throughout the course and especially in the
completion of my project work.
CONTENTS
INTRODUCTION
PROJECT OVERVIEW
SOURCE CODE
OUTPUT
CONCLUSION
BIBLIOGRAPHY
INTRODUCTION
The Project titled “ SCHOOL WEBSITE” designs a school website
which can be accessed by anyone and provides a brief history
along with a list of few of the facilities of the school.
Further the website has an application form for the new
students who are seeking admission to the school. The details of
the applicant submitted in the application form are stored in the
school database(MySQL).
Then for the students and teachers of the school there is a
separate feature called the “WE CARE PANEL” which they can
access using the username and the password provided by the
school. Using the Panel the students can search for the details
about their teachers via their name and vice versa. (It can also
display the imformation of the person who logges in.)
Both students and teachers can also submit any enquiry in the
panel.
The enquiry too would be stored in the school database
(MySQL).
Then there is the school stationary ehich provides a list of items
available in the stationary and also calculates the total cost of
the items as per the quantity.
There is another option in the website which can be accessed
only by the School Management and is used to either update or
delete the information of a student or a teacher.
PROJECT OVERVIEW
\
SELECT * FROM STUDENTS;
OUR FACILITIES:
SHOWS A LIST OF FACILITIES PROVIDED BY THE SCHOOL
NEW ADMISSIONS:
AN APPLICATION FORM TO REGISTER THE DETAILS
THE DETAILS REGARDING THE APPLICANT SUBMITTED IN THE
FORM ARE STORED IN THE SCHOOL DATABASE (MYSQL TABLE
‘APPLICANT)
STATIONARY:
CALCULATES THE PRICE OF THE STATIONARY ITEMS YOU SELECT
AS PER THE QUANTITY
SCHOOL MANAGEMENT:
A FEATURE WHICH CAN BE ACCESSED ONLY BY THE SCHOOL
MANAGEMENT AND IS USED TO UPDATE OR DELETE THE
INFORMATION OF A STUDENT OR A TEACHER.
SOURCE CODE
CODE - 1
import mysql.connector
mydb=mysql.connector.connect(host="localhost",user="root",passwd="MySQL",d
atabase="SCHOOL")
mycursor=mydb.cursor()
insert_query="""INSERT INTO
STUDENTS(ADMIN_NO,CLASS,R_NO,NAME,PARENT_NAME,GENDER,DATE_OF_BIR
TH,CONTACT,USERNAME,PASSWORD) VALUES(%s,%s,%s,%s,%s,%s,%s,%s,%s,
%s)"""
data=(ADMIN_NO,CLASS,R_NO,NAME,PARENT_NAME,GENDER,DATE_OF_BIRTH,C
ONTACT,USERNAME,PASSWORD)
mycursor.execute(insert_query,data)
mydb.commit()
mydb=mysql.connector.connect(host="localhost",user="root",passwd="MySQL",d
atabase="SCHOOL")
mycursor=mydb.cursor()
insert_query="""INSERT INTO
TEACHERS(NAME,GENDER,DATE_OF_BIRTH,SUBJECT,CONTACT,USERNAME,PASSW
ORD) VALUES(%s,%s,%s,%s,%s,%s,%s)"""
data=(NAME,GENDER,DATE_OF_BIRTH,SUBJECT,CONTACT,USERNAME,PASSWORD
)
mycursor.execute(insert_query,data)
mydb.commit()
insert("MR.JAGDISH MATHUR","MALE","12-12-
1985","MATHEMATICS","7876755678","JAGDISH1985","JM121285")
insert("MR.SANDEEP KM","MALE","29-06-
1992","SCIENCE","8978673345","SANDEEP1992","SK290692")
insert("MR.RAHUL ARYAN","MALE","16-03-
1989","BIOLOGY","7845236510","RAHUL1989","RA160389")
insert("MRS.MANVI SINGH","FEMALE","08-11-
1990","COMPUTER","8201654325","MANVI1990","MS081190")
insert("MR.JITHIN GEORGE","MALE","23-10-
1987","HISTORY","8291463598","MUKUL1987","JG231087")
insert("MRS.SANJANA WILSON","FEMALE","23-02-
1994","ACCOUNTANCY","7102893547","SANJANA1994","SW230294")
insert("MR.ROY THOMAS","MALE","11-11-
1990","ENGLISH","9426835801","ROY1990","RT111190")
insert("MRS.ISHITA AGGARWAL","FEMALE","18-12-
1988","ECONOMICS","8016753254","ISHITA1988","IA181288")
mydb=mysql.connector.connect(host="localhost",user="root",passwd="MySQL",d
atabase="SCHOOL")
mycursor=mydb.cursor()
insert_query="""INSERT INTO
SCHOOL_MANAGEMENT(NAME,GENDER,DATE_OF_BIRTH,DESIGNATION,USERNA
ME,PASSWORD) VALUES(%s,%s,%s,%s,%s,%s)"""
data=(NAME,GENDER,DATE_OF_BIRTH,DESIGNATION,USERNAME,PASSWORD)
mycursor.execute(insert_query,data)
mydb.commit()
insert("MR.GEO PAUL","MALE","13-01-
1974","PRINCIPAL","GEO1974","GP130174")
insert("MRS.KAREN ALBY","FEMALE","17-05-1980","VICE
PRINCIPAL","KAREN1980","KA170580")
insert("MR.RIJU C JOSE","MALE","19-11-
1980","HEADMASTER","RIJU1980","RJ191180")
mydb=mysql.connector.connect(host="localhost",user="root",passwd="MySQL",d
atabase="SCHOOL")
mycursor=mydb.cursor()
insert_query="""INSERT INTO STATIONARY(ITEM,PRICE) VALUES(%s,%s)"""
data=(ITEM,PRICE)
mycursor.execute(insert_query,data)
mydb.commit()
insert("CLASS-X ENGLISH READER",160)
insert("CLASS-X SCIENCE",400)
insert("CLASS-X MATHEMATICS",220)
insert("CLASS-X SOCIAL SCIENCE",500)
insert("CLASS-XI ENGLISH READER",120)
insert("CLASS-XI MATHEMATICS",290)
insert("CLASS-XI PHYSICS+CHEMISTRY",550)
insert("CLASS-XI BIOLOGY",250)
insert("CLASS-XI ACCOUNTACY+ECONOMICS",400)
insert("CLASS-XI BUSINESS STUDIES",250)
insert("CLASS-XI COMPUTER SCIENCE",500)
insert("CLASS-XII ENGLISH READER",300)
insert("CLASS-XII MATHEMATICS",320)
insert("CLASS-XII PHYSICS+CHEMISTRY",690)
insert("CLASS-XII BIOLOGY",340)
insert("CLASS-XII ACCOUNTACY+ECONOMICS",520)
insert("CLASS-XII BUSINESS STUDIES",370)
insert("CLASS-XII COMPUTER SCIENCE",600)
CODE – 2
from tkinter import *
import mysql.connector
from random import *
#THE FUNCTION IMPORTS DATA FROM THE SQL TABLE AND STORES IT IN A
DICTIONARY
def import_data():
L1=[]
global D1
D1={} #D1 STORES DATA FROM THE TABLE 'STUDENTS' WITH NAME OF
STUDENT AS THE KEYWORD
mydb=mysql.connector.connect(host="localhost",user="root",passwd="MySQL",d
atabase="SCHOOL")
mycursor=mydb.cursor()
mycursor.execute("SELECT * FROM STUDENTS")
myrecords=mycursor.fetchall()
for i in myrecords:
i2=list(i)
L1.append(i2)
l=len(L1)
for i in range(l):
D1[L1[i][3]]=L1[i][0],L1[i][1],L1[i][2],L1[i][4],L1[i][5],L1[i][6],L1[i][7],L1[i]
[8],L1[i][9]
L2=[]
global D2
D2={} #D2 STORES DATA FROM THE TABLE 'TEACHERS' WITH NAME OF
TEACHER AS THE KEYWORD
mydb=mysql.connector.connect(host="localhost",user="root",passwd="MySQL",d
atabase="SCHOOL")
mycursor=mydb.cursor()
mycursor.execute("SELECT * FROM TEACHERS")
myrecords=mycursor.fetchall()
for i in myrecords:
i2=list(i)
L2.append(i2)
l=len(L2)
for i in range(l):
D2[L2[i][0]]=L2[i][1],L2[i][2],L2[i][3],L2[i][4],L2[i][5],L2[i][6]
L3=[]
global D3
D3={} #D3 STORES DATA FROM THE TABLE 'SCHOOL_MANAGEMENT' WITH
THE NAMES AS KEYWORD
mydb=mysql.connector.connect(host="localhost",user="root",passwd="MySQL",d
atabase="SCHOOL")
mycursor=mydb.cursor()
mycursor.execute("SELECT * FROM SCHOOL_MANAGEMENT")
myrecords=mycursor.fetchall()
for i in myrecords:
i2=list(i)
L3.append(i2)
l=len(L3)
for i in range(l):
D3[L3[i][0]]=L3[i][1],L3[i][2],L3[i][3],L3[i][4],L3[i][5]
L4=[]
global D4
D4={} #D4 STORES THE DATA FROM TABLE STATIONARY WITH THE ITEM
NAME AS THE KEYWORD
mydb=mysql.connector.connect(host="localhost",user="root",passwd="MySQL",d
atabase="SCHOOL")
mycursor=mydb.cursor()
mycursor.execute("SELECT * FROM STATIONARY")
myrecords=mycursor.fetchall()
for i in myrecords:
i2=list(i)
L4.append(i2)
l=len(L4)
for i in range(l):
D4[L4[i][0]]=L4[i][1]
import_data()
back=Button(window1,text="BACK",width=7,command=window1.destroy,font=("C
alibri",16,"bold"),fg="white",bg="grey")
back.place(x=383,y=645)
back=Button(window2,text="BACK",command=window2.destroy,width=7,font=("C
alibri",16,"bold"),fg="white",bg="grey")
back.place(x=383,y=645)
back=Button(submit,text="BACK",command=submit.destroy,width=8,font=("Calibr
i",14,"bold"),fg="white",bg="grey")
back.place(x=205,y=70)
def admission(): #TO CREATE THE APPLICATION FORM
def apply(): #FOR ENTERING THE APPLICATION FORM DETAILSS TO THE
MYSQL TABLE 'APPLICANTS'
r1=e1.get()
r2=e2.get()
r3=e3.get()
r4=e4.get()
r5=i.get()
r6=tklist.get()
r7=j.get()
r8=e5.get()
mydb=mysql.connector.connect(host="localhost",user="root",passwd="MySQL",d
atabase="SCHOOL")
mycursor=mydb.cursor()
insert="INSERT INTO APPLICANTS VALUES(%s,%s,%s,%s,%s,%s,%s,%s)"
data=(r1,r2,r3,r4,r5,r6,r7,r8)
try:
mycursor.execute(insert,data)
mydb.commit()
except:
mydb.rollback()
mydb.close()
window3=Tk()
window3.geometry("850x725")
window3.title("SCHOOL WEBSITE")
window3.configure(bg="dark slate grey")
l1=Label(window3,text="APPLICATION
FORM",font=("Algerian",36,"underline"),fg="white",bg="lightseagreen")
l1.place(x=205,y=20)
l2=Label(window3,text="NAME OF THE
PUPIL",width=22,font=("Calibri",20),fg="black",bg="lightsalmon")
l2.place(x=50,y=125)
l3=Label(window3,text="FATHER'S
NAME",width=22,font=("Calibri",20),fg="black",bg="lightsalmon")
l3.place(x=50,y=185)
l4=Label(window3,text="MOTHER'S
NAME",width=22,font=("Calibri",20),fg="black",bg="lightsalmon")
l4.place(x=50,y=245)
l5=Label(window3,text="DATE OF BIRTH (YYYY-MM-
DD)",width=26,font=("Calibri",17),fg="black",bg="lightsalmon")
l5.place(x=50,y=305)
l6=Label(window3,text="GENDER",width=22,font=("Calibri",20),fg="black",bg="lig
htsalmon")
l6.place(x=50,y=360)
l7=Label(window3,text="SELECT THE
STREAM",width=22,font=("Calibri",20),fg="black",bg="lightsalmon")
l7.place(x=50,y=420)
l8=Label(window3,text="SEEKING ADMISSION TO THE
HOSTEL",width=31,font=("Calibri",14),fg="black",bg="lightsalmon")
l8.place(x=50,y=480)
l9=Label(window3,text="PHONE
NUMBER",width=24,font=("Calibri",19),fg="black",bg="lightsalmon")
l9.place(x=50,y=535)
e1=Entry(window3,width=25,font=("Calibri",20),fg="black",bg="lightcyan2")
e1.place(x=440,y=125)
e2=Entry(window3,width=25,font=("Calibri",20),fg="black",bg="lightcyan2")
e2.place(x=440,y=185)
e3=Entry(window3,width=25,font=("Calibri",20),fg="black",bg="lightcyan2")
e3.place(x=440,y=245)
e4=Entry(window3,width=29,font=("Calibri",17),fg="black",bg="lightcyan2")
e4.place(x=440,y=305)
i=StringVar(window3,"MALE")
rad1=Radiobutton(window3,text="FEMALE",width=10,font=("Calibri",17),variable=
i,value="FEMALE",bg="lightcyan2")
rad1.place(x=639,y=360)
rad2=Radiobutton(window3,text="MALE",width=10,font=("Calibri",17),variable=i,v
alue="MALE",bg="lightcyan2")
rad2.place(x=439,y=360)
streams=["SCIENCE (BIO-MATHS)","SCIENCE (BIO-COMP)","COMMERCE WITH
MATHS","COMMERCE WITH IP","HUMANITIES"]
tklist=StringVar()
tklist.set("STREAMS")
menu=OptionMenu(window3,tklist,*streams)
menu.configure(width=51,bg="lightcyan2")
menu.place(x=438,y=420)
j=StringVar(window3,"REQUIRED")
rad3=Radiobutton(window3,text="NO",width=16,font=("Calibri",12),variable=j,val
ue="NOT REQUIRED",bg="lightcyan2")
rad3.place(x=636,y=480)
rad4=Radiobutton(window3,text="YES",width=16,font=("Calibri",12),variable=j,val
ue="REQUIRED",bg="lightcyan2")
rad4.place(x=438,y=480)
e5=Entry(window3,width=25,font=("Calibri",20),fg="black",bg="lightcyan2")
e5.place(x=439,y=535)
b1=Button(window3,text="SUBMIT",command=lambda:
[apply(),window3.destroy(),submit("APPLICATION
SUBMITTED",15,20)],font=("Calibri",16,"bold"),fg="white",bg="grey")
b1.place(x=360,y=600)
back=Button(window3,text="BACK",command=window3.destroy,width=7,font=("C
alibri",16,"bold"),fg="white",bg="grey")
back.place(x=360,y=660)
#"LOGIN PAGES"
def common(win): #THE COMMON DETAILS TO BE VIEWED IN BOTH
STUDENTS AND TEACHERS PANEL
import_data()
f1=Frame(win,width=260,height=540,bg="slategray3")
f1.place(x=575,y=93)
l1=Label(f1,text="CLASS
LISTS",width=12,font=("Calibri",28),fg="white",bg="coral3")
l1.place(x=13,y=85)
C1=["8A","9A","10A","11A","11B","11C"]
C2=["8B","9B","10B","12A","12B","12C"]
n=0
for i in C1:
C=[]
C.append(i)
for j in D1:
if D1[j][1]==i:
A=[D1[j][2],j]
C.append(A)
tklist=StringVar()
tklist.set(i)
menu=OptionMenu(f1,tklist,*C)
menu.configure(width=4,font=("Calibri",24),fg="black",bg="lightgrey")
menu.place(x=12,y=150+int(n))
n=n+65
n=0
for i in C2:
C=[]
C.append(i)
for j in D1:
if D1[j][1]==i:
A=[D1[j][2],j]
C.append(A)
tklist=StringVar()
tklist.set(i)
menu=OptionMenu(f1,tklist,*C)
menu.configure(width=4,font=("Calibri",24),fg="black",bg="lightgrey")
menu.place(x=139,y=150+int(n))
n=n+65
C=[]
title="TEACHERS LIST->"
C.append(title)
for i in D2:
C.append(i)
tklist=StringVar()
tklist.set("TEACHERS LIST")
menu=OptionMenu(f1,tklist,*C)
menu.configure(width=12,font=("Calibri",24),fg="white",bg="coral3") #A
MENU BUTTON SHOWING THE NAMES OF ALL THE TEACHERS
menu.place(x=12,y=10)
mydb=mysql.connector.connect(host="localhost",user="root",passwd="MySQL",d
atabase="SCHOOL")
mycursor=mydb.cursor()
insert="INSERT INTO ENQUIRIES VALUES(%s,%s)"
data=(v1,v2)
mycursor.execute(insert,data)
mydb.commit()
mydb.close()
f5=Frame(win,width=550,height=95,bg="lightblue3")
f5.place(x=10,y=530)
l5=Label(f5,text="ENQUIRIES",width=14,font=("Calribi",17),fg="black",bg="lightblu
e3")
l5.place(x=10,y=5)
en=Entry(f5,width=28,font=("Calibri",17),fg="black",bg="grey")
en.place(x=205,y=5)
b=Button(f5,text="SUBMIT",command=lambda:[enquiry(),submit("ENQUIRY
SUBMITTED",18,20)],width=7,font=("Calibri",13,"bold"),fg="white",bg="black")
b.place(x=465,y=45)
I2=[]
n=42
for i in D1:
if i==S:
global name
name=i
A=[D1[i][0],D1[i][3],D1[i][4],D1[i][1],D1[i][5],D1[i][6],D1[i][7]]
I2.append(A)
for i in I2:
for j in range(6):
l3=Label(f,text=i[j],width=28,font=("Calibri",16),fg="black",bg="purple1")
l3.place(x=230,y=10+int(n))
n=n+36
l3=Label(f,text=name,width=35,font=("Calibri",22),fg="black",bg="navajowhite3")
l3.place(x=10,y=5)
window7=Toplevel()
window7.geometry("850x700")
window7.title("TEACHER PANEL")
window7.configure(bg="brown4")
l1=Label(window7,text="TEACHER'S
PANEL",font=("Algerian",36,"underline"),fg="white",bg="steelblue")
l1.place(x=205,y=20)
common(window7)
f3=Frame(window7,width=550,height=240,bg="ivory3")
f3.place(x=10,y=195)
I=["GENDER","DATE OF BIRTH","SUBJECT","CONTACT"]
n=42
for i in I:
l2=Label(f3,text=i,width=14,font=("Calribi",18),fg="black",bg="limegreen")
l2.place(x=8,y=25+int(n))
n=n+42
I2=[]
n=42
for i in D2:
if D2[i][4]==U1:
global name
name=i
A=[D2[i][0],D2[i][1],D2[i][2],D2[i][3],D2[i][4]]
I2.append(A)
for i in I2:
for j in range(4):
l3=Label(f3,text=i[j],width=24,font=("Calibri",19),fg="black",bg="mediumpurple4")
l3.place(x=220,y=25+int(n))
n=n+42
l3=Label(f3,text=name,width=29,font=("Calibri",26),fg="white",bg="blue")
l3.place(x=10,y=10)
f4=Frame(window7,width=550,height=45,bg="white")
f4.place(x=10,y=460)
l4=Label(f4,text="STUDENT
NAME",width=15,font=("Calibri",17),fg="black",bg="sienna2")
l4.place(x=10,y=5)
T1=[]
for i in D1:
T1.append(i)
tklist1=StringVar()
tklist1.set("STUDENTS")
T1.sort()
menu=OptionMenu(f4,tklist1,*T1)
menu.configure(width=24,font=("Calibri",13),fg="black",bg="sienna3")
menu.place(x=205,y=3)
b=Button(f4,text="SEARCH",command=student_search,width=7,font=("Calibri",14,
"bold"),fg="black",bg="grey")
b.place(x=460,y=3)
back=Button(window7,text="BACK",width=7,command=window7.destroy,font=("C
alibri",16,"bold"),fg="white",bg="grey")
back.place(x=383,y=645)
I=["SUBJECT","DATE OF BIRTH","CONTACT"]
n=42
for i in I:
l2=Label(f4,text=i,width=14,font=("Calribi",18),fg="black",bg="mediumpurple2")
l2.place(x=10,y=19+int(n))
n=n+42
I2=[]
n=42
for i in D2:
if i==S:
global name
name=i
A=[D2[i][2],D2[i][1],D2[i][3]]
I2.append(A)
for i in I2:
for j in range(3):
l3=Label(f4,text=i[j],width=24,font=("Calibri",18),fg="black",bg="plum3")
l3.place(x=230,y=19+int(n))
n=n+42
l3=Label(f4,text=name,width=34,font=("Calibri",22),fg="white",bg="sienna2")
l3.place(x=10,y=9)
window6=Toplevel()
window6.geometry("850x700")
window6.title("STUDENT PANEL")
window6.configure(bg="dodgerblue3")
l1=Label(window6,text="STUDENT'S
PANEL",font=("Algerian",36,"underline"),fg="white",bg="black")
l1.place(x=205,y=20)
common(window6)
student_details(window6,10,185,name)
f4=Frame(window6,width=550,height=45,bg="white")
f4.place(x=10,y=470)
l4=Label(f4,text="TEACHER
NAME",width=15,font=("Calibri",17),fg="white",bg="blue")
l4.place(x=10,y=5)
T2=[]
for i in D2:
T2.append(i)
T2.sort()
tklist2=StringVar()
tklist2.set("TEACHERS")
menu=OptionMenu(f4,tklist2,*T2)
menu.configure(width=24,font=("Calibri",13),fg="white",bg="blue")
menu.place(x=205,y=3)
b=Button(f4,text="SEARCH",command=teach_search,width=7,font=("Calibri",14,"b
old"),fg="black",bg="grey")
b.place(x=460,y=3)
elif val=="TEACH":
n=[]
for i in D2:
n.append(i)
l=[]
for i in D2:
l.append(D2[i][4])
m=[]
for i in D2:
m.append(D2[i][5])
if U1 not in l:
l3=Label(window5,text="(INVALID USERNAME OR
PASSWORD)",width=32,font=("Calibri",12,"bold"),fg="red",bg="white")
l3.place(x=163,y=195)
else:
i=l.index(U1)
if P1!=m[i]:
l3=Label(window5,text="(INVALID USERNAME OR
PASSWORD)",width=30,font=("Calibri",10,"bold"),fg="red",bg="white")
l3.place(x=186,y=195)
else:
check=1
window5.destroy()
if check==0:
Spanel()
elif check==1:
Tpanel()
window5=Tk()
window5.geometry("600x350")
window5.title("LOGIN")
window5.configure(bg="black")
l=Label(window5,text="WE-CARE
LOGIN",font=("Algerian",32,"underline"),fg="white",bg="black")
l.place(x=140,y=15)
l1=Label(window5,text="USERNAME",width=16,font=("Calibri",20),fg="black",bg="
white")
l1.place(x=50,y=90)
l2=Label(window5,text="PASSWORD",width=16,font=("Calibri",20),fg="black",bg="
white")
l2.place(x=50,y=145)
e1=Entry(window5,width=16,font=("Calibri",22),fg="black",bg="white")
e1.place(x=308,y=90)
e2=Entry(window5,show="*",width=16,font=("Calibri",22),fg="black",bg="white")
e2.place(x=308,y=145)
p=StringVar(window5,"STUD")
rad3=Radiobutton(window5,text="STUDENT
LOGIN",width=15,font=("Calibri",12),variable=p,value="STUD",bg="white")
rad3.place(x=390,y=250)
rad4=Radiobutton(window5,text="TEACHER'S
LOGIN",width=15,font=("Calibri",12),variable=p,value="TEACH",bg="white")
rad4.place(x=390,y=290)
b2=Button(window5,text="SIGN
UP",command=sign_up,width=6,font=("Calibri",14,"bold"),fg="white",bg="grey")
b2.place(x=259,y=235)
back=Button(window5,text="BACK",command=window5.destroy,width=6,font=("C
alibri",14,"bold"),fg="white",bg="grey")
back.place(x=259,y=285)
mydb=mysql.connector.connect(host="localhost",user="root",passwd="MySQL",d
atabase="SCHOOL")
mycursor=mydb.cursor()
if a=="TEACHER":
if f=="NAME":
mycursor.execute("UPDATE TEACHERS SET NAME ='"+newi+"' WHERE
NAME ='"+n+"'")
elif f=="DATE_OF_BIRTH":
mycursor.execute("UPDATE TEACHERS SET DATE_OF_BIRTH ='"+newi+"'
WHERE NAME ='"+n+"'")
elif f=="SUBJECT":
mycursor.execute("UPDATE TEACHERS SET SUBJECT ='"+newi+"' WHERE
NAME ='"+n+"'")
elif f=="CONTACT":
mycursor.execute("UPDATE TEACHERS SET CONTACT ='"+newi+"' WHERE
NAME ='"+n+"'")
if a=="STUDENT":
if f=="CLASS":
mycursor.execute("UPDATE STUDENTS SET CLASS ='"+newi+"' WHERE
NAME ='"+n+"'")
elif f=="R_NO":
mycursor.execute("UPDATE STUDENTS SET R_NO ='"+newi+"' WHERE
NAME ='"+n+"'")
elif f=="NAME":
mycursor.execute("UPDATE STUDENTS SET NAME ='"+newi+"' WHERE
NAME ='"+n+"'")
elif f=="PARENT_NAME":
mycursor.execute("UPDATE STUDENTS SET PARENT_NAME ='"+newi+"'
WHERE NAME ='"+n+"'")
elif f=="DATE_OF_BIRTH":
mycursor.execute("UPDATE STUDENTS SET DATE_OF_BIRTH ='"+newi+"'
WHERE NAME ='"+n+"'")
elif f=="CONTACT":
mycursor.execute("UPDATE STUDENTS SET CONTACT ='"+newi+"' WHERE
NAME ='"+n+"'")
mydb.commit()
window11=Toplevel()
window11.geometry("750x350")
window11.title("UPDATE")
window11.configure(bg="black")
l=Label(window11,text="UPDATE "+a+"
INFO",font=("Algerian",28,"underline"),fg="white",bg="black")
l.place(x=175,y=15)
I=["SELECT THE NAME","SELECT FIELD TO BE UPDATED","ENTER THE NEW
RECORD"]
n=60
for i in I:
l2=Label(window11,text=i,width=30,font=("Calribi",18),fg="black",bg="white")
l2.place(x=25,y=25+int(n))
n=n+55
if a=="TEACHER":
T1=[]
for i in D2:
T1.append(i)
T1.sort()
nam=StringVar()
nam.set("TEACHERS")
menu=OptionMenu(window11,nam,*T1)
menu.configure(width=22,font=("Calibri",13),fg="black",bg="white")
menu.place(x=480,y=82)
T2=["NAME","DATE_OF_BIRTH","SUBJECT","CONTACT"]
field=StringVar()
field.set("FIELDS")
menu=OptionMenu(window11,field,*T2)
menu.configure(width=22,font=("Calibri",13),fg="black",bg="white")
menu.place(x=480,y=140)
if a=="STUDENT":
T1=[]
for i in D1:
T1.append(i)
T1.sort()
nam=StringVar()
nam.set("STUDENTS")
menu=OptionMenu(window11,nam,*T1)
menu.configure(width=22,font=("Calibri",13),fg="black",bg="white")
menu.place(x=480,y=82)
T2=["CLASS","R_NO","NAME","PARENT_NAME","DATE_OF_BIRTH","CONTACT"]
field=StringVar()
field.set("FIELDS")
menu=OptionMenu(window11,field,*T2)
menu.configure(width=22,font=("Calibri",13),fg="black",bg="white")
menu.place(x=480,y=140)
new=Entry(window11,text=i,width=16,font=("Calribi",20),fg="black",bg="white")
new.place(x=480,y=195)
b1=Button(window11,text="UPDATE",command=lambda:
[update_sql(),window11.destroy(),submit("DETAILS UPDATED
SUCCESSFULLY",5,15)],width=22,font=("Calibri",16,"bold"),fg="white",bg="grey")
b1.place(x=475,y=255)
def delete(a): #PAGE FOR DELETING DETAILS OF STUDENT OR TEACHER
import_data()
def delete_sql(): #DELETING DETAILS OF STUDENT OR TEACHER FROM THE
SQL TABLE
n=nam.get()
mydb=mysql.connector.connect(host="localhost",user="root",passwd="MySQL",d
atabase="SCHOOL")
mycursor=mydb.cursor()
if a=="TEACHER":
mycursor.execute("DELETE FROM TEACHERS WHERE NAME ='"+n+"'")
elif a=="STUDENT":
mycursor.execute("DELETE FROM STUDENTS WHERE NAME ='"+n+"'")
mydb.commit()
window11=Toplevel()
window11.geometry("850x200")
window11.title("DELETE")
window11.configure(bg="black")
l=Label(window11,text="DELETE "+a+"
INFO",font=("Algerian",28,"underline"),fg="white",bg="black")
l.place(x=175,y=15)
l2=Label(window11,text="NAME OF "+a+" WHOSE INFO IS TO BE
DELETE",width=50,font=("Calribi",14),fg="black",bg="white")
l2.place(x=25,y=85)
T=[]
if a=="TEACHER":
for i in D2:
T.append(i)
nam=StringVar()
nam.set("TEACHERS")
elif a=="STUDENT":
for i in D1:
T.append(i)
nam=StringVar()
nam.set("STUDENTS")
T.sort()
menu=OptionMenu(window11,nam,*T)
menu.configure(width=18,font=("Calibri",13),fg="black",bg="white")
menu.place(x=600,y=80)
b1=Button(window11,text="DELETE",command=lambda:
[delete_sql(),window11.destroy(),submit("DETAILS DELETED
SUCCESSFULLY",5,15)],width=22,font=("Calibri",13,"bold"),fg="white",bg="grey")
b1.place(x=600,y=140)
def SMpanel(): #THE PANEL ONLY FOR THE SCHOOL MANAGEMENT STAFFS
(PRINCIPAL--VICE PRINCIPAL--HEADMASTER)
import_data()
window10=Toplevel()
window10.geometry("850x700")
window10.title("SCHOOL MANAGEMENT PANEL")
window10.configure(bg="darkorchid")
l1=Label(window10,text="SCHOOL MANAGEMENT
PANEL",font=("Algerian",34,"underline"),fg="white",bg="orchid4")
l1.place(x=100,y=20)
common(window10)
f1=Frame(window10,width=550,height=205,bg="peachpuff2")
f1.place(x=10,y=195)
I=["GENDER","DATE OF BIRTH","DESIGNATION"]
n=42
for i in I:
l2=Label(f1,text=i,width=14,font=("Calribi",18),fg="white",bg="black")
l2.place(x=8,y=30+int(n))
n=n+42
I2=[]
n=42
for i in D3:
if D3[i][3]==U1:
global name
name=i
A=[D3[i][0],D3[i][1],D3[i][2],D3[i][3]]
I2.append(A)
for i in I2:
for j in range(3):
l3=Label(f1,text=i[j],width=24,font=("Calibri",19),fg="white",bg="black")
l3.place(x=220,y=30+int(n))
n=n+42
l3=Label(f1,text=name,width=29,font=("Calibri",26),fg="white",bg="black")
l3.place(x=10,y=10)
f2=Frame(window10,width=550,height=220,bg="green2")
f2.place(x=10,y=410)
I1=["STUDENT RECORD -->","TEACHER RECORD -->"]
n=10
for i in I1:
l2=Label(f2,text=i,width=24,font=("Calribi",18),fg="white",bg="black")
l2.place(x=8,y=2+int(n))
n=n+100
b1=Button(f2,text="UPDATE S",width=12,command=lambda:
[update("STUDENT")],font=("Calribi",14),fg="white",bg="black")
b1.place(x=375,y=10)
b2=Button(f2,text="DELETE S",width=12,command=lambda:
[delete("STUDENT")],font=("Calribi",14),fg="white",bg="black")
b2.place(x=375,y=60)
b3=Button(f2,text="UPDATE T",width=12,command=lambda:
[update("TEACHER")],font=("Calribi",14),fg="white",bg="black")
b3.place(x=375,y=110)
b4=Button(f2,text="DELETE T",width=12,command=lambda:
[delete("TEACHER")],font=("Calribi",14),fg="white",bg="black")
b4.place(x=375,y=160)
l1=Label(window9,text="USERNAME",width=16,font=("Calibri",20),fg="black",bg="
white")
l1.place(x=50,y=90)
l2=Label(window9,text="PASSWORD",width=16,font=("Calibri",20),fg="black",bg="
white")
l2.place(x=50,y=145)
e1=Entry(window9,width=16,font=("Calibri",22),fg="black",bg="white")
e1.place(x=308,y=90)
e2=Entry(window9,show="*",width=16,font=("Calibri",22),fg="black",bg="white")
e2.place(x=308,y=145)
b2=Button(window9,text="SIGN
UP",command=sign_up2,width=6,font=("Calibri",14,"bold"),fg="white",bg="grey")
b2.place(x=259,y=235)
back=Button(window9,text="BACK",command=window9.destroy,width=6,font=("C
alibri",14,"bold"),fg="white",bg="grey")
back.place(x=259,y=285)
else:
bill=0
window14=Tk()
window14.geometry("500x120")
window14.title("BILL")
window14.configure(bg="black")
lb1=Label(window14,text="THE TOTAL BILL IS
Rs."+str(bill),width=30,font=("Microsoft Yahei",20,),fg="white",bg="black")
lb1.place(x=20,y=20)
back=Button(window14,text="BACK",command=window14.destroy,width=8,font=
("Calibri",14,"bold"),fg="white",bg="grey")
back.place(x=205,y=65)
window13=Toplevel()
window13.geometry("850x500")
window13.title("SCHOOL STATIONARY")
window13.configure(bg="slateblue4")
fram=Frame(window13,width=800,height=375,bg="lavender")
fram.place(x=20,y=100)
l1=Label(window13,text="SCHOOL
STATIONARY",font=("Algerian",36,),fg="white",bg="black")
l1.place(x=170,y=20)
n=50
for i in range(0,3):
l1=Label(fram,text="SELECT THE ITEM
NAME",width=24,font=("Calibri",20,),fg="white",bg="black")
l1.place(x=10,y=25+n)
n=n+65
ITEM=[]
for i in D4:
ITEM.append(i)
ITEM.sort()
item1=StringVar()
item1.set("ITEMS")
menu=OptionMenu(fram,item1,*ITEM)
menu.configure(width=30,font=("Calibri",15,"bold"),fg="white",bg="black")
menu.place(x=370,y=75)
ITEM=[]
for i in D4:
ITEM.append(i)
ITEM.sort()
item2=StringVar()
item2.set("ITEMS")
menu=OptionMenu(fram,item2,*ITEM)
menu.configure(width=30,font=("Calibri",15,"bold"),fg="white",bg="black")
menu.place(x=370,y=140)
ITEM=[]
for i in D4:
ITEM.append(i)
ITEM.sort()
item3=StringVar()
item3.set("ITEMS")
menu=OptionMenu(fram,item3,*ITEM)
menu.configure(width=30,font=("Calibri",15,"bold"),fg="white",bg="black")
menu.place(x=370,y=205)
e1=Entry(fram,width=3,font=("Calibri",20,"bold"),fg="white",bg="black")
e1.place(x=735,y=77)
q1=""
e2=Entry(fram,width=3,font=("Calibri",20,"bold"),fg="white",bg="black")
e2.place(x=735,y=142)
q2=""
e3=Entry(fram,width=3,font=("Calibri",20,"bold"),fg="white",bg="black")
e3.place(x=735,y=207)
q3=""
b1=Button(fram,text="ITEMS
AVAILABLE",width=33,font=("Calibri",15,"bold"),fg="white",bg="grey")
b1.place(x=372,y=18)
b2=Button(fram,text="QTY",width=4,font=("Calibri",15,"bold"),fg="white",bg="gre
y")
b2.place(x=733,y=18)
bill=Button(fram,text="BILL",width=12,height=3,command=calculate,font=("Calibri
",16,"bold"),fg="white",bg="grey")
bill.place(x=372,y=260)
b5=Button(window,text="STATIONARY",command=stationary,width=20,font=("Ti
mes New Roman",24,"bold"),fg="thistle1",bg="red")
b5.place(x=20,y=470)
b6=Button(window,text="SCHOOL
MANAGEMENT",command=school_management,width=21,font=("Times New
Roman",24,"bold"),fg="black",bg="red3")
b6.place(x=430,y=645)
l2=Label(window,text="CONTACT-
XXXXXXXXXX",font=("Calibri",18,"bold"),fg="ghost white",bg="cornflower Blue")
l2.place(x=500,y=570)
l3=Label(window,text="MAIL-
[email protected]",font=("Calibri",18,"bold"),fg="ghost white",bg="cornflower
Blue")
l3.place(x=500,y=600)
home()
CONCLUSION
Working on this project has helped me and my team to get a taste
of the practical applications of the things that we learn at school.
This has helped me understand the concepts very well. Besides
learning about the subject. We were also able to work as a team
and cultivated essential values like teamwork and patience.
I hope the things that I learned while doing this project will help
me in the future when I’m presented with difficult situations. I
have done this project in the best possible way I could and I hope
it serves its purpose well.
THANK YOU.
BIBLIOGRAPHY
www.geeksforgeeks.org
www.msqltutorial.org
www.w3schools.com
www.tutorialspoint.com
stackoverflow.com
Computer Science with Python – Textbook Class 11
Computer Science with Python – Textbook Class 12