You are on page 1of 52

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

JnanaSangama, Belagavi-590010

DBMS MINI PROJECT REPORT 1


ON
“Online Bus Ticket Booking System for Travel Management”

Submitted in partial fulfillment for the requirements for the fifth semester
BACHELOR OF ENGINEERING
COMPUTER SCIENCE AND ENGINEERING

For the Academic Year 2023-2024


Submitted by:
PRITI MONDAL 1MV21CS073
VAISHNAVI 1MV21CS115
VINAY KUMAR 1MV21CS119
PIYUSH KUMAR 1MV21CS127

Under the guidance of:


Dr. Suma Swamy
Professor, Department of CSE
Sir M.Visvesvaraya Institute of Technology, Bengaluru

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


SIR M.VISVESVARAYA INSTITUTE OF TECHNOLOGY
HUNASAMARANAHALLI, BENGALURU-562157
SIR M.VISVESVARAYA INSTITUTE OF TECHNOLOGY
Krishnadevaraya Nagar, International Airport Road,
Hunasmaranahalli, Bengaluru – 562157
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

CERTIFICATE
It is certified that the DBMS Mini Project work entitled " ONLINE BUS TICKET BOOKING
SYSTEM FOR TRAVEL MANAGEMENT" is carried out by PRITI
MONDAL(1MV21CS073), VAISHNAVI(1MV21CS115), VINAY KUMAR M
S(1MV21CS119), PIYUSH KUMAR(1MV21CS127) bonafide students of Sir M
VisvesvarayaInstitute of Technology in partial fulfillment for the 5 th semester for the award of
the Degree of Bachelor of Engineering in Computer Science and Engineering of the
Visvesvaraya Technological University, Belagavi during the academic year 2023-2024. It is
certified that all corrections and suggestions indicated for Internal Assessment have been
incorporated in the report deposited in the department library. The project report has been
approved as it satisfies the academic requirements in respect of project work prescribed for the
course of Bachelor of Engineering.

Name &Signature of Name & Signature of Name & Signature of


Guide HOD Principal

Dr. Suma Swamy Dr. Anitha T N Dr. Rakesh S G


Prof & Internal Guide HOD Principal,
Dept. of CSE, Sir MVIT Dept. of CSE, Sir MVIT
Bengaluru-562157 Sir MVIT Bengaluru– 562157
Bengaluru-562157

External Examination:

Name of Examiner Signature with Date

1)

2)
I
DECLARATION

We hereby declare that the entire project work embodied in this dissertation has been carried
out by us and no part has been submitted for any degree or diploma of any institution
previously.

Place: Bengaluru

Date:

Signature of Students:

PRITI MONDAL VAISHNAVI


(1MV21CS073)
(1MV21CS115)

VINAY KUMAR M S PIYUSH KUMAR


(1MV21CS119) (1MV21CS127)

II
ACKNOWLEDGMENT

It gives us immense pleasure to express our sincere gratitude to the management of Sir M.
Visvesvaraya Institute of Technology, Bengaluru for providing the opportunity and the
resources to accomplish our project work in their premises.

On the path of learning, the presence of an experienced guide is indispensable and we would
like to thank our guide Dr Suma Swamy, Professor, Department of CSE, for her invaluable
help and guidance.

Heartfelt and sincere thanks to Dr. Anitha T N, HOD, Department of CSE, for her
suggestions,constant support and encouragement.

We would also like to convey our regards to Dr. Rakesh S G, Principal, Sir MVIT for providing
us with the infrastructure and facilities needed to develop our project.

We would also like to thank the staff of Department of Computer Science and Engineering and
lab-in-charges for their co-operation and suggestions. Finally, we would like to thank all our
friends for their help and suggestions without which completing this project would not have
been possible.

- PRITI MONDAL 1MV21CS073

- VAISHNAVI 1MV21CS115

- VINAY KUMAR 1MV21CS119

- PIYUSH KUMAR 1MV21CS127

III
ABSTRACT

The Bus Ticket Booking System in Travel Management is a sophisticated software solution designed
to enhance the efficienc and convenience of booking bus tickets for travel purposes. This system
serves as a centralized platform that seamlessly integrates with travel management systems, providing
a comprehensive solution for both travelers and travel coordinators.

The system offers a user-friendly interface for travelers, allowing them to easily search for bus routes,
view schedules, and make bookings within the context of their broader travel plans. Travelers can
conveniently reserve bus tickets, choose preferred seats, and receive e-tickets, ensuring a smooth and
integrated travel experience. The system also incorporates features such as real-time updates on bus
availability, departure times, and pricing, ensuring travelers have the most up-to-date information at
their fingertips.

For travel coordinators and managers, the Bus Ticket Booking System integrates seamlessly with
travel management platforms. It enables coordinators to plan and book bus transportation as part of a
larger travel itinerary, ensuring a cohesive and well-managed travel experience. The system facilitates
efficient coordination of bus services, providing real-time visibility into bookings, occupancy levels,
and travel expenses.

The Bus Ticket Booking System in Travel Management is a valuable tool for organizations and
individuals seeking to streamline the process of booking bus tickets within the broader context of
travel planning. By fostering integration, efficiency, and real-time information accessibility, this
system contributes to the over all improvement of travel management processes and enhances the
travel experience for both individual and corporate travelers.

IV
TABLE OF CONTENTS

Chapters Page no.

1. Introduction 1-2

Introduction 1

Aim / Objectives Of This Project 2

2. Front End and Back End 3-10

HTML 3-5
CSS 6-7
JavaScript 8-9
Back end 10

3. Specifications 11-13

3.1 : Software Requirements 11-12


3.1.1 : Functional Requirements 11
3.1.2 : Non- Functional Requirements 12
3.2 : Hardware Requirement 13

4. System Design 14-19

4.1 ER Diagram 14-16


4.2 UML Diagram 17-19

5. Conceptual Design 20-25


5.1 Create Commands 20-22
5.2 Insert Commands and Data 23
5.3 SQL Queries 24-25
6. Front End Design, Connectivity 26-30
and Implementation
6.1 Bus listing 26
6.2 Bus search 27

V
6.3 Ticket booking 28
6.4 Fetching ticket details 29
6.5 User signup 30

7. Source Code- Front end 31-35

8. Results, Discussion & Screenshots 36-38

9. Conclusion & Scope 39

References & Weblinks 40

VI
LIST OF FIGURES

Fig. No. Description Page No.

2.1 HTML 04

2.2 HTML CODE AND WEB PAGE 05

2.3 CSS LOGO 06

2.4 CSS EXAMPLE OUTPUT 07

2.5 JAVASCRIPT 08

2.6 JAVASCRIPTEXAMPLE 09

2.7 FRONTEND AND BACKEND 10

4.1 ER DIAGRAM OF BUS TICKET 14

BOOKING SYSTEM
4.2 17
UML DIAGRAM OF BUS TICKET
BOOKING SYSTEM
8.1 FRONT PAGE OF OUR WEBSITE 31
31
8.2 BUS DETAILS

8.3 32
FILLING BUS DETAILS 32
8.4 PASSENGERS DETAILS

33
8.5 Enter Bus Details

8.6 Enter Passenger Details 33

8.7 Booking Bus Details after trigger 34

8.8 Booking Bus Details before trigger 34

VI
I
VI
II
CHAPTER 1 INTRODUCTION

Chapter 1

INTRODUCTION

The Online Bus Ticket Booking System for Travel Management is a mini project that aims to
provide a convenient and user-friendly platform for travelers to search and book bus tickets online.
This project utilizes the power of database management using MySQL to store and manage the
necessary information related to buses, routes, schedules, and bookings.

The system allows users to search for buses based on their desired origin and destination, along
with the preferred travel date. Upon entering these details, the system retrieves relevant
information from the database and displays available bus options, including departure time,
duration, fare and seat availability.

The Online Bus Ticket Booking System for Travel Management is a pioneering project aimed at
revolutionizing the way bus transportation is planned, booked, and managed within the broader
context of travel arrangements. In an era where seamless integration and efficiency are paramount
in the travel industry, this project seeks to provide a comprehensive solution that caters to the
needs of both individual travelers and travel coordinators.

Need for the project:

As the travel industry continues to evolve, the demand for efficient and user-friendly solutions has
grown significantly. Bus transportation, a crucial component of travel, often faces challenges
related to manual booking processes, lack of real-time information, and disjointed coordination
within the broader travel itinerary. This project addresses these challenges by introducing an
innovative Online Bus Ticket Booking System integrated into the larger framework of travel
management.

DEPT. OF CSE, SIR MVIT 2023-2024 1


CHAPTER 1 INTRODUCTION

OBJECTIVES
The primary objectives of this project are as follows:

Seamless Integration: Develop a system that seamlessly integrates bus ticket booking into travel
management platforms, ensuring a unified and streamlined experience for both travelers and travel
coordinators.

Real-Time Information: Provide travelers with real-time information on bus schedules, seat
availability, and ticket prices, empowering them to make informed decisions while planning their
journeys.

Efficient Coordination: Enable travel coordinators to efficiently plan and manage bus
transportation as an integral part of the overall travel itinerary, fostering better organization and
coordination.

User-Friendly Interface: Design a user-friendly interface that caters to the diverse needs of
individual travelers and large groups, making the bus ticket booking process intuitive and accessible.

Expense Tracking: Implement features that allow travel managers to track and analyze bus travel
expenses, facilitating better budget management and financial decision-making.

Enhanced Communication: Foster improved communication between travelers and travel


coordinators through the provision of notifications, updates, and alerts related to bus reservations
and travel plans.

DEPT. OF CSE, SIR MVIT 2023-2024 2


CHAPTER 2 FRONT END AND BACK END

Chapter 2

FRONT END AND BACK END

1. FRONT-END

• HTML
• CSS
• JAVASCRIPT
• BOOTSTRAP4

2. BACK-END
• PHP
• PHPMYADMIN USED FOR MYSQL DATABASE
• XAMPP SERVER

DEPT. OF CSE, SIR MVIT 2023-2024 3


CHAPTER 2 FRONT END AND BACK END

HTML (Hyper Text Markup Language)

FIG 2.1: HTML

2.1 Introduction to HTML

HTML, short for Hypertext Markup Language, is the cornerstone of the web, forming the
fundamental structure that underpins every webpage. It serves as the language that web browsers use
to interpret and display content, allowing developers to create rich, interconnected digital
experiences. HTML achieves this through a series of tags that define the elements of a webpage,
from headings and paragraphs to images and links.

Web development begins with HTML, as it provides the framework upon which content is organized
and presented. Its semantic structure allows developers to signify the importance and relationships
between different sections, aiding accessibility and search engine optimization. By defining
headings, lists, forms, and more, HTML establishes the building blocks that serve as the canvas for
design and interactivity.

DEPT. OF CSE, SIR MVIT 2023-2024 4


CHAPTER 2 FRONT END AND BACK END

2.2 Tags in HTML


Tags in HTML are predefined elements that structure and format content within a webpage. They
define how content should be displayed or function, such as headings, paragraphs, links, images, and
more. Tags are enclosed in angle brackets, with opening and closing tags used to encapsulate content
and apply desired effects.

1. <h1> to <h6> (Headings): These tags define headings of varying levels, where <h1> isthe
highest and <h6> is the lowest. They provide structure and hierarchy to content.

2. <p> (Paragraph): This tag creates paragraphs of text, separating content into readable blocks.

3. <a> (Anchor): Used for creating hyperlinks, the <a> tag enables linking to other webpagesor
resources.

4. <img> (Image): The <img> tag embeds images into a webpage, enhancing visual content.

5. <ul> (Unordered List) and <ol> (Ordered List): These tags create bullet-pointed and
numbered lists, respectively.

6. <li> (List Item): Works within <ul> or <ol> to define individual list items.

<div> (Division): A versatile container used for grouping and styling content sections.

HTML Example code and output (Demonstration)

FIG 2.2: HTML CODE AND WEB PAGE

DEPT. OF CSE, SIR MVIT 2023-2024 5


CHAPTER 2 FRONT END AND BACK END

CSS (Cascading Style Sheets)


2.3 What is CSS ?

CSS (Cascading Style Sheets) is a powerful language used in web development to control the visual
appearance of HTML elements. It enables designers and developers to apply styles like colors, fonts,
spacing, and layout to web content, making it visually appealing and enhancing user experience.

CSS is vital for web development as it decouples the presentation layer from the content layer,
allowing for consistent styling across an entire website. This separation promotes efficient
maintenance and updates, as changes to the visual design can be made without altering the
underlying content. Moreover, CSS facilitates responsive design, enabling websites to adapt
gracefully to various screen sizes and devices. This is achieved through media queries that adjust
styles based on the device's characteristics.

In essence, CSS empowers developers to transform raw HTML into aesthetically pleasing and user-
friendly web interfaces. It fosters creativity and control over design, improves site performance, and
ensures a seamless and consistent visual experience across different platforms and devices.

FIG 2.3: CSS LOGO

DEPT. OF CSE, SIR MVIT 2023-2024 6


CHAPTER 2 FRONT END AND BACK END

2.4 CSS example

CSS Example source code

DEPT. OF CSE, SIR MVIT 2023-2024 7


CHAPTER 2 FRONT END AND BACK END

Javascript
2.5 Introduction to Javascript
JavaScript is a dynamic programming language that plays a pivotal role in web development.
Originally developed to enhance the interactivity of webpages, JavaScript has evolved into a
versatile tool for creating interactive user experiences and adding functionality to websites.

Importance of JavaScript in Web Development: JavaScript empowers developers to


create engaging, responsive, and dynamic web applications. It enables real-time updates, form
validation, animations, and interactive features that enhance user engagement. With the rise of Single
Page Applications (SPAs) and modern web frameworks like React, Angular, and Vue.js, JavaScript's
significance has grown even further.

Additionally, JavaScript is essential for asynchronous programming, enabling actions to be


performed without waiting for preceding operations to complete. This is crucial for smooth user
experiences, as data can befetched from servers, content can be updated, and user input can be
processed without causing page reloads or disruptions.

2.6 JavaScript DOM (Document Object Model)


The Document Object Model (DOM) is a programming interface for web documents. It represents
the structure of a webpage as a tree of objects, where each object corresponds to a part of the
document, such as elements, attributes, and text. JavaScript interacts with the DOM to manipulate
and modify the content and behavior of webpages dynamically.

2.5: Javascript

DEPT. OF CSE, SIR MVIT 2023-2024 8


CHAPTER 2 FRONT END AND BACK END

2.7 JavaScript and DBMS

The integration of JavaScript with Database Management Systems (DBMS) is crucial for modern
web development. Utilizing server-side JavaScript frameworks like Node.js ensures a consistent
language throughout the application stack. Through RESTful APIs and asynchronous operations,
developers can seamlessly interact with diverse databases, be they relational (e.g., MySQL,
PostgreSQL) or NoSQL (e.g., MongoDB).

a. Server-Side JavaScript:
Traditionally, JavaScript was limited to client-side execution within web browsers. However, with
the advent of server-side JavaScript frameworks like Node.js, developers can now use JavaScript for
back-end development as well.

b. RESTful APIs:
Representational State Transfer (REST) is a widely adopted architectural style for building web
services. JavaScript can interact with DBMS through RESTful APIs, enabling communication
between the front-end and back-end components of an application. RESTful APIs provide a
standardized way to request and manipulate data in the database, fostering a modular and scalable
architecture.

c. Asynchronous JavaScript and Database Operations:


JavaScript's asynchronous nature is well-suited for handling non-blocking operations, making it
ideal for interacting with databases. Asynchronous frameworks and libraries, such as Promises and
async/await, enhance the efficiency of database operations by allowing developers to write code that
doesn't block the execution thread, improving the overall performance of web applications.

2.6: Javascript Example

DEPT. OF CSE, SIR MVIT 2023-2024 9


CHAPTER 2 FRONT END AND BACK END

Backend Development
2.8 Introduction to Backend Development: Engine of Web Functionality

Backend development powers the hidden machinery of web applications, orchestrating data
processing, server management, and complex functionalities that users rarely see but heavily rely
on. It involves designing, building, and maintaining the server-side logic that supports the front end's
user interfaces. Backends manage databases, user authentication, APIs, and more, ensuring smooth
interactions between users and the application.

Backend developers wield programming languages like Python, Ruby, PHP, and Node.js to create
the logic that drives the application's core operations. They design APIs that facilitate
communication between frontend and backend, enabling data exchange and functionality. In an era
where user experiences are increasingly dynamic, backend development remains the backbone,
working silently to deliver the seamless and efficient services that underpin our digital world.

2.7 :Frontend and Backend relation

DEPT. OF CSE, SIR MVIT 2023-2024 10


CHAPTER 3 SPECIFICATIONS

Chapter 3

SPECIFICATIONS

3.1 SOFTWARE REQUIREMENTS

1. Web Browser Compatibility:


 The system should be compatible with major web browsers such as Google
Chrome, Mozilla Firefox, Safari, and Microsoft Edge.
2. Development Environment:
 The project should be developed using a suitable integrated development
environment (IDE) for web development (e.g., Visual Studio Code, Sublime Text).
3. Backend Frameworks:
 PHP version 7.x or higher should be used for the server-side scripting.
 MySQL version 5.7 or later should be the preferred database management system.
4. Frontend Technologies:
 HTML5 for markup.
 CSS3 for styling.
 JavaScript for client-side interactivity.

Functional Requirements:
1. User Authentication:
 Users should be able to register, log in, and log out.
 Implement user roles (e.g., admin, regular user).
2. Database Schema:
 Define a well-structured database schema to store relevant data.
 Tables for users, data entries, etc., based on the project's specific requirements.
3. CRUD Operations:
 Users should be able to perform CRUD (Create, Read, Update, Delete) operations
on data.
 Implement forms for data entry and editing.
4. Search and Filter:
 Users should be able to search and filter data based on specific criteria.
5. Data Validation:
 Implement validation on the server side to ensure data integrity.

DEPT. OF CSE, SIR MVIT 2023-2024 11


CHAPTER 3 SPECIFICATIONS

Non-Functional Requirements:
1. Performance:
 The system should handle a reasonable amount of concurrent users.
 Optimize database queries and frontend code for performance.
2. Scalability:
 The system should be designed to scale as the user base and data volume grow.
3. Reliability:
 Ensure the system is reliable and available with minimal downtime.
4. Usability:
 The user interface should be intuitive and user-friendly.
5. Accessibility:
 Ensure that the application is accessible to users with disabilities.
6. Data Backup and Recovery:
 Implement regular backups of the database to prevent data loss.
 Develop a recovery plan in case of system failure.

DEPT. OF CSE, SIR MVIT 2023-2024 12


CHAPTER 3 SPECIFICATIONS

3.2 : HARDWARE REQUIREMENTS


The hardware requirements for a DBMS project using HTML, CSS, JS, PHP, and MySQL can vary
depending on factors such as the scale of the project, expected user load, and performance
requirements. Here's a basic set of hardware requirements to get you started:

1. Web Server:

 A dedicated or cloud-based web server is recommended.

 Minimum 2 CPU cores (e.g., dual-core) for handling web server processes.

 4 GB RAM or higher for optimal performance.

2. Database Server:

 A separate server or instance for MySQL database management.

 Minimum 2 CPU cores for handling database operations.

 8 GB RAM or higher for efficient database performance.

 Adequate storage space based on the expected data volume (consider using SSDs for
better performance).

3. Network:

 High-speed internet connection for serving web pages and handling database queries
efficiently.

 Adequate bandwidth to handle concurrent user connections.

4. Load Balancer (Optional):

 If expecting high traffic, consider implementing a load balancer to distribute


incoming requests across multiple web server instances.

5. Backup System:

 Implement a reliable backup solution with sufficient storage capacity to regularly


back up the database and application data.

6. Firewall and Security Measures:

 Use a firewall to protect the server from unauthorized access.

 Implement security best practices for both the web and database servers.

DEPT. OF CSE, SIR MVIT 2023-2024 13


CHAPTER 4 SYSTEM DESIGN

Chapter 4

SYSTEM DESIGN

4.1 Entity Relationship Diagram

FIG 4.1 : ER DIAGRAM 0F BUS TICKET BOOKING SYSTEM

DEPT. OF CSE, SIR MVIT 2023-2024 14


CHAPTER 4 SYSTEM DESIGN

Creating a comprehensive ER (Entity-Relationship) diagram description requires more space than


can be accommodated in a single response, but I'll provide a brief summary. A detailed ER diagram
description typically covers entities, relationships, attributes, and cardinalities.

Entities and Relationships

Admin Entity:
 Represents administrators with attributes AID (primary key), NAME, and PSW.
BusDetails Entity:
 Represents bus details with attributes BUS_ID (primary key), NAME, FARE,
NO_OF_SEATS, TYPE, Time, BFROM, BTO, BNO, and BNAME.
BookingDetails Entity:
 Represents booking details with attributes BUS_ID (primary key), BFROM, BTO,
VACANT, and JDATE.
Ticket Entity:
 Represents tickets with attributes TID (primary key), SEAT_NO, U_ID, PNAME,
NO_SEAT, B_ID, J_DATE, TICKET_STATUS, and BOOKING_DATE.
UserInfo Entity:
 Represents user information with attributes AGE, UID(primary key), UName,
AADHARNO (unique), PSW, Email, and Name.
Relationships:
 "Admin" (AID) is related to "BusDetails" (NAME) with a one-to-many relationship,
indicating that an administrator can manage multiple bus details.
 "Ticket" (TID) is related to "BusDetails" (BUS_ID) with a one-to-many relationship,
indicating that a ticket can be associated with a specific bus.
 "Ticket" (SEAT_NO) is related to "UserInfo" (U_ID) with a one-to-one relationship,
indicating that a seat is associated with a user.
 "BookingDetails" (BUS ID) is related to "BusDetails" (BUS ID) with a one-to-one
relationship, indicating a specific bus for booking.

DEPT. OF CSE, SIR MVIT 2023-2024 15


CHAPTER 4 SYSTEM DESIGN

Additional Details and Cardinalities

 Attributes and Data Types:


 Mention the data types and constraints of each attribute (e.g., VARCHAR, INT,
DATETIME).
 Cardinalities:
 Specify the cardinalities of relationships (one-to-one, one-to-many, many-to-many).
 Key Constraints:
 Highlight primary and foreign key constraints.
 ER Diagram Notation:
 Briefly describe the notation used in the ER diagram (e.g., crow's foot notation for
cardinalities).
 Entities and Relationships Overview:
 Provide a concise summary of each entity's role and its relationships.

Remember to include visual representations of the entities, attributes, and relationships in the ER
diagram. This summary provides a starting point for a more detailed description tailored to your
specific ER diagram.

DEPT. OF CSE, SIR MVIT 2023-2024 16


CHAPTER 4 SYSTEM DESIGN

4.2 UML diagram

FIG 4.2 : UML DIAGRAM OF BUS TICKET BOOKING


SYSTEM

DEPT. OF CSE, SIR MVIT 2023-2024 17


CHAPTER 4 SYSTEM DESIGN

DESCRIPTION OF UML DIAGRAM

Creating a Unified Modeling Language (UML) diagram for your scenario involves representing
classes, attributes, relationships, and cardinalities. I'll describe a simplified version of a UML Class
Diagram for the given tables:

Class Diagram:

1. Admin Class:
 Attributes: AID (String), NAME (String), PSW (String)
2. BusDetails Class:
 Attributes: BUS_ID (String), NAME (String), FARE (int), NO_OF_SEATS (int),
TYPE (String), Time (Time), BFROM (String), BTO (String), BNO (String),
BNAME (String)
3. BookingDetails Class:
 Attributes: BUS_ID (String), BFROM (String), BTO (String), VACANT (String),
JDATE (Time)
4. Ticket Class:
 Attributes: TID (String), SEAT_NO (int), U_ID (String), PNAME (String),
NO_SEAT (String), B_ID (String), J_DATE (DateTime), TICKET_STATUS
(boolean), BOOKING_DATE (DateTime)
5. UserInfo Class:
 Attributes: AGE (int), UID (String), UName (String), AADHARNO (String), PSW
(String), Email (String), Name (String)

Relationships:
1. Admin to BusDetails (Association):
 One Admin can manage multiple BusDetails (1 to *)
2. Ticket to BusDetails (Association):
 One Ticket is associated with one BusDetails (1 to 1)
3. Ticket to UserInfo (Association):
 One Ticket is associated with one UserInfo (1 to 1)
4. BookingDetails to BusDetails (Association):
 One BookingDetails is associated with one BusDetails (1 to 1)

DEPT. OF CSE, SIR MVIT 2023-2024 18


CHAPTER 4 SYSTEM DESIGN

Additional Information:

 Multiplicity:
 Multiplicity indicates the number of instances of one class related to the number of
instances of another class.
 (*): Zero or more instances, (1): Exactly one instance.
 Attributes and Data Types:
 Include attribute names and data types in each class.
 Navigability:
 Represent the direction of the association (if applicable).
 Aggregation/Composition:
 Consider whether there are parts or components within a whole (indicate using a
diamond shape).

This simplified UML Class Diagram captures the basic structure and relationships between the
classes. Remember that you can further refine it based on your specific requirements, adding more
details, such as methods, visibility, and additional constraints if necessary.

DEPT. OF CSE, SIR MVIT 2023-2024 19


CHAPTER 5 CONCEPTUAL DESIGN
Chapter 5

CONCEPTUAL DESIGN

5.1 Create commands

1. Admin Table:
 Admin table stores information about administrators.
 Columns: AID (Primary Key), NAME, PSW.
 AID is the primary key, ensuring each administrator has a unique identifier.
2. BusDetails Table:
 BusDetails table holds details about buses, including schedules and routes.
 Columns: BUS_ID (Primary Key), NAME, FARE, NO_OF_SEATS, TYPE, Time,
BFROM, BTO, BNO, BNAME.
 BUS_ID serves as the primary key, uniquely identifying each bus.
3. BookingDetails Table:
 BookingDetails table stores details about bookings for buses.
 Columns: BUS_ID (Primary Key, Foreign Key), BFROM, BTO, VACANT, JDATE.
 The FOREIGN KEY constraint references the BUS_ID in BusDetails, establishing a
relationship.
4. Ticket Table:
 Ticket table contains information about booked tickets.
 Columns: TID (Primary Key), SEAT_NO, U_ID (Foreign Key), PNAME,
NO_SEAT, B_ID (Foreign Key), J_DATE, TICKET_STATUS,
BOOKING_DATE.
 FOREIGN KEY constraints link B_ID to BusDetails(BUS_ID) and U_ID to
UserInfo(UID).
5. UserInfo Table:
 UserInfo table stores user information for those booking tickets.
 Columns: AGE, UID(Primary Key), UName, AADHARNO (Unique), PSW, Email,
Name.
 AADHARNO is unique, ensuring uniqueness among users.

DEPT. OF CSE, SIR MVIT 2023-2024 20


CHAPTER 5 CONCEPTUAL DESIGN

CREATE TABLE Admin (


AID VARCHAR(50) PRIMARY KEY,
NAME VARCHAR(50),
PSW VARCHAR(50)
);

CREATE TABLE BusDetails (


BUS_ID VARCHAR(50) PRIMARY KEY,
NAME VARCHAR(50),
FARE INT,
NO_OF_SEATS INT,
TYPE VARCHAR(50),
Time TIME(6),
BFROM VARCHAR(50),
BTO VARCHAR(50),
BNO VARCHAR(50),
BNAME VARCHAR(50)
);

CREATE TABLE BookingDetails (


BUS_ID VARCHAR(50) PRIMARY KEY,
BFROM VARCHAR(50),
BTO VARCHAR(50),
VACANT VARCHAR(50),
JDATE TIME(6),
FOREIGN KEY (BUS_ID) REFERENCES
BusDetails(BUS_ID)
);

CREATE TABLE Ticket (


TID VARCHAR(50) PRIMARY KEY,
SEAT_NO INT,
U_ID VARCHAR(50),
PNAME VARCHAR(100),
NO_SEAT VARCHAR(20),
B_ID VARCHAR(20),
J_DATE DATETIME(6),
TICKET_STATUS BIT,
BOOKING_DATE DATETIME(6),
FOREIGN KEY (B_ID) REFERENCES BusDetails(BUS_ID),
FOREIGN KEY (U_ID) REFERENCES UserInfo(UID)
);

CREATE TABLE UserInfo (


AGE INT PRIMARY KEY,
UID VARCHAR(50), UName
VARCHAR(50),
AADHARNO VARCHAR(20) UNIQUE,
PSW VARCHAR(20),
Email VARCHAR(100),
Name VARCHAR(50)
);

DEPT. OF CSE, SIR MVIT 2023-2024 21


CHAPTER 5 CONCEPTUAL DESIGN

5.2 Insert Commands and Data

1. INSERT INTO `admin` (`a_id`, `name`, `psw`) VALUES(1, 'admin', 'admin');

2. INSERT INTO `booking_det` (`bus_id`, `vacant`, `jdate`, `bfrom`, `bto`) VALUES


(3, 75, '2019-11-16', 'Bhind ', 'Delhi'),
(2, 78, '2019-11-21', 'Bhind ', 'Delhi'),
(5, 70, '2019-11-23', 'Bangalore', 'Ladakh');

3. INSERT INTO `bus_details` (`bus_id`, `bname`, `bno`, `bfrom`, `bto`, `time`, `type`, `no_seat`, `fare`)
VALUES
(2, 'Toofan Express', 'mp 30 sc 0137', 'Bhind ', 'Delhi', '6pm', 'Ac', 80, 1000),
(3, 'Satabdi Express', 'MP07 Se1212', 'Bhind ', 'Delhi', '7 pm', 'Non Ac', 80, 500),
(4, 'Janrath', 'up16sc1212', 'Lucknow', 'gorakhpur', '6am', 'Ac', 80, 350),
(5, 'Taj express', 'mp30Ka1213', 'Bangalore', 'Ladakh', '8AM', 'Ac', 80, 5000);

4. INSERT INTO `ticket` (`tid`, `bus_id`, `uid`, `seat_no`, `no_seat`, `ticket_status`, `jdate`, `booking_date`,
`pname`) VALUES
(1, 3, 1, ' 1 2', 2, 'Conform', '2019-11-16', '2019-11-17', 'rajesh'),
(2, 2, 1, ' 1 2', 2, 'Conform', '2019-11-21', '2019-11-21', 'Rajesh'),
(3, 5, 2, ' 1 2 3 4 5 6 7 8 9 10', 10, 'Conform', '2019-11-23', '2019-11-21', 'Nishant'),
(4, 3, 3, ' 3 4 5', 3, 'Conform', '2019-11-16', '2019-11-21', 'Rajeev Kumar');

5. INSERT INTO `user_info` (`uid`, `name`, `uname`, `age`, `adhar_no`, `psw`, `email`) VALUES
(1, 'Rajesh', 'rajesh', '22', '123456', 'rajesh', 'raj@gmail.com'),
(2, 'Nishant', 'nishant', '22', '12345', 'nishant', 'ni@gmail.com'),
(3, 'Rajeev Kumar', 'rajeev', '23', '1234567', 'rajeev', 'ra@gmail.com');

DEPT. OF CSE, SIR MVIT 2023-2024 22


CHAPTER 5 CONCEPTUAL DESIGN

5.3 SQL Queries

1. SELECT bus_details.bname, AVG(booking_det.vacant) AS avg_vacant_seats


FROM bus_details
JOIN booking_det ON bus_details.bus_id = booking_det.bus_id
GROUP BY bus_details.bname;

| bname | avg_vacant_seats |
|---------------------|----------------------|
| Toofan Express | 76.5 |
| Satabdi Express | 72.5 |
| Janrath | [average_value] |
| Taj express | [average_value] |

Process :-
1. Identify the tables involved: bus_details and booking_det.
2. Use a JOIN operation to combine the tables based on the common column
bus_id.
3. Apply the AVG() aggregate function to calculate the average of the vacant
seats.
4. Group the results by the bname column.
5. Present the results showing bname and the calculated average vacant seats.
6. Interpret the results, understanding the average vacant seats per bus.
7. Handle incomplete data by representing average values for buses with no
bookings.

2. SELECT * FROM user_info;


+-----+--------------+---------+-----+---------+--------+-------------------+
| uid | name | uname | age | adhar_no| psw | email |
+-----+--------------+---------+-----+---------+--------+-------------------+
| 1 | Rajesh | rajesh | 22 | 123456 | rajesh | raj@gmail.com |
| 2 | Nishant | nishant | 22 | 12345 | nishant| ni@gmail.com |
| 3 | Rajeev Kumar | rajeev | 23 | 1234567 | rajeev | ra@gmail.com |
+-----+--------------+---------+-----+---------+--------+-------------------+

3. SELECT uid, COUNT(DISTINCT jdate) AS num_journeys


FROM ticket
GROUP BY uid
HAVING num_journeys > 1;

| uid | num_journeys |
|-----|-------------------|
|1 |2 |
|2 |1 |
|3 |1 |

DEPT. OF CSE, SIR MVIT 2023-2024 23


CHAPTER 5 CONCEPTUAL DESIGN

4. SELECT bus_details.bname, SUM(bus_details.fare) AS total_revenue


FROM bus_details
JOIN ticket ON bus_details.bus_id = ticket.bus_id
WHERE ticket.ticket_status = 'Conform'
GROUP BY bus_details.bname;

| bname | total_revenue |
|---------------------|------------------|
| Toofan Express | 1000 |
| Satabdi Express | 500 |
| Janrath | [total_value] |
| Taj express | [total_value] |

5.
SELECT uid AS id, name, uname AS username, age, adhar_no, psw AS
password, email
FROM user_info
UNION
SELECT a_id AS id, name, NULL AS username, NULL AS age, NULL AS
adhar_no, psw AS password, NULL AS email
FROM admin;

| id | name | username | age | adhar_no | password | email |


|----|----------------|----------|-----|----------|----------|----------------|
| 1 | Rajesh | rajesh | 22 | 123456 | rajesh | raj@gmail.com |
| 2 | Nishant | nishant | 22 | 12345 | nishant | ni@gmail.com |
| 3 | Rajeev Kumar | rajeev | 23 | 1234567 | rajeev | ra@gmail.com |
| 1 | admin | admin | NULL| NULL | admin | NULL |

Trigger operation:- Updates booking_datails and reduces no. of seats.

Below is a trigger that utilizes a cursor in MySQL. This trigger is designed to enforce a constraint on the
booking_det table. It ensures that whenever a new ticket is inserted into the ticket table, the corresponding
vacant count in the booking_det table is updated accordingly, reducing the number of available seats.

DELIMITER $$

CREATE PROCEDURE book_ticket(busID INT, userID INT, seatCount INT, bookingDate DATE,
passengerName VARCHAR(30))
BEGIN
DECLARE vacantSeats INT;
DECLARE doneBooking INT DEFAULT FALSE;
DECLARE availableSeats INT;
DECLARE c_booking CURSOR FOR
SELECT vacant FROM booking_det WHERE bus_id = busID;

-- Check if there are enough vacant seats


DEPT. OF CSE, SIR MVIT 2023-2024 24
CHAPTER 5 CONCEPTUAL DESIGN
SELECT vacant INTO vacantSeats FROM booking_det WHERE bus_id = busID;

IF vacantSeats >= seatCount THEN


-- Insert ticket
INSERT INTO ticket (bus_id, uid, seat_no, no_seat, ticket_status, jdate, booking_date, pname)
VALUES (busID, userID, '', seatCount, 'Conform', CURDATE(), bookingDate, passengerName);

-- Update vacant seats count


UPDATE booking_det
SET vacant = vacant - seatCount
WHERE bus_id = busID;

SELECT 'Ticket(s) booked successfully.';


ELSE
SELECT 'Sorry, there are not enough vacant seats for this booking.';
END IF;

-- Open the cursor and fetch available seats after booking


OPEN c_booking;
read_booking_loop: LOOP
FETCH c_booking INTO availableSeats;
IF doneBooking THEN
LEAVE read_booking_loop;
END IF;
END LOOP;
CLOSE c_booking;

-- Display available seats


SELECT CONCAT('Available seats after booking: ', availableSeats) AS Message;
END$$

CREATE TRIGGER update_vacant_seats AFTER INSERT ON ticket


FOR EACH ROW
BEGIN
DECLARE busID INT;
DECLARE numSeats INT;

-- Fetch busID and numSeats for the inserted ticket


SELECT bus_id, no_seat INTO busID, numSeats FROM ticket WHERE tid = NEW.tid;

-- Update vacant seats count for the bus


UPDATE booking_det
SET vacant = vacant - numSeats
WHERE bus_id = busID;
END$$

DELIMITER ;

DEPT. OF CSE, SIR MVIT 2023-2024 25


CHAPTER 5 CONCEPTUAL DESIGN

 I've added error handling using a CONTINUE HANDLER to handle situations where no seats or
bookings are found for a given bus and journey date. This ensures the procedure doesn't throw an error
if there's no data found.
 Comments have been added to explain the purpose of each section of the procedure.
 The trigger remains the same, calling the calculate_and_update_vacant_seats procedure for each new
row inserted into the ticket table.

The SQL code provided creates a trigger named update_vacant_seats. This trigger fires after each
INSERT operation on the ticket table. It aims to update the count of vacant seats for the corresponding
bus in the booking_det table.

However, please note that the output of this code would typically be produced within a SQL
environment or management tool such as MySQL Workbench, phpMyAdmin, or a similar tool that
supports executing SQL scripts.

When executed, this SQL script would:

Create the update_vacant_seats trigger.


Set the delimiter to $$ to allow defining the trigger body.
Define the trigger body, which includes declaring variables, fetching the busID and numSeats for the
inserted ticket, and updating the vacant seats count for the corresponding bus.
Reset the delimiter to the default (;) to signify the end of the SQL statement.

DEPT. OF CSE, SIR MVIT 2023-2024 26


CHAPTER 5 CONCEPTUAL DESIGN

Report Generated:

DEPT. OF CSE, SIR MVIT 2023-2024 27


CHAPTER 6 Front End Design, Connectivity and Implementation

CHAPTER 6

FRONT END DESIGN, CONNECTIVITY AND IMPLEMENTATION

6.1 Module 1: Bus listing

The Bus Listing Module is a key feature of our Online Ticket Booking System, offering users a centralized and
comprehensive view of available bus services. Leveraging data from the bus_details, booking_det, and related
tables, this module serves as a user-friendly platform for browsing and selecting buses that cater to diverse travel
needs.
Key Features:

6. Overview of Available Buses:


The module provides users with a curated list of available buses, showcasing essential information such
as bus name, number, departure, and arrival locations.

7. Visual Representation of Routes:


Users can access an intuitive visual representation of bus routes, offering a clear understanding of the
journey itinerary, including departure and arrival points.

8. Dynamic Seat Availability Status:


Real-time seat availability information is dynamically displayed for each bus, allowing users to identify
buses with the desired number of vacant seats.

9. Detailed Bus Specifications:


Users can access detailed specifications for each bus, including its type (AC/Non-AC), total number of
seats, departure time, and fare details.

10. Sorting and Filtering Options:


The module offers sorting and filtering options based on various parameters such as bus type, departure
time, and seat availability, enabling users to tailor their search according to their preferences.
By incorporating the Bus Listing Module into our Online Ticket Booking System, we aim to simplify the
process of bus selection for users, providing them with a centralized platform to explore, compare, and
choose from a diverse range of available buses. This module plays a crucial role in enhancing the overall
user journey and facilitating efficient travel planning and booking.

DEPT. OF CSE, SIR MVIT 2023-2024 28


CHAPTER 6 Front End Design, Connectivity and Implementation

6.2 Module 2: Bus search


The Bus Search Module is a pivotal component of our Online Ticket Booking System, designed to empower
users with a streamlined and efficient way to find specific buses based on their preferences and travel
requirements. Leveraging data from the bus_details, booking_det, and related tables, this module ensures that
users can easily locate buses that match their criteria.

Key Features:

1. Advanced Search Parameters:

Users have the flexibility to perform advanced searches based on various parameters such as bus type
(AC/Non-AC), departure and arrival locations, departure time, and seat availability.

2. Customizable Filters:

The module offers customizable filters, allowing users to tailor their search criteria according to their
preferences. Filters may include bus type, route, departure time range, and available seats.

3. Real-time Seat Availability Updates:

Users can view real-time updates on seat availability, ensuring that they make informed decisions when
searching for buses for their preferred travel date.

4. Dynamic Route Visualization:

An interactive map or visual representation of bus routes enhances the user experience, providing a clear
overview of the journey itinerary and helping users make more informed choices.

By incorporating the Bus Search Module into our Online Ticket Booking System, we aim to provide users
with a powerful tool to efficiently find buses that align with their preferences and travel plans. This module
contributes to an enhanced user experience, making the process of bus selection and booking more intuitive
and user-friendly.

DEPT. OF CSE, SIR MVIT 2023-2024 29


CHAPTER 6 Front End Design, Connectivity and Implementation

6.3 Module 3: Ticket booking

The Ticket Booking Module is a fundamental element of our Online Ticket Booking System, providing
users with a streamlined and user-friendly platform to reserve and confirm seats for their preferred bus
journeys. This module leverages data from tables such as ticket, bus_details, user_info, and related entities
to facilitate a seamless ticket booking experience

Key Features

1. User Authentication and Profile Management:

Users are required to log in securely to their accounts, ensuring a personalized and secure booking
experience. The module supports profile management, allowing users to update personal information,
view booking history, and manage their preferences.

2. Bus Selection and Journey Details:

Users can search and select buses based on various criteria, including departure and arrival locations,
journey date, and bus type. The module provides detailed information about each bus, including its name,
number, departure time, and fare.

3. Dynamic Seat Selection

An interactive seat map enables users to visually select and reserve specific seats on the chosen bus. Real-
time seat availability is displayed, allowing users to make informed decisions about their seating
preferences.

4. Journey Date Selection

Users can effortlessly choose their preferred journey date, and the module dynamically fetches and
displays real-time information on bus availability for the selected date.

DEPT. OF CSE, SIR MVIT 2023-2024 30


CHAPTER 6 Front End Design, Connectivity and Implementation

6.4 Module 4: Fetching ticket details


The Ticket Details Fetching Module is an integral part of our Online Ticket Booking System, designed to
retrieve and present comprehensive information about users' booked tickets. Leveraging data from the
ticket, bus_details, user_info, and related tables, this module offers users a centralized platform to access
and manage details related to their ticket reservations.

Key Features:
1. User Authentication and Security:
To access ticket details, users must authenticate securely into their accounts. This ensures that sensitive
ticket information is only accessible to authorized individuals.

2. Booking History Overview:


The module provides users with an overview of their booking history, displaying a list of past and upcoming
journeys. This allows users to quickly review and manage their entire travel itinerary.

3. Detailed Ticket Information:


Users can retrieve detailed information about each booked ticket, including the bus details (bus name,
number, departure time), seat numbers, journey date, and the current status of the ticket (e.g., confirmed,
pending).

4. E-Ticket Access:
The module allows users to access electronic tickets (e-tickets) for their booked journeys. E-tickets serve as
digital records and can be conveniently downloaded or presented digitally during the travel process.

5. Real-time Updates:
Users receive real-time updates on their ticket status, ensuring they are informed of any changes or updates
related to their booked journeys. This includes updates on seat confirmations, changes to the bus schedule,
or any relevant travel information.

DEPT. OF CSE, SIR MVIT 2023-2024 31


CHAPTER 6 Front End Design, Connectivity and Implementation

6.5 Module 5: User signup


The User Signup Module is a fundamental component of our Online Ticket Booking System, facilitating a
seamless and secure process for users to create accounts and access personalized features. Leveraging data
from the user_info table, this module ensures a user-friendly signup experience and establishes a foundation
for users to engage with the booking system.

Key Features

1. User Registration:
New users can initiate the signup process by providing essential information such as their name, username,
age, Aadhar number, email, and password. The registration form is designed to be intuitive and
straightforward.

2. Email Verification:
To enhance account security, users receive a verification email upon successful registration. Clicking the
verification link ensures the validity of the provided email address and activates the user account.

3. Profile Creation:
Upon successful verification, users can complete their profiles by adding additional details such as age,
Aadhar number, and other relevant information. This enhances the personalization of the user experience.

4. Secure Password Management:


The signup module employs secure password management practices, including encryption and password
strength requirements, to ensure the protection of user accounts.

5. User Authentication:
The module supports secure user authentication mechanisms, requiring users to log in using their registered
email and password. This ensures that only authorized users can access personalized features.

DEPT. OF CSE, SIR MVIT 2023-2024 32


CHAPTER 7 SOURCE CODE-FRONT END

CHAPTER 7
Source Code- Front end

1. Bus listing
if (isset($_POST['bus'])) {
$bname=$_POST['bname'];
$bno=$_POST['bno'];
$from=$_POST['from'];
$to=$_POST['to'];
$time=$_POST['time'];
$seat=$_POST['sno'];
$type=$_POST['rad'];
$fare=$_POST['fare'];
$sql="SELECT * FROM bus_details WHERE bno='$bno'AND
bfrom='$from'";
$run=mysqli_query($con,$sql);
if (mysqli_num_rows($run)>0) {
echo "<h4>BUS DETAILS ALREADY EXIST PLEASE ENTER VALID
DETAILS.... THANKS</h4>";
}
else
{
$sql="INSERT INTO bus_details (bus_id, bname, bno, bfrom, bto, time, type,
no_seat ,fare)
VALUES (NULL, '$bname', '$bno', '$from', '$to','$time', '$type', '$seat'
,'$fare')";
$run=mysqli_query($con,$sql);
if ($run) {
header('location:../admin.php');
}
}
}

DEPT. OF CSE, SIR MVIT 2023-2024 33


CHAPTER 7 SOURCE CODE-FRONT END

2. Bus search

if (isset($_POST['search'])) {
$from=$_POST['from'];
$to=$_POST['to'];
$date=$_POST['date'];
$sql="SELECT * FROM booking_det WHERE jdate='$date'AND bfrom='$from'AND bto='$to'AND
vacant>0";
$run=mysqli_query($con,$sql);
if (mysqli_num_rows($run)>0) {
while ($row=mysqli_fetch_array($run)) {
$bus_id=$row['bus_id'];
$vacant=$row['vacant'];
$sql1="SELECT * FROM bus_details WHERE bus_id='$bus_id'";
$run1=mysqli_query($con,$sql1);
$rows=mysqli_fetch_array($run1);
$bname=$rows['bname'];
$bno=$rows['bno'];
$time=$rows['time'];
$type=$rows['type'];
$fare=$rows['fare'];
$from=$_POST['from'];
$to=$_POST['to'];
$date=$_POST['date'];
$sql="SELECT * FROM booking_det WHERE jdate='$date'AND bfrom='$from'AND bto='$to'AND
vacant>0";
$run=mysqli_query($con,$sql);
if (mysqli_num_rows($run)>0) {
while ($row=mysqli_fetch_array($run)) {
$bus_id=$row['bus_id'];
$vacant=$row['vacant'];
$sql1="SELECT * FROM bus_details WHERE bus_id='$bus_id'";
$run1=mysqli_query($con,$sql1);
$rows=mysqli_fetch_array($run1);
$bname=$rows['bname'];
$bno=$rows['bno'];
$time=$rows['time'];
$type=$rows['type'];
$fare=$rows['fare'];

DEPT. OF CSE, SIR MVIT 2023-2024 34


CHAPTER 7 SOURCE CODE-FRONT END

3. Ticket booking
if (isset($_POST['booking'])) {
$jid=$_POST['jid'];
$bid=$_POST['bid'];
$seat=$_POST['seat'];
$name=$_POST['name'];
$no_p=$_POST['no_p'];
$uid=$_SESSION['uid'];
$date=date("Y-m-d");
$vacant=$seat-$no_p;
$sql="SELECT * FROM booking_det WHERE bus_id='$bid'AND jdate='$jid'";
$run=mysqli_query($con,$sql);
if (mysqli_num_rows($run)>0) {
$sql="UPDATE booking_det SET vacant='$vacant' WHERE bus_id='$bid'AND jdate='$jid'";
$run=mysqli_query($con,$sql);
if ($run) {
$sql="SELECT * FROM bus_details WHERE bus_id='$bid'";
$run=mysqli_query($con,$sql);
$row=mysqli_fetch_array($run);
$tseat=$row['no_seat'];
$seatno=$tseat-$seat;
$tseatno="";
for ($i=0; $i <$no_p; $i++) {
++$seatno;
$tseatno=$tseatno." ".$seatno;
}
$sql="SELECT * FROM ticket WHERE uid='$uid'AND pname='$name'AND jdate='$jid' AND
bus_id='$bid' ";
$run=mysqli_query($con,$sql);
if (mysqli_num_rows($run)>0) {
echo "Your ticket is ALREADY booked, please check your ticket";

}else{
$sql="INSERT INTO ticket (tid, bus_id, uid, seat_no, no_seat, ticket_status, jdate, booking_date,
pname) VALUES (NULL, '$bid', '$uid', '$tseatno', '$no_p', 'Conform', '$jid', '$date', '$name')";
$run=mysqli_query($con,$sql);
if ($run) {
echo "Your Ticket is Conformed .....Thank you";

}
}

DEPT. OF CSE, SIR MVIT 2023-2024 35


CHAPTER 7 SOURCE CODE-FRONT END

4. Fetching ticket details

if (isset($_POST['ticket'])) {
$uid=$_SESSION['uid'];
$sql="SELECT * FROM ticket WHERE uid='$uid'";
$run=mysqli_query($con,$sql);
if (mysqli_num_rows($run)==0) {
echo "<h4>First Book the ticket</h4>";
}else{
while ($row=mysqli_fetch_array($run)) {
$bid=$row['bus_id'];
$uid=$row['uid'];
$seat_no=$row['seat_no'];
$no_seat=$row['no_seat'];
$ticket_status=$row['ticket_status'];
$jdate=$row['jdate'];
$booking_date=$row['booking_date'];
$pname=$row['pname'];
$sql1="SELECT * FROM user_info WHERE uid='$uid' ";
$run1=mysqli_query($con,$sql1);
$rows=mysqli_fetch_array($run1);
$age=$rows['age'];
$adhar_no=$rows['adhar_no'];
$email=$rows['email'];
$sql2="SELECT * FROM bus_details WHERE bus_id='$bid'";
$run2=mysqli_query($con,$sql2);
$row1=mysqli_fetch_array($run2);
$bname=$row1['bname'];
$bno=$row1['bno'];
$bfrom=$row1['bfrom'];
$bto=$row1['bto'];
$time=$row1['time'];
$fare=$row1['fare'];
$Tfare=$fare*$no_seat;

DEPT. OF CSE, SIR MVIT 2023-2024 36


CHAPTER 7 SOURCE CODE-FRONT END

5. User signup

if (isset($_POST['signup'])) {
$name=$_POST['name'];
$uname=$_POST['uname'];
$age=$_POST['age'];
$pno=$_POST['pno'];
$aidno=$_POST['aidno'];
$psw=$_POST['psw'];
$email=$_POST['email'];
$sql="SELECT * FROM user_info WHERE uname='$uname'";
$run=mysqli_query($con,$sql);
if (mysqli_num_rows($run)>0) {
echo "<h4>USERNAME ALREADY EXIST PLEASE ENTER VALID USERNAME</h4>";
}else{
$sql="INSERT INTO user_info (uid, name, uname, age, adhar_no, psw, email)
VALUES (NULL, '$name', '$uname', '$age', '$aidno', '$psw', '$email')";
$run=mysqli_query($con,$sql);
if($run){
$_SESSION['uid']=mysqli_insert_id($con);
$_SESSION['uname']=$uname;
header('location:login.php');
}
}
}

DEPT. OF CSE, SIR MVIT 2023-2024 37


CHAPTER 8 RESULTS, DISCUSSIONS AND SCREENSHOTS

CHAPTER 8

RESULTS, DISCUSSIONS AND SCREENSHOTS

8.1 : front page of our website.

8.2 : bus details.

DEPT. OF CSE, SIR MVIT 2023-2024 38


CHAPTER 8 RESULTS, DISCUSSIONS AND SCREENSHOTS

8.3: filling the bus details.

8.4: passengers details.

DEPT. OF CSE, SIR MVIT 2023-2024 39


CHAPTER 8 RESULTS, DISCUSSIONS AND SCREENSHOTS

8.5 Enter Bus Details

8.6 Passenger Details


DEPT. OF CSE, SIR MVIT 2023-2024 40
CHAPTER 8 RESULTS, DISCUSSIONS AND SCREENSHOTS

8.7 Booking Bus Details before trigger

8.8 Booking Bus Details after trigger

DEPT. OF CSE, SIR MVIT 2023-2024 41


CHAPTER 9 CONCLUSION AND SCOPE

CHAPTER 9
CONCLUSION AND SCOPE

CONCLUSION: The Online Bus Ticket Booking System for Travel Management represents a significant
advancement in the realm of travel technology, offering a streamlined and user-friendly platform for booking
bus tickets online. Through the integration of MySQL for robust database management and a combination of
frontend technologies including HTML, CSS, JavaScript, and Bootstrap4, this system provides travelers with
real-time access to bus schedules, seat availability, and fares.

The primary objectives of this project, including seamless integration, real-time information provision, efficient
coordination, user-friendly interface design, expense tracking, and enhanced communication, have been
successfully achieved. By addressing these objectives, the system aims to revolutionize the way bus
transportation is planned, booked, and managed within the broader context of travel arrangements.

SCOPE:

The scope of this project extends beyond the mere booking of bus tickets, encompassing a holistic approach to
travel management. While the current system focuses on bus transportation, there is potential for expansion to
include other modes of transport such as trains or flights. Furthermore, future iterations of the system could
incorporate additional features such as personalized travel recommendations, integration with accommodation
booking platforms, and support for multi-modal travel itineraries.

Additionally, the scalability of the system allows for adaptation to various contexts and user requirements,
catering to individual travelers as well as travel coordinators organizing group trips. With ongoing
technological advancements and feedback from users, there is ample opportunity to enhance the functionality,
user experience, and efficiency of the Online Bus Ticket Booking System for Travel Management.

In conclusion, this project lays the groundwork for a comprehensive and adaptable solution to meet the
evolving needs of travelers and travel management professionals. By embracing innovation and leveraging the
power of technology, the Online Bus Ticket Booking System stands poised to make significant contributions to
the travel industry, fostering convenience, accessibility, and efficiency in the booking and management of bus
transportation.

DEPT. OF CSE, SIR MVIT 2023-2024 42


CHAPTER 10 REFERENCES AND WEBLINKS

REFERENCES AND WEBLINKS

1. https://www.w3schools.com/sql/default.asp
2. https://www.codecademy.com/learn/learn-sql
3. https://learnsql.com/
4. https://www.khanacademy.org/computing/computer-
programming/sql
5. http://sqlzoo.net/
6. http://www.tutorialspoint.com/sql/
7. https://eu.udacity.com/course/intro-to-relational-databases--
ud197
8. https://askyourcode.com/
9. https://webnus.net/free-coding-help-websites/#geeksforgeeks

DEPT. OF CSE, SIR MVIT 2023-2024 43

You might also like