You are on page 1of 2

fee_details

import main_menu
import fee_details
#import report
import mysql.connector as co
def FEE_MENU():
while True: print("\t\t.
................................................................"
)
print("\t\t*********Welcome to School Management
System**************") print("\t\t......")
print("\n\t\t*******Fees
Details********") print("1:Fees Deposit
of a student") print("2:View the fees of a
student") print("3:Remove student")
print("4:Return")
print("\t\t---------------------------------")
choice=int(input("Enter your choice")) if
choice==1:
fee_details.feeDeposit()
elif choice==2:
fee_details.feeView()
elif choice==3:
fee_details.removeStu()
elif choice==4:
return
else:
print("Error: Invalid Choice try again........")
conti="Press any key to return to Main Menu" def
feeDeposit():
try:
mycon=co.connect(host="localhost", user="root", passwd="ankit",database="KVK")
cursor=mycon.cursor()
L=[]
roll=int(input("Enter the roll 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 fee (roll,feeDeposit,Month) values (%s,%s,%s)"
cursor.execute(sql,fee)
mycon.commit()
mycon.close()
print('Fees Paid !!!')
except:
print('error')
def feeView():
mycon=co.connect(host="localhost", user="root", passwd="ankit",database="KVK")
cursor=mycon.cursor()
print("Please enter the details to view the fee details :")
roll=int(input("Enter the roll number of the student whose fee is to be viewed : ")) sql="Select
Student.stroll, Student.stname, Student.stclass, sum(fee.feeDeposit), fee.month from Student INNER
JOIN fee ON Student.stroll=fee.roll and fee.roll = %s"
rl=(roll,)
cursor.execute(sql,rl)
res=cursor.fetchall()
for x in res:
print(x)
def removeStu():
mycon=co.connect(host="localhost", user="root", passwd="ankit",database="KVK")
cursor=mycon.cursor()
roll=int(input("Enter the roll number of the student to be deleted : "))
rl=(roll,)
sql="Delete from fee where roll=%s"
cursor.execute(sql,rl) mycon.commit()
print("Record Deleted")

You might also like