0% found this document useful (1 vote)
3K views30 pages

Travel Management Project For Computer Science

This document contains the source code for a travel management system project submitted by Kevin Jacob Field, a class 12 student at Rockwoods High School in Udaipur, India. The source code is written in Python and uses MySQL for the backend database. The system allows users to create an account, book travel, and modify or delete bookings. It stores customer details and bookings in database tables. The main menu offers options to book travel, modify or view bookings, and exit the program.

Uploaded by

Kevin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
3K views30 pages

Travel Management Project For Computer Science

This document contains the source code for a travel management system project submitted by Kevin Jacob Field, a class 12 student at Rockwoods High School in Udaipur, India. The source code is written in Python and uses MySQL for the backend database. The system allows users to create an account, book travel, and modify or delete bookings. It stores customer details and bookings in database tables. The main menu offers options to book travel, modify or view bookings, and exit the program.

Uploaded by

Kevin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 30

ROCKWOODS HIGH SCHOOL, UDAIPUR

Travel Management System

AISSCE
Computer Science
Project Record
SESSION- 2022-2023
Submitted By: Kevin Jacob Field
Class: XII Stream: Science
Rockwoods High School, Udaipur
(DEPARTMENT OF COMPUTER SCIENCE)

BONAFIDE CERTIFICATE
CERTIFIED TO BE THE BONAFIDE RECORD OF WORK DONE BY

MISTER Kevin Jacob Field OF CLASS XII Science IN THE ROCKWOODS

HIGH SCHOOL, UDAIPUR DURING THE ACADEMIC YEAR 2022-23.

DATED…………

SHABBIR MODI
P.G.T. IN COMPUTER SCIENCE

ANJALA SHARMA
PRINCIPAL

SUBMITTED FOR ALL INDIAN SENIOR SCHOOL CERTIFICATE


EXAMINATION, 2022-23 IN COMPUTER SCIENCE AT THE
ROCKWOODS HIGH SCHOOL, UDAIPUR.

DATED ……………

EXTERNAL EXAMINER

SEAL

2
DECLARATION
I hereby declare that this project entitled
“Travel Management System” is the original work
done, written and compiled by me for All India
Senior Certificate Examination in Computer Science
at the Rockwoods High School, Udaipur during the
year 2022-2023.

Name: Kevin JacobField


Class: XII
Stream: Science
Signature:
Dated:

3
ACKNOWLEDGEMENT
I EXPRESS MY DEEP GRATITUDE AND APPRECIATION TO THOSE
WHO AGREED TO PARTICIPATE IN THIS PROJECT, FOR THEIR TIME
EXPENDED AND COURAGE IN SHARING THEIR INSIGHTS WITH A
FLEDGING STUDENT. IT IS TO THEM THAT I AM MOST INDEBTED,
AND I CAN ONLY HOPE THAT THE PRODUCTS OF OUR
COLLABORATION BENEFITS EACH ONE AS MUCH AS I BENEFITED
FROM THE PROCESS.

I HAVE BEEN IMMEASURABLY ENRICHED BY WORKING UNDER


THE SUPERVISION OF MR. SHABBIR MODI THE SUBJECT
TEACHER, WHO HAS GREAT LEVEL OF KNOWLEDGE AND WHO
HAS AN ART OF ENCOURAGING CORRECTING AND DIRECTING ME
IN EVERY SITUATION POSSIBLE, WHICH HAS ENABLED ME TO
COMPLETE THE PROJECT.

AT TIMES, MY STUDIES CARRIED OUT A GREAT COST TO THOSE


CLOSEST TO ME. I THANK MY FAMILY AND MY FELLOW
STUDENTS FOR THEIR BEST UNDERSTANDING AND SUPPORT.

I ACKNOWLEDGE TO ALL THE PEOPLE WHO HAVE INVOLVED AND


SUPPORTED ME IN MAKING THIS PROJECT.

GROUP MEMBERS:
1. Kevin Jacob Field (Group leader)
2. KShitij Singh Chouhan
3. Reewa Singh

4
INDEX

S.NO CONTENTS PAGE NO SIGN


1 SYNOPSIS 6 - 10
2 SOURCE CODE 11 - 21
3 OUTPUTS 22 - 29
4 BIBLIOGRAPHY 30

5
1.SYNOPSIS

A travel management system is an application developed


to provide reservation facilities to the customer the travel application
system provides all the necessary tools for the user as well as for the
customer to facilitate and simplify the traveling procedures.

Problem with the existing system

The user is required to maintain and handle all the considerable


information of the customer such as the passport, Visa/Work-
permit related information, travel information etc..

These are maintained presently in Microsoft Excel form in


standalone mode which is time and effort consuming causing a
high possibility of error creation.

Hence there is a need to automate this process by introducing a


new system

6
Proposed System (new system)

The development of this new system is meant to automate the


entire process by providing a user-friendly application with
various controls making the system easier and more flexible for
the user to access and input all the customer’s considerable
information.

This automated system will provide all the reliable services in


lesser amount of time reducing the error possibility and
providing more speed and accuracy resulting in the
enhancement of productivity of the company

System Requirement Specifications 

 Hardware Requirements: 

         3.1 GHz Processor and Above  

7
         RAM 8 GB and Above 
       HDD 1 TB Hard Disk Space and Above 

Peripherals:

 Dot Matrix Invoice Printer 


 Receipt Printer

Software Requirements: 

 Windows 10 OS 
 Python      
 MySQL 8.0 Command Line Client 
 MySQL connector

Python (Frond End)

Python is an interpreted, high-level and general-purpose programming


language used worldwide. Python's design philosophy emphasizes code
readability with its notable use of significant whitespace. Its language
constructs and object-oriented approach aim to
help programmers write clear, logical code for small and large-scale
projects

8
Python interpreters are supported for mainstream operating
systems and available for a few more (and in the past supported many
more). A global community of programmers develops and
maintains CPython, a free and open-source[32] reference
implementation. A non-profit organization, the Python Software
Foundation, manages and directs resources for Python and C Python
development.

MySQL (Back End)

MySQL is an open-source relational database management


system (RDBMS).

A relational database organizes data into one or more data tables in


which data types may be related to each other; these relations help
structure the data. SQL is a language programmer use to create,
modify and extract data from the relational database, as well as control
user access to the database.

In addition to relational databases and SQL, an RDBMS like MySQL


works with an operating system to implement a relational database in a
computer's storage system, manages users, allows for network access
and facilitates testing database integrity and creation of backups.

9
MySQL is free and open-source software under the terms of the GNU
General Public License, and is also available under a variety
of proprietary licenses. 

MySQL connector

MySQL Connector is a driver for connecting to


a MySQL database server through the Open Database Connectivity
(ODBC) application program interface (API), which is the standard
means of connecting to any database. Users can connect from within
common applications and programming environments, such as
Microsoft Access or Excel .

MySQL connector is available for most major operating systems,


including Windows, Unix, Linux, Solaris, AIX, and OS X either under the
free software/open source GNU General Public License (GPL) or under a
commercial license.

Objective
Customer should hold a valid passport with a valid visa to the destination

country; all the necessary information will be collected from the customer

including his telephone number that will be a reference for our agency to check
whether he has an account in our customer database plus the complete address

in the local country and the number of days he will reside in the country he

shall visit finally after payment is done a ticket will be printed on a ticket

boarding card, and a bill receipt will be produced on a dot matrix invoice printer.

10
2.SOURCE CODE

11
import mysql.connector

conn = mysql.connector.connect(host='localhost', password='1234',


user='root', database='travel_booking')
c1 = conn.cursor()
c1.execute("create database if not exists travel_booking ") # Database
Travel_booking
c1.execute(
'create table if not exists accounts (Phone_number bigint(13) primary
key,name varchar(30),password bigint(10));') # Accounts table
c1.execute(
'create table if not exists customer_bookings(Phone_number
bigint(13) ,FOREIGN KEY(Phone_number) REFERENCES
accounts(Phone_number),Your_location varchar(30),Your_destination
varchar(30),time varchar(30),Gender char(5),date_booked
varchar(90));') # customer booking details table
conn.commit()

from time import gmtime, strftime

n = strftime("%a, %d %b %Y", gmtime())


n = str(n)
today = n[5:]

print(' ', '________ABC TRAVEL AGENCY WELCOMES


YOU !__________')
print()
print(' ', n)
print()
print('\t\tPress 1 to Login')
print('\t\tPress 2 Create account')
print("\t\tpress 3 delete account")
print('\t\tPress 4 to Exit')
print()

12
def main_menu():
print('\t\t12.Book for a board')
print('\t\t13.Modify Booking')
print('\t\t14.Delete Booking')
print('\t\t15.My travel log')
print('\t\t0.Exit')
print()
choice1 = int(input('Enter Your Choice='))
if choice1 == 0:
print()
print("Thank you , Visit again !!")
import sys
sys.exit()

if choice1 == 12:
your_location = input('Your location : ')
your_destination = input('Your destination : ')
x=""
while x != 'M' and x != 'F':
gender = input("Your Gender (M / F) : ").upper()
if gender!= 'M' and gender!= 'F':
print("********************INVALID
CHOICE**********************")
else:
break
time = input('time to start board : ')
c1.execute("insert into customer_bookings values(" + str(a) + ",' " +
your_location + " ' ,' " + your_destination + " ' ,' " + time + " ' ,' " +
gender + " ',' " + today + " ' )")
conn.commit()
print()
print('********************************AT YOUR SERVICE
AT', time, "********************************")

13
print()
main_menu()

if choice1 == 13:
print('\t\t 1.Update Location')
print('\t\t 2.Update Destination')
print('\t\t 3.Update Time')
print('\t\t 4.Go back to Main Menu')
print('\t\t 5.Exit')
choice2 = int(input("Enter your choice : "))
if choice2 == 1:
location = input("Enter your modified location : ")
c1.execute("update customer_bookings set Your_location=%s
where Phone_number=%s", (location, a))
conn.commit()
x = ''
while x != 'y' and x != 'n':
ui = input("Do you wish to continue (Y/N) : ").lower()
if ui == 'y':
main_menu()
elif ui == 'n':
import sys
sys.exit()
else:
print("********************INVALID
CHOICE**********************")
print()
elif choice2 == 2:
Destination = input("Enter your modified destination : ")
c1.execute("update customer_bookings set Your_destination=%s
where Phone_number=%s", (Destination, a))
conn.commit()
x = ''
while x != 'y' or 'n':
ui = input("Do you wish to continue (Y/N) : ").lower()

14
if ui == 'y':
main_menu()
else:
import sys
sys.exit()
elif choice2 == 3:
Time = input("Enter your modified Time : ")
c1.execute("update customer_bookings set Time=%s where
Phone_number=%s", (Time, a))
conn.commit()
x = ''
while x != 'y' and x != 'n':
ui = input("Do you wish to continue (Y/N) : ").lower()
if ui == 'y':
main_menu()
elif ui == 'n':
import sys
sys.exit()
else:
print("********************INVALID
CHOICE**********************")
print()
elif choice2==4:
main_menu()
else:
import sys
sys.exit()

if choice1 == 14:
x = ''
while x != 'y' and 'n':
ui = input(
"Are you sure you want to delete all the bookings associated
with this number (Y/N) : ").lower()
if ui == 'y':

15
delete = "delete from customer_bookings where
phone_number= {}".format(a)
c1.execute(delete)
conn.commit()
print(

u'**************************************BOOKINGS
SUCCESSFULLY
DELETED**************************************')
print()
x = ''
while x != 'y' and x != 'n':
ui = input("Do you wish to continue (Y/N) : ").lower()
if ui == 'y':
main_menu()
elif ui == 'n':
import sys
sys.exit()
else:
print("********************INVALID
CHOICE**********************")
print()
else:
import sys
sys.exit()
if choice1 == 15:
c1.execute("select * from customer_bookings where
phone_number like '" + str(a) + "';")
mydata = c1.fetchall()
print("\nPhone number : ", mydata[0][0])
print("Your location : ", mydata[0][1])
print("Your destination :", mydata[0][2])
print("Time : ", mydata[0][3])
print("Gender : ", str(mydata[0][4]))
print("Date booked : ", str(mydata[0][5]))

16
conn.commit()
x = ''
while x != 'y' and x != 'n':
ui = input("Do you wish to continue (Y/N) : ").lower()
if ui == 'y':
main_menu()
elif ui == 'n':
import sys
sys.exit()
else:
print("********************INVALID
CHOICE**********************")
print()
if choice1 != 14 and 12 and 13 and 15:
print()
print()
print("********************INVALID
CHOICE**********************")
import sys
sys.exit()
x = ''
while x != 1 and 2 and 3 and 4:
choice = int(input('Enter your choice : '))

if choice == 1:
print()
a = int(input('Enter your phone number : '))
# Name of the person
u = ("select name from accounts where phone_number = " + str(a)
+ ";")
c1.execute(u)
# Wrong phone number[account doesn't exist]
datan = c1.fetchall()
s = c1.rowcount
s = abs(s)

17
if s != 1:
print()
print("***********************ACCOUNT DOESN'T
EXIST************************")
print()
create = int(input("Press 32 to create account {{or}} Press 0 to
exit="))
if create == 32:
phone_number = int(input('Enter your phone number : '))
name = str(input('Name : '))
password = str(input('password[10] : '))
c1.execute("insert into
accounts(Phone_number,password,name )values(" + str(
phone_number) + ",'" + password + "',' " + name + " ')")
conn.commit()
print(
'**************************************ACCOUNT
SUCCESSFULLY
CREATED**************************************')
x = ''
while x != 'y' and x != 'n':
ui = input("Do you wish to continue (Y/N) : ").lower()
if ui == 'y':
main_menu()
elif ui == 'n':
import sys

sys.exit()
else:
print("********************INVALID
CHOICE**********************")
print()
else:
import sys

18
sys.exit()

datan = datan[0]
datan = list(datan)
datan = datan[0]
datan = str(datan)

# selecting password
y = "select password from accounts where phone_number
=({})".format(a)
c1.execute(y)
data = c1.fetchall()
data = data[0]
data = list(data)
data = data[0]

b = int(input('Enter your password : '))


if b != data:
print()
print("***********************INVALID
PASSWORD**************************")
conn.commit()

if b == data:
print()
print("LOGGED IN !!!!!")
print()
print("HI", datan, "!!")
print()
print("What can I do for you?")
print()
main_menu()

if choice == 2:
phone_number = int(input('Enter your phone number : '))

19
name = str(input('Enter your name : '))
password = str(input('password[10] : '))
c1.execute("insert into
accounts(Phone_number,password,name )values(" + str(
phone_number) + ",'" + password + "',' " + name + " ')")
conn.commit()
print(
'**************************************ACCOUNT
SUCCESSFULLY
CREATED**************************************')
x = ''
while x != 'y' and x != 'n':
ui = input("Do you wish to continue (Y/N) : ").lower()

if ui == 'y':
main_menu()
elif ui == 'n':
import sys

sys.exit()
else:
print("********************INVALID
CHOICE**********************")
print()

if choice == 3:
phone_number = int(input("enter your phone number : "))
c1.execute("delete from customer_bookings where phone_number
=" + str(phone_number) + ";")
c1.execute("delete from accounts where phone_number =" +
str(phone_number) + ";")
conn.commit()
print()
print(

20
"**************************************ACCOUNT
SUCCESSFULLY
DELETED**************************************")
x = ''
while x != 'y' and x != 'n':
ui = input("Do you wish to continue (Y/N) : ").lower()
if ui == 'y':
main_menu()
elif ui == 'n':
import sys

sys.exit()
else:
print("********************INVALID
CHOICE**********************")
print()
if choice == 4:
print("Thank you , Visit again !!")
import sys

sys.exit()

if choice != 1 and 2 and 3 and 4:


print()
print()
print("********************INVALID
CHOICE**********************")

21
3.OUTPUTS

22
Logging in:

a)With invalid info:

b)Wit
h valid info:

23
Main Menu:

To book for a board:

To Modify booking:

24
a)Update Location:

b)Update Destination:

c)Update Time:

d)Go back to Main Menu:


25
e)Exit:

Delete Bookings :

Display Travel Log:


26
Exit:

Looping for Invalid Output :


27
Database:
Travel_Booking

Tables Used:
28
1.Accounts
2. Customer_bookings

Output in MySQL:

a)Structure of table accounts:

b)Structure of table customer_bookings:

4.BIBLIOGRAPHY

1. Website:
 www.google.com
29
 www.youtube.com

2. Books:
 Computer Science with Python Vol 1 by Sumita Arora
 Computer Science with Python Vol 2 by Sumita Arora

30

You might also like