0% found this document useful (0 votes)
7 views

shruti computer science project

This document is a project report by Shruti Punjabi on an 'Airline Reservation' system, completed as part of her Computer Science curriculum for the Central Board of Secondary Education. It includes sections on hardware and software used, an introduction to Python and MySQL, project details, flow charts, source code, and acknowledgments. The project aims to facilitate online flight ticket booking and management through a user-friendly interface.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

shruti computer science project

This document is a project report by Shruti Punjabi on an 'Airline Reservation' system, completed as part of her Computer Science curriculum for the Central Board of Secondary Education. It includes sections on hardware and software used, an introduction to Python and MySQL, project details, flow charts, source code, and acknowledgments. The project aims to facilitate online flight ticket booking and management through a user-friendly interface.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

NAME- SHRUTI PUNJABI

CLASS- XII
STREAM- SCIENCE
SUBJECT- COMPUTER SCIENCE(083)
REGISTRATION NO.- E221301180044
BOARD ROLL NO.-
TOPIC- AIRLINE RESERVATION
NERUL, NAVI MUMBAI

CERTIFICATE

This is to certify that this computer project ”Airline reservation” has been
completed by ‘Ms Shruti Punjabi’ of class XII Science in partial fulfillment
of the curriculum of the Central Board of Secondary Education leading to
the award of All India Senior School Certificate for the year 2020-21.

Registration No. :
Board Roll No:

__________________ __________________

External Examiner Internal Examiner

Date: Date:

__________________ ___________________

SCHOOL SEAL PRINCIPAL

Date:
DECLARATION
I hereby declare that the project
entitled “Airline reservation”
submitted to “Tilak public school” for
subject “computer science” under the
guidance of “Mrs Amrita Dutta” is a
record of original work done by us and
there is no copy or project related to it
has been submitted to any other
educational institution by us.
ACKNOWLEDGEMENT
I would like to express my special thanks of
gratitude to my teacher “ 'Mrs.Amrita' ” as
well as our principal “ Mrs.Prabhavathy
Ajith Kumar ” who gave me the golden
opportunity to do this wonderful project on
the topic
“ Airline reservation ” .

I would also like to thank my parents and


my project partner -“ Unnati dalal” who
helped me a lot in finalizing this project
within the limited time frame.

Finally, I would like to thank CBSE for


giving me an opportunity to do this project
and mam for giving me a suitable partner.
INDEX
SR.NO TOPIC PG NO.
1 HARDWARE AND
SOFTWARE USED
7-8
2 INTRODUCTION
TO PYTHON & MySQL
9-14
INTRODUCTION
3 TO PROJECT
15-17
4 FLOW CHART 18
5 FILE 19-20
STRUCTURE
6 SOURCE CODE 21-46
7 OUTPUT 47-52
8 LIMITATIONS AND
IMPROVEMENTS
53
9 CONCLUSION 54
10 BIBLIOGRAPHY 55
HARDWARE AND SOFTWARE USED
HARDWARE-
• LENOVO LAPTOP
• RAM- 4 GB
• PROCESSOR- INTEL(R) CORE i3-4030U CPU
• PRINTER
SOFTWARE-
• WINDOWS 8.1 SINGLE LANGUAGE
• PYTHON IDLE 3.8.1
• MY SQL WORKBENCH
• MICROSOFT OFFICE 2010
Introduction to python

Python is developed by Guido Van Rossum . He started


Implementing python in 1989. Python is a very simple
programming language so even if you are new in
programming ,you can learn python without facing any
issues.
Uses of python:-
1.Readable- it is easier to read by system as well as
programmer.
2. Easy to learn- it is a high level language.
3. Cross platform- can run on various systems as
mac,linux etc
4. Open source- It has an open source code which is
readable and available at free of cost

5. large standard library.


6. free of cost - python is available at free of cost.

7. supports exception handling.


8. Advanced features.

9. automatic memory management.


Applications of python.
1. Web development- web framework like django and
flask are based on python.
2. Machine learning.
3. Data analysis.
4. Scripting
5. Game development
6. Can develop embedded applications in python
7. Desktop applications.
Introduction to MySql

MySQL is an oracle backed open source relational database


management system (RDBMS) based in structured query
language(SQL). MYSQL runs on virtually all platforms,
including linux, UNIX and windows. Although it can be used
in a wide range of applications. MYSQL is most often
associated with web applications and online publishing

Features of MySQL server:-


1. It is secure

2. Easy to use

3. Client/server architecture

4. Free to download

5. It is scalable

6. High performance
7. High flexibility

8. Memory Efficiency

Python and MySQL connectivity


We can connect python to mySQL using mySQL
connector. Here python acts as a front end and mySQL
acts as a backend.

Code:-
import mysql.connector

mycon= mysql.connector.connect(user=’root’ ,
password=’password’, host=’localhost’)
Introduction to project
Online Airline Reservation System is a web
application that helps the commuters to book
flight tickets online.
In order to book the tickets, the commuter
has to either sign in if he/she is already a
member or register themselves in order to
book flights.
While booking, the user has to select the
type of airlines he/she will be travelling. This
can be done by viewing the flights and
choosing the one through which they want to
be travelled.
He/she has to fill up the details of their
reservation in the reservation option. A
message box will appear after the reservation is
successful.
Payment option will open up to pay the
ticket fare via online transaction(credit cards)
The System will provide notice related to flight
to the passengers through their provided mail
and phone number.
If in case commuters want to cancel their
reservation it can be done through the cancel
reservation option. A message box will appear
of cancel reservation being successful and
payment will be refundable.

Advantages
1. User gets notice regarding flight
which will help him during booking.
2. User can select the type of airlines he
wants to travel.
3. User can wherever and whenever
book and cancel the reservations.
4. User can easily login and register
without any notices and complications
Flow chart

Start

no yes

Register An account? Sign in

Sign in

View flights Reservation

Cancel Sucessful but want to cancel

reservation payment

Sucessful

End Reserve
File structures
Modules used.
1.Tkinter module- Tkinter is the standard GUI library for
python. Python when combined with tkinter provides a
fast and easy way to create GUI applications. Tkinter
provides a powerful object oriented interface to the TK
GUI toolkit
2.Mysql connector- It is used to connect python to mysql
where python act as frontend and sql as backend.
3. PIL –python imaging library is a free and open source
additional library for the python programming that adds
support for opening ,manipulating and saving many
different image file formats.
List of Functions
FUNCTIONS USES OF FUNCTIONS

1.checksignin() For signing in the


account
2.newuser() Add details of new user

3.Adduser() To add a newuser

4.booking1() Booking the tickets

5. view() View the flights

6. delete() To cancel reservation

7.payment() To do the payment of


ticket
Source code
1.Menu code
from tkinter import *

from PIL import ImageTk,Image

import mysql.connector as pymysql

from tkinter import messagebox

def main1():

main1

def newuser1():

newuser1

def delete():

delete

def View1():

View1

def booking1():

booking1

root = Tk()

root.title("Airline")

root.minsize(width=400,height=400)

root.geometry("2880x1800")

# Add your own database name and password here to reflect in the code

mypass = "abcdef"

mydatabase="library"
con
=pymysql.connect(host="localhost",user="root",password="root",database="project")

con1=
pymysql.connect(host="localhost",user="root",password="root",database="project1")

con2 =
pymysql.connect(host="localhost",user="root",password="root",database="project2")

con3 =
pymysql.connect(host="localhost",user="root",password="root",database="project3")

cur = con.cursor()

cur1 = con1.cursor()

cur2 = con2.cursor()

cur3 = con3.cursor()

# Take n greater than 0.25 and less than 5

same=True

n=0.5

# Adding a background image

background_image =Image.open("C:/Users/RUPAM/Documents/1287373.jpg")

[imageSizeWidth, imageSizeHeight] = background_image.size

newImageSizeWidth = int(imageSizeWidth*n)

if same:

newImageSizeHeight = int(imageSizeHeight*n)

else:

newImageSizeHeight = int(imageSizeHeight/n)

background_image =
background_image.resize((newImageSizeWidth,newImageSizeHeight),Image.ANTIALIAS)

img = ImageTk.PhotoImage(background_image)

Canvas1 = Canvas(root)
Canvas1.create_image(650,340,image = img)

Canvas1.config(bg="white",width = newImageSizeWidth, height = newImageSizeHeight)

Canvas1.pack(expand=True,fill=BOTH)

headingFrame1 = Frame(root,bg="indian red",bd=10,relief=RAISED)

headingFrame1.place(relx=0.2,rely=0.1,relwidth=0.6,relheight=0.16)

headingLabel = Label(headingFrame1, text="Welcome to\n AIRLINES ", bg='indian red',


fg='black', font=('Gabriola',20,"bold"))

headingLabel.place(relx=0,rely=0, relwidth=1, relheight=1)

btn1 = Button(root,text="Sign in",bg='misty rose4',


fg='white',font=('Gabriola',15,"bold"),bd=8,relief=RAISED, command = main1)

btn1.place(relx=0.28,rely=0.3 , relwidth=0.45,relheight=0.1)

btn2 = Button(root,text="Add newuser",bg='misty rose4',


fg='white',font=('Gabriola',15,"bold"),bd=8,relief=RAISED, command=newuser1)

btn2.place(relx=0.28,rely=0.4, relwidth=0.45,relheight=0.1)

btn3= Button(root,text="cancel reservation",bg='misty rose4',


fg='white',font=('Gabriola',15,"bold"),bd=8,relief=RAISED, command=delete)

btn3.place(relx=0.28,rely=0.5, relwidth=0.45,relheight=0.1)

btn4 = Button(root,text="View Flights",bg='misty rose4',


fg='white',font=('Gabriola',15,"bold"),bd=8,relief=RAISED, command=View1)

btn4.place(relx=0.28,rely=0.6, relwidth=0.45,relheight=0.1)

btn5 = Button(root,text="Reservation",bg='misty rose4',


fg='white',font=('Gabriola',15,"bold"),bd=8,relief=RAISED, command = booking1)

btn5.place(relx=0.28,rely=0.7, relwidth=0.45,relheight=0.1)

root.mainloop()
2.sign in code
from tkinter import *

from PIL import ImageTk,Image

from tkinter import messagebox

import mysql.connector as pymysql

# Add your own database name and password here to reflect in the code

#mypass = "abcdef"

#mydatabase="library"

con =
pymysql.connect(host="localhost",user="root",password="root",database="project")

cur = con.cursor()

# Enter Table Names here

signinTable = "signin" #signin Table

def checksignin():

uname = userName.get()

pwd = password.get()

signinSql = "select username,password from "+signinTable+" where username =


'"+uname+"' and password = '"+pwd+"'"

cur.execute(signinSql)

count=cur.rowcount

if count>0:

messagebox.showinfo('Success',"You have logged in Successfully")

root.destroy()

library()

else:
messagebox.showinfo('Failure',"Please check User Name and Password")

root = Tk()

root.title("Sign in")

root.minsize(width=400,height=400)

root.geometry("2880x1800")

# Take n greater than 0.25 and less than 5

same=True

n=0.5

# Adding a background image

background_image =Image.open("C:/Users/RUPAM/Documents/1287373.jpg")

[imageSizeWidth, imageSizeHeight] = background_image.size

newImageSizeWidth = int(imageSizeWidth*n)

if same:

newImageSizeHeight = int(imageSizeHeight*n)

else:

newImageSizeHeight = int(imageSizeHeight/n)

background_image =
background_image.resize((newImageSizeWidth,newImageSizeHeight),Image.ANTIALIAS)

img = ImageTk.PhotoImage(background_image)

Canvas1 = Canvas(root)

Canvas1.create_image(650,340,image = img)

Canvas1.config(bg="white",width = newImageSizeWidth, height = newImageSizeHeight)

Canvas1.pack(expand=True,fill=BOTH)

headingFrame1 = Frame(root,bd=10, bg='indian red',relief=RAISED)

headingFrame1.place(relx=0.35,rely=0.1,relwidth=0.2,relheight=0.10)
headingLabel = Label(headingFrame1, text="SIGN IN", bg='indian red', fg='black',
font=('Gabriola',15,"bold"))

headingLabel.place(relx=0,rely=0, relwidth=1, relheight=1)

labelFrame = Frame(root, bg="misty rose4",bd=10,relief=RAISED, cursor="Target")

labelFrame.place(relx=0.2,rely=0.5,relwidth=0.5,relheight=0.3)

# Enter User Name

lb1 = Label(labelFrame,text="user name : ", bg='misty rose4',


fg='white',font=('Gabriola',20,"bold"))

lb1.place(relx=0.05,rely=0.2, relheight=0.08)

userName = Entry(labelFrame)

userName.place(relx=0.3,rely=0.2, relwidth=0.62, relheight=0.08)

lb2 = Label(labelFrame,text="Password : ",bg='misty rose4',


fg='white',font=('Gabriola',20,"bold"))

lb2.place(relx=0.05,rely=0.35, relheight=0.08)

password = Entry(labelFrame)

password.place(relx=0.3,rely=0.35, relwidth=0.62, relheight=0.08)

#Submit Button

SubmitBtn = Button(root,text="SUBMIT",bg='indian red',


fg='black',font=('Gabriola',15,"bold"),bd=10,relief=RAISED,command=checksignin)

SubmitBtn.place(relx=0.28,rely=0.9, relwidth=0.18,relheight=0.08)

quitBtn = Button(root,text="Quit",bg='indian red',


fg='black',font=('Gabriola',15,"bold"),bd=10,relief=RAISED, command=root.destroy)

quitBtn.place(relx=0.53,rely=0.9, relwidth=0.18,relheight=0.08)

root.mainloop()
3.Add new user code
from tkinter import *

#from main1 import *

from PIL import ImageTk,Image

from tkinter import messagebox

import mysql.connector as pymysql

def newuser():

Fname = userInfo1.get()

Lname = userInfo2.get()

ContactNo = userInfo3.get()

Address= userInfo4.get()

Dob = userInfo5.get()

Email= userInfo6.get

#Email = Email.lower()

insertuser = "insert into "+newuserTable+"


values('"+Fname+"','"+Lname+"','"+ContactNo+"','"+Address+"','"+Dob+"','"+Email+"')"

try:

cur.execute(insertuser)

con.commit()

messagebox.showinfo('Congratulations',"Newuser added successfully")

except:

messagebox.showinfo("Error","Can't add data into Database")

print(Fname)

print(Lname)

print(ContactNo)
print(Address)

print(Dob)

print(Email)

root.destroy()

#def adduser():

#global
userInfo1,userInfo2,userInfo3,userInfo4,userInfo5,userInfo6,Canvas1,con,cur,newuserTabl
e,root

root = Tk()

root.title("Airline")

root.minsize(width=400,height=400)

root.geometry("600x500")

#mypass = "root"

#mydatabase="project1"

con =
pymysql.connect(host="localhost",user="root",password="root",database="project1")

cur = con.cursor()

# Enter Table Names here

newuserTable = "newuser" # newuser Table

#Canvas1 = Canvas(root)

# Take n greater than 0.25 and less than 5

same=True

n=0.5

# Adding a background image

background_image =Image.open("C:/Users/RUPAM/Documents/1287373.jpg")

[imageSizeWidth, imageSizeHeight] = background_image.size


newImageSizeWidth = int(imageSizeWidth*n)

if same:

newImageSizeHeight = int(imageSizeHeight*n)

else:

newImageSizeHeight = int(imageSizeHeight/n)

background_image =
background_image.resize((newImageSizeWidth,newImageSizeHeight),Image.ANTIALIAS)

img = ImageTk.PhotoImage(background_image)

Canvas1 = Canvas(root)

Canvas1.create_image(650,340,image = img)

Canvas1.config(bg="white",width = newImageSizeWidth, height = newImageSizeHeight)

Canvas1.pack(expand=True,fill=BOTH)

newuserTable= "newuser" # Book Table

Canvas1 = Canvas(root)

Canvas1.config(bg="#ff6e40")

Canvas1.pack(expand=True,fill=BOTH)

headingFrame1 = Frame(root,bg="#FFBB00",bd=5)

headingFrame1.place(relx=0.25,rely=0.1,relwidth=0.5,relheight=0.13)

headingLabel = Label(headingFrame1, text="New User", bg='black', fg='white',


font=('Courier',15))

headingLabel.place(relx=0,rely=0, relwidth=1, relheight=1)

labelFrame = Frame(root,bg='black')

labelFrame.place(relx=0.1,rely=0.4,relwidth=0.8,relheight=0.5)

# Fname

lb1 = Label(labelFrame,text="First Name : ", bg='black', fg='white')

lb1.place(relx=0.05,rely=0.2, relheight=0.06)
userInfo1 = Entry(labelFrame)

userInfo1.place(relx=0.3,rely=0.2, relwidth=0.62, relheight=0.08)

# Lname

lb2 = Label(labelFrame,text="Last Name : ", bg='black', fg='white')

lb2.place(relx=0.05,rely=0.35, relheight=0.06)

userInfo2 = Entry(labelFrame)

userInfo2.place(relx=0.3,rely=0.35, relwidth=0.62, relheight=0.08)

# ContactNo

lb3 = Label(labelFrame,text="Contact no. : ", bg='black', fg='white')

lb3.place(relx=0.05,rely=0.50, relheight=0.06)

userInfo3 = Entry(labelFrame)

userInfo3.place(relx=0.3,rely=0.50, relwidth=0.62, relheight=0.08)

# Address

lb4 = Label(labelFrame,text="Address : ", bg='black', fg='white')

lb4.place(relx=0.05,rely=0.65, relheight=0.06)

userInfo4 = Entry(labelFrame)

userInfo4.place(relx=0.3,rely=0.65, relwidth=0.62, relheight=0.08)

# Dob

lb5 = Label(labelFrame,text="DOB : ", bg='black', fg='white')

lb5.place(relx=0.05,rely=0.80, relheight=0.06)

userInfo5 = Entry(labelFrame)

userInfo5.place(relx=0.3,rely=0.80, relwidth=0.62, relheight=0.08)

# email

lb6 = Label(labelFrame,text="Email_id : ", bg='black', fg='white')

lb6.place(relx=0.05,rely=0.95, relheight=0.04)
userInfo6 = Entry(labelFrame)

userInfo6.place(relx=0.3,rely=0.95, relwidth=0.62, relheight=0.08)

#Submit Button

SubmitBtn = Button(root,text="SUBMIT",bg='#d1ccc0', fg='black',command=newuser)

SubmitBtn.place(relx=0.28,rely=0.95, relwidth=0.18,relheight=0.04)

quitBtn = Button(root,text="Quit",bg='#f7f1e3', fg='black', command=root.destroy)

quitBtn.place(relx=0.53,rely=0.95, relwidth=0.18,relheight=0.04)

root.mainloop()

4.View flights code


from tkinter import *

from PIL import ImageTk,Image

from tkinter import messagebox

import mysql.connector as pymysql

# Add your own database name and password here to reflect in the code

con =
pymysql.connect(host="localhost",user="root",password="root",database="project3")

cur = con.cursor()

# Enter Table Names here

#reservationTable = "reservation"

#def View():

root = Tk()

root.title("reservation")

root.minsize(width=400,height=400)
root.geometry("2880x1800")

# Take n greater than 0.25 and less than 5

same=True

n=0.5

# Adding a background image

background_image =Image.open("C:/Users/RUPAM/Documents/1287373.jpg")

[imageSizeWidth, imageSizeHeight] = background_image.size

newImageSizeWidth = int(imageSizeWidth*n)

if same:

newImageSizeHeight = int(imageSizeHeight*n)

else:

newImageSizeHeight = int(imageSizeHeight/n)

background_image =
background_image.resize((newImageSizeWidth,newImageSizeHeight),Image.ANTIALIAS)

img = ImageTk.PhotoImage(background_image)

Canvas1 = Canvas(root)

Canvas1.create_image(650,340,image = img)

Canvas1.config(bg="white",width = newImageSizeWidth, height = newImageSizeHeight)

Canvas1.pack(expand=True,fill=BOTH)

Canvas1 = Canvas(root)

Canvas1.config(bg="#12a4d9")

Canvas1.pack(expand=True,fill=BOTH)

headingFrame1 = Frame(root, bd=10,bg='indian red',relief=RAISED)

headingFrame1.place(relx=0.25,rely=0.1,relwidth=0.5,relheight=0.13)

headingLabel = Label(headingFrame1, text="Flights", bg='indian red', fg='black',


font=('Gabriola',25,"bold"))
headingLabel.place(relx=0,rely=0, relwidth=1, relheight=1)

labelFrame = Frame(root,bg='misty rose4',bd=10,relief=RAISED)

labelFrame.place(relx=0.1,rely=0.3,relwidth=0.8,relheight=0.5)

y = 0.25

Label(labelFrame, text="%-30s%-40s%-30s%-30s%-30s%-
40s"%('boarding','destination','day','time','fare','class'),bg='misty
rose4',fg='white',font=('Gabriola',15,"bold")).place(relx=0.07,rely=0.1)

Label(labelFrame, text="--------------------------------------------------------------------------------------
----------------------------------------------------------------------",bg='misty
rose4',fg='black').place(relx=0.05,rely=0.2)

#getBooks = "select * from reservation"

try:

cur.execute("select * from reservation")

#print(cur.fetchall())

for i in cur:

Label(labelFrame, text="%-30s%-40s%-30s%-30s%-30s%-
40s"%(i[0],i[1],i[2],i[3],i[4],i[5]),bg='misty
rose4',fg='white',font=('Gabriola',15,"bold")).place(relx=0.07,rely=y)

y+=0.1

cur.fetchone()

messagebox.showinfo("fetched all files")

except:

messagebox.showinfo("Failed to fetch files from database")

quitBtn = Button(root,text="Back",bg='indian
red',bd=10,fg='black',font=('Gabriola',13,"bold"),relief=RAISED, command=root.destroy)

quitBtn.place(relx=0.4,rely=0.9, relwidth=0.18,relheight=0.08)

root.mainloop()
5.reservation code
from tkinter import*

from PIL import ImageTk,Image

from tkinter import messagebox

import mysql.connector as pymysql

con =
pymysql.connect(host="localhost",user="root",password="root",database="project3")

cur = con.cursor()

BookingTable = "booking"

def booking():

global issueBtn,labelFrame,lb1,inf1,inf2,inf3,inf4,inf5,inf6,quitBtn,root,Canvas1

boarding = inf1.get()

destination = inf2.get()

day=inf3.get()

time=inf4.get()

fare=inf5.get()

Class=inf6.get()

issueBtn.destroy()

labelFrame.destroy()

lb1.destroy()

inf1.destroy()

inf2.destroy()

inf3.destroy()

inf4.destroy()

inf5.destroy()
inf6.destroy()

bookSql = "insert into "+BookingTable+" values


('"+boarding+"','"+destination+"','"+Class+"','"+day+"','"+time+"','"+fare+"')"

show = "select * from "+BookingTable

#cur.execute(updateStatus)

con.commit()

messagebox.showinfo('success',"welcome to airlines" )

root.destroy()#BookingTable = "booking"

root = Tk()

root.title("booking")

root.minsize(width=400,height=400)

root.geometry("2880x1800")

# Take n greater than 0.25 and less than 5

same=True

n=0.5

# Adding a background image

background_image =Image.open("C:/Users/RUPAM/Documents/1287373.jpg")

[imageSizeWidth, imageSizeHeight] = background_image.size

newImageSizeWidth = int(imageSizeWidth*n)

if same:

newImageSizeHeight = int(imageSizeHeight*n)

else:

newImageSizeHeight = int(imageSizeHeight/n)

background_image =
background_image.resize((newImageSizeWidth,newImageSizeHeight),Image.ANTIALIAS)

img = ImageTk.PhotoImage(background_image)
Canvas1 = Canvas(root)

Canvas1.create_image(650,340,image = img)

Canvas1.config(bg="white",width = newImageSizeWidth, height = newImageSizeHeight)

Canvas1.pack(expand=True,fill=BOTH)

Canvas1 = Canvas(root)

Canvas1.config(bg="#D6ED17")

Canvas1.pack(expand=True,fill=BOTH)

headingFrame1 = Frame(root,bg="indian red",bd=10,relief=RAISED)

headingFrame1.place(relx=0.25,rely=0.1,relwidth=0.5,relheight=0.13)

headingLabel = Label(headingFrame1, text="reservation", bg='indian red', fg='black',


font=('Gabriola',27,"bold"))

headingLabel.place(relx=0,rely=0, relwidth=1, relheight=1)

labelFrame = Frame(root,bg='misty rose4',bd=10,relief=RAISED,cursor="target")

labelFrame.place(relx=0.1,rely=0.3,relwidth=0.8,relheight=0.5)

# Book ID

lb1 = Label(labelFrame,text="Boarding : ", bg='misty rose4',


fg='white',font=('Gabriola',15,"bold"))

lb1.place(relx=0.05,rely=0.2)

inf1 = Entry(labelFrame)

inf1.place(relx=0.3,rely=0.2, relwidth=0.62)

# Issued To Student name

lb2 = Label(labelFrame,text="Destination : ", bg='misty rose4',


fg='white',font=('Gabriola',15,"bold"))

lb2.place(relx=0.05,rely=0.3)

inf2 = Entry(labelFrame)

inf2.place(relx=0.3,rely=0.3, relwidth=0.62
# Issued To Student name

lb3 = Label(labelFrame,text="Class : ", bg='misty rose4',


fg='white',font=('Gabriola',15,"bold"))

lb3.place(relx=0.05,rely=0.4)

inf3 = Entry(labelFrame)

inf3.place(relx=0.3,rely=0.4, relwidth=0.62)

# Issued To Student name

lb4 = Label(labelFrame,text="Day : ", bg='misty rose4',


fg='white',font=('Gabriola',15,"bold"))

lb4.place(relx=0.05,rely=0.5)

inf4 = Entry(labelFrame)

inf4.place(relx=0.3,rely=0.5, relwidth=0.62)

# Issued To Student name

lb5 = Label(labelFrame,text="Time : ", bg='misty rose4',


fg='white',font=('Gabriola',15,"bold"))

lb5.place(relx=0.05,rely=0.6)

inf5 = Entry(labelFrame)

inf5.place(relx=0.3,rely=0.6, relwidth=0.62)

# Issued To Student name

lb6 = Label(labelFrame,text="fare : ", bg='misty rose4',


fg='white',font=('Gabriola',15,"bold"))

lb6.place(relx=0.05,rely=0.7)

inf6 = Entry(labelFrame)

inf6.place(relx=0.3,rely=0.7, relwidth=0.62)

#Issue Button

issueBtn = Button(root,text="insert",bg='indian red',bd=10,


fg='black',font=('Gabriola',20,"bold"),relief=RAISED,command=booking)
issueBtn.place(relx=0.28,rely=0.9, relwidth=0.18,relheight=0.08)

quitBtn = Button(root,text="Quit",bg='indian red',bd=10,


fg='black',font=('Gabriola',20,"bold"),relief=RAISED, command=root.destroy)

quitBtn.place(relx=0.53,rely=0.9, relwidth=0.18,relheight=0.08)

root.mainloop()

6.payment code
from tkinter import*

from PIL import ImageTk,Image

from tkinter import messagebox

import mysql.connector as pymysql

con =
pymysql.connect(host="localhost",user="root",password="root",database="project1")

cur = con.cursor()

paymentTable = "payment"

def payment():

global issueBtn,labelFrame,lb1,inf1,inf2,inf3,inf4,inf5,quitBtn,root,Canvas1

code = inf1.get()

cvv = inf2.get()

expiry_date=inf3.get()

password=inf4.get()

fare=inf5.get()

#Class=inf6.get()

issueBtn.destroy()

labelFrame.destroy()
lb1.destroy()

inf1.destroy()

inf2.destroy()

inf3.destroy()

inf4.destroy()

inf5.destroy()

#inf6.destroy()

bookSql = "insert into "+paymentTable+" values


('"+code+"','"+cvv+"','"+expiry_date+"','"+password+"','"+fare+"')"

show = "select * from "+paymentTable

#cur.execute(updateStatus)

con.commit()

messagebox.showinfo('success',"payment successful" )

root.destroy()

#BookingTable = "payment"

root = Tk()

root.title("payment")

root.minsize(width=400,height=400)

root.geometry("2880x1800")

# Take n greater than 0.25 and less than 5

same=True

n=0.5

# Adding a background image

background_image =Image.open("C:/Users/RUPAM/Documents/1287373.jpg")

[imageSizeWidth, imageSizeHeight] = background_image.size


newImageSizeWidth = int(imageSizeWidth*n)

if same:

newImageSizeHeight = int(imageSizeHeight*n)

else:

newImageSizeHeight = int(imageSizeHeight/n)

background_image =
background_image.resize((newImageSizeWidth,newImageSizeHeight),Image.ANTIALIAS)

img = ImageTk.PhotoImage(background_image)

Canvas1 = Canvas(root)

Canvas1.create_image(650,340,image = img)

Canvas1.config(bg="white",width = newImageSizeWidth, height = newImageSizeHeight)

Canvas1.pack(expand=True,fill=BOTH)

Canvas1 = Canvas(root)

Canvas1.config(bg="#D6ED17")

Canvas1.pack(expand=True,fill=BOTH)

headingFrame1 = Frame(root,bg="indian red",bd=10,relief=RAISED)

headingFrame1.place(relx=0.25,rely=0.1,relwidth=0.5,relheight=0.13)

headingLabel = Label(headingFrame1, text="Payment", bg='indian red', fg='black',


font=('Gabriola',27,"bold"))

headingLabel.place(relx=0,rely=0, relwidth=1, relheight=1)

labelFrame = Frame(root,bg='misty rose4',bd=10,relief=RAISED,cursor="target")

labelFrame.place(relx=0.25,rely=0.3,relwidth=0.5,relheight=0.4)

# code

lb1 = Label(labelFrame,text="code : ", bg='misty rose4',


fg='white',font=('Gabriola',18,"bold"))

lb1.place(relx=0.05,rely=0.1)
inf1 = Entry(labelFrame)

inf1.place(relx=0.15,rely=0.2, relwidth=0.25)

# Issued To Student name

lb2 = Label(labelFrame,text="cvv : ", bg='misty rose4',


fg='white',font=('Gabriola',18,"bold"))

lb2.place(relx=0.65,rely=0.15)

inf2 = Entry(labelFrame)

inf2.place(relx=0.75,rely=0.2, relwidth=0.09)

# Issued To Student name

lb3 = Label(labelFrame,text="expiry date : ", bg='misty rose4',


fg='white',font=('Gabriola',18,"bold"))

lb3.place(relx=0.05,rely=0.39)

inf3 = Entry(labelFrame)

inf3.place(relx=0.25,rely=0.45, relwidth=0.12)

# Issued To Student name

lb4 = Label(labelFrame,text="password : ", bg='misty rose4',


fg='white',font=('Gabriola',18,"bold"))

lb4.place(relx=0.65,rely=0.39)

inf4 = Entry(labelFrame)

inf4.place(relx=0.8,rely=0.45, relwidth=0.09)

# Issued To Student name

lb5 = Label(labelFrame,text="fare: ", bg='misty rose4',


fg='white',font=('Gabriola',18,"bold"))

lb5.place(relx=0.05,rely=0.6)

inf5 = Entry(labelFrame)

inf5.place(relx=0.2,rely=0.65, relwidth=0.09)

# Issued To Student name #


lb6 = Label(labelFrame,text="fare : ", bg='misty rose4',
fg='white',font=('Gabriola',15,"bold"))

#lb6.place(relx=0.05,rely=0.7)

#inf6 = Entry(labelFrame)

#inf6.place(relx=0.3,rely=0.7, relwidth=0.62)

#Issue Button

issueBtn = Button(root,text="Pay",bg='indian red',bd=10,


fg='black',font=('Gabriola',20,"bold"),relief=RAISED,command=payment)

issueBtn.place(relx=0.28,rely=0.9, relwidth=0.18,relheight=0.08)

quitBtn = Button(root,text="Quit",bg='indian red',bd=10,


fg='black',font=('Gabriola',20,"bold"),relief=RAISED, command=root.destroy)

quitBtn.place(relx=0.53,rely=0.9, relwidth=0.18,relheight=0.08)

root.mainloop()

7.cancel reservation code


from tkinter import*

from PIL import ImageTk,Image

from tkinter import messagebox

import mysql.connector as pymysql

con =
pymysql.connect(host="localhost",user="root",password="root",database="project3")

cur = con.cursor()

BookingTable = "booking"

def booking():

global issueBtn,labelFrame,lb1,inf1,inf2,inf3,inf4,inf5,inf6,quitBtn,root,Canvas1

boarding = inf1.get()

destination = inf2.get()
day=inf3.get()

time=inf4.get()

fare=inf5.get()

Class=inf6.get()

issueBtn.destroy()

labelFrame.destroy()

lb1.destroy()

inf1.destroy()

inf2.destroy()

inf3.destroy()

inf4.destroy()

inf5.destroy()

inf6.destroy()

bookSql = "insert into "+BookingTable+"


values'"+boarding+"','"+destination+"','"+Class+"','"+day+"','"+time+"','"+fare+"')"

show = "select * from "+BookingTable

#cur.execute(updateStatus)

con.commit()

messagebox.showinfo('CANCEL',"are you sure you want to cancel?")

root.destroy()

#BookingTable = "booking"

root = Tk()

root.title("booking")

root.minsize(width=400,height=400)

root.geometry("2880x1800")
# Take n greater than 0.25 and less than 5

same=True

n=0.5

# Adding a background image

background_image =Image.open("C:/Users/RUPAM/Documents/1287373.jpg")

[imageSizeWidth, imageSizeHeight] = background_image.size

newImageSizeWidth = int(imageSizeWidth*n)

if same:

newImageSizeHeight = int(imageSizeHeight*n)

else:

newImageSizeHeight = int(imageSizeHeight/n)

background_image =
background_image.resize((newImageSizeWidth,newImageSizeHeight),Image.ANTIALIAS)

img = ImageTk.PhotoImage(background_image)

Canvas1 = Canvas(root)

Canvas1.create_image(650,340,image = img)

Canvas1.config(bg="white",width = newImageSizeWidth, height = newImageSizeHeight)

Canvas1.pack(expand=True,fill=BOTH)

Canvas1 = Canvas(root)

Canvas1.config(bg="#D6ED17")

Canvas1.pack(expand=True,fill=BOTH)

headingFrame1 = Frame(root,bg="indian red",bd=10,relief=RAISED)

headingFrame1.place(relx=0.25,rely=0.1,relwidth=0.5,relheight=0.13)

headingLabel = Label(headingFrame1, text="Cancel reservation", bg='indian red',


fg='black', font=('Gabriola',27,"bold"))

headingLabel.place(relx=0,rely=0, relwidth=1, relheight=1)


labelFrame = Frame(root,bg='misty rose4',bd=10,relief=RAISED,cursor="target")

labelFrame.place(relx=0.1,rely=0.3,relwidth=0.8,relheight=0.5)

# Book ID

lb1 = Label(labelFrame,text="Boarding : ", bg='misty rose4',


fg='white',font=('Gabriola',15,"bold"))

lb1.place(relx=0.05,rely=0.2)

inf1 = Entry(labelFrame)

inf1.place(relx=0.3,rely=0.2, relwidth=0.62)

# Issued To Student name

lb2 = Label(labelFrame,text="Destination : ", bg='misty rose4',


fg='white',font=('Gabriola',15,"bold"))

lb2.place(relx=0.05,rely=0.3)

inf2 = Entry(labelFrame)

inf2.place(relx=0.3,rely=0.3, relwidth=0.62)

# Issued To Student name

lb3 = Label(labelFrame,text="Class : ", bg='misty rose4',


fg='white',font=('Gabriola',15,"bold"))

lb3.place(relx=0.05,rely=0.4)

inf3 = Entry(labelFrame)

inf3.place(relx=0.3,rely=0.4, relwidth=0.62)

# Issued To Student name

lb4 = Label(labelFrame,text="Day : ", bg='misty rose4',


fg='white',font=('Gabriola',15,"bold"))

lb4.place(relx=0.05,rely=0.5)

inf4 = Entry(labelFrame)
inf4.place(relx=0.3,rely=0.5, relwidth=0.62)

# Issued To Student name


lb5 = Label(labelFrame,text="Time : ", bg='misty rose4',
fg='white',font=('Gabriola',15,"bold"))

lb5.place(relx=0.05,rely=0.6)

inf5 = Entry(labelFrame)

inf5.place(relx=0.3,rely=0.6, relwidth=0.62)

# Issued To Student name

lb6 = Label(labelFrame,text="fare : ", bg='misty rose4',


fg='white',font=('Gabriola',15,"bold"))

lb6.place(relx=0.05,rely=0.7)

inf6 = Entry(labelFrame)

inf6.place(relx=0.3,rely=0.7, relwidth=0.62)

#Issue Button

issueBtn = Button(root,text="Cancel",bg='indian red',bd=10,


fg='black',font=('Gabriola',20,"bold"),relief=RAISED,command=booking)

issueBtn.place(relx=0.28,rely=0.9, relwidth=0.18,relheight=0.08)

quitBtn = Button(root,text="Back",bg='indian red',bd=10,


fg='black',font=('Gabriola',20,"bold"),relief=RAISED, command=root.destroy)

quitBtn.place(relx=0.53,rely=0.9, relwidth=0.18,relheight=0.08)

root.mainloop()

sql coding
add new user
use project1; create table newuser (Fname varchar(40) NOT NULL, Lname varchar(40)
NOT NULL, ContactNo int Primary key, Address varchar(40), Dob char(10),Emailchar(15));
select * from newuser;

booking-create database project2; use project2; create table booking (Boarding


varchar(20), Destination varchar(20) NOT NULL, Day varchar(15), time char(10), Fare int
primary key, class varchar(2));
Output
1.Menu

2.sign in
3.Add new user

4.cancel reservation
5.view flights

6. Reservation
8. Payment
mySql output:-
1. Sign in

2. New user

3. Reservation

4. payment
LIMITATIONS AND IMPROVEMENTS
The Existing system includes problems like lack of time
consuming, accuracy, high cost, security problems, etc.
There are many problems in existing systems like:

● Manpower
● High cost
● Time and speed
● Security
● Complexity
● Maintenance
● Accuracy
● Storing
● Records might got lost or be insufficient due to
manual errors.
● Maintaining and managing data is very costly and
time consuming, because there are many documents
that have to be maintained by each branch and
copies have to be transferred to relative branches.
● Transfer of information within the branches is costly
and time consuming.
Conclusion
This system is user friendly and accurate.
>This system is efficient in reservation.
>It has no hidden cost.
>It enables customer to check availability of
the flights online, buy airplane tickets and pay
for them online.
>This makes it easier for the customer to get
the flight tickets online instead of accessing
them from some other sources.
Bibliography
-www.wikipedia.com
-www.scribd.com
-computersciencearticle.in
-www.tutorialspoint.com
-www.quora.com
-Sumita arora textbook -XI & Xll

You might also like