Travel Management System
Travel Management System
travel MANAGEMENT
SYSTEM
PROJECT PREPARED
BY: NITIN
RATHAUR
CLASS:XII SCIENCE
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
SESSION:2021-22
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
TABLE OF CONTENTS
1 Certi 昀椀 cate -
2 Acknowledgement -
3 Package/Module Used 5
4 Coding 8
5 Output 11
6 Limitation 13
7 Requirements 13
8 Bibliography 14
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
Certi 昀椀 cate
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
Date :
PRINCIPAL’s SIGNATURE:
___________________
Acknowledgement
guide teacher Mr. Deep Narayan Singh (PGT (CS)), for his expert help &
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
valuable guidance, comments and suggestions. I also place on record,
our sincere gratitude to one and all who directly or indirectly have lent
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
Package/Module
Used
Python Database Connectivity: - Database connectivity
refers to connection and communication between an application
and a database system.
MySQL.connector-Library or package to connect from
python to MySQL.
Command to install connectivity package:-
pip install mysql-connector-python
Command to import connector:-
import mysql.connector
Steps for python MySQL connectivity
1 . Install Python
2. Install MySQL
3. Open Command prompt
4. Switch on internet connection
5. Type pip install mysql-connector-python and execute
6. Open python IDLE
7. import mysql.connector
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
Multiple ways to retrieve data:
fetchall( )-Fetch all (remaining) rows of a query result,
returning them as a sequence of sequences (e.g. a list of tuples)
fetch many (size)-Fetch the next set of rows of a query result,
returning a sequence of sequences. It will return number of
rows that matches to the size argument.
fetchone( )-Fetch the next row of a query result set, returning a
single sequence or None when no more data is available
fetchmany(<size>):- MySQL Connector/Python has the
fetchmany() method that returns the next number of rows (n) of
the result set, which allows you to balance between retrieval
time and memory space.
This is a read-only attribute and returns the number of rows
rowcount −
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
Time module in Python provides various time-related
functions. This module comes under Python’s standard
utility modules.
The strftime( ) function is used to convert date and time
objects to their string representation. It takes one or more
input of formatted code and returns the string representation.
Syntax :
strftime(format)
Returns : It returns the string representation of the date or
time object.
Directive Meaning Output Format
%a Abbreviated weekday name. Sun, Mon, …
%d Day of the month as a zero 01, 02, …, 31
added decimal.
%b Abbreviated month name. Jan, Feb, …, Dec
%Y Year with century as a 2013, 2019 etc.
decimal number.
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
#DATABASE TRAVEL_BOOOKING
import mysql.connector
conn=mysql.connector.connect(host='localhost',password=root',us
er='root')
c1=conn.cursor()
if conn.is_connected:
c1.execute("create database travel_booking")
print("database created successfully")
#ACOUNTS TABLE
import mysql.connector
conn=mysql.connector.connect(host='localhost',password=root',us
er='root',database='travel_booking')
c1=conn.cursor()
c1.execute('create table accounts(Phone_number bigint(13)
primary key,name varchar(30),password bigint(10));')
conn.commit()
print("Table accounts created successfully")
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
#CUSTOMER_DETAILS TABLE
import mysql.connector
conn=mysql.connector.connect(host='localhost',password='root',us
er='root',database='travel_booking')
c1=conn.cursor()
c1.execute('create table 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), Driver
varchar(60), Urgency varchar(30),date_booked varchar(90));'
)
conn.commit()
print("table customer_bookings created successfully")
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
CODINg
#MAIN Source code
import mysql.connector
conn=mysql.connector.connect(host='localhost',password='1234',
user='root',database='travel_booking')
c1=conn.cursor()
conn.autocommit==True
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()
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
s=c1.rowcount
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
s=abs(s)
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:
Number=')) phone_number=int(input('Phone
name=str(input('Name='))
password =str(input( 'password[10]='))
c1.execute("insert into
accounts(Phone_number,password,name )v
alues(" + str(phone_number) +",'"
+password + "',' "+name+" ')")
conn.commit()
print('Account sucessfully Created')
import sys
sys.exit()
else:
import sys
sys.exit()
datan=datan[0]
datan=list(datan)
datan= datan[0]
datan= str(datan)
=({})".format(a)
c1.execute(y)
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
d
a
t
a
=
c
1
.
f
e
t
c
h
a
l
l
(
)
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
data=data[0]
data=list(data)
data=data[0]
if b==data:
print()
print("LOGGED IN !!!!!")
print()
print("HI",datan,"!!")
print()
print("What can I do for you?")
print()
print('12.Book for a board')
print('13.Bill verification')
print('14.My travel log')
print('0.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=')
time=input('time to start board=')
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
driver=input("driver gender
preferences=")
urgency=input('urgency(yes/no)=')
customer_bookings c1.execute("insert into
print('********************************AT
YOUR SERVICE
AT',time,"***************************
*****")
import sys
sys.exit()
if choice1==13:
Dist=int(input('distance travelled
[km]='))
bill=Dist*5
print('your payment =Rs.',bill)
if choice1==14:
c1.execute("select
your_destination,date_boo
ked from customer_bookings where
phone_number like '"+str(a)+"';")
data=c1.fetchall()
for row in data:
print(row[0],'- {',row[1],'}')
conn.commit()
import sys
sys.exit()
if choice!=14 and 12 and 13:
print()
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
print()
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
print("********************INVALID
CHOICE**********************")
import sys
sys.exit()
if choice==2:
phone_number=int(input('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 sucessfully Created')
import sys
sys.exit()
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("**************************************SUCCESSFULLY
ACCOUNT
DELETED**************************************")
import sys
sys.exit()
if choice==4:
print("Thank you , Visit again !!")
import sys
sys.exit()
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
if choice!=1 and 2 and 3:
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
print()
print()
print("********************INVALID
CHOICE**********************")
OUTPUT
1. Welcome Screen:
2. Creating account:
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
3. Account Login:
5. Delete account:
5.Bill Verification:
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
5. My Travel Log:
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
LIMITATION
1. Software does not provide the Graphical user interface
for it's operations.
2. Login authentication is not available in software.
REQUIREMENTS
● Processors: Intel Atom® processor or
Intel® Core™ i3 processor
● Disk space: 10 GB
● Operating systems: Windows* 7
or later, macOS, and Linux
● Python* versions: 3.7.X, 3.8.X
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
● .NET Framework 4.5.2 is required for VS Code. If you are
4.5.2 is installed.
BIBLIOGRAPHY
PAGE
\*
MERG Downloaded by Ardhendu Sekhar
PAGE
\*
MERG Downloaded by Ardhendu Sekhar