0% found this document useful (0 votes)
26 views49 pages

FINAL PROJECT REPORT - Travel Agency Management System

The document is a mini project report for a Database Management System (DBMS) titled 'Travel Agency Management System' submitted by students of RNS Institute of Technology. It outlines the project's objectives, features, and the system's design, including an E-R diagram and relational schema. The system allows admin and users to manage hotel and vehicle bookings through a web-based application, facilitating easy access and transactions.
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)
26 views49 pages

FINAL PROJECT REPORT - Travel Agency Management System

The document is a mini project report for a Database Management System (DBMS) titled 'Travel Agency Management System' submitted by students of RNS Institute of Technology. It outlines the project's objectives, features, and the system's design, including an E-R diagram and relational schema. The system allows admin and users to manage hotel and vehicle bookings through a web-based application, facilitating easy access and transactions.
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/ 49

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

JNANA SANGAMA, BELAGAVI – 590 018

A DBMS MINI PROJECT


REPORT ON

“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

DEPARTMENT OF INFORMATION SCIENCE AND ENGINEERING

CERTIFICATE

Certified that the Database Management System Mini project work entitled has been

successfully completed by S Kavya (1RN20IS126) & xxxxx a bonafide student of RNS


Institute of Technology, Bengaluru in partial fulfillment of the requirements for the award of

degree in Bachelor of Engineering in Information Science and Engineering of

Visvesvaraya Technological University, Belagavi during academic year 2023-2024. The


Database Management System Mini project report has been approved as it satisfies the
academic requirements in respect of Mini project work for the said degree.

Ms. Divyashree S Dr. Suresh L

Faculty In charge Professor & HoD -ISE


DECLARATION

We, S Kavya [USN: 1RN20I0S126], student of IV Semester BE, in


Information Science and Engineering, RNS Institute of Technology hereby
declare that the Database Mini project work entitled has been carried out
and submitted in partial fulfillment of the requirements for the IV Semester
degree of Bachelor of Engineering in Information Science and
Engineering of Visvesvaraya Technological University, Belagavi during
academic year 2023-2024.

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

K Narayan Krishna [1RN20IS]


P Sree Hari Thejus [1RN20IS1]

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

LIST OF FIGURES vii

ABBREVIATIONS viii

1. INTRODUCTION 1
1.1 Background 1

1.2 Introduction to Travel Agency Management System 1

2. E R DIAGRAM AND RELATIONAL SCHEMA DIAGRAM 3


2.1 Description of ER Diagram 3

2.2 Description of Relational Schema Diagram 5

3. SYSTEM DESIGN 8

3.1 Table Description 8

3.2 Stored Procedure 11

3.3 Triggers 12

4. IMPLEMENTATION 14

4.1 Front-end Development 14

4.2 Back-end Development 15

4.3 User Flow Diagram 18

4.4 Discussion of code Segment 18

4.5 Discussion of Results 32

4.6 Application of project 39

5. CONCLUSION AND FUTURE ENHANCEMENT 40


5.1 Conclusion 40

5.2 Future Enhancement 40


6. REFERENCES 41

vi
LIST OF FIGURES

Figure. No. Descriptions Page


Figure. 2.1 E-R Diagram for Travel Agency Management System 3
Figure. 2.2 Relational Schema – Travel Agency Management 5
System
Figure. 4.1 Successful Booking user flow diagram 18
Figure. 4.2 Login Page 32
Figure. 4.3 Home Page 32
Figure 4.4 Manager Hotel Booking 33
Figure. 4.5 Manager Vehicle Booking 33
Figure. 4.6 User Vehicle Booking 34
Figure. 4.7 Add Hotel for Manager 34
Figure. 4.8 Edit Page for Manager 35
Figure. 4.9 View History Page 35
Figure. 4.10 Hotel Booking Form for User 36
Figure. 4.11 Vehicle Booking Form for User 36
Figure. 4.12 Booking Logs 37
Figure. 4.13 Bill for User 37
Figure. 4.14 PDF Bill 38

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.

1.2 Introduction to Travel Agency Management System


Travel Agency Management System is a web-based project for travel bookings. The
main objective of this project is to create a fast, effective and reliable online working platform to
develop a communication system between customers and the agency.

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.

Department of ISE, RNSIT 2023- 2024


1
DBMS Mini Project Report Travel Agency Management System

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.

Department of ISE, RIT 2022 - 2023


2
Chapter 2

E R DIAGRAM AND RELATIONAL SCHEMA


DIAGRAM

2.1 Description of ER Diagram


Id User_id Payment
Id
Name 1:N Booking
HOTEL
BOOKING From_date
1:N
Addresss HOTEL Price Change

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)

Figure 2.1: E-R Diagram for Travel Agency Management System

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.

Department of ISE, RNSIT 2023- 2024


3
18CSL58: DBMS Mini Project Report Travel Agency Management System

2.1.1 Components of Travel Agency Management System, E-R Diagram

Entity types like HOTEL and HOTEL BOOKING are in rectangular boxes.

1. Relationships like BOOKING and PRICE CHANGE are in diamond boxes,


attached to entity types with straight lines.
2. Attributes are shown in ovals like Name and Payment, each attached by a straight
line to entity or relationship type.
3. Key attributes like Id are underlined.
4. Multi-valued entities like in HOTEL HISTORY and VEHICLE HISTORY, are
represented using double layered rectangular boxes.

2.1.2 E-R Diagram Relationships Description


1. HOTEL:BOOKING is of cardinality 1:N as one hotel can possibly have more than
one booking and therefore connected by an IN relationship. There is total
participation from BOOKING as all bookings are made to some hotel, but partial
participation from HOTEL as some hotels may not have a booking.
2. HOTEL:PRICE CHANGE is of cardinality 1:N as one hotel can have more than
one price change and therefore connected by an IN relationship. There is total
participation from PRICE CHANGE as all price changes are made to some hotel,
but partial participation from HOTEL as some hotels may not have price changes.
3. VEHICLE:BOOKING is of cardinality 1:N as one vehicle can possibly have more
than one booking and therefore connected by an IN relationship. There is total
participation from BOOKING as all bookings are made to some vehicle, but partial
participation from VEHICLE as some vehicles may not have a booking
4. VEHICLE:PRICE CHANGE is of cardinality 1:N as one vehicle can have more
than one price change and therefore connected by an IN relationship. There is total
participation from PRICE CHANGE as all price changes are made to some vehicle,
but partial participation from VEHICLE as some vehicles may not have price
changes.
.

Department of ISE, RNSIT 2023- 2024


4
18CSL58: DBMS Mini Project Travel Agency Management System

2.2 Description of Relational Schema Diagram

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

Id Name Address No_of_rooms Cost_ac Cost_non_ac Cost_per_person


HOTEL

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

Department of ISE, RNSIT 2023- 2024


5
18CSL58: DBMS Mini Project Travel Agency Management System

2.2.1 General Constraints


1. NULL Constraint: Attributes that are under NOT NULL constraints have to be
filled compulsorily. Almost all the attributes in the project are under NOT NULL
constraint.
2. Entity Integrity Constraint: This constraint makes sure that no primary key can
have a NULL value assigned to it. The primary keys involved in the project include:
 Vehicle.id
 VehicleBookings.id
 Hotel.id
 HotelBooking.id
 User.id
 VehicleHistory.id
 HotelHistory.id
3. Referential Integrity Constraints: A table in the back end of the project may have
references pointing to an attribute in another table. The various tables are also linked
with multiple foreign keys which are all set to cascade any update or delete
operation on the attribute in the main table. The various Foreign Key attributes are:
 Hotel_id
 Username
 Vehicle_id
 User_id

2.2.2 Schema Description

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.

Department of ISE, RNSIT 2023- 2024


6
18CSL58: DBMS Mini Project Travel Agency Management System
5. HOTEL BOOKING: This table contains the details of the hotel booking like id,
user, from_date, to_date, count, room_no, ac, cost, hotel, payment.
6. VEHICLE HISTORY: Contains history of the vehicle booking like id, vehicle,
old_multiplier, new_multiplier, created_at.
7. HOTEL HISTORY: This table contains histoy of the hotel booking like id, hotel,
old_cost_ac,new_cost_ac,old_cost_non_ac,new_cost_non_ac, old_cost_per_preson,
new_cost_per_person, created_at.

Department of ISE, RNSIT 2023- 2024


7
Chapter 3

SYSTEM DESIGN

3.1 Table Description

USER

FIELD TYPE NULL? KEY DEFAULT

Id INT(11) NO PRIMARY None


Password VARCHAR(128) NO None
Last_login DATETIME(6) YES NULL
Is_superuser TINYINT(1) NO None
Username VARHAR(150) NO FOREIGN None
First_name VARCHAR(150) NO None
Last_name VARCHAR(150) NO None
Email VARCHAR(254) NO None
Is_staff TINYINT(1) NO None
Is_active TINYINT(1) NO None
Date_joined DATETIME(6) NO None

VEHICLE

Department of ISE, RNSIT 2020 - 2021


8
FIELD TYPE NULL? KEY DEFAULT

Id INT(11) NO PRIMARY None


FIELD TYPE NULL? KEY DEFAULT
Name VARCHAR(100) YES NULL
Id
Reg_no INT(11)
VARCHAR(10) NO
YES PRIMARY None
NULL
Source
Type VARCHAR(100)
VARCHAR(100) YES NULL
Destination
Seats VARCHAR(10)
INT(11) YES
YES NULL
NULL
From_date
Ac DATE
TINYINT(1) YES
NO NULL
None
Cost
Multiplier DOUBLE
DOUBLE YES
YES NULL
NULL
To_date DATE YES NULL
Kilometers INT(11) YES NULL
User_id INT(11) YES FOREIGN NULL
Vehicle_id INT(11) NO FOREIGN None
Payment VARCHAR(20) YES NULL
VEHICLE BOOKINGS

HOTEL

FIELD TYPE NULL? KEY DEFAULT

Id INT(11) NO PRIMARY None


Name VARCHAR(100) YES NULL
Address VARCHAR(100) YES NULL
No_of_rooms INT(11) YES NULL
Cost_ac DOUBLE YES NULL
Cost_non_ac DOUBLE YES NULL
Cost_per_person DOUBLE YES NULL

Department of ISE, RNSIT 2020 - 2021


9
HOTEL BOOKING

VEHICLE HISTORY

FIELD TYPE NULL? KEY DEFAULT

Id INT(11) NO PRIMARY None


Old_multiplier DOUBLE YES NULL
New_multiplier DOUBLE YES NULL
Created_at DATETIME(6) NO None
Vehicle_id INT(11) NO FOREIGN None

FIELD TYPE NULL? KEY DEFAULT

Id INT(11) NO PRIMARY None


From_date DATE YES NULL
To_date DATE YES NULL
Count INT(11) YES NULL
Ac TINYINT(1) NO None
Cost DOUBLE YES NULL
Hotel_id INT(11) NO FOREIGN None
User_id INT(11) YES FOREIGN NULL
Payment VARCHAR(20) YES NULL

Department of ISE, RNSIT 2020 - 2021


10
18CSL58: DBMS Mini Project Report Travel Agency Management System

HOTEL
HISTORY

FIELD TYPE NULL? KEY DEFAULT

Id INT(11) NO PRIMARY None


Old_cost_ac DOUBLE YES NULL
New_cost_ac DOUBLE YES NULL
Old_cost_non_ac DOUBLE YES NULL
New_cost_non_ac DOUBLE YES NULL
Old_cost_per_person DOUBLE YES NULL
New_cost_per_person DOUBLE YES NULL
Created_at DATETIME(6) NO None
Hotel_id INT(11) NO FOREIGN None

3.2 Stored Procedures


A stored procedure is a prepared SQL code that you can save, so the code can be reused over
and over again. So if you have an SQL query that you write over and over again, save it as a
stored procedure, and then just call it to execute it. You can also pass parameters to a stored
procedure, so that the stored procedure can act based on the parameter value(s) that is passed
In this project, we’ve created a stored procedure that takes in two arguments, start_date and
end_date. This procedure selects all the bookings made between the start_date and end_date. It
selects from both Hotel bookings and vehicle bookings.

DROP PROCEDURE `hotelbookings_bw_dates`;


CREATE DEFINER=`root`@`localhost` PROCEDURE
`hotelbookings_bw_dates`(IN `start_date` DATE, IN `end_date` DATE, IN `user_id` INT)
NOT DETERMINISTIC NO SQL SQL SECURITY DEFINER
BEGIN
SELECT * FROM `app1_hotelbooking` AS H
WHERE ((H.from_date BETWEEN start_date AND end_date)
AND (H.to_date BETWEEN start_date AND end_date))
AND (H.user_id=user_id);
END

Department of ISE, RNSIT 2020 - 2021


11
DROP PROCEDURE `vehiclebookings_bw_dates`;
CREATE DEFINER=`root`@`localhost` PROCEDURE
`vehiclebookings_bw_dates`(IN `start_date` DATE, IN `end_date` DATE, IN `user_id` INT)
NOT DETERMINISTIC NO SQL SQL SECURITY DEFINER
BEGIN
SELECT * FROM `app1_vehiclebookings` AS V
WHERE ((V.from_date BETWEEN start_date AND end_date)
AND (V.to_date BETWEEN start_date AND end_date)
AND (V.user_id=user_id));
END

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.

DROP TRIGGER IF EXISTS `hotel_history_afterupdate`;

CREATE DEFINER=`root`@`localhost` TRIGGER `hotel_history_afterupdate` AFTER


UPDATE ON `app1_hotel` FOR EACH ROW

BEGIN

IF old.cost_ac <> new.cost_ac OR old.cost_non_ac <> new.cost_non_ac OR


old.cost_per_person <> new.cost_per_person

THEN

INSERT INTO `app1_hotelhistory`(hotel_id, old_cost_ac,


new_cost_ac,old_cost_non_ac,new_cost_non_ac,old_cost_per_person,new_cost_p
er_person, created_at)

VALUES(old.id, old.cost_ac, new.cost_ac,


old.cost_non_ac,new.cost_non_ac,old.cost_per_person,new.cost_per_person, NOW());

Department of ISE, RNSIT 2020 - 2021


12
END IF;

END

DROP TRIGGER IF EXISTS `vehicle_history_afterupdate`;

CREATE DEFINER=`root`@`localhost` TRIGGER `vehicle_history_afterupdate` AFTER


UPDATE ON `app1_vehicle` FOR EACH ROW

BEGIN

IF old.multiplier <> new.multiplier

THEN

INSERT INTO `app1_vehiclehistory`(vehicle_id, old_multiplier, new_multiplier,


created_at)

VALUES(old.id, old.multiplier, new.multiplier, NOW());

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.

Department of ISE, RNSIT 2020 - 2021


13
Chapter 4

IMPLEMENTATION

4.1 Front-end Development

The front-end is built using a combination of technologies such as Hypertext Markup


Language (HTML), JavaScript and Cascading Style Sheets (CSS). Front-end developers
design and construct the user experience elements on the web page or app including
buttons, menus, pages, links, graphics and more.

4.1.1 Hypertext Markup Language

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.

4.1.2 Cascading style sheets

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.

Department of ISE, RNSIT 2020 - 2021


14
18CSL58: DBMS Mini Project Report Travel Agency Management System

4.1.3 JavaScript

JavaScript is a dynamic computer programming language. It is lightweight and most


commonly used as a part of web pages, whose implementations allow client-side script to
interact with the user and make dynamic pages. It is an interpreted programming language
with object-oriented capabilities. Client-side JavaScript is the most common form of the
language. The script should be included in or referenced by an HTML document for the
code to be interpreted by the browser. It means that a web page need not be a static
HTML, but can include programs that interact with the user, control the browser, and
dynamically create HTML content. The JavaScript client-side mechanism provides many
advantages over traditional CGI server-side scripts. The JavaScript code is executed when
the user submits the form, and only if all the entries are valid, they would be submitted to
the Web Server. JavaScript can be used to trap user-initiated events such as button clicks,
link navigation, and other actions that the user initiates explicitly or implicitly.
Advantages are: Less server interaction, immediate feedback to the visitors, increased
interactivity and richer interfaces.

4.2 Back-end Development

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.

4.2.1 Python for Web Development

Advantages of developing web applications in Python:


 Easy to learn: Python is the most popular language for first-time learners for a reason.
The language relies on common expressions and whitespace, which allows you to write
significantly less code compared to some other languages like Java or C++. Not only that,
but it has a lower barrier of entry because it’s comparatively more similar to your everyday
language so you can easily understand the code.
 Rich ecosystem and libraries: Python offers a vast range of library tools and packages,
which allows you to access much pre-written code, streamlining your application

Department of ISE, RNSIT 2020 - 2021


15
18CSL58: DBMS Mini Project Report Travel Agency Management System

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.

Popular Python Web Frameworks:


 Django is a Python web framework that offers an open-source, high-level framework
that “encourages rapid development and clean, pragmatic design.” It’s fast, secure, and
scalable. Django offers strong community support and detailed documentation. Django is
incredibly flexible in which you can work with MVPs to larger companies. For some
perspective, some of the largest companies that use Django are Instagram, Dropbox,
Pinterest, and Spotify.
 Flask is considered a microframework, which is a minimalistic web framework. It’s less
“batteries-included,” meaning that it lacks a lot of features and functionality that full-
stack frameworks like Django offer, such as a web template engine, account
authorization, and authentication. Flask is minimalistic and lightweight, meaning that
you add extensions and libraries that you need as you code without automatically being
provided with it by the framework. Flask is also a prevalent and powerful web
framework as it’s used by large companies like Netflix, LinkedIn, and Uber.

4.2.2 Web Server – Apache

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,

Department of ISE, RNSIT 2020 - 2021


16
18CSL58: DBMS Mini Project Report Travel Agency Management System
Google

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.

4.2.3 Database – MySQL

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.

Department of ISE, RNSIT 2020 - 2021


17
DBMS Mini Project Report Travel Agency Management System
System

4.3 User Flow Diagram

CHECK USER MANAGER MANAGE


LOGIN HOTELS/
VEHICLES
CUSTOMER
VIEW
BOOKING
LOGS

BOOK
VIEW HOTELS/
BOOKING VEHICLES
LOGS

DOWNLOAD
OR PRINT
BILL

Figure 4.1 Successful Booking user flow diagram

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.

4.4 Discussion of Code Segment


This section talks about the important code sections and modules that are implemented in
the Travel Agency Management System project. These modules add logic to the complete
system, and make it function the way it is supposed to. It also talks about the integration
between the front end HTML code and the back end MySQL database.

4.4.1 Login Page

templates/registration/login.html

<div class="login-page">
<div class="form">
<h1 style="color: white">Log in</h1>

Department of ISE, RIT 2023 - 2024


18
DBMS Mini Project Report Travel Agency Management System
System
<form method="post">
{% csrf_token %}
<input type="text" placeholder=" Email-address" name="email" required>
<br>
<input type="password" placeholder=" password" name="password" required>
<br>
<input class="button" type="submit" , value="Log in">
</form>
</div>
</div>

home/urls.py

from django.urls import path


import app1.views as views

urlpatterns = [
path('login/', views.loginview, name='login'),

app1/views.py

from django.contrib.auth import authenticate, login

from django.contrib.auth.decorators import login_required

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

Department of ISE, RIT 2023 - 2024


19
DBMS Mini Project Report Travel Agency Management System
System
print(user)
if user:
print(user)
login(request, user)
return redirect('index')
return render(request, 'login.html')

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.

4.4.2 Add Hotels and Vehicles

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>

<input class="btn btn-md btn-success" type="submit" value="Save">

Department of ISE, RIT 2023 - 2024


20
DBMS Mini Project Report Travel Agency Management System
System
<button class="btn btn-md btn-danger" type="button" onclick="window.history.back();
return false;">Cancel</button>
</form>
</div>

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>

templates/Hotel_update.html and templates/vehicle_update.html

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

Department of ISE, RIT 2023 - 2024


21
DBMS Mini Project Report Travel Agency Management System
System

return false;">Cancel</button>
</form>

app1/views.py

from django.contrib.auth.decorators import login_required, user_passes_test


from django.contrib.auth.models import User
from django.http import HttpResponse
from django.shortcuts import render, redirect

from app1.models import Vehicle, Hotel, VehicleBookings, HotelBooking

from django.views.generic.edit import UpdateView


from django.urls import reverse_lazy
from django.contrib.auth.mixins import LoginRequiredMixin

@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,

Department of ISE, RIT 2023 - 2024


22
DBMS Mini Project Report Travel Agency Management System
System

multiplier=multiplier,
ac=ac
)
return redirect('vehicle')
else:
return render(request, 'addvehicle.html')

class VehicleUpdateView(LoginRequiredMixin, UpdateView):


model = Vehicle
fields = '__all__'
template_name = 'vehicle_update.html'
success_url = reverse_lazy('vehicle')
@user_passes_test(lambda u: u.is_superuser)
def addhotel(request):
if request.method == 'POST':
name = request.POST.get('name')
address = request.POST.get('addrress')
ac = request.POST.get('ac')
nonac = request.POST.get('nonac')
perperson = request.POST.get('perperson')
noofrooms = request.POST.get('rooms')
Hotel.objects.create(
name=name,
address=address,
no_of_rooms=noofrooms,
cost_ac=ac,
cost_non_ac=nonac,
cost_per_person=perperson
)
return redirect('hotel')
else:

return render(request, 'addhotel.html')

Department of ISE, RIT 2023 - 2024


23
DBMS Mini Project Report Travel Agency Management System
System

class HotelUpdateView(LoginRequiredMixin, UpdateView):

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

from django.urls import path


import app1.views as views

urlpatterns = [

path('addvehicle/', views.addvehicle, name='addvehicle'),


path('addhotel/', views.addhotel, name='addhotel'),

path('deletevehicle/<int:id>/', views.deletevehicle, name='deletevehicle'),


path('deletehotel/<int:id>/', views.deletehotel, name='deletehotel'),
path('updatevehicle/<int:pk>/', views.VehicleUpdateView.as_view(), name='updatevehicle'),
path('updatehotel/<int:pk>/', views.HotelUpdateView.as_view(), name='updatehotel'),

Department of ISE, RIT 2023 - 2024


24
DBMS Mini Project Report Travel Agency Management System
System

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.

4.4.3 Book Hotels or Vehicles

Templates/hbform.html and templates/vbform.html

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

Department of ISE, RIT 2023 - 2024


25
DBMS Mini Project Report Travel Agency Management System
System
<br>

AC: <input id="ac" type="checkbox" name="roomtype" />

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

Department of ISE, RIT 2023 - 2024


26
DBMS Mini Project Report Travel Agency Management System
System
if (ac == true) {

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

var cost = parseFloat(mul) * km


document.getElementById('total').value = cost
document.getElementById('cost').innerHTML = 'Cost : ' + cost
document.getElementById('sub').style.display = 'block'
}
</script>

App1/views.py

def vbformview(request, id):


if request.method == 'GET':

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

from django.urls import path


import app1.views as views

Department of ISE, RIT 2023 - 2024


30
DBMS Mini Project Report Travel Agency Management System
System
urlpatterns = [

path('vbform/<int:id>/', views.vbformview, name='vbform'),


path('hbform/<int:id>/', views.hbformview, name='hbform'),

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.

4.5 Discussion of Results

Department of ISE, RIT 2023 - 2024


31
DBMS Mini Project Report Travel Agency Management System
System

Figure 4.2 Login 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.

Figure 4.3 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

Figure 4.4 Manager Hotel Booking

Figure 4.5 Manager Vehicle Booking

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.

Department of ISE, RIT 2023 - 2024


33
DBMS Mini Project Report Travel Agency Management System
System

Figure 4.6 User Vehicle Booking

The manager can Add Vehicle/Hotel. The Add Vehicle and Add Hotel forms will be shown as below.

Figure 4.7 Add Hotel for Manager

Department of ISE, RIT 2023 - 2024


34
DBMS Mini Project Report Travel Agency Management System
System
The edit form will look as follows, with certain pre filled values. After the necessary changes are made
and saved, the new details will replace the old and the update history can be viewed by clicking on View
History where the date and time of he updates are also saved.

Figure 4.8 Edit page for Manager

Figure 4.9 View History Page

Department of ISE, RIT 2023 - 2024


35
DBMS Mini Project Report Travel Agency Management System
System
If the User is a customer, he can only view and book Hotels/Vehicles. When the user clicks on Book Now
in either of the tables, a booking form will be shown as follows. The forms will contain autofilled fields
with details of the selected Hotel or Vehicle.

Figure 4.10 Hotel Booking Form for User

Figure 4.11 Vehicle Booking Form for User

Department of ISE, RIT 2023 - 2024


36
DBMS Mini Project Report Travel Agency Management System
System
The user can also view his/her booking logs which contains all of the previous bookings made by that
user.

Figure 4.12 Booking Logs

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

Figure 4.13 Bill for User

Department of ISE, RIT 2023 - 2024


37
DBMS Mini Project Report Travel Agency Management System
System

Figure 4.14 PDF Bill

Department of ISE, RIT 2023 - 2024


38
DBMS Mini Project Report Travel Agency Management System

4.5 Application of project

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.

Major applications of Travel Agency Management System are:


1. All the booking logs are available at one place.
2. You can make multiple bookings at one go.
3. Support multilingualism and use of multiple currencies.

Department of ISE, RIT 2020 - 2021


39
Chapter 5

CONCLUSION AND FUTURE ENHANCEMENT

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.

5.2 Future Enhancements

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.

Department of ISE, RIT 2020 - 2021


40
Chapter 6

REFERENCES

[1] Raghu Ramakrishnan and Johannes Gehrke, Database Management Systems,


McGRAW HILL, 3rd Edition.
[2] Ramez Elmasri and Shamkant B. Navathe, Fundamentals of Database Systems,
Pearson, 7th Edition.
[3] https://www.w3schools.com/
[4] https://stackoverflow.com/
[5] https://docs.djangoproject.com/en/3.1/
[6] https://api.jquery.com/
[7] https://dev.mysql.com/doc/
[8] https://www.mysqltutorial.org/

Department of ISE, RIT 2023 - 2024


41

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy