0% found this document useful (0 votes)
20 views22 pages

Document

The document contains code for a school management system with the following functionality: 1. A main menu allows the user to select between admission, student, and fee modules. 2. The admission module allows adding, viewing, searching, deleting, and updating admission records. 3. The student module allows adding, viewing, searching, deleting, and updating student records including subjects. 4. The fee module allows depositing fees, viewing fees of all students, and viewing fees of a particular student.

Uploaded by

vaccinedose656
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views22 pages

Document

The document contains code for a school management system with the following functionality: 1. A main menu allows the user to select between admission, student, and fee modules. 2. The admission module allows adding, viewing, searching, deleting, and updating admission records. 3. The student module allows adding, viewing, searching, deleting, and updating student records including subjects. 4. The fee module allows depositing fees, viewing fees of all students, and viewing fees of a particular student.

Uploaded by

vaccinedose656
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Main Menu.

py:

import main_menu

import admission

import student_data

import fee_details

while True:

print("\t\t........

print("\t\t.....********* SCHOOL MANAGEMENT

SYSTEM*******") print("\t\t..............

print("\n\t\t******* ****SUNBEAM SCHOOL

print("*1. Admission*")

print("*2. Student Data*") print("*3. Fee Details*")

print("*4. Exit*")

print("\t\t..............

print("\t\t-----

choice=int(input("Enter your choice: "))


--")

Page 13

if choice==1:

admission.adm_menu()

elif choice==2:

student_data.stu_menu()

elif choice==3:

fee_details.fee_menu()

elif choice==4:

break

else:

print("Error: Invalid Choice try again..") conti=input("press any key ti continue..")

Admission.py:

Import main_menu

Import admission
Import mysql.connector as co

Def adm_menu():

While True:

Print(“\t\t....

Print(“\t\t.....*********School Management

System***********”)

Print(“\t\t............. .”)

Print(“\n**Admission**\n”)

Print(“*1. Add New Admission Details*”)

Print(“*2. Show Admission Details*”)

Print(“*3. Search Admission record*”)

Print(“*4 . Deletion of Record”)

Print(“*5. Update Admission Details*”)

Print(“*6. Return*”)

Print(“\t\t-----

Choice=int(input(“Enter your choice: “))


If choice==1:

Admission.admin_details()

Elif choice==2:

Admission.show_admin_details()

Elif choice==3:

Admission.search_admin_details()

Elif choice==4:

Admission.delete_admin_details()

Elif choice==5:

Admission.edit_admin_details()

Elif choice==6:

Return

Else:

Print(“Error: Invalid Choice try again..”)

Conti=input(“press any key ti continue..”)


Def admin_details():

Try:

Mycon=co.connect(host=”localhost”, user=”root”, passwd=”root”, database=”MPS”)

Cursor=mycon.cursor()

Adno=input(“Enter Admission No.: “)

Rno=input(“Enter Role No.: “)

Sname=input(“Enter Student name No.: “)

Address=input(“Enter Address: “)

Phon=input(“Enter Mobile No.: “)

Clas=input(“Enter Class: “)

Query=”insert into Admission (adno,rno, sname, address,

Phon, clas) value(‘{}’, ‘{}’, ‘{}’, ‘{}’, ‘{}’, ‘{}’)”.format(adno,rno,

Sname, address,phon,clas) cursor.execute(query)

Mycon.commit()

Mycon.close()

Cursor.close()
Print(‘Record has been saved in admission table’)

Except: print(‘error’)

Def show_admin_details(): mycon=co.connect(host=”localhost”, user=”root”, passwd=”root”,


database=”MPS”) cursor=mycon.cursor() cursor.execute(“Select * from Admission”) data =
cursor.fetchall()

For row in data:

Print(row)

Def search_admin_details():

Mycon=co.connect(host=”localhost”, user=”root”, passwd=”root”, database=”MPS”)


cursor=mycon.cursor() adn=input(“Enter Admission Number: “) st=”select * from Admission where
adno=’%s’”%(adn) cursor.execute(st) data = cursor.fetchall() print(data)

Def delete_admin_details():

Mycon=co.connect(host=”localhost”, user=”root”, passwd=”root”, database=”MPS”)


cursor=mycon.cursor() adn=input(“Enter Admission Number: “) st=”delete from admission where
adno=’%s”%(adn) cursor.execute(st) mycon.commit()

Print(“Record has been deleted”)

Def edit_admin_details():

Mycon=co.connect(host=”localhost”, user=”root”,

Passwd=”root”, database=”MPS”)
Cursor=mycon.cursor()

Print(“1: Edit Name: “)

Print(“2: Edit Address: “)

Print(“3: Phone number: “)

Print(“4: Return: “)

Print(“\t\t---- -“)

Choice = int(input(“Enter your choise: “))

If choice == 1:

Admission.edit_name()

Elif choice == 2:

Admission.edit_address()

Elif choice == 3:

Admission.edit_phno()

Elif choice == 4:

Return

Else:
Print(“Error: Invalid Choise try again.....”)

Conti=”Press any key to return to “

Def edit_name():

Mycon =co.connect(host=”localhost”,user=”root”,

Passwd=”root”, database=”MPS”) cursor=mycon.cursor()

Ac=input(“Enter Admission no: “)

Nm=input(“Enter correct name: “)

St = “update Admission set sname=’%s’ where adno =

‘%s’””%(nm,ac)

Cursor.execute(st) mycon.commit() print(‘Data updated successfully’)

Def edit_address():

Mycon =co.connect(host=”localhost”,user=”root”, passwd=”root”, database=”MPS”)


cursor=mycon.cursor() ac=input(“Enter Admission no: “)

Nm=input(“Enter correct address: “)

St = “update Admission set address=’%s’ where adno =

‘%s’””%(nm,ac) cursor.execute(st) mycon.commit() print(‘Data updated successfully’)


Def edit_phno():

Mycon =co.connect(host=”localhost”,user=”root”, passwd=”root”, database=”MPS”)


cursor=mycon.cursor()

Ac=input(“Enter Admission no: “) nm=input(“Enter correct Phone: “)

‘%s”%(nm,ac)

St = “update Admission set phon=’%s’ where adno =

Cursor.execute(st) mycon.commit()

Print(‘Data updated successfully’)

Student_data.py:

Import main_menu import student_data

Import mysql.connector as co

Def stu_menu():

While True:

Print(“\t\t....

Print(“\t\t.....*********SCHOOL MANAGEMENT

SYSTEM***********”)
Print(“\t\t.

Print(“\n\t\t********** ***STUDENT

Print(“*1. Add Student Record*”)

Print(“*2. Show Student Records*”)

Print(“*3. Search Student record*”)

Print(“*4. Deletion of Record”)

Print(“*5. Update Student Record*”)

Print(“*6. Return*”)

Print(“\t\t----------

Choice=int(input(“Enter your choice: “)) if choice==1:

Student_data.add_record()

Elif choice==2:

Student_data.show_stu_details()

Elif choice==3:

Student_data.search_stu_details()
Elif choice==4:

Student_data.delete_stu_details()

Elif choice==5:

Student_data.edit_stu_details()

Elif choice==6:

Return

Else:

Print(“Error: Invalid Choice try again..”)

Conti=input(“press any key ti continue..”)

Def add_record():

Try:

Mycon=co.connect(host=”localhost”, user=”root”, passwd=”root”, database=”MPS”)

Cursor=mycon.cursor()

Session=input(“Enter Session: “)

Stname=input(“Enter Student Name: “)

Stclass=input(“Enter Class: “)
Stsec=input(“Enter Section: “)

Stroll=input(“Enter Roll No.: “)

Sub = []

For i in range(3):

Sb = input(f”Enter subject (i+1): “)

Sub.append(sb)

Query=”insert into Student() value(‘{}’, ‘{}’, ‘{}’, ‘{}’,{}}}’,

‘{}’)”.format(session, stname,stclass,stsec,stroll,sub[0],sub[1],

Sub[2])

Cursor.execute(query)

Mycon.commit()

Mycon.close() cursor.close()

Print(‘Record has been saved in admission table’)

Except: print(‘error’)

Def show_stu_details():
Mycon=co.connect(host=”localhost”, user=”root”, passwd=”root”, database=”MPS”) print(row)

Cursor=mycon.cursor() cursor.execute(“Select * from Student”)

Data = cursor.fetchall() for row in data:

Def search_stu_details():

Mycon=co.connect(host=”localhost”, user=”root”, passwd=”root”, database=”MPS”)


cursor=mycon.cursor() adn=input(“Enter Admission Number: “) st=”select * from Student where
stroll=’%s’”%(adn) cursor.execute(st) data = cursor.fetchall() print(data)

Def delete_stu_details():

Mycon=co.connect(host=”localhost”, user=”root”, passwd=”root”, database=”MPS”)


cursor=mycon.cursor() adn=input(“Enter Admission Number: “) st=”delete from Student where
stroll=’%s”%(adn) cursor.execute(st) mycon.commit()

Print(“Record has been deleted”)

Def edit_stu_details():

Mycon=co.connect(host=”localhost”, user=”root”,

Passwd=”root”, database=”MPS”) cursor=mycon.cursor()

Print(“*1: Edit Name* “)

Print(“*1: Edit First Subject* “)

Print(“*3: Edit Second Subject* “)


Print(“*4: Edit Third Subject* “)

Print(“*5: Return* “)

Print(“\t\t--------

Choice = int(input(“Enter your choise: “))

If choice == 1:

Student_data.edit_name()

Elif choice == 2:

Student_data.edit_sub1()

Elif choice == 3:

Student_data.edit_sub2()

Elif choice == 4:

Student_data.edit_sub3()

Elif choice == 5:

Return

Print(“Error: Invalid Choise try again.....”) conti=”Press any key to return to “

Else:
Def edit_name():

Mycon =co.connect(host=”localhost”,user=”root”, passwd=”root”, database=”MPS”)


cursor=mycon.cursor()

Ac=input(“Enter Roll no: “)

Nm=input(“Enter Correct name: “)

St = “update Student set stname=’%s’ where stroll = ‘%s’”%(nm,ac)

Cursor.execute(st) mycon.commit()

Print(‘Data updated successfully’)

Def edit_sub1():

Mycon =co.connect(host=”localhost”,user=”root”, passwd=”root”, database=”MPS”)

Cursor=mycon.cursor()

Ac=input(“Enter Roll no: “) nm=input(“Enter Correct Subject: “)

St = “update Student set sub1=’%s’ where stroll = ‘%s”%(nm,

Ac)

Cursor.execute(st)
Mycon.commit() print(‘Data updated successfully’)

Def edit_sub2():

Mycon =co.connect(host=”localhost”,user= “root”, passwd=”root”, database=”MPS”)

Cursor=mycon.cursor()

Ac=input(“Enter Roll no: “)

Nm=input(“Enter Correct Subject: “)

St = “update Student set sub2=’%s’ where stroll = ‘%s”%(nm,

Ac)

Cursor.execute(st)

Mycon.commit()

Print(‘Data updated successfully’)

Def edit_sub3():

Mycon =co.connect(host=”localhost”,user=”root”, passwd=”root”, database=”MPS”) ac=input(“Enter


Roll no: “) nm=input(“Enter Correct Subject: “) ac)

Cursor=mycon.cursor()

St = “update Student set sub3=’%s’ where stroll = ‘%s”%(nm,


Cursor.execute(st)

Mycon.commit()

Print(‘Data updated successfully’)

Fee_details.py:

Import main_menu

Import fee_details

Import mysql.connector

Def fee_menu():

While True:

Print(“\t\t....

Print(“\t\t.....*********SCHOOL MANAGEMENT

SYSTEM***********”)

Print(“\t\t......... .”)

Print(“\n **FEE DETAILS**\n”)

Print(“*1: Deposit Fee*”)


Print(“*2: View Fee of All Students*”)

Print(“*3: View Fee of a Particular Student*”)

Print(“*4: Return*”)

Try:

userInput = int(input(“Please Select An Above

Option: “))

Except ValueError:

Exit(“\nHy! That’s Not A Number”)

Else:

Page 25

Print(“\n”)

If (userinput==1):

Fee_details.feeDeposit()

Elif (userInput==2): fee_details.feeView()

Elif (userInput==3):
Fee_details.feeViewPart()

Elif (userInput==4): return

Print(“—“)

Def feeDeposit():

Mydb=mysql.connector.connect(host=”localhost”, user=”root”,passwd=”root”, database=”MPS”)

Mycursor=mydb.cursor()

L=[]

Roll=int(input(“Enter the Admission number: “))

L.append(roll)

Feedeposit=int(input(“Enter the Fee to be deposited: “))

L.append(feedeposit)

Month=input(“Enter month of fee: “)

L.append(month)

Fee=(L)

Sql=”insert into Fees (adno, FeeDeposit, Month) values (%s,

% s,%s)”
Mycursor.execute(sql,fee)

Mydb.commit()

Print (“Fee has been Deposited Succefully!!!”)

Def feeView():

Print (“*ALL FEE DETAILS*”)

Mydb=mysql.connector.connect(host=”localhost”, user=”root”,passwd=”root”, database=”MPS”)

Mycursor=mydb.cursor()

Sql=”Select Admission.adno, Admission.sname, Admission.clas, sum (Fees. FeeDeposit),


count(Fees.month) from Admission, Fees where Admission.adno=Fees.adno Group by adno”

Mycursor.execute(sql)

Res=mycursor.fetchall()

Month = [‘April’, ‘May’, ‘June’, ‘July’, ‘August’, ‘September’, ‘October’, ‘November’,’December’,


‘January’, ‘February’,’March’]

For x in res:

X = list(x)

A = x.pop()

x.append(month[a-1])
print(x,end = ‘ ‘)

print (f” Fee left from {month[a]}”)

print(‘\n’,’\n’)

def feeViewPart():

mydb=mysql.connector.connect(host=”localhost”, user=”root”,passwd=”root”, database=”MPS”)


mycursor=mydb.cursor() admno=int(input(“Enter the Admission number of the Student : “))

sql=”Select Admission.adno, Admission.sname, Admission.clas, sum(Fees. FeeDeposit),


count(Fees.month) from Admission INNER JOIN Fees ON Admission.adno=Fees. Adno and Fees.adno
= %s” adm=(admno,)

mycursor.execute(sql,adm) res=mycursor.fetchall()

month = [‘April’, ‘May’, ‘June’, ‘July’, ‘August’, ‘September’, ‘October’,’November’, ‘December’,


‘January’, ‘February’,’March’]

for x in res:

x = list(x)

a = x.pop()

x.append(month[a-1])

print(‘\n’,x,’\n’)

print (f”Fee left from {month[a]}”)


print('\n','\n')

You might also like