0% found this document useful (0 votes)
4 views5 pages

Flight Reservation System Features

Uploaded by

palprajjawal509
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views5 pages

Flight Reservation System Features

Uploaded by

palprajjawal509
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

#A flight reservation system core features:

# Database side:

'''--Flights table: flight ID,flight brand, source, destination, departure


date/time, arrival date/time,
price(first class, business class, economic class).
--Users table: user ID, name, email, password, contact.
--bookings table: booking ID, user ID, flight ID, passengers, status(booked,
Cancelled, Completed).
--Admin table: admin ID, username, password.
--Payment table: payment ID, booking ID, amount, payment method, status(Success,
Failed, Pending), date.'''

#User Panel:

'''--Sign up / login.
--Search flights (by source, destination, date).
--View available flights with details (code, name, timing, duration, price,
seats).
--book flight (select seats, enter passenger details).
--Payment gateway (fake or real).
--View booking history and status.
--Cancel booking.
--Profile management (update info, password).'''

#Admin Panel:

'''--Login.
--Manage flights (add, update, delete).
--Manage users (view, block/unblock).
--View all bookings.
--Generate reports (daily bookings, revenue, etc.).'''
AIRPORTS = [
("DEL-Delhi", "Indira Gandhi International Airport - New Delhi"),
("bOM-Mumbai", "Chhatrapati Shivaji Maharaj International Airport - Mumbai"),
("bLR-bengaluru", "Kempegowda International Airport - bengaluru"),
("MAA-Chennai", "Chennai International Airport - Chennai"),
("HYD-Hyderabad", "Rajiv Gandhi International Airport - Hyderabad"),
("AMD-Ahmedabad", "Sardar Vallabhbhai Patel International Airport - Ahmedabad"),
("GOA-Goa", "Dabolim Airport - Goa"),
("CCU-Kolkata", "Netaji Subhas Chandra bose International Airport - Kolkata"),
("COK-Kochi", "Cochin International Airport - Kochi"),
("PNQ-Pune", "Pune Airport - Pune"),
]
from tkinter import *
from PIL import ImageTk,Image #Using Pillow an external library
import [Link]
#-----------------------------------------
DATABASE------------------------------------------#
db=[Link](host='localhost',user='root',password='root',autocommit=
True)
cus=[Link]()
[Link]('Create database if not exists Flight_Reservation_System')
#Database Flight_Reservation_System
[Link]('Use Flight_Reservation_System')
[Link]("Create Table if not exists Flights ("
#Flights table
"Flight_ID Varchar(10) Primary key, "
"Flight_brand Varchar(10), "
"Source Varchar(50), "
"Destination Varchar(50), "
"Departure_Date_Time DATETIME, "
"Arrival_Date_Time DATETIME, "
"First_Class_Price Float(10,2), "
"business_Class_Price Float(10,2), "
"Economic_Class_Price Float(10,2))")
[Link]('Select * from Flights')
test1=[Link]()
if test1==[]:
[Link]('insert into Flights
(Flight_ID,Flight_brand,Source,Destination,Departure_Date_Time,Arrival_Date_Time,'
'First_Class_Price,business_Class_Price,Economic_Class_Price) values
'
'("VI1067","Vistara","DEL-Delhi","bOM-Mumbai","2026-01-23
11:30:00","2026-01-23 14:15:00",15000,10000,5000), '
'("IN2076","Indigo","bOM-Mumbai","bLR-bengaluru","2026-01-27
10:00:00","2026-01-27 12:30:00",8000,5000,2500), '
'("AI3087","Air India","PNQ-Pune","CCU-Kolkata","2026-02-15
21:00:00","2026-02-15 00:30:00",10000,6000,4000)')
else:
pass
[Link]("Create Table if not exists Users ("
#Users Table
"User_ID Varchar(50) Primary Key, "
"Name Varchar(100), "
"Email_ID Varchar(100), "
"Password Varchar(80) Unique, "
"Contact Varchar(50))")
[Link]('Select * from Users')
test2=[Link]()
if test2==[]:
[Link]('insert into Users (User_ID,Name,Email_ID,Password,Contact) '
'values
("user947","Default_user","defaultuser123@[Link]","user123","3409008562")')
#Random number
else:
pass
[Link]("Create Table if not exists bookings ("
#bookings Table
"booking_ID Varchar(20) Primary key, " #Generatable
"User_ID Varchar(50) references Users(User_ID) On delete cascade, "
"Flight_ID Varchar(10) references Flights(Flight_ID) On delete cascade,
"
"Passengers int(10), "
"booking_Status Varchar(20), " #booked,Cancelled,Completed
"booking_Date_time DATETIME)")
[Link]('Select * from bookings')
test3=[Link]()
if test3==[]:
[Link]('insert into bookings
(booking_ID,User_ID,Flight_ID,Passengers,booking_Status,booking_Date_time) '
'values ("USAI3087","user947","AI3087",68,"booked","2025-12-13
11:03:45")')
else:
pass
[Link]("Create Table if not exists Admin ("
# Admin table
"Admin_ID Varchar(30) Primary key, "
"Admin_Name Varchar(30), "
"Password Varchar(10) Unique)")
[Link]('Select * from Admin')
test4=[Link]()
if test4==[]:
[Link]('insert into Admin (Admin_ID,Admin_Name,Password) '
'values ("admin123","Admin","Admin123")')
else:
pass
[Link]("Create Table if not exists Payments ("
#Payments Table
"Payment_ID Varchar(50) Primary Key, "
"booking_ID Varchar(20) references bookings(booking_ID) On delete
cascade, "
"Amount Float(10,2), "
"Payment_Method Varchar(30), " #UPI, Credit Card, Debit Card,
Netbanking
"Payment_Status Varchar(20), " #(Success, Failed, Pending)
"Payment_Date_time DATETIME)")
[Link]('Select * from Payments')
test5=[Link]()
if test5==[]:
[Link]('insert into Payments
(Payment_ID,booking_ID,Amount,Payment_Method,Payment_Status,Payment_Date_Time) '
'values ("TXN3290877328957","USAI3087",6000,"UPI","Success","2025-
12-13 11:03:45")')
else:
pass
#=====================================GUI========================================#
def Flight_Reservation_System():
main=Tk()
[Link]("0x0")
#-------------------Titling
[Link]("Fligh_Reservation_System")
#-------------------Logo Defining
icon = PhotoImage(file="[Link]")
[Link](True, icon)
main.icon_ref = icon
#=======================================Front
Panel=====================================#
def Front_Panel(Panel2):
front_panel=Toplevel()
screen_width=main.winfo_screenwidth() #Gives width of screen
screen_height=main.winfo_screenheight() #Gives height of screen
front_panel.geometry(f"{screen_width}x{screen_height}")
#-------------------Creating next button
def front_buttons():
def front_next_feature():
Panel2()
front_panel.destroy()

front_next=Button(front_panel,text='Next',command=front_next_feature,padx=6,pady=3)
#padx and pady adds padding between border and text of button.
front_next.place(relx=0.99, rely=0.99, anchor="se", x=-25, y=-55)
#relx = horizontal position relative to window width (0.0 = left edge, 1.0 = right
edge).
#------------------Creating exit button
#rely = vertical position relative to window height (0.0 = top edge, 1.0 = bottom
edge).

front_exit=Button(front_panel,text='Exit',command=front_panel.destroy,padx=6,pady=3
) #x=-25 means move 25 pixels left from the right edge.
front_exit.place(relx=0.95, rely=0.99, anchor="se", x=-25, y=-55)
#y=-55 means move 55 pixels up from the bottom edge.
front_buttons()
#anchor= controls which part of a widget or shape is fixed to a given position.
#-------------------Backgroung Image defining
original_background = [Link]("[Link]")
#Image=Handles image processing.
background=[Link](original_background)
#ImageTk=Converts Pillow images into a format Tkinter can display
#-------------------Applying image and text background
canvas=Canvas(front_panel,width=1080,height=600)
[Link](fill='both',expand=True)
background_item=canvas.create_image(0,0, image=background,anchor='nw')
text_item=canvas.create_text(230,180, text="Flight Reservation System",
font=('Times New Roman',45,'bold
italic'),fill='#102542')
#-------------------Creating resizeable background image
def front_resizer(i):
global new_background
resized_background=original_background.resize(([Link], [Link]),
#[Link] gives the best quality when resizing images.
[Link])
#It blends nearby pixels smoothly so the resized image looks sharp and detailed
without blur.
new_background=[Link](resized_background)
[Link](background_item, image=new_background)
#Itemconfig=Used with Canvas items to change their properties after creation
[Link](text_item, [Link]//1.5, [Link]//5.5)
#Coord()=Used to get or set coordinates of a Canvas item.
front_panel.bind('<Configure>',front_resizer)
#Bin()=Used to run a function when the widget resizes or reconfigures.
front_buttons()
#====================================Credits
Panel===================================#
def Credit_Panel():
credit_panel=Toplevel()
screen_width=main.winfo_screenwidth()
screen_height=main.winfo_screenheight()
credit_panel.geometry(f"{screen_width}x{screen_height}")
#-------------------Creating next button
def credit_buttons():
def credit_next_feature():
credit_panel.destroy()

credit_next=Button(credit_panel,text='Next',command=credit_next_feature,padx=6,pady
=3)
credit_next.place(relx=0.99, rely=0.99, anchor="se", x=-20, y=-55)
#-------------------Creating back button
def credit_back_feature():
credit_panel.destroy()
Front_Panel(Credit_Panel)

credit_back=Button(credit_panel,text='Back',command=credit_back_feature,padx=6,pady
=3)
credit_back.place(relx=0.95, rely=0.99, anchor="se", x=-20, y=-55)
#-------------------Creating exit button

credit_exit=Button(credit_panel,text='Exit',command=credit_panel.destroy,padx=6,pad
y=3)
credit_exit.place(relx=0.91, rely=0.99, anchor="se", x=-20, y=-55)
credit_buttons()
#-------------------Backgroung Image defining
original_background = [Link]("[Link]")
background=[Link](original_background)
#-------------------Applying image and text background
canvas=Canvas(credit_panel,width=1080,height=600)

[Link](fill='both',expand=True)
background_item=canvas.create_image(0,0, image=background,anchor='nw')
text_item1=canvas.create_text(230,180, text="Developed by ---",
font=('Times New Roman',45,'bold
italic'),fill='#faf5e6')
text_item2=canvas.create_text(230,180, text="Shobhit",
font=('Times New Roman',43,'bold
italic'),fill='#faf5e6')
text_item3=canvas.create_text(230,180, text="Prajjwal Pal",
font=('Times New Roman',43,'bold
italic'),fill='#faf5e6')
text_item4=canvas.create_text(230,180, text="Sushant Verma",
font=('Times New Roman',43,'bold
italic'),fill='#faf5e6')
text_item5=canvas.create_text(230,180, text="Guided by ---",
font=('Times New Roman',45,'bold
italic'),fill='#faf5e6')
text_item6=canvas.create_text(230,180, text="Mr. Shaktirish Agarwal Sir",
font=('Times New Roman',43,'bold
italic'),fill='#faf5e6')
#-------------------Creating resizeable background image
def credit_resizer(i):
global new_background
resized_background=original_background.resize(([Link], [Link]),
[Link])
new_background=[Link](resized_background)
[Link](background_item, image=new_background)
[Link](text_item1, [Link]//3.55, [Link]//1.72)
[Link](text_item2, [Link]//4, [Link]//1.45)
[Link](text_item3, [Link]//4.06, [Link]//1.3)
[Link](text_item4, [Link]//4.15, [Link]//1.175)
[Link](text_item5, [Link]//1.35, [Link]//1.72)
[Link](text_item6, [Link]//1.35, [Link]//1.45)
credit_panel.bind('<Configure>',credit_resizer)
credit_buttons()
Front_Panel(Credit_Panel)
[Link]()
Flight_Reservation_System()

You might also like