Airline Management System
Airline Management System
• Developed By:
Roll No:
1.Roushan Kumar Sinha.
22719020
2.Divyansh Krishn.
22719004
Project Report of Informatics Practices
On
Airline Management
System
By :
Aditya Prakash
Roll No.: 22718992
Under Guidance of :
Mr. Tej Pradhan
ACKNOWLEDGEME
NT
First and foremost I praise and thank
almighty from the depth of my heart, which
has been the source of strength in the
completion of my project. I extend my sincere
thanks to
ordination in
extending every possible support for the
completion of
Mr. Tej
forthis project.
guiding meI immensely
would like to express
through a deep
the course
of the
Pradhan
sense of
thanks
project.&He
gratitude
always to my teacher
evinced in charge
keen interest in
my work. I
also thank my Parents for their motivation &
support.
I must thank my classmates for their timely
help
support for completion of this project. Last but
not
least, I would like to thank all those who had
helped
CERTIFICATE
This is to certify
that
Aditya
of class XII Praksh
‘A’ of Sarala Birla Public
School
successfully completedhasthe Information
Practices
project entitled
“Airline management System”
25
__________________ _________________
Signature of Signature of
_
the Internal the external
Examiner Examiner
INDEX
5.
6.
7.
Problem
Definition
Definition and Working of Functions
The Airline Management System is a Python-based application
integrated with a MySQL database. It facilitates user
registration, login, flight management (admin), and ticket
booking/cancellation (users). Below are the core functions and
their functionalities:
1. Database Connection
Establishes a connection to the MySQL database
(connect_db)
airline_management.
2. User Registration
Allows new users (admin or regular) to register by providing
(register_user)
a username,
3. database
User Login
constraints.
Authenticates users based on their credentials and returns
(login)
their role
(admin/user).
4. Add Flight
Admins can add new flights with details such as
(add_flight)
name, source,
the bookings table and updates the seat availability for the
corresponding flight.
8. Main Menu
Manages the flow of the program by providing options for
(main)
registration,
Challenges:
1. Manual management of flight schedules and
consuming and error-
bookings
prone. is time-
2. Lack of centralized and secure storage for user and
such as user
authentication, flight management, and ticket handling. It
provides
and accuracy.
Software and Hardware
Requirements
Hardware
(minimum)
• RAM: 4GB (minimum) • Storage: 50MB for program and
• Python 3.8 or
Requirements
• MySQL
above Server 8.0 or
Spyder)
Scope of Future
Enhancements
1.Enhanced User
criteria
such as source, destination, departure time, or price
range.
relevant flights, enhancing the overall user
experience.
o Benefit: Saves time for users by allowing them to
4. Real-Time Flight
quickly find
Updates
o Integrate APIs from airline systems to provide live
updates
flight schedules,
on delays, or
cancellations.
o Benefit: Ensures passengers receive accurate
information, reducing confusion and improving trust in
and timely
the system.
5. Graphical User Interface
picking,Aand
o Benefit: GUI makes the system more accessible to
interactive dashboards for admins.
limited technical knowledge, increasing adoption and
users with
satisfaction.
6. Mobile
Application
o Extend the system's reach by developing a mobile
compatible with Android and iOS
application
platforms.
o Benefit: Provides flexibility to users who prefer
bookings on the go, increasing convenience and
managing their
engagement.
7. Data Analytics and
Reporting
o Implement tools to analyze booking trends, user
peak travel
preferences,
times. and
o Benefit: Enables admins to make data-driven
adding more flights during high-demand periods
decisions, such as
or tailoring
Support
o Add support for multiple languages to cater to a
base
diverse
. user
o Benefit: Increases usability for non-English speakers,
the system’s reach and
broadening
inclusivity.
9. Email and SMS
Notifications
o Send automated email and SMS notifications for
confirmations, flight reminders, or
booking
cancellations.
o Benefit: Keeps passengers informed and engaged,
communication and user
enhancing
satisfaction.
trends, enabling
targeted promotions and optimizing resource allocation.
• Increasing Accessibility: A mobile app and enhanced user
roles make the system accessible to a broader audience,
encouraging more users to utilize the service.
payment gateway
build trust among users, leading to higher satisfaction and
repeat
business.
Source
Python Code
code
import
mysql.connector
# Database
Connection
return
def connect_db():
host="localhost",
mysql.connector.connect(
user="root", # Replace with your MySQL
username
password="12345", # Replace with your MySQL
) password
database="airline_management"
# User
Registration
def
conn = connect_db()
register_user():
cursor = conn.cursor()
").lower()
if print("Invalid
role not in ("admin", "user"):
role! Please choose 'admin'
or 'user'.")
tryreturn
:
cursor.execute("INSERT INTO users (username, password, role) VALUES (%s,
%s, %s)", (username,
password,
role))
conn.commit()
print(f"{role.capitalize()} registered
successfully!")
except
print("Username already
mysql.connector.IntegrityError:
exists.")
finally
conn.clos
:
e()
# User
Login
conn = connect_db()
def
cursor = conn.cursor()
login():
cursor.fetchone()
conn.close()
return result[0],
if result:
username
else
print("Invalid
:
credentials.")
# Admin: Add
Flight
conn
def =
add_flight():
connect_db()
cursor =
conn.cursor()
flight_name = input("Enter flight
name:
source
") = input("Enter source: ") destination = input("Enter destination:
destination, departure_time,
seats_available) VALUES (%s, %s, %s,
%s, %s)",
(flight_name, source, destination, departure_time,
conn.commit()
seats_available))
print("Flight added
successfully!")
conn.close()
# View All
Flights
conn = connect_db()
def
cursor = conn.cursor()
view_flights():
cursor.execute("SELECT * FROM
flights")
forprint(f"ID: {flight[0]}, flight_name: {flight[1]}, source: {flight[2]},
flight in cursor.fetchall():
departure_time:
{flight[5]}") {flight[4]}, seats_available:
destination: {flight[3]},
conn.clos
e()
# User: Book Ticket
def
book_ticket(username)
conn = connect_db()
:
cursor = conn.cursor()
%s", (username,))
user_id = cursor.fetchone()[0]
view_flights()
flight_id = int(input("Enter Flight ID to book: ")) cursor.execute("SELECT
e()
# User: Cancel Ticket
def
cancel_ticket(username
conn = connect_db()
):
cursor = conn.cursor()
(username,))
user_id = cursor.fetchone()[0]
flights f ON b.flight_id = f.flight_id WHERE b.user_id =
%s", (user_id,))
cursor.execute("SELECT b.booking_id, f.flight_name, f.source, f.destination
bookings =
FROM bookings b JOIN
cursor.fetchall()
if for
bookings:
booking in
print(f"Booking ID: {booking[0]}, Flight: {booking[1]}, From:
bookings:
{booking[2]}, To: {booking[3]}")
booking_id = int(input("Enter Booking ID to cancel: "))
cursor.execute("DELETE FROM bookings WHERE booking_id = %s AND user_id =
user_id
%s", (booking_id,
))
cursor.execute("UPDATE flights f JOIN bookings b ON f.flight_id = b.flight_id SET
f.seats_available
(booking_id,)) + 1 WHERE b.booking_id = %s",
f.seats_available =
conn.commit() print("Booking
cancelled successfully!")
else
: print("No bookings
found.")
conn.clos
e()
# Main
Menu
def main():
while
print("\n--- Airline Management
True:
System ---")
print("1. Register")
print("2. Login")
print("3. Exit")
choice = input("Enter choice: ")
if register_use
choice == "1":
r()
elif choice ==
role, username =
"2":
login()
if while
role == "admin":
True:
print("\n--- Admin Menu ---")
print("1. Add Flight")
admin_choice = input("Enter
choice: ")
if add_flight
admin_choice == "1":
elif admin_choice
()
== "2":
view_flight
s()
elif admin_choice
brea
== "3":
k ==
elif role
while
"user":
True:
print("\n--- User Menu ---")
user_choice == "1":
book_ticket(userna
elif
me)user_choice ==
cancel_ticket(userna
"2":
me)
elif user_choice ==
view_flight
"3":
s()user_choice ==
elif
brea
"4":
k ==
elif choice
print("Exiting system.
"3":
Goodbye!") break
if __name__ ==
main(
"__main__":
)
Mysql
code
-- Create Database
CREATE DATABASE
airline_management;
-- Use the
USE
Database
airline_management;
-- Create Users
Table TABLE
CREATE
users
user_id
( INT AUTO_INCREMENT
-- Create Flights
Table TABLE
CREATE
NULL, departure_time
-- Create Bookings
Table TABLE
CREATE
);
Outpu
t
SQL
tables
Bibliography
12
• Informatic Practices Sumita Arora Class
12