FINAL PROJECT REPORT - Travel Agency Management System
FINAL PROJECT REPORT - Travel Agency Management System
“TITLE”
Submitted in partial fulfillment of the requirements for the IV Semester
of degree of Bachelor of Engineering in Information Science and
Engineering of Visvesvaraya Technological University, Belagavi
Submitted by
XXX YYY
1RN20IS126 128
Under the Guidance of
Ms. DIVYASHREE S
Assistant Professor
Dept. of ISE,
RNSIT
Department of
Information Science and
Engineering
RNS Institute of Technology
Dr. Vishnuvaradhan Road, Rajarajeshwari Nagar
post, Channasandra, Bengaluru-560098
2023 -2024
RNS INSTITUTE OF TECHNOLOGY
Dr. Vishnuvaradhan Road, Rajarajeshwari Nagar post,
Channasandra, Bengaluru - 560098
CERTIFICATE
Certified that the Database Management System Mini project work entitled has been
Place : Bengaluru
Date :
S Kavya
1RN20IS126
i
ACKNOWLEDGMENT
The fulfillment and rapture that go with the fruitful completion of any assignment would be inadequate
without mentioning the people who made it possible, whose steady guidance and support crowned the
efforts with success.
We would like to profoundly thank the Management of RNS Institute of Technology for providing
such a healthy environment to carry out this project work. We would like to express our thanks to our
Director, Dr. M.K. Venkatesha, and Principal, Dr. Ramesh Babu H.S., for their support and
inspiration towards the attainment of knowledge.
We wish to place on record our gratitude to Dr. Suresh L., Professor and Head of the Department,
Information Science and Engineering, for being the driving force and mastermind behind our project
work. Our heartfelt thanks go to Mrs. Divyashree S, Assistant Professor, Department of Information
Science and Engineering, for guiding the project and to all the staff members of the Department of
Information Science and Engineering for their help at all times.
Additionally, we extend our gratitude to all other teaching and non-teaching staff of the Information
Science & Engineering department, RNSIT, Bangalore, who have directly or indirectly helped us carry
out the project work.
Place: Bengaluru
Date: 19/07/2024
i
ABSTRACT
Our project, Travel Agency Management System has Admin login and User login on the
Web based application. When the admin logs into the website, they can add, edit and delete the
information of the vehicles and hotels. When the user logs in, they can book vehicles and hotels
that the admin has entered and make the payment according to the calculated cost. They can also
download their bill as a pdf. The user can also check the booking logs of their previous bookings.
v
TABLE OF CONTENTS
CERTIFICATE ii
DECLARATION iii
ABSTRACT iv
ACKNOWLEDGMENT v
TABLE OF CONTENTS vi
ABBREVIATIONS viii
1. INTRODUCTION 1
1.1 Background 1
3. SYSTEM DESIGN 8
3.3 Triggers 12
4. IMPLEMENTATION 14
vi
LIST OF FIGURES
vii
ABBREVIATIONS
AC - Air Conditioning
API - Application Programming Interface
CSS - Cascading style sheets
DBMS - Database Management System
ER - Entity Relationship
GPL - General Public License
HTML - Hypertext Markup Language
HTTP - Hypertext Transfer Protocol
ID - Identification
JS - JavaScript
MVD - Multi Valued Dependency
MVP - Minimum Viable Product
PHP - PHP Hypertext Preprocessor
SQL - Structured Query Language
TB - Terabyte
viii
Chapter 1
INTRODUCTION
1.1 Background
A database is an organized collection of data, generally stored and accessed
electronically from a computer system. Where databases are more complex they are often
developed using formal design and modeling techniques.
The database management system (DBMS) is the software that interacts with end
users, applications, the database itself to capture and analyze the data and provides
facilities to administer the database. The sum total of the database, the DBMS and the
associated applications can be referred to as a "database system". Often the term
"database" is also used to loosely refer to any of the DBMS, the database system or an
application associated with the database. The DBMS manages three important things: the
data, the database engine that allows data to be accessed, locked and modified and the
database schema, which defines the database’s logical structure. These three foundational
elements help provide concurrency, security, data integrity and uniform administration
procedures. Typical database administration tasks supported by the DBMS include
change management, performance monitoring/tuning and backup and recovery. Many
database management systems are also responsible for automated rollbacks, restarts and
recovery as well as the logging and auditing of activity.
Today all the people are busy with their schedules and no one has time to make a
trip for holidays with their family. This Travel Agency booking process is very difficult
to understand in a general meaning. But we are providing a Solution for that Problem.
This system provides a facility for easy access to customers and travel agents. The
admin and user can login to the website with easy and simple steps and make vehicle and
hotel bookings according to the information entered by admin.
This project also covers various features like online registration of the users,
modifying the details of the website by the management staff or administrator of the
website, by adding, deleting or modifying the vehicle and hotel booking details which
reflects when the user is making bookings.
In general, this website would be designed to perform like any other travel agency
website available online.
Hotel_id To_date
Cost_ac Cost_per_person
Ac Count
Cost_non_ac
Id
HOTEL Old_cost_ac
Hotel_id HOTEL
HISTORY
HISTORY
Old_cost_per_person New_cost_ac
New_cosr_per_person Old_cost_non_ac
Id
Name
New_cost_non_ac
1:N
Reg_no
Booking Id
VEHICLE From_date
Type Cost
Multiplier To_date
Seats 1:N Payment
VEHICLE
Kilometers BOOKING Source Password
Vehicle_id Id
Price change Email
Destination Id
Vehicle_id
User_id Username
VEHICLE
HISTORY Is_superuser
USER
Created_at
Is_staff
Firstname(0)
New_multiplier
Old_multiplier Is_active(0) Lastname(0)
Entity relationship diagram displays the relationships of entity set stored in a database. In
other words, we can say that ER diagrams help you to explain the logical structure of
databases. At first look, an ER diagram looks very similar to the flowchart. However, ER
Diagram includes many specialized symbols, and its meanings make this model unique.
Entity types like HOTEL and HOTEL BOOKING are in rectangular boxes.
USER
Id Password Last_l Is_superus Username First_n Last_na Ema Is_sta Is_acti Dat
ogin er ame me il ff ve ed
VEHICLE
Id Name Reg_no Type Seats Ac Multiplier
VEHICLE BOOKINGS
I User_i Sourc Destinatio From_dat To_dat Cos Kilometer Vehicle_i Paymen
d d e n e e t s d t
HOTEL BOOKING
Id User_i From_date To_date Count Ac Cost Hotel_id Payment
d
VEHICLE HISTORY
Id Vehicle_id Old_multiplier New_multiplier Created_at
HOTEL HISTORY
Id Hotel_ Old_cost New_cost Old_cost_ New_cost_no Old_cost_per New_cost_per Created_at
id _ac _ac non_ac n_ac _person _person
Figure 2.2 Relational Schema Diagram for Travel Agency Management System
The above Figure.2.2 shows the relational schema of Travel Agency Management System.
It has the following entities.
1. USER: This table contains details of user like id, password, last_login, is_superuser,
username, first_name, last_name, email, is_staff, is_active, date_joined.
2. VEHICLE: This table contains the details of the vehicle like id, name, reg_no,
type, ac, seats, multiplier.
3. VEHICLE BOOKINGS: This table contains the details of the journey of the
vehicle like id, user, source, destination, from_date, to_date, cost, kilometers,
vehicle, payment.
4. HOTEL: This table contains the details of the hotel room like id, name, address,
no_of_rooms, cost_ac, cost_non_ac, cost_per_person.
SYSTEM DESIGN
USER
VEHICLE
HOTEL
VEHICLE HISTORY
HOTEL
HISTORY
3.3 Trigger
A trigger is a stored procedure in database which automatically invokes whenever a special
event in the database occurs.
BEFORE and AFTER of Trigger: BEFORE triggers run the trigger action before the triggering
statement is run. AFTER triggers run the trigger action after the triggering statement is run.
In this project, a trigger is added to log the change in the price of any hotel or vehicle.
BEGIN
THEN
END
BEGIN
THEN
END IF;
END
The above trigger is called whenever an update is made on the `Hotel` or `Vehicle` table and if
price changes are made, the old and new values are inserted into other tables `Vehicle History`
or `Hotel History` hence logging the change in prices.
IMPLEMENTATION
HTML is a computer language devised to allow website creation. These websites can then
be viewed by anyone else connected to the Internet. It is relatively easy to learn, with the
basics being accessible to most people in one sitting; and quite powerful in what it allows
you to create. HTML is the standard markup language for creating Web pages. It stands
for Hyper Text Markup Language. It describes the structure of a Web page. It consists of
a series of elements. It elements tell the browser how to display the content. It elements
are represented by tags. HTML tags label pieces of content such as "heading",
"paragraph", "table", and so on. Browsers do not display the HTML tags, but use them to
render the content of the page.
CSS stands for Cascading Style Sheets. It is a style sheet language which is used to
describe the look and formatting of a document written in markup language. It provides
an additional feature to HTML. It is generally used with HTML to change the style of
web pages and user interfaces. CSS is used along with HTML and JavaScript in most
websites to create user interfaces for web applications. Before CSS, tags like font, color,
background style, element alignments, border and size had to be repeated on every web
page. This was a very long process. CSS solved that issue. CSS style definitions are saved
in external CSS files so it is possible to change the entire website by changing just one
file. CSS provides more detailed attributes than plain HTML to define the look and feel of
the website.
4.1.3 JavaScript
Backend is server side of the website. It stores and arranges data, and also makes sure
everything on the client-side of the website works fine. It is the part of the website that
you cannot see and interact with. It is the portion of software that does not come in direct
contact with the users. The parts and characteristics developed by backend designers are
indirectly accessed by users through a front-end application. Activities, like writing APIs,
creating libraries, and working with system components without user interfaces or even
systems of scientific programming, are also included in the backend.
development time. For example, you have access to Numpy and Pandas for mathematical
analysis, Pygal for charting, and SLQALchemy for composable queries. Python also offers
amazing web frameworks like Django and Flask.
Fast prototyping: Because Python takes significantly less time to build your projects
compared to other programming languages, your ideas come to life a lot faster, allowing
you to gain feedback and iterate quickly. This quick development time makes Python
especially great for startups who can hit the market sooner to gain a competitive edge.
Wide-spread popularity: Python is one of the most popular languages in the world,
with communities from all over the world. Because of how popular the language is,
Python is continuously updated with new features and libraries, while also providing
excellent documentation and community support. Especially for new developers, Python
provides extensive support and framework for one to begin their developer journey.
Apache is an open-source and free web server software that powers around 46% of
websites around the world. The official name is Apache HTTP Server, and it’s maintained
and developed by the Apache Software Foundation. It allows website owners to serve
content on the web — hence the name “web server”. Although we call Apache a web
server, it is not a physical server, but rather a software that runs on a server. Its job is to
establish a connection between a server and the browsers of website visitors (Firefox,
Chrome, Safari, etc.) while delivering files back and forth between them (client-server
structure). Apache is a cross-platform software, therefore it works on both UNIX and
Windows servers.
MySQL is a fast, easy-to-use RDBMS being used for many small and big businesses. It is
developed, marketed and supported by MySQL AB, which is a Swedish company. It is
released under an open-source license. So you have nothing to pay to use it. It is a very
powerful program in its own right. It handles a large subset of the functionality of the
most expensive and powerful database packages. It uses a standard form of the well-
known SQL data language. It works on many operating systems and with many languages
including PHP, PERL, C, C++, JAVA, etc. It works very quickly and works well even
with large data sets. It is very friendly to PHP, the most appreciated language for web
development. MySQL supports large databases, up to 50 million rows or more in a table.
The default file size limit for a table is 4GB, but you can increase this (if your operating
system can handle it) to a theoretical limit of 8 million terabytes (TB). It is customizable.
The open-source GPL license allows programmers to modify the MySQL software to fit
their own specific environments.
BOOK
VIEW HOTELS/
BOOKING VEHICLES
LOGS
DOWNLOAD
OR PRINT
BILL
The above figure 4.1 shows the user flow diagram for the project. When a user logs in, it first
checks if the user belongs to ‘managers’ group or ‘customer’ group. If the user is a manager,
he/she has privileges to manage the Hotels and Vehicles, add or delete a Hotel/Vehicle, update
the price .If the user is a customer, he/she has privileges only to view and book Hotels/Vehicles
add a new sale and generate the bill, and view their booking logs.
templates/registration/login.html
<div class="login-page">
<div class="form">
<h1 style="color: white">Log in</h1>
home/urls.py
urlpatterns = [
path('login/', views.loginview, name='login'),
app1/views.py
@login_required(login_url='login')
def index(request):
return render(request, 'home.html')
def loginview(request):
if request.method == 'POST':
username = request.POST.get('email')
password = request.POST.get('password')
print(username, password)
user = authenticate(username=username, password=password)
Working:
The loginview() function takes the email and password and authenticates the user.
Render the form in the template login.html.
Username and password are the two inputs provided. On input, the form validates the
values entered and authenticates the user if it is active in the database.
After successful login, the user is redirected to the home page.
templates/addhotel.html
<div class="form">
<h2>Add Hotel</h2>
<form method="post">
{% csrf_token %}
Name: <input type="text" name="name"/>
<br>
Address: <input type="text" name="address"/>
<br>
No of Rooms: <input type="number" name="rooms"/>
<br>
Cost of AC: <input type="number" name="ac"/>
<br>
Cost of Non AC: <input type="number" name="nonac"/>
<br>
Cost per Person: <input type="number" name="perperson"/><br>
templates/addvehicle.html
<div class="form">
<h2>Add Vehicle</h2>
<form method="post">
{% csrf_token %}
Name: <input type="text" name="name"/>
<br>
Reg no: <input type="text" name="regno"/>
<br>
Vehicle type: <input type="text" name="type"/>
<br>
Base cost: <input type="number" name="multiplier"/>
<br>
Seats: <input type="number" name="seats"/>
<br>
AC:<input type="checkbox" name="ac">
<br><br>
<input type="submit" value="Save" class="btn btn-md btn-success">
<button class="btn btn-md btn-danger" type="button"
onclick="window.history.back(); return false;">Cancel</button>
</form>
</div>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button class="btn btn-md btn-success" type="submit">Save</button>
<button class="btn btn-md btn-danger" type="button" onclick="window.history.back();
return false;">Cancel</button>
</form>
app1/views.py
@user_passes_test(lambda u: u.is_superuser)
def addvehicle(request):
if request.method == 'POST':
name = request.POST.get('name')
regno = request.POST.get('regno')
type = request.POST.get('type')
seats = request.POST.get('seats')
multiplier = request.POST.get('multiplier')
ac = request.POST.get('ac')
if ac:
ac=True
else:
ac=False
Vehicle.objects.create(
name=name,
reg_no=regno,
seats=seats,
type=type,
multiplier=multiplier,
ac=ac
)
return redirect('vehicle')
else:
return render(request, 'addvehicle.html')
model = Hotel
fields = '__all__'
template_name = 'hotel_update.html'
success_url = reverse_lazy('hotel')
@user_passes_test(lambda u: u.is_superuser)
def deletevehicle(request, id):
Vehicle.objects.get(id=id).delete()
return redirect('vehicle')
@user_passes_test(lambda u: u.is_superuser)
def deletehotel(request, id):
Hotel.objects.get(id=id).delete()
return redirect('hotel')
app1/urls.py
urlpatterns = [
Working:
If the user is authenticated as manager, then he/she can add hotel/vehicle, edit hotel and
vehicle values such as price and also delete hotels or vehicles.
When the add vehicle/add hotel button is clicked, respective forms are rendered and the
manager can add values such as name, address, cost, type, base cost etc.
The DeleteView doesn’t have a template. It has a post function which takes the primary
key of the row to be deleted. When Delete button is clicked, based on the id of the
selected object it is deleted from the database.
Django’s built-in generic edit views are used to update the values.This is done by
UpdateView when the manager clicks on the Edit button.
The class that inherits these views needs to be specified the model it’s going to work
with, the form fields to be displayed and the success url after post is successful.
<div class="form">
<h2>Hotel Booking Form</h2>
<form method="post">
{% csrf_token %}
<input name="hotelid" value="{{ hotel.id }}" hidden>
<p class="p">Address: {{ hotel.address }}</p>
<br>
No of people: <input id="count" type="number" name="noofpeople" required/>
<br>
<p class="p">Cost of ac room: {{ hotel.cost_ac }}</p>
<br>
<p class="p">Cost of non ac room: {{ hotel.cost_non_ac }}</p>
<br>
<p class="p">Cost per person: {{ hotel.cost_per_person }}</p>
<br><br>
Start-date: <input id="start" type="date" name="startdate" required/>
<br><br>
End-date: <input id="end" type="date" name="enddate" required/>
<br><br>
<p id="paymentmode">Payment Mode</p>
<input list="payment" name="payment">
<datalist id="payment">
<option value="Cash" selected>
<option value="Credit Card">
<option value="Debit Card">
<option value="Google pay">
</datalist>
<br><br>
<button class="button" type="button" onclick="calculate()">Calculate</button>
<p id="cost"></p>
<input name="total" id="total" hidden>
<input class="button" id="sub" style="display: none" type="submit" value="Book
now">
<a class="btn btn-success" style="display: none" type="submit" href="{% url
"hotelbill" %}">Book Now</a>
</form>
</div>
<script>
function calculate() {
var count = document.getElementById('count').value
var ac = document.getElementById('ac').checked
var start = new Date(document.getElementById("start").value);
var end = new Date(document.getElementById("end").value);
var days = parseInt((end - start) / (24 * 3600 * 1000));
console.log(days)
var cost =
(days *{{ hotel.cost_ac }}) + (parseInt(count) *{{ hotel.cost_per_person }})
} else {
var cost = (days *{{ hotel.cost_non_ac }}) + (parseInt(count) *{{
hotel.cost_per_person }})
}
document.getElementById('cost').innerHTML = 'Cost: ' + cost;
document.getElementById('total').value = cost;
document.getElementById('sub').style.display = 'block';
}
</script>
<div class="form">
<h2>Vehicle Booking Form</h2>
<form method="post">
{% csrf_token %}
<input name="vehid" value="{{ vehicle.id }}" hidden>
Source: <input type="text" name="Source"/>
<br>
Destination: <input type="text" name="Destination"/>
<br>
Vehicle type: <p class="p">{{ vehicle.type }}</p>
<br>
Base cost: <p class="p" id="multiplier"> {{ vehicle.multiplier }}</p>
<br><br>
Start-date: <input type="date" name="startdate" required/>
<br><br>
End-date: <input type="date" name="enddate" required/>
<br><br>
Kilometers: <input id="km" type="number" name="kilometers" required/>
<br>
<p id="paymentmode">Payment Mode</p>
<input list="payment" name="payment">
Department of ISE, RIT 2023 - 2024
27
DBMS Mini Project Report Travel Agency Management System
System
<datalist id="payment">
<option value="Cash" selected>
<option value="Credit Card">
<option value="Debit Card">
<option value="Google pay">
</datalist>
<br><br>
<button class="button" onclick="calculate()" type="button">Calculate</button>
<br>
<p id="cost"></p>
<input value="" hidden id="total" name="total">
<input class="button" id="sub" style="display: none" type="submit" value="Book
now">
</form>
</div>
<script>
function calculate() {
var mul = document.getElementById('multiplier').innerHTML
var km = document.getElementById('km').value
App1/views.py
try:
vehicle = Vehicle.objects.get(id=id)
except:
Department of ISE, RIT 2023 - 2024
28
DBMS Mini Project Report Travel Agency Management System
System
return redirect('vehicle')
context = {
'vehicle': vehicle
}
return render(request, 'vbform.html', context)
else:
source = request.POST.get('Source')
destination = request.POST.get('Destination')
startdate = request.POST.get('startdate')
enddate = request.POST.get('enddate')
km = request.POST.get('kilometers')
vehid = request.POST.get('vehid')
payment = request.POST.get('payment')
total = request.POST.get('total')
vehicle = Vehicle.objects.get(id=int(vehid))
VehicleBookings.objects.create(
user=request.user,
source=source,
destination=destination,
from_date=startdate,
to_date=enddate,
kilometers=km,
vehicle=vehicle,
cost=total,
payment=payment,
)
return redirect('vehiclebill')
def hbformview(request, id):
if request.method == 'GET':
try:
hotel = Hotel.objects.get(id=id)
except:
Department of ISE, RIT 2023 - 2024
29
DBMS Mini Project Report Travel Agency Management System
System
return redirect('hotel')
context = {
'hotel': hotel
}
return render(request, 'hbform.html', context)
else:
hotel = Hotel.objects.get(id=int(request.POST.get('hotelid')))
count=request.POST.get('noofpeople')
ac = request.POST.get('roomtype')
startdate = request.POST.get('startdate')
enddate = request.POST.get('enddate')
payment = request.POST.get('payment')
total = request.POST.get('total')
if ac:
ac=True
else:
ac=False
HotelBooking.objects.create(
user= request.user,
from_date=startdate,
to_date=enddate,
cost=total,
ac=ac,
count=count,
payment=payment,
hotel=hotel
)
return redirect('hotelbill')
Working:
If the user is authenticated as customer, then he/she can book vehicles /hotels.
When the user clicks on the Book now in either of the tables, the respective forms will be
rendered. This is done in views with the function hbformview() and vbformview().
The id of the selected Hotel or Vehicle object is passed and the form is rendered with the
pre-filled values.
If the request method is ‘GET’, the forms are rendered and the user can enter the details
of the booking. If method is ‘POST’, the data is taken from the forms and stored into the
booking logs in the database.
The cost is calculated using javascript depending on the distance, number of people, if
the room is ac or non-ac. Javascript takes these values as entered in the form and
multiplies it with the base cost and gives the total cost. The calculated amount is
dynamically added as hidden inputs on the page.
The server side takes the post data and looks for the hidden inputs in request.POST and
adds them to the corresponding tables.
After the post is successful, the user is redirected to the bill page where the user can
download the pdf of the bill.
The booking will also be visible to the user in the Booking logs page.
If the user is registered and is active, he/she will be able to login using his/her username and
password. After login is successful, he/she will be redirected to the Home Page.
If the user is a Manager, then clicking on Vehicles/Hotels will give the following view.
Department of ISE, RIT 2023 - 2024
32
DBMS Mini Project Report Travel Agency Management System
System
If the user is a customer the Add, Delete, Edit and View History options will not be available. Only the
Book Now option will be displayed.
The manager can Add Vehicle/Hotel. The Add Vehicle and Add Hotel forms will be shown as below.
After the booking form is filled, when the user clicks on Book now, it generates a bill with an option to
download the bill in pdf form
These types of Travel Agency Management Systems are examples of flourish technology
has had on the world. These help users book their vehicles or hotel rooms tickets from
their laptops, mobiles phones or tablets. They are easy to use and get the job done in very
few steps. The old methods of standing is long lines and waiting for hours is gone. As
they are deployed on the web, they can be multi lingual which would support diversity
and cause these systems to spread worldwide. These systems also help integrate use of
multiple currency options to make the payments. As the booking info can be carried on
phones, the problem of losing them is also removed and is also eco-friendly.
5.1 Conclusion
This project was an attempt to make the structure and working of a Travel Agency
Management System simpler and user-friendly. This was an attempt to make it similar to
the real world implementation. In this scenario, all the undertakings of the Travel Agency
Management System was achieved in a constructive manner. Given the right guidance
and support, its applications and availability can be enhanced.
1. Email and message verifications could be sent to the users on successful booking
of tickets.
2. Hosting it on an online web server.
3. Travel Packages could be included.
4. Colleting and analyzing vehicles and hotel price data to predict and book when the
price is lowest.
REFERENCES