0% found this document useful (0 votes)
11 views29 pages

Travel Management System

Uploaded by

Ardhendu
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 (0 votes)
11 views29 pages

Travel Management System

Uploaded by

Ardhendu
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/ 29

Travel Management Sysytem

computer fundamentals and html (St.Mary's College, Sulthan


Bathery)

Scan to open on Studocu


Studocu is not sponsored or endorsed by any college or university
Downloaded by Ardhendu Sekhar ([email protected])
KENDRIYA
VIDYALAYA
CHHATARPUR

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

Sr. No. Topic Page No

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

This is certi 昀椀 ed that "--------------------" of class XII

has successfully completed his “Computer science

practical Report 昀椀 le” during academic session 2021-

2022 as per the guidelines issued by CBSE.

Signature of Internal Signature of


External Examiner Examiner

PAGE
\*
MERG Downloaded by Ardhendu Sekhar
Date :

PRINCIPAL’s SIGNATURE:

___________________

Acknowledgement

I wish to express our sincere thanks to ……………………….., Kendriya

Vidyalaya Chhatarpur ,Madhya Pradesh for guiding us to cause the

successful outcome of this project work.

I wish to express our deep & profound sense of gratitude to our

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

their helping hand in this venture.

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 −

that were affected by an execute( ) method


Function to execute SQL queries
execute( ):- This method executes a SQL query against the
database. This is a DB API compliant call. Parameters are
substituted using question marks, e.g. "SELECT name FROM
table WHERE id=?". The parameter args is a tuple. It returns
None on success or raises an exception in the case of an error.
Syntex:- cursor_obj.execute(query [,args])

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.

time.gmtime( ) method of Time module is used to convert a


time expressed in seconds since the Unix Time [seconds that have
elapsed since January 1, 1970] to a time.struct_time object in
UTC [Universal Time Coordinate]

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")

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

from time import gmtime, strftime


n=strftime("%a, %d %b %Y", gmtime())
n=str(n)
today=n[5:]

print(' ',' TRAVEL DAILY welcomes


U!!!!!! ')
print()
print(' ',n)
print()
print('Press 1 to Login')
print('Press 2 Create account')
print("press 3 delete account")
print('Press 4 to Exit')
print()
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()

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)

phone_number #selecting password


y="select password from accounts where

=({})".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]

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()
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

values(" + str(a) +",' " +


your_location + " ' ,'
"+your_destination+ " ' ,' "+time+ " ' ,'
"+driver+" ' ,' "+urgency+" ',' "+today+"
' )")
conn.commit()
print()

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:

4. Book for Travel

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

● Visual Studio Code (Version 1.40)

PAGE
\*
MERG Downloaded by Ardhendu Sekhar
● .NET Framework 4.5.2 is required for VS Code. If you are

using Windows 7, please make sure .NET Framework

4.5.2 is installed.

● Microsoft o 昀케 ce for output presentation

BIBLIOGRAPHY

1. Computer Science with Python By :Sumita Arora


2. https://www.geeksforgeeks.org/
3. https://www.w3schools.com/python/python_classes.asp
4. http://python.mykvs.in/

PAGE
\*
MERG Downloaded by Ardhendu Sekhar
PAGE
\*
MERG Downloaded by Ardhendu Sekhar

You might also like