Project File Class 12
Project File Class 12
2024-2025
PROJECT ON
AIRLINES MANAGEMENT SYSTEM
1
ACKNOWLEDGEMENT
2
TABLE OF CONTENTS
S.NO. TOPICS PAGE.NO.
1. INTRODUCTIO 4
N
2. OBJECTIVE OF 5
PROJECT
System 6
3. Implementation
Hardware used
Software used
Theoretical 7
4. Background
What is Database?
What is MySQL?
What is python?
5. CODE 8
6. OUTPUT 18
7. REFERENCES
3
INTRODUCTION
4
OBJECTIVE OF PROJECT
The primary objective of the Airline Management
System is to develop an automated, efficient, and user-
friendly software solution to manage and streamline
various operations of an airline. The key objectives
include:
1. Automating Flight Management: To create a
system for efficient management of flight
schedules, availability, and updates.
2. Simplifying Ticket Booking: To provide a seamless
platform for passengers to search for flights, book
tickets, and make payments online.
3. Efficient Reservation System: To allow easy
management of reservations, cancellations, and
passenger details by the airline staff.
4. Customer Management: To maintain and organize
customer profiles, including personal information,
booking history, and preferences.
5. User-Friendly Interface: To design an intuitive
interface for both passengers and airline staff,
ensuring ease of use and improved customer
experience.
5
System Implementation
HARDWARE USED:
1. Intel(R) Core (TM) i5-6500 CPU @
3.20GHz 3.19 GHz
SOFTWARE USED:
1. Windows 10
2. IDLE Python 3.12.6
3. MYSQL 8.0
4. Microsoft® Word (version 2019)
6
Theoretical Background
WHAT IS DATABASE?
DBMS is a software to store and maintain data in
the form of tables. We can easily create, modify,
delete and view data from database. Examples:
Ms-Access, MySQL, SQLite, Microsoft SQL Server,
Oracle etc.
WHAT IS MYSQL?
In order to access data within the Oracle
database, all programs and users must use,
Structured Query Language (SQL). SQL is the set of
commands that is recognised by nearly all
RDBMDs.
WHAT IS PYTHON?
Python is a high-level language. It is a free and
open-source language. It is an interpreted
language, as Python programs are executed
by an interpreter
7
CODE
import datetime
8
f=1
else:
f=0
if f==1:
b=int(input('kindly enter the updated No. of available seats:'))
cr.execute('update flights set Avl_seats={} where
Flight_Id={}'.format(b,d))
c.commit()
cr.execute('select*from flights where Flight_Id={}'.format(d))
h=cr.fetchone()
upd.add_row(h)
print('here are the Updated details')
print(upd)
else:
print('Flight ID UnAvaialable')
elif p==2:
for j in data:
if j[1]==d:
f=1
else:
f=0
if f==1:
b=int(input('kindly enter the updated Price:'))
cr.execute('update flights set Price={} where Flight_Id={}'.format(b,d))
c.commit()
cr.execute('select*from flights where Flight_Id={}'.format(d))
h=cr.fetchone()
upd.add_row(h)
print('here are the Updated details')
print(upd)
else:
print('Flight ID UnAvaialable')
elif p==3:
for j in data:
if j[1]==d:
f=1
else:
f=0
if f==1:
b=input('kindly enter the updated Date and Time of Departure\nIn
format(yyyy-mm-dd hh:mm:ss):')
cr.execute('update flights set departure_time="{}" where
Flight_Id={}'.format(b,d))
9
c.commit()
cr.execute('select*from flights where Flight_Id={}'.format(d))
h=cr.fetchone()
upd.add_row(h)
print('here are the Updated details')
print(upd)
else:
print('Flight ID UnAvaialable')
g=input('wish to update more......(y/n)')
if g=='n':
break
def disp():
cr.execute('select*from flights')
global data
flights=PrettyTable()
flights.field_names=['Flight
Name','Flight_Id','Destination','St_point','avl_seats','Arrival_time','Price','Departure_time
']
data=cr.fetchall()
for i in data:
flights.add_row(i)
print(flights)
def sarch():
cr.execute('select*from Flights')
fl=PrettyTable()
fl.field_names=['Flight
Name','Flight_Id','Destination','St_point','avl_seats','Arrival_time','Price','Departure_time
']
f=0
lo=cr.fetchall()
while True:
print('How do you wish to search')
z=int(input('1.<Destination>\n2.<Price>\n3.<Date of Departure>("Work in Progress")\
n4.<Exit>\nEnter your choice:'))
if z==1:
while True:
k=input('Kindly enter the destination:')
for i in lo:
if i[2]==k:
f=1
break
else:
10
f=0
if f==1:
cr.execute("select*from flights where Destination='{}'".format(k))
b=cr.fetchone()
fl.add_row(b)
print(fl)
fl.del_row(0)
else:
print('Destination UnAvailable')
o=input('wish to search more using this option.......(y/n)')
if o=='n':
break
elif z==2:
while True:
y=int(input('Kindly enter the Lowest value for your price Range:'))
x=int(input('Kindly enter the highest value for your price Range:'))
f=0
for i in lo:
if i[6]>y and i[6]<x:
f=1
break
else:
f=0
if f==1:
cr.execute("select*from flights where Price between {} and
{}".format(y,x))
b=cr.fetchall()
for j in b:
fl.add_row(j)
print(fl)
fl.del_row(0)
else:
print('UnAvailable price range\nSorry :(')
v=input('wish to search more using this option.......(y/n)')
if v=='n':
break
elif z==3:
11
else:
f=0
if f==1:
cr.execute("select*from flights where departure_time='{}'".format(c))
b=cr.fetchall()
for v in b:
fl.add_row(v)
else:
print('Flight UnAvailable')
print(fl)
elif z==4:
break
def reg():
reg=PrettyTable()
reg.field_names=['Destination','Flight_Name','Flight_Id','St_Point','Avl_seats','Arrival_Time
','Price','Departure_time','Name','P_Id','Phone_No','Gender','Age']
cr.execute('select*from flights natural join passangers')
z=cr.fetchall()
for i in z:
reg.add_row(i)
print(reg)
import datetime
import mysql.connector as sql
from prettytable import PrettyTable
c=sql.connect(host='localhost',user='root',passwd='hillwoods',database='flight_management')
cr=c.cursor()
12
flights.add_row(i)
print(flights)
#2 to register
def insrt():
while True:
n=input('enter your name:')
i=int(input('enter your id:'))
a=int(input('enter your age:'))
g=input('enter your gender:')
global d
d=input('Where do you wish to fly to:')
p=input('enter your phone no.:')
f=0
cr.execute('select*from flights')
b=cr.fetchall()
for j in b:
if d==j[2]:
f=1
break
else:
f-0
if f==1:
cr.execute("insert into passangers values('{}',{},'{}','{}',
{},'{}')".format(n,i,p,g,a,d))
cr.execute("update flights set Avl_seats=Avl_seats-1 where
Destination='{}'".format(d))
passa=PrettyTable()
passa.field_names=['Destination','Flight_Name','Flight_Id','St_Point','Avl_seats','Arrival_Ti
me','Price','Departure_time','Name','P_Id','Phone_No','Gender','Age']
cr.execute('select*from flights natural join passangers where
passangers.Name="{}"'.format(n))
z=cr.fetchall()
for x in z:
print('Here are your flight details')
passa.add_row(x)
print(passa)
passa.del_row(0)
c.commit()
else:
print("Sorry:( but this flight isn't avaialable")
o=input('want to register more.....(yes/no)')
if o=='no':
print('>>>Your FLight Ticket has been succesfully booked<<<\nThank You for flying
with us:))')
break
13
#3 to cancel registration
def dele():
a=int(input('enter your Id:'))
cr.execute('select*from passangers')
f=0
lo=cr.fetchall()
for i in lo:
if i[1]==a:
f=1
break
else:
f=0
if f==1:
cr.execute("delete from passangers where P_Id={}".format(a))
c.commit()
print('Your flight tickets has been successfully canceled\nYour money will be soon
refunded\nThank you for contacting us :]')
else:
print('You are not registered!!')
if z==1:
while True:
k=input('Kindly enter the destination:')
for i in lo:
if i[2]==k:
f=1
break
else:
f=0
if f==1:
cr.execute("select*from flights where Destination='{}'".format(k))
b=cr.fetchone()
fl.add_row(b)
14
print(fl)
fl.del_row(0)
else:
print('Destination UnAvailable')
o=input('wish to search more using this option.......(y/n)')
if o=='n':
break
elif z==2:
while True:
y=int(input('Kindly enter the Lowest value for your price Range:'))
x=int(input('Kindly enter the highest value for your price Range:'))
f=0
for i in lo:
if i[6]>y and i[6]<x:
f=1
break
else:
f=0
if f==1:
cr.execute("select*from flights where Price between {} and
{}".format(y,x))
b=cr.fetchall()
for j in b:
fl.add_row(j)
print(fl)
fl.del_row(0)
else:
print('UnAvailable price range\nSorry :(')
v=input('wish to search more using this option.......(y/n)')
if v=='n':
break
elif z==3:
m=datetime.datetime(2024,y,k)
M=datetime.datetime(2024,Y,K)
for i in lo:
if i[7]>m and i[7]<M:
15
f=1
break
else:
f=0
if f==1:
cr.execute("select*from flights where departure_time between '{}' and
'{}'".format(m,M))
b=cr.fetchall()
for v in b:
fl.add_row(v)
else:
print('Flight UnAvailable')
print(fl)
elif z==4:
break
import datetime
import Admin
import user
while True:
print('welcome 0◡0\nHow Do you wish to enter')
a=int(input('1 : <Admin>\n2 : <User>\n3 : <Exit>\nEnter your choice:\n'))
if a==1:
ps=input('enter the Password:)')
if ps=='Gotham':
print('⁜===============================!Welcome Admin!
================================⁜')
print('=======================✧⪁Welcome To Gotham
Airlines⪄✧========================')
print('===============================✧Welcome
Admin✧================================')
print('================================================================================')
print(' »◔◡◔« ')
while True:
print('How do you wish to preceed:')
p=int(input('1 : <Add Flight Records>\n2 : <Display all Flight records>\
n3 : <Display all registrations>\n4 : <Search Flight Records>\n5 : <Update Flight Records>\
nEnter your choice:'))
print()
if p==1:
Admin.flight()
print()
16
elif p==2:
Admin.disp()
print()
elif p==3:
Admin.reg()
print()
elif p==4:
Admin.sarch()
print()
elif p==5:
Admin.upd()
print()
else:
print('Invalid Choice\n Please choose from above(i.e. from 1 to 5)')
print()
w=input('wish to continue.....(y/n)')
if w=='n':
break
else:
print('Wrong Password¬_¬\nYou are not the <Admin>')
print()
elif a==2:
print('⁜==============================================================================⁜')
print('=======================✧⪁Welcome To Gotham
Airlines⪄✧==========================')
print('==================(☞゚ヮ゚)☞✧Fly anywhere with Us✧☜(゚ヮ゚
☜)======================')
print('================================================================================')
print(' »◔◡◔« ')
while True:
print('How do you wish to preceed:')
k=int(input('1 : <Display all avaialable flights>\n2 : <Book a Flight Ticket>\
n3 : <Search the flight Records>\n4 : <Cancel Bookings>\n5 : <Exit>\nEnter your choice:'))
print()
if k==1:
user.disp()
print()
elif k==2:
user.insrt()
print()
elif k==3:
user.sarch()
print()
elif k==4:
user.dele()
17
print()
else:
print('Invalid Choice\n Please choose from above(i.e. from 1 to 4)')
print()
w=input('wish to continue.....(y/n)')
if w=='n':
break
elif a==3:
print('Thank you for flying with us OwO <3')
break
else:
print('Invalid Choice\nPlease choose from above(i.e. from 1 to 3)')
OUTPUT
18
19
20
21
REFERENCES
In order to work on this project titled-
AIRLINES MANAGEMENT SYSTEM, the
following books and sites are referred by us
during the various phases of development:
1. http://www.mysql.org/
2. http://www.python.org/
3. COMPUTER SCIENCE FOR CLASS XII
- by SUMITA ARORA
22