Cs Project
Cs Project
For Administrators:
- Efficient Student Management: Easily add, update, and view student records.
- Fee Tracking: Monitor unpaid fees across the school, by class, or section.
- Payment Management: Record and track fee payments, update balances, and
maintain accurate records.
- Reporting: Generate detailed reports on unpaid fees, fee payments, and other
financial data.
For Students:
- Personal Fee Management: View personal fee details, including total fees, fees
paid, and balance.
- Payment History: Access a history of past fee payments.
- Fee Payments: Pay fees online and receive immediate updates on their account.
Functionality of the School Fee
Management System
Administrator Functions:
1. Add Student: Administrators can input new student details, including name,
grade, section, and fees information.
2. View Student Records: Access comprehensive student records, filterable by
class or section.
3. Manage Unpaid Fees: View students with outstanding fees, generate reports
for different classes or sections.
4. Record Payments: Update fee payments, manage student balances, and track
payment history.
5. Generate Reports: Create detailed reports to monitor fee payments, unpaid
balances, and other financial aspects.
Student Functions:
1. View Personal Details: Check personal details, including fee structure, amount
paid, and balance.
2. View Fee Breakdown: Access a detailed breakdown of total fees, fees paid,and
remaining balance.
3. Review Payment History: View a log of past fee payments.
4. Pay Fees: Make payments online and update account balances instantly.
-- Create the database
USE school_fee_system;
name VARCHAR(50),
grade VARCHAR(10),
section VARCHAR(10),
balance DECIMAL(10, 2)
);
student_id INT,
def connect_to_db():
return mysql.connector.connect(
host="localhost",
user="root",
password="1234",
database="school_fee_system"
# Administrator Functions
def admin_view():
while True:
if choice == "1":
add_student()
view_all_students()
view_students_by_class()
view_unpaid_fees()
view_unpaid_fees_by_class()
view_unpaid_fees_by_class_and_section()
view_students_paid_fees()
break
else:
def add_student():
name = input("Enter student's name: ")
db = connect_to_db()
cursor = db.cursor()
cursor.execute(query, values)
db.commit()
db.close()
def view_all_students():
db = connect_to_db()
cursor = db.cursor()
students = cursor.fetchall()
print("-" * 67)
db.close()
def view_students_by_class():
db = connect_to_db()
cursor = db.cursor()
students = cursor.fetchall()
print("-" * 57)
def view_unpaid_fees():
db = connect_to_db()
cursor = db.cursor()
students = cursor.fetchall()
print("-" * 45)
db.close()
def view_unpaid_fees_by_class():
grade = input("Enter the class to view unpaid fees (e.g., 11): ")
db = connect_to_db()
cursor = db.cursor()
cursor.execute("SELECT * FROM students WHERE grade = %s AND balance > 0",
(grade,))
students = cursor.fetchall()
print("-" * 35)
db.close()
def view_unpaid_fees_by_class_and_section():
db = connect_to_db()
cursor = db.cursor()
students = cursor.fetchall()
print(f"\n--- Students with Unpaid Fees in Class {grade}, Section {section} ---")
print(f"{'ID':<5} {'Name':<20} {'Balance':<10}")
print("-" * 30)
db.close()
def view_students_paid_fees():
db = connect_to_db()
cursor = db.cursor()
students = cursor.fetchall()
print("-" * 67)
db.close()
# Student Functions
def student_view():
db = connect_to_db()
cursor = db.cursor()
cursor.execute(query, (student_id,))
student = cursor.fetchone()
if student:
while True:
print("6. Logout")
if choice == "1":
view_personal_details(student)
view_payment_history(student_id)
pay_fees(student_id)
update_personal_details(student_id)
break
else:
else:
db.close()
def view_personal_details(student):
print(f"{'ID:':<15} {student[0]}")
print(f"{'Name:':<15} {student[1]}")
print(f"{'Class:':<15} {student[2]}")
print(f"{'Section:':<15} {student[3]}")
print(f"{'Balance:':<15} {student[6]:.2f}")
print("------------------------")
def view_fee_breakdown(student):
print(f"{'Balance:':<15} {student[6]:.2f}")
print("------------------------")
def view_payment_history(student_id):
db = connect_to_db()
cursor = db.cursor()
payments = cursor.fetchall()
print("-" * 44)
db.close()
def pay_fees(student_id):
db = connect_to_db()
cursor = db.cursor()
result = cursor.fetchone()
if result:
total_fees = float(result[0])
fees_paid = float(result[1])
current_balance = float(result[2])
if new_balance < 0:
new_balance = 0.00
update_query = "UPDATE students SET fees_paid = %s, balance = %s WHERE
student_id = %s"
db.commit()
else:
db.close()
def update_personal_details(student_id):
phone = input("Enter new phone number (or press Enter to skip): ")
db = connect_to_db()
cursor = db.cursor()
update_query = "UPDATE students SET "
fields = []
values = []
if name:
fields.append("name = %s")
values.append(name)
if grade:
fields.append("grade = %s")
values.append(grade)
if section:
fields.append("section = %s")
values.append(section)
if email:
fields.append("email = %s")
values.append(email)
if phone:
fields.append("phone = %s")
values.append(phone)
if fields:
values.append(student_id)
cursor.execute(update_query, tuple(values))
db.commit()
else:
db.close()
# Main Execution
if __name__ == "__main__":
while True:
print("3. Exit")
if choice == "1":
if password == "admin123":
admin_view()
else:
print("Incorrect password.")
elif choice == "2":
student_view()
break
else:
OUTPUT IMAGES
ADMINISTRATOR WINDOW
STUDENT VIEW OUTPUTS
MYSQL QUERY OUTPUT