DBMS Advanced Gym Management System Report
DBMS Advanced Gym Management System Report
A PROJECT REPORT
Submitted by
Jacob Immanuel RA2212701010008
Sai Krisha D RA2212701010016
Nukala Dinakar Nisank RA2212701010033
BACHELOR OF TECHNOLOGY
in
ARTIFICIAL INTELLIGENCE
NOV 2024
DEPARTMENT OF COMPUTATIONAL INTELLIGENCE
SCHOOL OF COMPUTING
COLLEGE OF ENGINEERING AND TECHNOLOGY SRM
INSTITUTE OF SCIENCE AND TECHNOLOGY
KATTANKULATHUR – 603 203
BONAFIDE CERTIFICATE
Certified that this project report "Advanced Gym Management System" is the
bonafide work of Jacob Immanuel [RA2212701010008], Sai Krisha D
[RA2212701010016] and Nukala Dinakar Nisank [RA2212701010033], who
carried out the project work under my supervision in the project course Database
Management Systems [21CSC205P] for the academic year 2024-2025 [III
year / V semester].
Date:
By implementing a robust relational database management system, this project aims to reduce
manual paperwork, minimize errors, and enable quick and accurate decision-making. With
features like seamless member enrolment, real-time tracking of payments, supplement
inventory management, and staff salary processing, the system provides a holistic approach to
gym operations.
The use of structured queries ensures data integrity, while foreign key relationships maintain
consistency across the database. This system is scalable and can be expanded to incorporate
additional features such as equipment maintenance tracking, member activity monitoring, and
gym attendance reporting in the future.
E-R DIAGRAM
RELATIONAL TABLES
Member Entity:
Member_id Name Date of Gender Date of joining Plan chosen Phone
birth number
Schema Representation:
Member (Member_id, Name, Date of birth, Gender, Date of joining, Plan chosen, Phone
number)
Primary Key- Member_id
Coach Entity:
Coach_id Name Gender Phone number
Schema Representation:
Coach (Coach_id, Name, Gender, Phone number)
Primary Key- Coach_id
Payments Entity:
Transaction_id Member_id Date Plan Amount
Schema representation:
Payments (Transactionn_id, Name, Date, Plan, Amount)
Primary Key- Transactionn_id
Supplements Entity:
Supplement_id Supplement Name Quantity Cost
Schema Representation:
Supplements (Supplement_id, Supplement Name, Quantity, Cost)
Primary Key- Supplement_id
Membership Entity:
Plan Type Amount
Schema Representation:
Membership (Plan_Type, Amount)
Primary Key-Plan_Type
Schema Representation:
Support Staff (Staff_id, Name, Gender)
Primary Key- Staff_id
Admin Entity:
Staff_id Name
Schema Representation:
Admin (Staff_id, Name)
Primary Key- Staff_id
Schema Representation:
GMS Portal (Username, Password)
SQL QUERIES – IMPLEMENTATION OF THE BACKEND
1. DATABASE CREATION IN SQL
USE GymManagementSystem;
3. Table 1: Member
dob DATE,
gender VARCHAR(10),
phone_number VARCHAR(15),
address TEXT);
4. Table 2: Coach
gender VARCHAR(10),
phone_number VARCHAR(15),
address TEXT,
salary DECIMAL(10, 2) NOT NULL);
5. Table 3: Payments
member_id INT,
plan_type VARCHAR(50),
6. Table 4: Supplements
7. Table 5: Membership
gender VARCHAR(10),
address TEXT );
9. Table 7: Admin
address TEXT,
phone_number VARCHAR(15),
salary DECIMAL(10, 2) );
coach_i coach_name
d
1 Rahul
2 Neha
3 Deepa
member_id joining_date plan_chosen membership_status
1 2023-01-10 Monthly Active
2 2022-05-12 Monthly Active
3 2021-09-18 Monthly Active
4 2020-11-14 Monthly Active
2.ADMIN TABLE
Normalization Used – This Table is already in the Third normal form. So no further
normalization is required. The table can be further decomposed to reduce
redundancies. They are:
staff_id name
1 Rahul Nair
2 Meera Iyer
Normalization Used – This Table is already in the Third normal form. So no further
normalization is required.
4.MEMBERSHIP TABLE
Normalization Used – This Table is already in the Second normal form. So no further
normalization is required.
5.COACH TABLE
Normalization Used – This Table is already in the Third normal form. So no further
normalization is required. The table can be further decomposed to reduce
redundancies. They are:
coach_id phone_number
1 9966554433
2 9966554455
3 9966554466
4 9966554477
coach_id address
1 T. Nagar, Chennai, Tamil Nadu
2 Adyar, Chennai, Tamil Nadu
3 Velachery, Chennai, Tamil Nadu
4 Anna Nagar, Chennai, Tamil Nadu
6.SUPPLEMENTS TABLE
Normalization Used – This Table is already in the Third normal form. So no further
normalization is required. The table can be further decomposed to reduce
redundancies. They are:
supplement_id supplement_name
S1001 Whey Protein
S1002 Creatine Monohydrate
S1003 BCAAs
S1004 Multivitamins
S1005 Fish Oil
S1006 Pre-Workout
S1007 Glutamine
Concurrency Control
b. Row-Level Locking
Row-level locking secures individual rows to prevent concurrent sessions from making
conflicting updates. For example, if a session is updating a specific member_id, using FOR
UPDATE in SELECT locks that row, so no other session can modify it until the first session
completes and commits.
c. Optimistic Locking
Recovery Mechanisms
Recovery mechanisms are designed to restore the database to a consistent state following a
failure, such as a system crash or a hardware failure.
The audit_log table tracks modifications, and the before_member_delete trigger logs
deletions, storing details like the user, action, and affected member ID. This helps with both
recovery and accountability by creating an audit trail for critical actions.
b. Cascading Data into Backup Tables
c. Scheduled Backups
Using tools like mysqldump, you can create daily backups of the entire database or specific
tables. Binary logging enables point-in-time recovery, which is critical for recovering to a
precise point following system issues or errors.
app = Flask(name)
app.config['SECRET_KEY'] = '@Bunny455'
conn = get_db_connection()
if conn is None:
print("Not Connected to MySQL DB")
def get_member_id_from_username(username):
connection = get_db_connection() # Make sure to get a DB connection
cursor = connection.cursor(dictionary=True)
cursor.execute("SELECT Member_id FROM member WHERE username = %s",
(username,))
member = cursor.fetchone() # Fetch the member details
cursor.close()
connection.close()
if member:
return member['Member_id']
return None
@app.route('/')
def home():
return render_template('home.html')
if conn is None:
print("Not Connected to MySQL DB")
cursor = conn.cursor()
if user:
session['username'] = username
return redirect(url_for('admin_dashboard')) # Redirect to admin dashboard
else:
flash('Invalid credentials. Please try again.', 'danger') # Flash message for invalid
login
return redirect(url_for('admin_login')) # Redirect back to login page
return render_template('admin_login.html')
@app.route('/admin_dashboard')
def admin_dashboard():
if 'username' in session:
return render_template('admin_dashboard.html')
return redirect(url_for('login'))
cursor = conn.cursor()
if request.method == 'POST':
# Retrieve the maximum member ID
cursor.execute("SELECT MAX(Member_id) FROM member")
max_id = cursor.fetchone()[0]
new_member_id = max_id + 1 if max_id is not None else 1 # Start from 1 if there are
no member
username = request.form['username']
password = request.form['password']
name = request.form['name']
phone_number = request.form['phone_number']
date_of_birth = request.form['date_of_birth']
gender = request.form['gender']
cursor.execute(
"INSERT INTO member (Member_id, Username, Password, Name,
Phone_number, Date_of_birth, Gender, Address, Date_of_joining, Plan_chosen) VALUES
(%s, %s, %s, %s, %s, %s, %s, %s, %s,%s)",
(new_member_id, username, password, name, phone_number, date_of_birth,
gender, address, date_of_joining, Plan_chosen)
)
conn.commit()
cursor.close()
return redirect(url_for('add_member'))
return render_template('add_member.html')
return redirect(url_for('admin_login'))
if request.method == 'POST':
# Get the member_id from the form input
member_id = request.form.get('member_id')
print("Selected member_id:", member_id)
if member_id:
# Retrieve current details of the member to be modified
query = "SELECT * FROM member WHERE Member_id = %s"
cursor.execute(query, (member_id,))
current_member = cursor.fetchone()
connection.commit()
flash("Member details updated successfully", "success")
return redirect(url_for('modify_member'))
else:
flash("Member not found", "danger")
else:
flash("Member ID is required to modify details", "warning")
if conn is None:
print("Not Connected to MySQL DB")
cursor = conn.cursor()
if request.method == 'POST':
supplement_id = request.form['supplement_id']
name = request.form['supplement_name']
quantity = request.form['quantity']
cost = request.form['cost']
cursor.execute(
"INSERT INTO supplements (supplement_id, supplement_name, quantity, cost)
VALUES (%s, %s,%s, %s) ON DUPLICATE KEY UPDATE quantity=%s, cost = %s",
(supplement_id, name, quantity, cost, quantity, cost)
)
conn.commit()
cursor.close()
return redirect(url_for('manage_supplements'))
cursor.execute("SELECT * FROM supplements")
supplements = cursor.fetchall()
cursor.close()
return redirect(url_for('admin_login'))
@app.route('/admin/update_supplement', methods=['POST'])
def update_supplement():
if 'username' in session:
supplement_id = request.form['id']
name = request.form['name']
cost = request.form['cost']
if conn is None:
print("Not Connected to MySQL DB")
cursor = conn.cursor()
cursor.execute("INSERT INTO supplements (id, name, cost) VALUES (%s, %s, %s)
ON DUPLICATE KEY UPDATE name = %s, cost = %s",
(supplement_id, name, cost, name, cost))
conn.commit()
cursor.close()
return redirect(url_for('admin_dashboard'))
return redirect(url_for('login'))
if conn is None:
return 'Failed to connect to database',500
cursor = conn.cursor()
cursor.execute("SELECT * FROM member WHERE username = %s AND password =
%s", (username,password))
user = cursor.fetchone()
cursor.close
conn.close()
if user:
session['username'] = username
return redirect(url_for('member_dashboard')) # Redirect to admin dashboard
else:
flash('Invalid credentials. Please try again.', 'danger') # Flash message for invalid
login
return redirect(url_for('member_login')) # Redirect back to login page
return render_template('member_login.html')
@app.route('/member_dashboard')
def member_dashboard():
if 'username' in session:
return render_template('member_dashboard.html')
return redirect(url_for('home'))
cursor = conn.cursor(dictionary=True)
@app.route('/track_plan')
def track_plan():
if 'username' in session:
return render_template('track_plan.html') # Make sure track_plan.html exists
return redirect(url_for('member_login'))
cursor = conn.cursor(dictionary=True)
@app.route('/view_transactions')
def view_transactions():
if 'username' in session:
cursor = conn.cursor(dictionary=True)
member_id = get_member_id_from_username(session['username'])
if member_id:
cursor.execute(
"SELECT transaction_id, transaction_date, amount, description "
"FROM transactions WHERE member_id = %s ORDER BY transaction_date
DESC", (member_id,)
)
transactions = cursor.fetchall()
cursor.close()
return render_template('view_transactions.html', transactions=transactions)
cursor.close()
flash("Member not found!", "error")
return redirect(url_for('member_dashboard'))
return redirect(url_for('member_login'))
@app.route('/add_transaction', methods=['POST'])
def add_transaction_route():
if 'username' in session:
member_id = get_member_id_from_username(session['username']) # Retrieve the
member ID from session info
amount = request.form['amount']
transaction_type = request.form['transaction_type']
description = request.form['description']
add_transaction(member_id, amount, transaction_type, description)
flash("Transaction added successfully", "success")
return redirect(url_for('view_transactions'))
return redirect(url_for('login'))
conn = get_db_connection()
if conn is None:
print("Not Connected to MySQL DB")
cursor = conn.cursor()
cursor.execute("SELECT * FROM coach WHERE username = %s AND password =
%s", (username,password))
user = cursor.fetchone()
cursor.close
conn.close()
if user:
session['username'] = username
return redirect(url_for('coach_dashboard')) # Redirect to admin dashboard
else:
flash('Invalid credentials. Please try again.', 'danger') # Flash message for invalid
login
return redirect(url_for('coach_login')) # Redirect back to login page
return render_template('coach_login.html')
@app.route('/coach_dashboard')
def coach_dashboard():
if 'username' in session:
return render_template('coach_dashboard.html')
@app.route('/coach/leave', methods=['POST'])
def coach_leave():
if 'username' in session:
leave_date = request.form['leave_date']
conn = get_db_connection()
if conn is None:
print("Not Connected to MySQL DB")
cursor = conn.cursor()
cursor.execute("INSERT INTO leaves (coach_id, leave_date) VALUES (%s, %s)",
(session['username'], leave_date))
conn.commit()
cursor.close()
return redirect(url_for('admin_dashboard'))
return redirect(url_for('login'))
if request.method == 'POST':
# Proceed to purchase
return redirect(url_for('proceed_to_purchase', item_id=supplement_id,
item_type='supplement'))
if request.method == 'POST':
# Proceed to purchase
return redirect(url_for('proceed_to_purchase', item_id=plan_id, item_type='plan'))
if item_type == 'supplement':
cursor.execute("SELECT Supplement_Name AS Name, Cost FROM supplements
WHERE Supplement_ID = %s", (item_id,))
item = cursor.fetchone()
description = f"Supplement Purchase: {item['Name']} (ID: {item_id})"
elif item_type == 'plan':
cursor.execute("SELECT Plan AS Name, Amount FROM plans WHERE Plan_ID =
%s", (item_id,))
item = cursor.fetchone()
description = f"Plan Purchase: {item['Name']} (ID: {item_id})"
if request.method == 'POST':
cursor.execute(
"INSERT INTO transactions (member_id, transaction_date, amount, description)
VALUES (%s, %s, %s, %s)",
(member_id, datetime.now(), item['Cost'], description)
)
conn.commit()
flash("Transaction successful!", "success")
return redirect(url_for('member_dashboard'))
cursor.close()
return render_template('proceed_to_purchase.html', item=item, item_type=item_type,
qr_code_path=qr_code_path)
return redirect(url_for('member_login'))
@app.route('/logout')
def logout():
session.pop('username', None)
return redirect(url_for('home'))
if name == 'main':
app.run(debug=True)
PYTHON CODE FOR FRONT END
<home.html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GYM Management System</title>
<style>
body {
margin: 0;
font-family: Arial, sans-serif;
height: 100vh;
background-size: cover;
background-position: center center;
overflow: hidden;
}
nav {
background-color: rgba(0, 0, 0, 0.8);
padding: 1rem;
display: flex;
align-items: center; /* Align items vertically */
justify-content: space-between; /* Space between left and right blocks */
}
nav a {
color: white;
margin: 0 15px;
text-decoration: none;
font-size: 1.2rem;
}
.nav-left,
.nav-right {
display: flex; /* Display links in a row */
}
.nav-left a,
.nav-right a {
color: white;
margin-left: 20px;
text-decoration: none;
font-size: 1rem;
}
nav a:hover {
color: rgb(255, 107, 107);
}
.container{
width: 100%;
max-width: 400px;
margin: 50px auto;
padding: 20px;
background: white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
margin-bottom: 200px;
margin-right: 100px;
.container a:hover {
color: rgb(1, 1, 1);
}
.container_center {
position: relative;
height: 100vh;
display: flex;
align-items: center;
justify-content: space-between;
}
.left-image {
width: 40%;
height: 100vh;
background-image: url('left-image.jpg'); /* Replace with actual image path */
background-size: cover;
background-position: center;
}
.center-content {
flex: 1;
display: flex;
justify-content: center;
align-items: flex-end; /* Align items to the bottom */
position: relative;
height: 100%; /* Ensure it takes full height */
}
.center-image {
width: 60%;
height: 50%;
background-image: url('center-image.jpg'); /* Replace with actual image path */
background-size: cover;
background-position: center;
border-radius: 15px;
}
button {
width: 100%;
margin: 5px;
padding: 10px;
background-color: #ff6b6b;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #333;
}
</style>
</head>
<body>
</div>
</nav>
<div class="container">
<button onclick="navigateToPage('Admin')">Admin Login</button>
<button onclick="navigateToPage('Coach')">Coach Login</button>
<button onclick="navigateToPage('Member')">Member Login</button>
</div>
</div>
<script>
function navigateToPage(role) {
if (role === 'Member') {
window.location.href = '/member_login';
} else if (role === 'Admin') {
window.location.href = '/admin_login';
} else if (role === 'Coach') {
window.location.href = '/coach_login';
}
}
</script>
</body>
</html>
<admin login>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GYM Management System</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
}
nav {
background-color: #333;
padding: 1rem;
text-align: center;
}
nav a {
color: white;
margin: 0 15px;
text-decoration: none;
font-size: 1.2rem;
}
nav a:hover {
color: #ff6b6b;
}
.container {
width: 100%;
max-width: 400px;
margin: 50px auto;
padding: 10px;
background: white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
color: #333;
}
input {
width: 95%;
padding: 10px;
margin: 10px 0;
border: 1px solid #ccc;
border-radius: 5px;
}
button {
width: 100%;
padding: 10px;
background-color: #ff6b6b;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #333;
}
</style>
</head>
<body>
<nav>
<a href="/">Home</a>
<a href="/about">About Us</a>
<a href="/contact">Contact</a>
</nav>
<div class="container">
<h1>Admin Login</h1>
<form action="/admin_login" method="POST">
<input type="text" id="username" name="username" placeholder="Username"
required>
<input type="password" id="password" name="password" placeholder="Password"
required>
<button type="submit">Login</button>
</form>
<div>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<ul>
{% for category, message in messages %}
<li class="{{ category }}">{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
</div>
</div>
</body>
</html>
<coach.html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GYM Management System</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
}
nav {
background-color: rgba(0, 0, 0, 0.8);
padding: 1rem;
display: flex;
align-items: center; /* Align items vertically */
justify-content: space-between; /* Space between left and right blocks */
}
nav a {
color: white;
margin: 0 15px;
text-decoration: none;
font-size: 1.2rem;
}
.nav-left,
.nav-right {
display: flex; /* Display links in a row */
}
.nav-left a,
.nav-right a {
color: white;
margin-left: 20px;
text-decoration: none;
font-size: 1rem;
}
nav a:hover {
color: rgb(255, 107, 107);
}
.container {
width: 100%;
max-width: 400px;
margin: 50px auto;
padding: 20px;
background: white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
color: #333;
}
input {
width: 95%;
padding: 10px;
margin: 10px 0;
border: 1px solid #ccc;
border-radius: 5px;
}
button {
width: 100%;
padding: 10px;
background-color: #ff6b6b;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #333;
}
</style>
</head>
<body>
<nav>
<a href="/">Home</a>
<a href="/about">About Us</a>
<a href="/contact">Contact</a>
</nav>
<div class="container">
<h1>Coach Login</h1>
<form action="/coach_login" method="POST">
<input type="text" id="username" name="username" placeholder="Username"
required>
<input type="password" id="password" name="password" placeholder="Password"
required>
<button type="submit">Login</button>
</form>
<div>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<ul>
{% for category, message in messages %}
<li class="{{ category }}">{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
</div>
</div>
</body>
</html>
<member.html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GYM Management System</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
}
nav {
background-color: #333;
padding: 1rem;
text-align: center;
}
nav a {
color: white;
margin: 0 15px;
text-decoration: none;
font-size: 1.2rem;
}
nav a:hover {
color: #ff6b6b;
}
.container {
width: 100%;
max-width: 400px;
margin: 50px auto;
padding: 20px;
background: white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
color: #333;
}
input {
width: 95%;
padding: 10px;
margin: 10px 0;
border: 1px solid #ccc;
border-radius: 5px;
}
button {
width: 100%;
padding: 10px;
background-color: #ff6b6b;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #333;
}
</style>
</head>
<body>
<nav>
<a href="/">Home</a>
<a href="/about">About Us</a>
<a href="/contact">Contact</a>
</nav>
<div class="container">
<h1>Member Login</h1>
<form action="/member_login" method="POST">
<input type="text" id="username" name="username" placeholder="Username"
required>
<input type="password" id="password" name="password" placeholder="Password"
required>
<button type="submit">Login</button>
</form>
<div>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<ul>
{% for category, message in messages %}
<li class="{{ category }}">{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
</div>
</div>
</body>
</html>
Add members
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GYM Management Sysytem</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
}
nav {
background-color: #333;
padding: 1rem;
text-align: center;
}
nav a {
color: white;
margin: 0 15px;
text-decoration: none;
font-size: 1.2rem;
}
nav a:hover {
color: #ff6b6b;
}
.container {
text-align: center;
padding: 50px;
}
input, select {
display: block;
margin: 10px auto;
padding: 10px;
width: 80%;
max-width: 300px;
border: 1px solid #ccc;
border-radius: 5px;
font-size: 1rem;
}
.btn {
padding: 10px 20px;
background-color: #ff6b6b;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 1rem;
}
.btn:hover {
background-color: #333;
}
</style>
</head>
<body>
<nav>
<a href="/">Home</a>
<a href="/admin_dashboard">Admin Dashboard</a>
<a href="/modify_member">Modify Existing Member</a>
<a href="/modify_member">Manage Supplements</a>
<a href="/logout" style="float: right;">Log Out</a>
</nav>
<div class="container">
<h1>Add New Member</h1>
<form action="/add_member" method="POST">
<input type="text" name="username" placeholder="Username" required>
<input type="password" name="password" placeholder="Password" required>
<input type="text" name="name" placeholder="Member Name" required>
<input type="text" name="phone_number" placeholder="Phone Number" required>
<input type="date" name="date_of_birth" placeholder="Date of Birth" required>
<select name="gender" required>
<option value="" disabled selected>Select Gender</option>
<option value="Male">Male</option>
<option value="Female">Female</option>
<option value="Other">Other</option>
</select>
<input type="text" name="address_line1" placeholder="Address Line 1" required>
<input type="text" name="address_line2" placeholder="Address Line 2">
<input type="text" name="street" placeholder="Street" required>
<input type="text" name="city" placeholder="City" required>
<input type="text" name="state" placeholder="State" required>
<input type="text" name="pincode" placeholder="Pincode" required>
<select name="Plan_chosen" required>
<option value="" disabled selected>Select plan</option>
<option value="Monthly">Monthly</option>
<option value="Quaterly">Quaterly</option>
<option value="Half">Half</option>
<option value="Annualy">Annualy</option>
</select>
<button type="submit" class="btn">Add Member</button>
</form>
</div>
</body>
</html>
Modifying existing member
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GYM Management System</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
}
nav {
background-color: #333;
padding: 1rem;
text-align: center;
}
nav a {
color: white;
margin: 0 15px;
text-decoration: none;
font-size: 1.2rem;
}
nav a:hover {
color: #ff6b6b;
}
.container {
text-align: center;
padding: 50px;
}
input, select {
display: block;
margin: 10px auto;
padding: 10px;
width: 80%;
max-width: 300px;
border: 1px solid #ccc;
border-radius: 5px;
font-size: 1rem;
}
.btn {
padding: 10px 20px;
background-color: #ff6b6b;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 1rem;
}
.btn:hover {
background-color: #333;
}
</style>
</head>
<nav>
<a href="/">Home</a>
<a href="/admin_dashboard">Admin Dashboard</a>
<a href="/add_member">Add Member</a>
<a href="/manage_supplements">Manage Supplements</a>
<a href="/logout" style="float: right;">Log Out</a>
</nav>
<body>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<ul class="flashes">
{% for category, message in messages %}
<li class="flash {{ category }}">{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
<div class="container">
<h1>Modify Existing Members</h1>
<form method="POST">
<label for="member_id">Select Member:</label>
<select name="member_id" id="member_id" required>
<option value="" disabled selected>Select a member</option>
{% for member in members %}
<option value="{{ member.member_id }}">{{ member.name }} (ID:
{{ member.member_id }})</option>
{% endfor %}
</select>
nav {
background-color: rgba(0, 0, 0, 0.8);
padding: 1rem;
display: flex;
align-items: center; /* Align items vertically */
justify-content: space-between; /* Space between left and right blocks */
}
nav a {
color: white;
margin: 0 15px;
text-decoration: none;
font-size: 1.2rem;
}
.nav-left,
.nav-right {
display: flex; /* Display links in a row */
}
.nav-left a,
.nav-right a {
color: white;
margin-left: 20px;
text-decoration: none;
font-size: 1rem;
}
nav a:hover {
color: rgb(255, 107, 107);
}
.container {
width: 100%;
max-width: 500px;
margin: 20px auto;
padding: 50px;
background: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
text-align: center;
}
table{
flex-wrap: wrap;
}
input, select {
display: block;
margin: 10px auto;
padding: 10px;
width: 80%;
max-width: 300px;
border: 1px solid #ccc;
border-radius: 5px;
font-size: 1rem;
}
.btn {
padding: 10px 20px;
background-color: #ff6b6b;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 1rem;
}
.btn:hover {
background-color: #333;
} </style>
</head>
<body>
<nav>
<div class="nav-left">
<img src="/static/images/gym_laidy_logo.png" alt="Logo"style="height: 40px;">
</div>
<a href="/">Home</a>
<a href="admin_dashboard">Admin Dashboard</a>
<a href="/add_member">Add Member</a>
<a href="/modify_member">Modify Existing Member</a>
<a href="/logout" style="float: right;">Logout</a>
</nav>
<div class="container">
<h1>Manage Supplements</h1>
<form action="/manage_supplements" method="POST">
<input type="text" name="supplement_id" placeholder="Supplement ID" required>
<input type="text" name="supplement_name" placeholder="Supplement Name"
required>
<input type="text" name="quantity" placeholder="Quantity" required>
<input type="text" name="cost" placeholder="Supplement Cost" required>
<button type="submit" class="btn">Add/Update Supplement</button>
</form>
<table class="table">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Quantity</th>
<th>Cost</th>
</tr>
</thead>
<tbody>
{% for supplement in supplements %}
<tr>
<td>{{ supplement[0] }}</td>
<td>{{ supplement[1] }}</td>
<td>{{ supplement[2] }}</td>
<td>{{ supplement[3] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</body>
</html>
View plan
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GYM Management System - View Supplements</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
}
nav {
background-color: #333;
padding: 1rem;
text-align: center;
}
nav a {
color: white;
margin: 0 15px;
text-decoration: none;
font-size: 1.2rem;
}
nav a:hover {
color: #ff6b6b;
}
.container {
text-align: center;
padding: 50px 0;
}
h1 {
color: #333;
}
.supplement-list {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.supplement-card {
background-color: white;
padding: 20px;
margin: 15px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
width: 250px;
text-align: center;
}
.supplement-card h3 {
color: #333;
}
.btn {
padding: 10px 20px;
background-color: #ff6b6b;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
.btn:hover {
background-color: #333;
}
</style>
</head>
<body>
<nav>
<a href="/">Home</a>
<a href="/member_dashboard">Member Dashboard</a>
<a href="/buy_subscription">Buy Subscription</a>
<a href="/track_plan">Track Plan</a>
<a href="/view_transactions">View Transactions</a>
<a href="/logout" style="float: right;">Logout</a>
</nav>
<div class="container">
<h1>Available Plans</h1>
<div class="supplement-list">
{% for plan in plan %}
<div class="supplement-card">
<h3>{{ plan.plan }}</h3>
<p>Cost: ₹{{ plan.amount }}</p>
<a href="{{ url_for('buy_plan', plan_id=plan['plan_ID']) }}"
class="btn btn-primary">Buy Now</a>
</a>
</div>
{% endfor %}
</div>
</div>
</body> </html>
Buy plan
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GYM Management Sysytem</title>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="favicon-32x32/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="favicon-16x16/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="stylesheet" href="styles.css"> <!-- Link to your CSS file -->
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
}
nav {
background-color: #333;
padding: 1rem;
text-align: center;
}
nav a {
color: white;
margin: 0 15px;
text-decoration: none;
font-size: 1.2rem;
}
nav a:hover {
color: #ff6b6b;
}
.nav-left,
.nav-right {
display: flex; /* Display links in a row */
}
.container {
text-align: center;
padding: 50px 0;
}
h1 {
color: #333;
}
.subscription_type-list {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.subscription_card {
background-color: white;
padding: 20px;
margin: 15px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
width: 250px;
text-align: center;
}
.supplement-card h3 {
color: #333;
}
.btn {
padding: 10px 20px;
background-color: #ff6b6b;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
.btn:hover {
background-color: #333;
}
</style>
</head>
<body>
<header>
<nav>
<div class="nav-left">
<img src="/static/images/gym_logo.png" alt="Logo">
</div>
<a href="/member_dashboard">Dashboard</a>
<a href="/view_plan">Buy Plan</a>
<a href="/buy_supplements">Buy Supplements</a>
<a href="/logout" style="float: right;">Logout</a>
</nav>
</header>
<main>
<div class="container">
<h1>Buy Subscription</h1>
<div class="subscription_type-list">
<p>Cost: ₹{{ plan.Amount }}</p>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GYM Management System - View Supplements</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
}
nav {
background-color: #333;
padding: 1rem;
text-align: center;
}
nav a {
color: white;
margin: 0 15px;
text-decoration: none;
font-size: 1.2rem;
}
nav a:hover {
color: #ff6b6b;
}
.container {
text-align: center;
padding: 50px 0;
}
h1 {
color: #333;
}
.supplement-list {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.supplement-card {
background-color: white;
padding: 20px;
margin: 15px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
width: 250px;
text-align: center;
}
.supplement-card h3 {
color: #333;
}
.btn {
padding: 10px 20px;
background-color: #ff6b6b;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
.btn:hover {
background-color: #333;
}
</style>
</head>
<body>
<nav>
<a href="/">Home</a>
<a href="/member_dashboard">Member Dashboard</a>
<a href="/buy_subscription">Buy Subscription</a>
<a href="/track_plan">Track Plan</a>
<a href="/view_transactions">View Transactions</a>
<a href="/logout" style="float: right;">Logout</a>
</nav>
<div class="container">
<h1>Available Supplements</h1>
<div class="supplement-list">
{% for supplement in supplements %}
<div class="supplement-card">
<h3>{{ supplement.Supplement_Name }}</h3>
<p>Cost: ₹{{ supplement.Cost }}</p>
<a href="{{ url_for('buy_supplements',
supplement_id=supplement['Supplement_ID']) }}"
class="btn btn-primary">Buy Now</a>
</a>
</div>
{% endfor %}
</div>
</div>
</body> </html>
Buy supplements
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GYM Management System - Buy Supplement</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
}
nav {
background-color: #333;
padding: 1rem;
text-align: center;
}
nav a {
color: white;
margin: 0 15px;
text-decoration: none;
font-size: 1.2rem;
}
nav a:hover {
color: #ff6b6b;
}
.container {
text-align: center;
padding: 50px 0;
}
h1 {
color: #333;
}
.supplement-card {
background-color: white;
padding: 20px;
margin: auto;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
width: 300px;
text-align: center;
}
.supplement-card h3 {
color: #333;
}
.btn {
padding: 10px 20px;
background-color: #ff6b6b;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
.btn:hover {
background-color: #333;
}
</style>
</head>
<body>
<nav>
<a href="/">Home</a>
<a href="/member_login">Member Dashboard</a>
<a href="/view_supplements">View Supplements</a>
<a href="/logout" style="float: right;">Logout</a>
</nav>
<div class="container">
<h1>Buy Supplement</h1>
<div class="supplement-card">
<h3>{{ supplement.Supplement_Name }}</h3>
<p>Cost: ₹{{ supplement.Cost }}</p>
<form action="" method="POST">
<button class="btn" type="submit">Proceed to Purchase</button>
</form>
</div>
</div>
</body>
</html>
View transactions
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>View Transactions</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
}
nav {
background-color: #333;
padding: 1rem;
text-align: center;
}
nav a {
color: white;
margin: 0 15px;
text-decoration: none;
font-size: 1.2rem;
}
nav a:hover {
color: #ff6b6b;
}
.container {
text-align: center;
padding: 50px 0;
}
h1 {
color: #333;
}
table {
width: 80%;
margin: 0 auto;
border-collapse: collapse;
background-color: white;
}
table th,
table td {
padding: 10px;
border: 1px solid #ddd;
}
table th {
background-color: #333;
color: white;
}
.btn {
padding: 10px 20px;
background-color: #ff6b6b;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
.btn:hover {
background-color: #333;
}
</style>
</head>
<body>
<nav>
<a href="/">Home</a>
<a href="/member_dashboard">Member Dashboard</a>
<a href="/buy_subscription">Buy Subscription</a>
<a href="/track_plan">Track Membership Plan</a>
<a href="/view_supplements">Buy Supplements</a>
</nav>
<div class="container">
<h1>Transaction History</h1>
<br>
Proceed to purchase
<!DOCTYPE html>
<html lang="en">
<head>
<title>Proceed to Purchase</title>
</head>
<body>
<h1>Confirm Purchase: {{ item.Name }}</h1>
<p>Cost: ₹{{ item.Cost }}</p>
<p>UPI ID: <strong>8143233886@ybl</strong></p>
<img src="{{ url_for('static', filename=qr_code_path.split('static/')[1]) }}" alt="QR Code
for Payment">
<form action="" method="POST">
<button type="submit">Confirm and Pay</button>
</form>
</body>
</html>
Admin dashboard
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GYM Management System</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
}
nav {
background-color: #333;
padding: 1rem;
text-align: center;
}
nav a {
color: white;
margin: 0 15px;
text-decoration: none;
font-size: 1.2rem;
}
nav a:hover {
color: #ff6b6b;
}
.container{
width: 100%;
max-width: 400px;
margin: 50px auto;
padding: 20px;
background: white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
text-align: center;
}
h1 {
text-align: center;
color: #333;
}
.btn {
padding: 10px 20px;
background-color: #ff6b6b;
color: white;
border: none;
border-radius: 5px;
margin: 10px;
cursor: pointer;
}
.btn:hover {
background-color: #333;
}
</style>
</head>
<body>
<nav>
<a href="/">Home</a>
<a href="/add_member">Add Member</a>
<a href="/modify_member">Modify Existing Member</a>
<a href="/manage_supplements">Manage Supplements</a>
<a href="/logout" style="float: right;">Log Out</a>
</nav>
<div class="container">
<h1>Admin Dashboard</h1>
<button class="btn" onclick="window.location.href='/add_member'">Add
Member</button>
<button class="btn" onclick="window.location.href='/modify_member'">Modify
Existing Member</button>
<button class="btn" onclick="window.location.href='/manage_supplements'">Manage
Supplements</button>
<!-- Add more Admin-specific functionalities here -->
</div>
</body>
</html>
Coach dashboard
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GYM Management System</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
}
nav {
background-color: #333;
padding: 1rem;
text-align: center;
}
nav a {
color: white;
margin: 0 15px;
text-decoration: none;
font-size: 1.2rem;
}
nav a:hover {
color: #ff6b6b;
}
.container {
width: 100%;
max-width: 400px;
margin: 0px auto;
padding: 20px;
background: white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
text-align: center;
padding: 50px 0;
}
h1 {
color: #333;
}
.btn {
padding: 10px 20px;
background-color: #ff6b6b;
color: white;
border: none;
border-radius: 5px;
margin: 10px;
cursor: pointer;
}
.btn:hover {
background-color: #333;
}
.hero {
width: 100%;
height: 300px;
background-image: url('coach-dashboard.jpg'); /* Replace with actual image path */
background-size: cover;
background-position: center;
}
</style>
</head>
<body>
<nav>
<a href="/">Home</a>
</nav>
<div class="hero"></div>
<div class="container">
<h1>Coach Dashboard</h1>
<button class="btn" onclick="window.location.href='/view_sessions'">View
Sessions</button>
<button class="btn" onclick="window.location.href='/apply_leave'">Apply for
Leave</button>
<!-- Add more Coach-specific functionalities here -->
</div>
</body> </html>
Member dashboard
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GYM Management System</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
}
nav {
background-color: #333;
padding: 1rem;
text-align: center;
}
nav a {
color: white;
margin: 0 15px;
text-decoration: none;
font-size: 1.2rem;
}
nav a:hover {
color: #ff6b6b;
}
.container {
text-align: center;
padding: 50px 0;
}
h1 {
color: #333;
}
.btn {
padding: 10px 20px;
background-color: #ff6b6b;
color: white;
border: none;
border-radius: 5px;
margin: 10px;
cursor: pointer;
}
.btn:hover {
background-color: #333;
}
</style>
</head>
<body>
<nav>
<a href="/">Home</a>
<a href="/member_login">Member Dashboard</a>
<a href="/view_plan">Buy Plan</a>
<a href="/track_plan">Track Membership Plan</a>
<a href="/view_transactions">View Transactions</a>
<a href="/view_supplements">Buy Supplements</a>
</nav>
<div class="container">
<h1>Member Dashboard</h1>
<button class="btn" onclick="window.location.href='/buy_plan'">Buy Plan</button>
<button class="btn" onclick="window.location.href='/track_plan'">Track Membership
Plan</button>
<button class="btn" onclick="window.location.href='/view_transactions'">View
Transactions</button>
<button class="btn" onclick="window.location.href='/view_supplements'">Buy
Supplements</button>
</div>
</body>
</html>
OUTPUT SCREENSHOTS WITH FRONT-END
IMPLEMENTATION:
CERTIFICATES :
N. Dinakar Nisank:
Jacob :
Krisha: