0% found this document useful (0 votes)
539 views

GYM MANAGEMENT CS Project

Uploaded by

packiya782
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)
539 views

GYM MANAGEMENT CS Project

Uploaded by

packiya782
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/ 37

PM SHRI KENDRIYA VIDYALAYA

VIRUDHUNAGAR

COMPUTER SCIENCE
PROJECT REPORT
2024-2025

TOPIC : Gym management

Submitted by,
Name:M.siranjeevi
CLASS-XII ‘a’
ROLL
NO.-23
CERTIFICATE
This is to certify that M.siranjeevi (Reg. no. ) of class XII ‘a’
successfully completed the project work on Hotel Management in
python programming language during the year 2024-2025 in
partial fulfillment of computer science practical examination
conducted by SSCE.

Mrs. Beena J. stuvert Mr. S Lakshmi Narayanan


(Subject teacher) (Principal)
Pgt computer science

Signature of external examiner


ACKNOWLEDGEMENT
I would liketo express my special thanks tomy
guide teacher Mrs. Beena J Stuvert, PGT
computer science of this vidyalaya for her
valuable guidance, strong encouragement
and kind suggestion in every step towards the
completion of this project. I am also thankful to
my group members who will also help me to
complete this project.
I would also like to extend my gratitude to our
principal Mr. Lakshmi Narayanan sir for
providing me with all the facility that was
required.

ABSTRACT
The Gym Management System is an innovative software
application designed to optimize the administration of fitness
centers. This project leverages Python programming and MySQL
database integration to facilitate the management of gym
operations, including trainer and member information, financial
records, and user authentication.
Key features of the system include the ability to add, modify,
and remove trainers and members, along with updating
membership plans and handling secure login processes. The
user-friendly interface ensures efficient navigation, allowing
gym staff to quickly access and manage essential data.
This system not only streamlines administrative tasks but also
enhances the overall user experience by providing timely
information and efficient service. Ultimately, the Gym
Management System serves as a vital tool for fitness centers
aiming to improve operational efficiency and member
satisfaction.

INDEX

S.NO CONTENT PAGE NUMBER


1. Abstract
2. Introduction
3. Hardware and software requirement
4. About python and mysql
5. Source code
6. Output
7. Conclusion
8. Bibliography
INTRODUCTION

The Gym Management System is a comprehensive


software solution designed to streamline the operations
of fitness centers. This project aims to simplify the
management of trainers and members, facilitating
efficient tracking of their information and interactions.
Built using Python and integrated with a MySQL
database, the system enables gym administrators to
manage various aspects such as adding and modifying
trainer and member details, updating membership fees,
and handling user authentication securely.
By centralizing these functions, the Gym Management
System not only enhances administrative efficiency but
also provides a user-friendly interface for staff. This
ensures that all relevant data is easily accessible,
promoting better decision-making and improved service
delivery within the gym environment. Whether
managing memberships, tracking payments, or updating
trainer information, this system is designed to meet the
dynamic needs of modern fitness facilities.

HARDWARE & SOFTWARE REQUIRMENTS

Hardware:-
 RAM OF 512 Mb
 Hard drive of 500Mb

Software:-
 IDLE (PYTHON 3.12) 64-bits
 MySQL 8.0
 WINDOWS 10
TECHNOLOGY USED

PYTHON

Python is an interpreted, high-level, general-purpose programming


language. Created by Guido van Rossum and first released in 1991.
Python is dynamically typed. It supports multiple programming
paradigms, including procedural,object-oriented, and functional
programming. It was mainly developed for emphasis on code
readability, and its syntax allows programmers to express concepts in
fewer lines of code.Python is a programming language that help you to
work quickly and integrate systems more efficiently.

There are two major Python versions- Python 2 and Python 3. Both are
quite different. Python is an interpreted, object-oriented, high-level
programming language with dynamic semantics. Its high-level built in
data structures, combined with dynamic typing and dynamic binding,
make it very attractive for Rapid Application Development, as well as
for use as a scripting or glue language to connect existing components
together. Python's simple, easy to learn syntax emphasizes readability
and therefore reduces the cost of program maintenance. Python
supports modules and packages, which encourages program modularity
and code reuse. The Python interpreter and the extensive standard
library are available in source or binary form without charge for all
major platforms, and can be freely distributed.

MYSQL
MySQL is the world's most popular open source database. With its
proven performance, reliability and ease-of-use, MySQL has become
the leading database choice forweb-based applications, used by high
profile web properties including Facebook, Twitter, YouTube, Yahoo!
and many more.

Oracle drives MySQL innovation, delivering new capabilities to power


next generation web, cloud, mobile and embedded applications.

A database is a structured collection of data. It may be anything from a


simple shopping list to a picture gallery or the vast amounts of
information in a corporate network. To add, access, and process data
stored in a computer database, you need a database management
system such as MySQL Server. Since computers are very good at
handling large amounts of data, database management systems play a
central role in computing, as standalone utilities, or as parts of other
applications.

The MySQL Database Software is a client/server system that consists


of a multithreaded SQL server that supports different back ends,
several different client programs and libraries, administrative tools, and
a wide range of application programming interfaces (APIs).
DATA TABLES
Mysql table structure:

Fees table:

Login table:
Member table:

Sno table:

Trainer table:
SOURCE CODE
import mysql.connector

print("""

_________________________________

GYM MANAGEMENT

_________________________________

""")

mydb = mysql.connector.connect(host="localhost", user="root", password="1234")

mycursor = mydb.cursor()

# Creating database and tables

mycursor.execute("CREATE DATABASE IF NOT EXISTS gym")

mycursor.execute("USE gym")

mycursor.execute("CREATE TABLE IF NOT EXISTS fees(silver INT, gold INT, platinum


INT)")

mycursor.execute("CREATE TABLE IF NOT EXISTS login(username VARCHAR(25),


password VARCHAR(25) NOT NULL)")

mycursor.execute("CREATE TABLE IF NOT EXISTS member(id INT


AUTO_INCREMENT PRIMARY KEY, name VARCHAR(25), gender VARCHAR(20),
category VARCHAR(25), amount INT)")

mycursor.execute("CREATE TABLE IF NOT EXISTS sno(trainer_id INT, member_id


INT)")

mycursor.execute("CREATE TABLE IF NOT EXISTS trainer(id INT


AUTO_INCREMENT PRIMARY KEY, name VARCHAR(25), age VARCHAR(25),
gender VARCHAR(10), salary INT)")

mydb.commit()
# Inserting initial data

def initialize_data():

mycursor.execute("SELECT * FROM login")

if not mycursor.fetchall():

mycursor.execute("INSERT INTO login VALUES('im__siranjeevi', '1234')")

mydb.commit()

mycursor.execute("SELECT * FROM sno")

if not mycursor.fetchall():

mycursor.execute("INSERT INTO sno VALUES(0, 0)")

mydb.commit()

mycursor.execute("SELECT * FROM fees")

if not mycursor.fetchall():

mycursor.execute("INSERT INTO fees VALUES(700, 600, 500)")

mydb.commit()

initialize_data()

# Function for user login

def login():

username = input("Enter username: ")

password = input("Enter password: ")

mycursor.execute("SELECT * FROM login WHERE username=%s AND password=


%s", (username, password))

if mycursor.fetchone():
print("Login successful!")

return True

else:

print("Invalid username or password.")

return False

# Function to modify plans, trainer info, and member info

def modify_info():

while True:

print("""

1. Plans

2. Trainer Info

3. Member Info

4. Go Back

""")

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

if ch == 1: # Modify Plans

print("""

1. Platinum

2. Gold

3. Silver

""")

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

amount = int(input("Enter amount per month to update: "))

if ch2 == 1:

mycursor.execute("UPDATE fees SET platinum=%s", (amount,))


mydb.commit()

print("Platinum plan updated successfully.")

elif ch2 == 2:

mycursor.execute("UPDATE fees SET gold=%s", (amount,))

mydb.commit()

print("Gold plan updated successfully.")

elif ch2 == 3:

mycursor.execute("UPDATE fees SET silver=%s", (amount,))

mydb.commit()

print("Silver plan updated successfully.")

elif ch == 2: # Trainer Info

trainer_id = int(input("Enter ID to modify: "))

mycursor.execute("SELECT * FROM trainer WHERE id=%s", (trainer_id,))

trainer = mycursor.fetchone()

if trainer:

print(f"\nCurrent Trainer Details:")

print(f"ID: {trainer[0]}, Name: {trainer[1]}, Age: {trainer[2]}, Gender:


{trainer[3]}, Salary: {trainer[4]}")

print("""

1. Name

2. Age

3. Gender

4. Salary

""")

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

if modify_choice == 1:
name = input("Enter updated name: ")

mycursor.execute("UPDATE trainer SET name=%s WHERE id=%s", (name,


trainer_id))

mydb.commit()

print("Name updated successfully.")

elif modify_choice == 2:

age = input("Enter updated age: ")

mycursor.execute("UPDATE trainer SET age=%s WHERE id=%s", (age,


trainer_id))

mydb.commit()

print("Age updated successfully.")

elif modify_choice == 3:

gender = input("Enter updated gender (m/f): ")

mycursor.execute("UPDATE trainer SET gender=%s WHERE id=%s",


(gender, trainer_id))

mydb.commit()

print("Gender updated successfully.")

elif modify_choice == 4:

salary = int(input("Enter updated salary: "))

mycursor.execute("UPDATE trainer SET salary=%s WHERE id=%s", (salary,


trainer_id))

mydb.commit()

print("Salary updated successfully.")

else:

print("ID Not Found.")

elif ch == 3: # Member Info

member_id = int(input("Enter ID to modify: "))


mycursor.execute("SELECT * FROM member WHERE id=%s", (member_id,))

member = mycursor.fetchone()

if member:

print(f"\nCurrent Member Details:")

print(f"ID: {member[0]}, Name: {member[1]}, Gender: {member[2]}, Category:


{member[3]}, Amount: {member[4]}")

print("""

1. Name

2. Gender

3. Category

""")

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

if modify_choice == 1:

name = input("Enter updated name: ")

mycursor.execute("UPDATE member SET name=%s WHERE id=%s", (name,


member_id))

mydb.commit()

print("Name updated successfully.")

elif modify_choice == 2:

gender = input("Enter updated gender (m/f): ")

mycursor.execute("UPDATE member SET gender=%s WHERE id=%s",


(gender, member_id))

mydb.commit()

print("Gender updated successfully.")

elif modify_choice == 3:

print("""

1. Platinum

2. Gold
3. Silver

""")

mycursor.execute("SELECT * FROM fees")

fees = mycursor.fetchone()

print(f"Current Fees: Platinum: {fees[2]}, Gold: {fees[1]}, Silver: {fees[0]}")

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

if category_choice == 1:

category = "Platinum"

amount = fees[2]

elif category_choice == 2:

category = "Gold"

amount = fees[1]

elif category_choice == 3:

category = "Silver"

amount = fees[0]

mycursor.execute("UPDATE member SET category=%s, amount=%s WHERE


id=%s", (category, amount, member_id))

mydb.commit()

print("Category and amount updated successfully.")

else:

print("ID Not Found.")

elif ch == 4: # Go Back

break

# Function to add a trainer

def add_trainer():
while True:

name = input("Enter Name: ")

age = input("Enter Age: ")

gender = input("Enter Gender (m/f): ")

salary = int(input("Enter Salary: "))

mycursor.execute("INSERT INTO trainer (name, age, gender, salary) VALUES (%s,


%s, %s, %s)", (name, age, gender, salary))

mydb.commit()

print(f"\nTrainer added successfully with the following details:")

mycursor.execute("SELECT LAST_INSERT_ID()") # Get the last inserted ID

trainer_id = mycursor.fetchone()[0]

print(f"ID: {trainer_id}, Name: {name}, Age: {age}, Gender: {gender}, Salary:


{salary}\n")

another = input("Do you want to add another trainer? (y/n): ")

if another.lower() != 'y':

break

# Function to add a member

def add_member():

while True:

name = input("Enter Name: ")

gender = input("Enter Gender (m/f): ")

print("""

1. Platinum -------------> amount -> 8400 [per month 700]

2. Gold -----------------> amount -> 7200 [per month 600]


3. Silver ---------------> amount -> 6000 [per month 500]

""")

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

mycursor.execute("SELECT * FROM fees")

fees = mycursor.fetchone()

if plan_choice == 1:

category = 'Platinum'

amount = fees[2]

elif plan_choice == 2:

category = 'Gold'

amount = fees[1]

elif plan_choice == 3:

category = 'Silver'

amount = fees[0]

mycursor.execute("INSERT INTO member (name, gender, category, amount)


VALUES (%s, %s, %s, %s)", (name, gender, category, amount))

mydb.commit()

print(f"\nMember added successfully with the following details:")

mycursor.execute("SELECT LAST_INSERT_ID()") # Get the last inserted ID

member_id = mycursor.fetchone()[0]

print(f"ID: {member_id}, Name: {name}, Gender: {gender}, Category: {category},


Amount: {amount}\n")

another = input("Do you want to add another member? (y/n): ")

if another.lower() != 'y':
break

# Function to remove a trainer

def remove_trainer():

while True:

trainer_id = int(input("Enter Trainer ID to remove: "))

mycursor.execute("DELETE FROM trainer WHERE id=%s", (trainer_id,))

mydb.commit()

print("Trainer removed successfully.")

another = input("Do you want to remove another trainer? (y/n): ")

if another.lower() != 'y':

break

# Function to remove a member

def remove_member():

while True:

member_id = int(input("Enter Member ID to remove: "))

mycursor.execute("DELETE FROM member WHERE id=%s", (member_id,))

mydb.commit()

print("Member removed successfully.")

another = input("Do you want to remove another member? (y/n): ")

if another.lower() != 'y':

break

# Main program loop


if login(): # User login

logged_in = True

while logged_in:

print("""

1. Add Trainer

2. Add Member

3. Remove Trainer

4. Remove Member

5. Modify Info

6. Change Password

7. Logout

""")

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

if choice == 1: # Add Trainer

add_trainer()

elif choice == 2: # Add Member

add_member()

elif choice == 3: # Remove Trainer

remove_trainer()

elif choice == 4: # Remove Member

remove_member()

elif choice == 5: # Modify


modify_info()

elif choice == 6: # Change Password

new_password = input("Enter new password: ")

mycursor.execute("UPDATE login SET password=%s", (new_password,))

mydb.commit()

print("Password changed successfully.")

elif choice == 7: # Logout

logged_in = False

print("Logged out successfully.")

OUTPUT SCREENS
GYM MANAGEMENT:

 Logging In:

 Adding Trainer:
 Adding Member:
 Removing Trainer:
 Removing member:

 Modifying :
1. Modifying plans:
2. Modifying trainer:
 Modifying trainer’s name:
 Modifying trainer’age:

 Modifying trainer’s gender:


 Modifying trainer’s salary:

3. Modifying member:
 Modifying member’s name:
 Modifying member’s gender:
 Modifying member’s category:
4. Going back from modifying:

 Changing password:
 logging out:
CONCLUSION
While developing this project, the Gym Management System teaches
us how to effectively manage gym operations, including trainer and
member management. This system, created using Python, provides a
clear structure for handling essential tasks while visualizing data for
better analysis.

The script comprises several key modules:


1. Main Module: This serves as the control center for all other
modules, coordinating their functions.
2. Trainer Information Module: This displays all relevant data about
trainers, making it easy to manage their profiles.
3. Member Information Module: Similar to the trainer module, this
provides a comprehensive overview of members and their details.
4. Fee Management Module: This allows for easy updates and
modifications to membership fees.
5. User Authentication Module: This ensures secure access through a
login system, protecting sensitive data.

Overall, this Gym Management System enhances operational


efficiency and improves the user experience for both staff and
members..
BIBLIOGRAPHY
 Computer science with PYTHON textbook for class XI
and XII by SUMITA ARORA.
 https//www.wikipedia.org
 https//www.projectworlds.in
 https//www.geeksforgeeks.org

You might also like