CS project
CS project
DATE: PRINCIPAL
INTERNAL EXTERNAL
DECLARATION
DATE: MEMBERS:1
2
e. Strong Community Support:
A large community of developers ensures plenty of tutorials,
forums, and documentation are available.
f. Versatile Applications:
From web development to AI, Python is used in virtually
every domain.
g. Rapid Development:
Its dynamic typing and interpreted nature allow for quick
testing and prototyping.
3
INTRODUCTION TO FLIGHT MANAGEMENT
SYSTEM
5
By simulating real-world airline operations, it helps users
understand the complexities of managing flights and
passengers effectively.
NEED OF FMS:
1. Minimized documentation and no duplication of records.
2. Reduced paper work.
3. Improved patient care
4. Better Administration Control
a. Core Features:
Flight creation and deletion (admin side)
Seat allocation and availability tracking
Passenger registration and ticket generation
Booking history and logs
b. Optional Add-ons:
Integration with payment gateways
Email/SMS alerts for booking confirmations
Real-time tracking using APIs
Graphical User Interface (GUI) with Tkinter or PyQt
c. Real-world Applications:
Training and simulations
Prototyping large-scale airline systems
Custom internal tools for travel agencies
d. Future Enhancements:
Cloud integration for remote access
AI-based suggestions for best travel options
9
HARDWARE AND SOFTWARE REQUIREMENTS
Hardware:
Minimum 4 GB RAM
Dual-core processor or higher
500 MB free storage
PC
Mobile phone
Software:
Python (3.x)
Text Editor or IDE (e.g., VS Code, PyCharm)
SQLite or MySQL (optional for database integration)
Python connector
Tkinter (for GUI if needed)
10
SOURCE CODE
def luggage():
print("What do you want to do?")
print("1. Add luggage")
print("2. Delete luggage")
x = int(input("Enter your choice: "))
if x == 1:
lname = input("Enter luggage type: ")
mycursor.execute("insert into luggage values(null,
'{}')".format(lname))
elif x == 2:
lid = int(input("Enter your luggage id: "))
mycursor.execute("delete from luggage where
luggage_id={}".format(lid))
else:
print("Please enter a valid option")
food()
obj.commit()
def food():
print("What do you want to do?")
print("1. Add new items")
print("2. Update price")
print("3. Delete items")
x = int(input("Enter your choice: "))
if x == 1:
fname = input("Enter food name: ")
fprice = int(input("Enter food price: "))
mycursor.execute("insert into food_items values(null, '{}',
{})".format(fname, fprice))
elif x == 2:
fid = int(input("Enter food id: "))
fprice = int(input("Enter new price: "))
mycursor.execute("update food_items set price={} where
sl_no={}".format(fprice, fid))
elif x == 3:
fid = int(input("Enter food id: "))
mycursor.execute("delete from food_items where
sl_no={}".format(fid))
else:
print("Please enter a valid option")
food()
obj.commit()
def classtype():
print("What do you want to do?")
print("1. Change the classtype name")
print("2. Change the price of classtype")
x = int(input("Enter your choice: "))
if x == 1:
oname = input("Enter old name: ")
nname = input("Enter new name: ")
mycursor.execute("update classtype set class_name='{}'
where class_name='{}'".format(nname, oname))
elif x == 2:
cname = input("Enter class name: ")
new_price = int(input("Enter new price: "))
mycursor.execute("update classtype set price={} where
class_name='{}'".format(new_price, cname))
else:
print("Please enter a valid option")
classtype()
obj.commit()
def fooditems():
print("\n\nTHE AVAILABLE FOODS ARE:\n")
mycursor.execute("select * from food_items")
x = mycursor.fetchall()
for i in x:
print("FOOD ID: ", i[0])
print("FOOD Name: ", i[1])
print("PRICE: ", i[2])
print("---------------------------")
def admin1():
print("************ WHAT'S YOUR TODAY'S GOAL?
****************")
print("1. Update details")
print("2. Show details")
print("3. Job approval")
x = int(input("Select your choice: "))
if x == 1:
print("1. Classtype")
print("2. Food")
print("3. Luggage")
x1 = int(input("Enter your choice: "))
if x1 == 1:
classtype()
elif x1 == 2:
food()
elif x1 == 3:
luggage()
else:
print("Please enter a valid option")
admin1()
elif x == 2:
print("1. Classtype")
print("2. Food")
print("3. Luggage")
print("4. Records")
y = int(input("From which table: "))
if y == 1:
mycursor.execute("select * from classtype")
elif y == 2:
mycursor.execute("select * from food_items")
elif y == 3:
mycursor.execute("select * from luggage")
elif y == 4:
mycursor.execute("select * from cust_details")
else:
print("Please enter a valid option")
admin1()
z = mycursor.fetchall()
for i in z:
print(i)
elif x == 3:
print("Job approval functionality not implemented yet.")
else:
print("Please enter a valid option")
admin1()
def admin():
while True:
sec = input("Enter the password: ")
if sec == "admin":
admin1()
break
else:
print("Your password is incorrect. Please try again.")
def record():
cid = int(input("Enter your customer id: "))
mycursor.execute("select * from cust_details where
cust_id={}".format(cid))
d = mycursor.fetchone()
if d:
print("YOUR DETAILS ARE HERE...........")
print("Customer ID: ", d[0])
print("Name: ", d[1])
print("Mobile Number: ", d[2])
else:
print("No record found.")
def ticketbooking():
cname = input("Enter your name: ")
cmob = int(input("Enter your mobile no: "))
fid = int(input("Enter flight id: "))
fname = input("Enter your flight name: ")
fcl = input("Enter your class: ")
dept = input("Enter departure place: ")
dest = input("Enter destination: ")
fday = input("Enter flight day: ")
ftime = input("Enter flight time: ")
fprice = int(input("Enter ticket rate: "))
mycursor.execute("insert into cust_details values(null, '{}',
{})".format(cname, cmob))
obj.commit()
def flightavailable():
print("\n\nTHE AVAILABLE FLIGHTS ARE:\n")
mycursor.execute("select * from flight_details")
x = mycursor.fetchall()
for i in x:
print("Flight ID: ", i[0])
print("Flight Name: ", i[1])
print("Departure: ", i[2])
print("Destination: ", i[3])
print("Take off Day: ", i[4])
print("Take off Time: ", i[5])
print("Business: ", i[6])
print("Middle: ", i[7])
print("Economic: ", i[8])
print("---------------------------")
def user():
while True:
print("************** MAY I HELP YOU?
*****************")
print("1. Flight details")
print("2. Food details")
print("3. Book ticket")
print("4. My details")
print("5. Exit")
x = int(input("Enter your choice: "))
if x == 1:
flightavailable()
elif x == 2:
fooditems()
elif x == 3:
ticketbooking()
elif x == 4:
record()
elif x == 5:
break
else:
print("Please choose a correct option")
def menu1():
print("**************** YOUR DESIGNATION?
*******************")
print("1. Admin")
print("2. User")
print("3. Exit")
x = int(input("Choose an option: "))
if x == 1:
admin()
elif x == 2:
user()
elif x == 3:
print("Exiting the system.")
else:
print("Please choose a correct option")
menu1()
menu1()
#mysql
23
Description and datas in table class_details:
24
Description and datas in table filght_details:
25
Description and datas in table luggage
OUTPUT SCREEN
Program Start
26
User Menu
27
Food Menu
Book Ticket
28
CONCLUSION
The Flight Management System developed using Python
and MySQL is a practical and efficient solution for
automating airline ticket booking and passenger
management. It provides a structured workflow for both
users and administrators.
This project helped demonstrate:
The power of Python as a front-end scripting language.
Real-world database operations using MySQL.
The importance of designing user-friendly menus and
interactive interfaces.
How modular programming helps in organizing complex
systems.
Through this project, students were able to gain:
Hands-on experience with MySQL integration.
Understanding of database CRUD operations (Create,
Read, Update, Delete).
Skills in creating real-time applications with login-based
access.
Insights into airline industry workflows such as
bookings, luggage, and food orders.
Moreover, the project can be enhanced further by:
Adding GUI using Tkinter or PyQt.
Integrating SMS/email ticket confirmations.
Adding payment gateway simulation.
Exporting tickets in PDF format.
29
BIBLIOGRAPHY
www.google.com
https://www.geeksforgeeks.org
https://www.w3schools.com/python/
30