CS-Project 123
CS-Project 123
Class : 12 C
ACKNOWLEDGEMENT
I take this opportunity to express my gratitude and respect to all those who
helped in the completion of this project and to my school for providing me
with this opportunity.
CONTENTS
S.N Topic Pg
o no.
1 INTRODUCTION 1
9 BIBLIOGRAPHY 26
INTRODUCTION
This project developed by my team provides a insight on the various
process that staff has to perform at an airport via their portal and how a
customer is able to book and track via the same portal.
OBJECTIVE AND SCOPE OF THE PROJECT
1. Hardware specifications:
HP-Laptop
Manufacturer: HP
Model: HP Pavillion Laptop 15-cx0xxx
Processor : Intel® Core™ i7-8300H CPU @ 2.3GHz
Installed Memory: 8192MB
System Type: Windows 11 Home 64-Bit
2. Software specifications:
Windows 11 Home
MySQL(8.0):
Spyder(Python 3.7)
Word(2016)
5. Con.close(): this method closes the cursor, resets all results, and
ensures that the object has no reference to its original connection
object.
MYSQL TABLES USED IN THIS PROJECT:
SOURCE CODE:
print('WELCOME TO DELHI AIRPORT ONLINE PORTAL')
import mysql.connector as ms
con=ms.connect(host='localhost',user='umed',passwd='1234',database='airport')
cur=con.cursor()
a=int(input('''
1 staff
2 customer
3 staff and airline details
select your choice(1/2) :'''))
if a==2:
b=int(input('''what do you want to do:
1 do a booking
2 track flight status
enter your choice: '''))
if b==1:
import mysql.connector as ms
con=ms.connect(host='localhost',user='umed',passwd='1234',database='airport')
cur=con.cursor()
b=input('enter your departure date')
c=input('departure airport')
d=input('enter arrival airport')
cur.execute('select * from flight_schedule as f,flightdate as t where
f.flight=t.flight and date like"%s"'%b)
data=cur.fetchall()
for i in data:
if i[1]==c:
if i[2]==d:
print('these are the available flight:')
print('flight: ',i[0])
print('departure: ',i[1])
print('arrival: ',i[2])
print('departure time: ',i[8])
print('arrival time: ',i[9])
print('flight id: ',i[10])
if i[4]!=0:
print('economy is available')
if i[5]!=0:
print('premium economy available')
if i[6]!=0:
print('bussiness available')
if i[7]!=0:
print('first available')
g=input('do you want to continue your booking(yes/no):')
if g=='yes':
h=int(input('enter your preffered flights flight id :'))
class2=int(input('''enter your prefered class:
1 economy
2 premium economy
3 bussiness
4 first'''))
if class2==1:
if i[4]==0:
print('flight doesnot have this seat')
elif i[4]!=0:
print('this is your final price after service charge=',i[4])
pay=input('do you want to continue to payment ')
if pay=='yes':
method=input('enter your prefered payment method
(card/cash)')
if method=='cash':
print('please vist the neasrest delhi airport office to pay
for yout flight within 48hours or the booking will be cancelled')
elif method=='card':
cardno=input('enter your card no:')
if len(cardno)==16:
cvv=int(input('enter cvv'))
exp=int(input('enter card exp date year(yyyy):'))
if exp>=2025:
mail=input('enter your mail')
print('thank you for your booking you will recive
the ticket in the mail')
else:
print('you card is not valid for payment')
else:
print('your card no is invalid please enter again')
else:
print('thankyou for visiting')
elif class2==2:
if i[5]==0:
print('flight doesnot have this seat')
elif i[5]!=0:
print('this is your final price after service charge=',i[5])
pay=input('do you want to continue to payment ')
if pay=='yes':
method=input('enter your prefered payment method
(card/cash)')
if method=='cash':
print('please vist the neasrest delhi airport office to pay for
yout flight within 48hours or the booking will be cancelled')
elif method=='card':
cardno=input('enter your card no:')
if len(cardno)==16:
cvv=int(input('enter cvv'))
exp=int(input('enter card exp date year(yyyy):'))
if exp>=2025:
mail=input('enter your mail')
print('thankyou for your booking you will recive the
ticket in the mail')
else:
print('you card is not valid for payment')
else:
print('your card no is invalid please enter again')
else:
print('thankyou for visiting')
elif class2==3:
if i[6]==0:
print('flight doesnot have this seat')
elif i[6]!=0:
print('this is your final price after service charge=',i[6])
pay=input('do you want to continue to payment ')
if pay=='yes':
method=input('enter your prefered payment method
(card/cash)')
if method=='cash':
print('please vist the neasrest delhi airport office to pay for
yout flight within 48hours or the booking will be cancelled')
elif method=='card':
cardno=input('enter your card no:')
if len(cardno)==16:
cvv=int(input('enter cvv'))
exp=int(input('enter card exp date year(yyyy):'))
if exp>=2025:
mail=input('enter your mail')
print('thankyou for your booking you will recive the
ticket in the mail')
else:
print('you card is not valid for payment')
else:
print('your card no is invalid please enter again')
else:
print('thankyou for visiting')
elif class2==4:
if i[7]==0:
print('flight doesnot have this seat')
elif i[7]!=0:
print('this is your final price after service charge=',i[7])
pay=input('do you want to continue to payment ')
if pay=='yes':
method=input('enter your prefered payment method
(card/cash)')
if method=='cash':
print('please vist the neasrest delhi airport office to pay for
yout flight within 48hours or the booking will be cancelled')
elif method=='card':
cardno=input('enter your card no:')
if len(cardno)==16:
cvv=int(input('enter cvv'))
exp=int(input('enter card exp date year(yyyy):'))
if exp>=2025:
mail=input('enter your mail')
print('thankyou for your booking you will recive the
ticket in the mail')
else:
print('you card is not valid for payment')
else:
print('your card no is invalid please enter again')
else:
print('thankyou for visiting')
elif b==2:
n=int(input('enter your flight slno :'))
cur.execute('select * from flight_schedule as f,flightdate as t where
f.flight=t.flight')
data=cur.fetchmany()
for i in data:
if i[3]==n:
print('flight',i[0])
print('departure airport:',i[1])
print('arrival airport',i[2])
print('slno:',i[3])
print('deprture time',i[8])
print('landing time',i[9])
print('flightid:',i[10])
print('flight date',i[12])
o=input('is this your flight yes/no')
if o=='yes':
print('thanks for using our service')
break
else:
print('flight not found')
break
if a==1:
while True:
p=int(input('''
enter your number with respect to your position in the staff :
1 ground staff (pssenger check in )
2 security staff (security check)
3 boarding(ground staff/cabin crew)
'''))
if p==1:
r=int(input('enter passenger id:'))
status=''
cur.execute('select*from passenger where passengerid=%s'%(r))
data=cur.fetchone()
name=data[7]
flightid=data[2]
passengerid=data[1]
if len(data)==0:
print('passenger details not found ')
elif len(data)!=0:
print('passenger details found ')
print('bookingid: ',data[0])
print('passengerid: ',data[1])
print('flight id: ',data[2])
print('seat number: ',data[3])
print('class: ',data[4])
print('booking date: ',data[5])
print('payment method: ',data[6])
print('name: ',data[7])
s=int(input('enter luggage weight:'))
if s<=30:
status='checked in '
print(status)
elif s>30:
print('weight is more than 30kg')
print('to carry this weight you need to pay extra')
print('your extra weight=',s-30)
payextra=input('do you want to pay extra')
if payextra=='yes':
extraweight=s-30
extrapayment=extraweight*40
print('you have to pay=',extrapayment)
input2=input('how would you like to pay (cash/card)')
if input2=='cash':
print('please vist the neasrest customer service to pay for your
excess weight ')
elif input2=='card':
while True:
cardno=input('enter your card no:')
if len(cardno)==16:
cvv=int(input('enter cvv'))
exp=int(input('enter card exp date year(yyyy):'))
if exp>=2025:
mail=input('enter your mail')
print('thankyou payment recived you may proceed')
break
else:
print('you card is not valid for payment')
else:
print('your card no is invalid please enter again')
elif payextra=='no':
print('please decrease your total weight')
elif p==2:
name2=input('enter passenger name: ')
cur.execute('select*from passenger where name="%s"'%(name2))
char=cur.fetchall()
pid=int(input('enter passenger id'))
for i in char:
if i[1]==pid:
print('imigration done ')
print('procede to security check')
carry_on_weight=int(input('enter the weight of carry on bag:'))
if carry_on_weight<=10:
print('security check completed ')
print('procede to the boarding gate')
elif carry_on_weight>10:
print('decrease your total weight or payextra')
print('your extra weight=',carry_on_weight-10)
payextra2=input('do you want to pay extra')
if payextra2=='yes':
extraweight2=carry_on_weight-10
extrapayment=extraweight*20
print('you have to pay=',extrapayment)
input2=input('how would you like to pay (cash/card):')
if input2=='cash':
print('please vist the neasrest customer service to pay for your
excess weight ')
elif input2=='card':
while True:
cardno=input('enter your card no:')
if len(cardno)==16:
cvv=int(input('enter cvv:'))
exp=int(input('enter card exp date year(yyyy):'))
if exp>=2025:
mail=input('enter your mail:')
print('thank you for your your payment is scuccesfull you
may proceed to boarding')
break
else:
print('you card is not valid for payment')
else:
print('your card no is invalid please enter again')
elif payextra2=='no':
print('please decrease your total weight')
elif p==3:
z=input('enter passenger name: ')
cur.execute('select*from passenger where name="%s"'%(z))
char=cur.fetchall()
pid=int(input('enter passenger id'))
for i in char:
if i[1]==pid:
print('boarding done ')
break
else:
print('passenger not found ')
break
break
if a==3:
chimp=int(input('''
1 staff details
2 mark attendence
3 airline details
who's details would you like to check : '''))
if chimp==1:
staff=cur.execute('select*from staff_details')
run=cur.fetchmany()
for i in run:
check=int(input('enter staff code:'))
if check==i[1]:
print('staff found')
print(i)
else:
print('staff not present . would you like to add new staff(yes/no)')
rule=input('enter your choice')
if rule=='yes':
name_new=input('enter name')
code_new=input('enter code as per position')
position_new=input('enter position')
cur.execute('select*from staff')
box=cur.fetchall()
print(box)
for i in box:
if code_new==i[0]:
print(i[0])
cur.execute('insert into staff_details values("%s",
%s)'%name_new,code_new)
con.commit()
cur.execute('insert into staff
values(%s,"%s")'%code_new,position_new)
con.commit()
print('new staff added')
else:
print('invalid code re-enter')
break
elif rule=='no':
break
elif chimp==2:
staff=cur.execute('select*from staff_details')
run2=cur.fetchmany()
id_code=int(input('enter your code'))
id_name=input('enter name')
for i in run2:
if i[0]==id_name and i[1]==id_code:
print('WELCOME attendence marked ')
else:
print('staff not found ')
elif chimp==3:
print('do you need details of specific flight companies')
done=input('enter your choice')
if done=='yes':
flightcode=int(input('enter company code'))
cur.execute('select* from flight')
flight=cur.fetchall()
found=0
for i in flight:
if flightcode==i[1]:
found=2
un=i[0]
cur.execute('select * from flight_schedule ')
company=cur.fetchall()
print('company:',i[0])
print('company code:',i[1])
companysch=input('do you want to see company flight schedule')
if companysch=='yes':
for i in company:
if i[0]==un:
print('company:',i[0],'departure:',i[1],'arival:',i[2],'slno:',i[3],'take off
time:',i[8],'landing time:',i[9],'flight id:',i[10])
print('departure:',i[1])
print('arival:',i[2])
print('slno:',i[3])
print('take off time:',i[8])
print('landing time:',i[9])
print('flight id:',i[10])
if found==0:
print('company details not found' )
1 staff
2 customer
3 staff and airline details
select your choice(1/2) :1
enter your number with respect to your position in the staff :
1 ground staff (pssenger check in )
2 security staff (security check)
3 boarding(ground staff/cabin crew)
1
enter passenger id:700
passenger details found
bookingid: 100
passengerid: 700
flight id: 737
seat number: 23
class: economy
booking date: 2024-05-12
payment method: credit card
name: rahul
enter luggage weight:35
weight is more than 30kg
to carry this weight you need to pay extra
your extra weight= 5
do you want to pay extra:yes
you have to pay= 200
how would you like to pay (cash/card):card
enter your card no:2345678902345678
enter cvv:234
enter card exp date year(yyyy):2029
enter your mail: umed.h@gmail.com
thankyou payment recived you may proceed
1 staff
2 customer
3 staff and airline details
select your choice(1/2) :1
1 staff
2 customer
3 staff and airline details
select your choice(1/2) :2
what do you want to do:
1 do a booking
2 track flight status
enter your choice: 1
enter your departure date2024-05-20
departure airportdelhi
enter arrival airportsharjha
these are the available flight:
flight: air arabia
departure: delhi
arrival: sharjha
departure time: 22:53:34
arrival time: 2:52:25
flight id: 747
economy is available
do you want to continue your booking(yes/no):yes
enter your preffered flights flight id :747
enter your prefered class:
1 economy
2 premium economy
3 bussiness
4 first1
this is your final price after service charge= 16500
do you want to continue to payment yes
enter your prefered payment method (card/cash)card
enter your card no:2345678902345678
enter cvv234
enter card exp date year(yyyy):2028
enter your mailumed.h@gmail.com
thank you for your booking you will recive the ticket in the mail
3. If a customer has to track his flight:
WELCOME TO DELHI AIRPORT ONLINE PORTAL
1 staff
2 customer
3 staff and airline details
select your choice(1/2) :2
what do you want to do:
1 do a booking
2 track flight status
enter your choice: 2
enter your flight slno :7
flight: air arabia
departure airport: delhi
arrival airport: sharjha
slno: 7
deprture time : 22:53:34
landing time : 2:52:25
flightid: 747
flight date: 2024-05-20
is this your flight yes/no:yes
thanks for using our service
4. If the administrator has to verify staff data
WELCOME TO DELHI AIRPORT ONLINE PORTAL
1 staff
2 customer
3 staff and airline details
select your choice(1/2) :3
1 staff details
2 mark attendence
3 airline details
who's details would you like to check : 1
enter staff code:234764
staff found
('pushkal', 234764)
1 staff
2 customer
3 staff and airline details
select your choice(1/2) :3
1 staff details
2 mark attendence
3 airline details
who's details would you like to check : 2
enter your code234764
enter namepushkal
WELCOME attendence marked
CONCLUSION AND FUTURESCOPE:
THANK YOU
BIBLIOGRAPHY:
www.python.org
www.wikipedia.org
www.google.com
https://dev.mysql.com/