0% found this document useful (0 votes)
41 views

Final Project

Uploaded by

moksharcs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Final Project

Uploaded by

moksharcs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 209

A

PROJECT REPORT
ON
“Cab Booking System”
in
Submission of partial fulfilment for the award of the degree of
Bachelor of Technology
in
Computer Science and Engineering & AIML
Session 2023-2024

A.P.J Abdul Kalam Technical University, Lucknow

Kashi Institute of Technology, Varanasi

Submitted To Submitted By
Mr. Ajay Maurya Pranjal Singh(2004281530007)
Assistant Professor Aditi Singh(2004281530001)
Department of CSE Mokkshada Mishra(2004281530005)
CANDIDATE’S DECLARATION

I hereby declare that the work which is being presented in this dissertation entitled
“Cab Booking Management System” in partial fulfilment of the requirements
for the award of the degree of “Bachelor of Technology Computer Science and
AIML” submitted to the department of Computer science, Faculty of Bachelor of
Technology, Kashi Institute of Technology(affiliated to APJ Abdul Kalam
University), Varanasi is an authentic record of my work carried out during the
period starting from 1st August 2024 to 10th Aug 2024 under the guidance of Mr.
Ajay Maurya (Assistant Professor CSE department) and Mr. Akhil Dev Mishra
(HOD, Department of Computer Science, Faculty of Bachelor of Technology,
Kashi Institute of Technology (APJ Abdul Kalaa University), Varanasi, Uttar
Pradesh).

I further declare that I have not submitted the matter in this dissertation for another
degree or diploma award.

Student Name:

Pranjal Singh(2004281530007)

Signature...................................

Aditi Singh(2004281530001)

Signature....................................

Mokkshada Mishra(2004281530005)

Signature.......................................
CERTIFICATE

This is to certify that Ms. Pranjal Singh, Ms. Aditi Singh, Ms. Mokkshada
Singh of B-Tech branch Computer Science and AIML has undergone the
project entitled “Cab Booking System”.

They have done an excellent job during their project. They have been completed
their project work during their B-Tech period tenure. Their performance was
good and satisfactory.

I would like to take this opportunity to express my appreciation to Ms. Pranjal


Singh, Ms. Aditi Singh, Ms. Mokkshada Mishra for their work wish them all the
very best for their future endeavours.

Under Guidance Head of Department(HOD)

Mr. Ajay Maurya Mr. Akhil Dev Mishra

Assistant Professor Department of CSE/AIML

Department of CSE Signature............................

Signature............................
AKNOWLEDGEMENT

It is a matter of great pleasure and happiness to make and submit this project
report. During the completion of this project, many persons assisted me and
offered their support.
I express my profound sense of gratitude to my guide Mr. Ajay Maurya for his
valuable suggestion, advice, and encouragement from time to time.
I feel obliged to Mr. Akhil Dev Mishra (Head, Department of Computer Science)
for their immense support and help.
Finally, I express my regards to my colleague who helped me a lot, during the
completion of this project.

Student Name:
Pranjal Singh (2004281530007)
Signature...................................
Aditi Singh (2004281530001)
Signature...................................
Mokkshada Mishra (2004281530005)
Signature...................................
Abstract

The cab booking System is a software application that uses java technology to
easily book cabs to customers and to record the details of various activities of user. It
will simplify the task and reduce the paper work of these organizations. This is a
system-based application that allow users to book a car, From this system car rental
company can manage all car bookings and customer information. User can book cars
and admin can confirm the booking and cancel the booking on the basis of
availability of the cars and drivers. We have developed this system to produce a
system-based system that allow customer to register and reserve cab and for the
company to effectively manage their Cab hiring business.

The system’s architecture includes three main layers: the data layer, the logic layer,
and the presentation layer. The system was implemented using Java swing, Java awt,
Apache NetBeans, and MySQL for database. The system’s interface allows the user
to register, login, enter location, route, driver, and various details to book a cab.

The system’s objective is to provide an automated and accurate way of managing


bookings . The system aims to provide a user-friendly efficient solutions for cab
management, reducing errors and saving time.
Preface

Project is an important part of the engineering curriculum. The B-Tech course helps a
student in getting acquainted with the manner in which his knowledge is being
practically used outside his institute and this normally different from what he has learnt
from books. Hence, when the student switches from the process of learning to that of
implementing his knowledge, he finds an abrupt change. This is exactly session during
the B-Tech curriculum becomes all the more important B-Tech prescribed for the
student of Technical College as a part of the four-year B-Tech course of engineering
by the AKTU,

This report gives the information about the organization and it’s working along with
the project undertaken in the B-Tech period.

The fundamental step used in SDLC process is based on the ISO 9001
guidelines. My aim was to follow the ISO guidelines and develop a perfect system.

The system development was organised into 5 major parts:

1. Requirement Gathering
2. Documentation/Design
3. Development
4. Coding
5. Testing
Table of Content

Title Page (i)


Candidate’s Declaration (ii)
Certificate From Company (iii)
Acknowledgment (iv)
Table of Contents (v)
Abstract (vi)
Preface (vii)

Title Page no.

Chapter-1. Introduction [1-11]


[10-19]

1.1 About the Project 1


10

1.2 Existing System 2


11

1.3 Project Module Summary 3


12

1.4 Software Tools Specification 7


16

1.5 Hardware and Software Requirements 10


18

1.6 Objectives 10
18

1.7 Significance 11
19

1.8 Limitation 11
19

Chapter-2. System Analysis and Feasibility Study 12-16


[20-23]

2.1 System Analysis 12


20

2.2 Identification of need 13


20

2.3 Preliminary Investigation 13


21

2.4 Feasibility Study 14


21
Chapter-3. System Design [17-35]
[24-35]

3.1 Symbols Used 17


24
3.2 DFDs 20
24
3.3 Flow Chart 21
27

3.4 Dependencies Used 24


29

3.5 UML 24
29

Chapter-4. Coding [36-184]


[42-138]

Chapter-5. Implementation [185-189]


[139-142]

5.1 Implementations 139


5.2 URL file 141

Chapter-6. Testing [190-195]


[143-147]

6.1 Introduction 190


143

6.2 Level of Testing 191


143

6.3 Testing Technique Used 191


144

6.4 Test Case 194


146

Chapter-7. Maintenance [196-198]


[148]
7.1 System Maintenance 196
148

Chapter-8. Conclusion & Future Scope [199-200]


[151-152]

8.1 Conclusion & Future Scope 199


151

Refrences [201]
[153]
CHAPTER - 1 INTRODUCTION

1.1 ABOUT THE PROJECT

1.1.1 BRIEF INTRODUCTION TO THE PROJECT

Cab Booking Management System is developed to manage all cab


hiring/booking work. It is useful for car booking agency that are
specialized in Hiring cabs to customers. Using this system many cab-
booking agencies are moving ahead to become a pioneer in the vehicle
rental industry by completely focusing on customers. Using this system, it
is very easy for customers to book a car and a cab-booking agency can also
track their booking. So, it is also very useful for car booking agency. It is a
system through which customers can view available cabs; register them,
and view profiles and book cabs. Mostly peoples use cab service for their
daily transportation need. Cab booking agency can also check which car is
free for booking and which cars are on booking at present time.
The objective and scope of my project Cab or Cab booking System is
to record the details of various activities of user. It will simplify the task
and reduce the paper work. Using this car booking management system,
the car owner can also become partner of the car booking agency by giving
their car for booking. Car rental management system is a system-based
application that allow users to book a car, From this system car rental
company can manage all car bookings and customer information. User can
book cars and admin can confirm the booking and cancel the booking on
the basis of availability of the cars and drivers. We have developed this
system to produce a system-based system that allow customer to register
and reserve cab and for the company to effectively manage their Cab hiring
business. Presently car booking agency do all work offline when a customer
comes to them, they take the booking order and call the car driver to check
their availability with their car if they manage to find a car for booking they
confirm the order otherwise they cancel the order as they have no car for

1
the booking. This process wastes a lot of time of customer and also of car
booking agency and it also give bad name to the agency but with our system
car agency can confirm the order within a minute by checking the
availability of cars for booking. So, this car booking system is helpful to
ease customer’s task whenever they need to rent a cab or hire a cab.
The proposed Cab Booking project system ensures that the users can
book the cab as per their requirements by on to the system site. It allows
users to book their cab, log manages their bookings and cancel their
bookings at any point of time. The users will get notified about the driver
and his mobile no. to communicate with him. Regular updates are provided
to the customer so that they are aware of their bookings, driver details, and
booking status. The user can also drop in their suggestions or queries in
the feedback form.

1.2 EXISTING SYSTEM


The existing system This project will allow the admin to add new
employees/customer after proper authentication. Admin can also add new cab and
price and destination and source. It can allocate cab to different destination at
different source. The database should store all personal details of customer such
as date of birth full name etc.
As soon as the user launches the application, he could come across
a well-defined user guide. It covers each aspect of the cab booking process,
making it easy for first-time users to perform core tasks. Such guides are
crucial to introduce app users to important mobile features and action
processes.

• Signup Process - The basic design architecture of your application is


to keep everything simple and user-friendly. The same should hold
true for the sign-up page. Before using the application, it is mandatory
to have a registered account with the platform. The overall process
should be minimalistic keeping in mind the mobile nature and requests
only the most critical information such as:
o Name

2
o Email
o Password
o Mobile number
o Date of Birth
o Identity Number
o Car details (In the case of the driver)

• User-Centric Booking Process - After the completion of the


registration process, the users can be taken to the main screen where
they can easily pick a ride for themselves. Here are the most
noticeable points in the cab booking process:
o Search option to enter the desired pickup location.
o GPS feature to detect current location.
o A detailed map to see their selected location.

Features related to the most frequented destinations and routes will add to
app usability and makes cab booking easy for riders.

1.2.1 DRAWBACKS OF THE EXISTING SYSTEM

● More manpower

● Time-consuming

● Consumes large volume of pare work

● Needs manual attention

The system needs to be automated to avoid all these limitations and make the work
more accurate.

1.3 PROJECT MODULE SUMMARY


This automated system has three types of modules –

1.3.1 SALESFORCE

3
Salesforce is the world’s 1 Customer relationship management (CRM) platform.
And We must extract multiple customer data from salesforce using API and
update the URL into salesforce.

1.3.2 CLOUD

The Cloud is made up of servers in data centers all over the world. This project
uses three cloud services: Google cloud and AWS and Microsoft Azure. And all
customer information is saved in the cloud.

1.3.3 LOG FILE

The Logfile is the name of any text file, but this file will create only to Save all errors
and Exceptions. And this file’s documents must be of the extension .txt. If any
activity is not working then the path is occurring exception but still, the bot kept
working because we used to continue the activity.

1.3.4 Cab Information

If the user chooses to book a ride right away, then, they are shown a
confirmation screen which also has detailed information regarding the rate
card and ride estimate. It also offers users to apply for discounts via coupon
codes. Pick a clone script that has cab scheduling and confirmation-related

4
5
1.3.4.1 Estimated time of arrival

As per services offered in the vicinity of the user, the application should
show the options of choosing the cab along with their estimated time of
arrival (ETA). This is the highly beneficial feature as the user is made
aware of the time frame from very beginning.

1.3.4.2 Cab confirmation

If the user chooses to book a ride right away, then, they are shown a
confirmation screen which also has detailed information regarding the rate
card and ride estimate. It also offers users to apply for a discount via coupon
codes. Pick a clone script that has cab scheduling and confirmation-related

1.3.4.3 Transparent booking process

One of the deciding factors that would make any cab booking service a hit
among users is the transparency in pricing. All the information related to
the fares should be made available to the user in a clear manner.

1.3.4.4 Fare precision

The option available to the users in the form of “Ride Estimate” shows all
the details related to the approximate time travel and the estimated cost to
the user. Giving a clear idea of fare and pricing can help your clone score
additional points.

1.3.4.5 Ride details

Once the booking is confirmed, users are able to see the current location
of the cab and the estimated time of arrival. Other details available are:

• Name and Phone number of the driver.

• Cab Number, Cab model name, and Colour

6
This project intends to automate some of the basic operations of an institute or
college or school. The Scope would be to provide basic functionalities using a web
application so that those manual processes can be automated. The main
functionalities involved would be around actors such as Students, Faculties &
System Admin. Basic operations will be allowed for these actors along with listing &
search capability.

1.4 SOFTWARE TOOLS SPECIFICATION


1.4.1 TECHNOLOGY: JAVA
JAVA was developed by James Gosling at Sun Microsystems Inc in the year 1995
and later acquired by Oracle Corporation. It is a simple programming language.
Java makes writing, compiling, and debugging programming easy. It helps to
create reusable code and modular programs. Java is a class-based, object-oriented
programming language and is designed to have as few implementation
dependencies as possible. A general-purpose programming language made for
developers to write once run anywhere that is compiled Java code can run on all
platforms that support Java. Java applications are compiled to byte code that can
run on any Java Virtual Machine. The syntax of Java is like c/c++.

History: Java’s history is very interesting. It is a programming language created


in 1991. James Gosling, Mike Sheridan, and Patrick Naughton, a team of Sun
engineers known as the green team initiated the Java language in 1991. Sun
Microsystems released its first public implementation in 1996 as Java 1.0. It
provides no-cost -run-times on popular platforms. Java1.0 compiler was re-
written in Java by Arthur Van Hoff to strictly comply with its specifications. With
the arrival of Java 2, new versions had multiple configurations built for different
types of platforms.

7
In 1997, Sun Microsystems approached the ISO standards body and later
formalized Java, but it soon withdrew from the process. At one time, Sun made
most of its Java implementations available without charge, despite their
proprietary software status. Sun generated revenue from Java through the selling
of licenses for specialized products such as the Java Enterprise System.

On November 13, 2006, Sun released much of its Java virtual machine as free,
open-source software. On May 8, 2007, Sun finished the process, making all its
JVM’s core code available under open-source distribution terms.

1.4.2 TOOL: NetBeans

NetBeans IDE is a free, open-source, integrated development environment (IDE) that


enables you to develop desktop, mobile, and web applications. The IDE supports
application development in various languages, including Java, HTML5, PHP, and
C++. The IDE provides integrated support for the complete development cycle, from
project creation through debugging, profiling, and deployment. The IDE runs on
Windows, Linux, Mac OS X, and other UNIX-based systems.

The IDE provides comprehensive support for JDK 8 technologies and the most
recent Java enhancements. It is the first IDE that provides support for JDK 8, Java
EE 7, and JavaFX 2. The IDE fully supports Java EE using the latest standards for
Java, XML, Web services, and SQL and fully supports the Glassfish Server, the
reference implementation of Java EE.

8
1.4.3 DATABASE: MySQL

MySQL is a fast, easy-to-use RDBMS being used for many small and big businesses.
MySQL is developed, marketed, and supported by MySQL AB, which is a Swedish
company. MySQL is becoming so popular because of many good reasons −

• MySQL is released under an open-source license. So, you have nothing


to pay to use it.
• MySQL is a very powerful program. It handles a large subset of the
functionality of the most expensive and powerful database packages.
• MySQL uses a standard form of the well-known SQL data language.
• MySQL works on many operating systems and with many languages
including PHP, PERL, C, C++, JAVA, etc.
• MySQL works very quickly and works well even with large data sets.
• MySQL 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).
• MySQL is customizable. The open-source GPL license allows
programmers to modify the MySQL software to fit their specific
environments.

9
1.5 HARDWARE AND SOFTWARE REQUIREMENTS
1.5.1 HARDWARE REQUIREMENTS
Processor : Intel core i3 or above
RAM : 4 GB or above
Hard disk : 80 GB and above

1.5.2 SOFTWARE REQUIREMENTS

• Operating System : Windows 7 or above


• Tool : NetBeans IDE 11.3, MySQL
• Language : Java
• Framework : NA
1.6 OBJECTIVES
Every organization, whether big or small, has human resource challenges to
overcome. every organization has different management needs; therefore we
design exclusive cab booking management systems that are adapted to your
managerial requirements. This is designed to assist in strategic planning, and will
help you ensure that your organization is equipped with the right level of human
resources for your future goals.
• The fare must be economical so that it must be in reach/budget of every
person.
• Cab must be reach on time on the defined destination. There must be a large
fleet of cabs (AC/Non AC).
• Provide the functionality to make your own bookings Update your web site
without the need to get a web designer involved.
• Engage your customers through interaction such as feedback forms
• Track your customers.

10
1.7 SIGNIFICANCE
The significance of a project should be its better use and benefits for the concerned
users and applications. This project java-based project may be useful for that
department or organizations that are doing time-consuming manual efforts and its
key attributes are summarised below:

• It may provide a better way to automate boring tasks.


• Data is secured in Cloud.
• Reduce time consumption
• No paperwork needed for future
• Reduce error scope.

1.8 LIMITATIONS
• Requires structured data
• NetBeans must be installed in the user’s system
• Browser installed in the system
• Cloud account is a must.
• MySQL installed in the system

11
CHAPTER - 2 SYSTEM ANALYSIS AND F
EASIBILITY STUDY

2.1 SYSTEM ANALYSIS

We analysed the whole market according to our project requirements. In our


project, we need an automation tool that will enable us to automate the business
process. The initial interface should be such that it should make the whole
environment user-friendly for the users but not at the cost of efficiency. After a
lot of analysis, we concluded that
‘NetBeans’ will be the best suited for java condign.; System analyses determine
the needs and constraints by analysing the requirement and interfacing with the
acquirer. Solution analysis determines the set of possible ways to satisfy the
requirements and constraints, analysis the possible solution, and selects the
optimum one.
The purpose of System analysis is to position the Project Team and their working
environment to ensure the successful completion of System Analysis. This is the

12
point at which the Project Team prepares to capture the detailed functional,
technical, operational, and transitional requirements of the system.

2.2 IDENTIFICATION OF NEED


Identification of need is the process of understanding the customer’s needs and
expectations from a proposed system or application. Identification of needs is a
description of how a system should behave or a description of system properties
or attributes. It can alternatively be a statement of "what an application is expected
to do. It is done to understand the problem which the software system is to solve.

The Process covers the complex task of eliciting and documenting the
requirements of all these users, modelling, and analysing these requirements, and
documenting them as a basis for system design.

2.3 PRELIMINARY INVESTIGATION


The investigation phase is also known as the fact-finding stage or the analysis of
the current system. This is a detailed study conducted to want to fully understand
the existing system and identify the basic information requirements Various
techniques may be used in fact-finding and all fact obtained must be recorded. A
thorough investigation was done in every affected aspect When determining
whether the purposed system is feasible enough to be implemented. As it was
essential for us to find out more about the present system, we used the following
methods to gather the information:

1. OBSERVATION

13
Necessary to see the way the system works first-hand.

2. DOCUMENT SAMPLING
These are all the documents that are used in the system. They are necessary to
check all the data and fill it into the cloud with the URL.

3. QUESTIONNAIRES
These were conducted to get the views of the other employees who are currently
employed in the system.

2.4 FEASIBILITY STUDY


All projects are feasible when given unlimited resources and infinite time. It is
both necessary and prudent to evaluate the feasibility of a project at the earliest
possible time. The efforts and resources spent in developing the system will be a
waste if the end solution does not offer a timely and sates to its users. A feasibility
study is a test of the system proposed regarding workability, impact on the
organization’s ability to meet user needs, and effective use of resources. Thus,
when a new application is proposed, it normally goes through a feasibility study
before it is approved for development. Feasibility and risk analysis are related in
many ways. If project risk is great, the possibility of producing quality software
is reduced.
A feasibility study is conducted to select the best system that meets
performance requirements. This entails an identification description, an evaluation
of the candidate system, and the selection of the best factory solution system for
the job. The system-required performance is defined by a statement of constraints,
the identification of specific system objectives, and a description of outputs.

The key considerations in feasibility analysis are:

14
1. Economic Feasibility

2. Technical Feasibility

3. Operational Feasibility

2.4.1 ECONOMIC FEASIBILITY


Economic analysis is the most frequently used method for evaluating the
effectiveness of a candidate system. More to determine the benefits and the saving
that are expressed from a candidate system and compare those costs if the benefits
outweigh the costs. Otherwise, further justification or alterations in the proposed
system will have to be made if it is to have a chance of being approved. This is an
ongoing effort that improves accuracy at each phase of the system life cycle.

2.4.2 TECHNICAL FEASIBILITY


Technical feasibility centres on the existing computer system hardware etc. and to
what extent it can support the proposed addition. For example, if the current
computer is operating at 80% capacity - an arbitrary ceiling – then running another
application could overload the system or require additional hardware. This
involves financial consideration to accommodate technical enhancements. If the
budget is a serious constraint, then the project is judged not feasible.

2.4.3 OPERATIONAL FEASIBILITY


It is common knowledge that computer installations have something to do with
turnover, transfers, retraining, and changes in employee job status. Therefore, it is
understandable that the introduction of a candidate system requires special efforts
to educate, sell, and train the staff on new ways of conducting business.

15
2.4.4 LEGAL FEASIBILITY
This assessment involves undertaking a study to analyse and determine whether—
and how well—the organization’s needs can be met by completing the project.
Operational feasibility studies also examine how a project plan satisfies the
requirements identified in the requirements analysis phase of system
development.

16
CHAPTER - 3 SYSTEM DESIGN

3.1 DATA FLOW DIAGRAM


The DFD is also known as the Bubble Chart. It is a simple graphical formalism
that can be used to represent a system in terms of the input data to the system.
Various processing is carried out on these data, and the URL is generated by the
system. The main reason why the DFD technique is so popular is probably that
DFD is a very simple formalism it is simple to understand and use. A DFD uses a
very limited number of primitive symbols to represent the functions performed by
the system and the data flow among these functions. Starting with the high-level
functions that a system performs, a DFD model hierarchically represents various
sub-functions. The five different types of primitive symbols used for constructing
DFDs are

3.1.1 SYMBOLS USED


3.1.1.1 PROCESS

A function is represented using a circle. This symbol is called a process or a bubble.

17
Bubbles are annotated with the names of the corresponding functions.

3.1.1.2 EXTERNAL ENTITY

An external entity such as a librarian, a library member, etc. is represented by a


rectangle. The external entities are essentially those physical entities external to
the software that interact with the system. In addition to the human users, the
external entity symbols can be used to represent external hardware and software
such as application software.

18
3.1.1.3 DATA FLOW

A directed arc or arrow is used as a data flow symbol. A data flow symbol
represents the data flow occurring between two processes, or between two
external entities and in the direction of the data flow arrow. Data flow symbols
are usually annotated with the corresponding data names.

3.1.1.4 DATASTORE

A data store represents a logical file. It is represented using two parallel lines. A
logical file can represent either a data store symbol, which can represent either a
data structure or a physical file on a disk. Each data store is connected to a process
using a data flow symbol. The direction of the data flow arrow shows whether
data is being read from or written into a data store. An arrow flowing in or out of
a data store implicitly represents the entire data of the data store and hence
connecting to a data store need not be annotated with the name of the
corresponding data items.

3.1.1.5 OUTPUT SYMBOL

The output symbol is used when a hard copy is produced, and the user of the copies
cannot be specified or there are several users of the output.

19
3.2 DFDs
3.2.1 ZERO LEVEL DFD

Cab booking
User Cloud Side
management system

Cab booking
Admin management system Cloud Side

Figure 3.1: Zero level dfd

20
3.2.2 FIRST LEVEL DFD

Manage all
activities/Get
Admin Cab booking records of
management system successful or
unsuccessful
transactions

Cab booking Manage user


User management system details only

Figure 3.2: First level dfd

3.3 Flow Chart


The Flowchart is the most widely used graphical representation of an algorithm
and procedural design workflows. It uses various symbols to show the operations
and decisions to be followed in a program. It flows in sequential order.

3.3.1 Flow Chart Symbols


3.3.1.1 Terminal Symbol

In the flowchart, it is represented with the help of a circle for denoting the start
and stop symbols. The symbol given below is used to represent the terminal
symbol.

21
3.3.1.2 Input/output Symbol:
The input symbol is used to represent the input data, and the output symbol is used
to display the output operation. The symbol given below is used for representing
the Input/output symbol.

3.3.1.3 Processing Symbol:


It is represented in a flowchart with the help of a rectangle box used to represent
the arithmetic and data movement instructions. The symbol given below is used
to represent the processing symbol.

3.3.1.4 Decision Symbol:


The diamond symbol is used for represents decision-making statements. The
symbol given below is used to represent the decision symbol.

3.3.1.5 Flowlines:

22
It represents the exact sequence in which instructions are executed. Arrows are
used to represent the flow lines in a flowchart. The symbol given below is used
for representing the flow lines:

3.3.1.6 Document Symbol:


This symbol is used in a flowchart to indicate a document or report. The symbol
given below is used to represent the document symbol.

3.3.1.7 Internal storage symbol:


The symbol given below is used to represent the internal storage symbol.

23
3.4 DEPENDENCIES USED
• import java.awt.*;

• import java.awt.event.*;

• import javax.swing.*;

• import java.sql.*;

• import java.util.*;

3.5 UNIFIED MODELLING LANGUAGE (UML)


The unified modeling language allows the software engineer to express an analysis
model using the modeling notation that is governed by a set of syntactic-semantic
rules. A UML system is represented using five different views that describe the
system distinctly. Each view is defined by a set of diagrams, which is as follows:

• User Model View


This view represents the system from the user’s perspective. The analysis
representation describes a usage scenario from the end-user’s perspective.
• Structural Model View
In this model, the data and functionality are arrived from inside the system.
This model view models the static structures.
• Implementation Model View
In this, the structural and behavioral parts of the system are represented as
they are to be built.
• Environmental Model View
In this, the structural and behavioral aspects of the environment in which
the system is to be implemented are repeated.

24
3.5.1 USE CASE DIAGRAM

Use case diagrams are usually referred to as diagrams used to describe a set of
actions (use cases) that some system or systems (subject) should or can perform
in collaboration with one or more external users of the system (actors). Each use
case should provide some observable and valuable result to the actors or other
stakeholders of the system.
A use case diagram at its simplest is a representation of the user’s
interaction with the system that shows the relationship between the user and the

25
different use cases in which the user is involved. A use case diagram can identify
the different types of users of a system and the different use cases and will often
be accompanied by other types of diagrams as well. Using case diagrams can be a
good communication tool for stakeholders.

26
SEQUENC DIAGRAM

Sequence diagram and collaboration diagram are called INTERACTION


DIAGRAMS. An interaction diagram shows an interaction, consisting of set of
objects and their relationship including the messages that may be dispatched
among them.

A sequence diagram is an introduction that empathizes the time ordering of


messages. Graphically a sequence diagram is a table that shows objects arranged
along the X-axis and messages ordered in increasing time along the Y-axis.

27
The Waterfall Model

The waterfall model is a sequential design process, often used in software development
processes. It takes the fundamental process activities of specification, development,
validation, and evolution and represents them as separate process phases such as
requirements specification, software design, implementation, testing

28
29
DATABASE DESIGN AND ANALYSIS:

Table AdminLogin

Sno Columnname Datatype Constraint reference


1 AdminID varchar(50) Primary key
2 UserName varchar(50) Not null
3 Password varchar(50) Notnull
4 EmailID varchar(50) Allow null
5 Department varchar(50) Not null

Table DriverDetails

Sno Columnname Datatype Constraint reference


1 DVID int Primary key
2 DriverID varchar(50) Allow null
3 Name varchar(50) Allow null
4 Address varchar(50) Allow null
5 PhoneNo varchar(50) Allow null
6 DOB Datetime Allow null
7 DOJ datetime Allow null

30
8 Experience varchar(50) Allow null
9 LicenceNo varchar(50) Allow null
10 ImagePath varchar(50) Allow null
11 NoOfAccident varchar(50) Allow null

Table EmployeeDetails

Sno Columnname Datatype Constraint reference

1 EID int PK

2 EmpID varchar(50) Notnull

3 EmpName varchar(50) Notnull

4 PAddress varchar(50) Notnull

5 CAddess varchar(50) Allownull

6 Qualification varchar(50) Notnull

7 DOB datetime Allownull

8 VehicleReqire varchar(50) Notnull

31
9 Gender varchar(50) Allownull

10 PhoneNo varchar(50) Notnull

11 Designation varchar(50) Notnull

12 Department varchar(50) Notnull

13 DOJ datetime Allownull

14 Status varchar(50) Notnull

15 Age varchar(50) Allownull

16 TimeSpan varchar(50) Notnull

17 ImagePath varchar(50) Allownull

Table RouteDetails

Sno Columnname Datatype Constraint reference

1 RTID Int PK

2 Routed varchar(50) NotNULL

3 RouteDescription varchar(50) NotNULL

4 Source varchar(50) NotNULL

32
5 Destination varchar(50) NotNULL

Table Biiling

Sno Columnname Datatype Constraint Reference

1 BillNo varchar(50) PK

2 VehicleID varchar(50) FK

3 SpareType varchar(50) Notnull

4 Quantity Int Notnull

5 BillDate varchar(50) Notnull

6 SparePart varchar(50) Notnull

7 Price Int Notnull

8 TotalAmount int Notnull

I have constructed a database that consists of six data tables. There will
be one main table (parent table) and five child tables, related to each other.
Patently, for this purpose the necessary primary and foreign keys should be
defined in the responding tables. The so-defined structure above is made up
in conformity with the user’s needs and demands. Each employee of the staff
is intended to have several records, responding to his Working History,
Contact Person Information, Salary Information, Time Information, and
Holiday Information, and only one record containing his basic information

33
within the company – his details as the date of birth, gender, marital status,
address, and phone details, and his current working record. An employee is
supposed to have not only one record of his Working history, or his Contact
Person Information For instance, if we look at the Time Information data
table – an employee may have several records in case he has some
experience within the current company. It is absolutely the same with the
Salary Information, Contact Person Information, and Holiday Information
data tables.

In the relationships between the data tables, we can distinguish six tables
that the database consists of. All the relationships are of type: “one-to-
many”. (For more details about the data tables, see. The primary key fields
could be set to Auto-number data type as Access creates these values in an
ascending order to ensure that they are unique within a table. Some of the
fields should be “adjusted” to accept null values. It is quite important to be
done as it is slightly related to the input fields of the application program. I
decided to perform it in the following way: I those fields that are compulsory
to be filled by the user I have set not to accept any null values of data and on
the other hand, those, that can be left blank, are set to accept null values. It
is easy to be performed by changing the Allow Zero Length setting.

It is just needed to go to the desired field that must be set, and switch between
the two options, offered in the “Allow Zero Length” field. In the example,
shown above, the personal_ID_Number field is set not to allow any null
values thus its field’s length cannot be zero as its value is quite essential for
identifying an employee as an

individual and distinctive person. That has been considered and done for a

34
kind of convenience as the user would wish not to enter all the data at the
moment, and come back later.

35
Chapter 4
Coding
About.java

package cab_booking;

import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

import java.awt.Font;

import javax.swing.JFrame;

import javax.swing.border.Border;

public class About extends JFrame implements ActionListener

JButton b1;

JLabel l1;

Font f, f1, f2;

TextArea t1;

String s;

public About()

super("About All Project Details");

36
setLayout(null);

JButton b1 = new JButton("Exit");

add(b1);

b1.setBounds(180, 430, 120, 20);

b1.addActionListener(this);

Font f = new Font("RALEWAY", Font.BOLD, 180);

setFont(f);

s=" About Projects \n "

+ "\nOnline Cab Booking System specializing in Hiring cabs to "

+ "customers. It is an online system through which customers "

+ "can view available cabs; register the cabs, view profile and "

+ "book cabs\n\n"

+ "With the taxi booking system, consumers will be able to "

+ "make reservations online as well as make it easier and save time\n\n"

+ "It enhances business processes since it makes use of internet "

+ "technology to increase their profits."

+ "\nThe software acts as a 24/7 office due to its all-time availability."

+ "\nIt’s user-friendly as they can book cabs from the comfort of "

+ "their homes or offices."

37
TextArea t1 = new TextArea(s, 10, 40, Scrollbar.VERTICAL);

t1.setEditable(false);

t1.setBounds(20, 100, 450, 300);

add(t1);

Font f1 = new Font("RALEWAY", Font.BOLD, 16);

t1.setFont(f1);

Container contentPane = this.getContentPane();

t1 = new TextArea();

JLabel l1 = new JLabel("About Project");

add(l1);

l1.setBounds(170, 10, 180, 80);

l1.setForeground(Color.red);

Font f2 = new Font("RALEWAY", Font.BOLD, 20);

l1.setFont(f2);

setBounds(700, 220, 500, 550);

38
setLayout(null);

setVisible(true);

public void actionPerformed(ActionEvent e)

dispose();

public static void main(String args[])

new About().setVisible(true);

Add_Customer.java

package cab_booking;

import java.awt.*;

import javax.swing.*;

import java.awt.event.*;

import java.sql.*;

39
public class Add_Customer implements ActionListener

JLabel id,id1,id2,id3,id4,id5,id6,id7,id8,id9,id10,id11,id12,id13;

JFrame f;

JTextField t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13;

JButton b,b1;

Add_Customer()

f=new JFrame("Add Employee");

f.setBackground(Color.WHITE);

f.setLayout(null);

id=new JLabel();

id.setBounds(0,0,900,600);

id.setLayout(null);

ImageIcon img=new
ImageIcon(ClassLoader.getSystemResource("cab_booking/Icons/customer.jpg"));

Image
i1=img.getImage().getScaledInstance(900,600,Image.SCALE_DEFAULT);

ImageIcon img1=new ImageIcon(i1);

id.setIcon(img1);

40
id1=new JLabel("New Customer Details");

id1.setBounds(280,30,500,50);

id1.setFont(new Font("Airal",Font.BOLD,30));

id1.setForeground(Color.black);

id.add(id1);

f.add(id);

id2=new JLabel("Username");

id2.setBounds(50,150,150,30);

id2.setFont(new Font("Arial",Font.BOLD,20));

id.add(id2);

t1=new JTextField();

t1.setBounds(200,150,150,30);

id.add(t1);

id3 = new JLabel("Name");

id3.setBounds(450,150,200,30);

id3.setFont(new Font("Airal",Font.BOLD,20));

id.add(id3);

t2=new JTextField();

41
t2.setBounds(600,150,150,30);

id.add(t2);

id4= new JLabel("Age");

id4.setBounds(50,200,100,30);

id4.setFont(new Font("Airal",Font.BOLD,20));

id.add(id4);

t3=new JTextField();

t3.setBounds(200,200,150,30);

id.add(t3);

id5= new JLabel("Date Of Birth");

id5.setBounds(450,200,200,30);

id5.setFont(new Font("Airal",Font.BOLD,20));

id.add(id5);

t4=new JTextField();

t4.setBounds(600,200,150,30);

id.add(t4);

id6= new JLabel("Address");

42
id6.setBounds(50,250,100,30);

id6.setFont(new Font("Airal",Font.BOLD,20));

id.add(id6);

t5=new JTextField();

t5.setBounds(200,250,150,30);

id.add(t5);

id7= new JLabel("Phone");

id7.setBounds(450,250,100,30);

id7.setFont(new Font("Airal",Font.BOLD,20));

id.add(id7);

t6=new JTextField();

t6.setBounds(600,250,150,30);

id.add(t6);

id8= new JLabel("Email Id");

id8.setBounds(50,300,100,30);

id8.setFont(new Font("Airal",Font.BOLD,20));

id.add(id8);

43
t7=new JTextField();

t7.setBounds(200,300,150,30);

id.add(t7);

id9= new JLabel("Country");

id9.setBounds(450,300,100,30);

id9.setFont(new Font("Arial",Font.BOLD,20));

id.add(id9);

t8=new JTextField();

t8.setBounds(600,300,150,30);

id.add(t8);

id10= new JLabel("Gender");

id10.setBounds(50,350,100,30);

id10.setFont(new Font("Arial",Font.BOLD,20));

id.add(id10);

t9=new JTextField();

t9.setBounds(200,350,150,30);

id.add(t9);

44
id11= new JLabel("Aadhar No");

id11.setBounds(450,350,100,30);

id11.setFont(new Font("Arial",Font.BOLD,20));

id.add(id11);

t10=new JTextField();

t10.setBounds(600,350,150,30);

id.add(t10);

b = new JButton("Submit");

b.setBackground(Color.BLACK);

b.setForeground(Color.WHITE);

b.setBounds(250,500,150,40);

id.add(b);

b1=new JButton("Cancel");

b1.setBackground(Color.RED);

b1.setForeground(Color.WHITE);

b1.setBounds(450,500,150,40);

id.add(b1);

45
b.addActionListener(this);

b1.addActionListener(this);

f.setVisible(true);

f.setSize(900,600);

f.setLocation(300,100);

public void actionPerformed(ActionEvent e)

String username=t1.getText();

String name = t2.getText();

String age = t3.getText();

String dob = t4.getText();

String address = t5.getText();

String phone = t6.getText();

String email = t7.getText();

String country = t8.getText();

String gender = t9.getText();

String aadhar = t10.getText();

if(e.getSource()==b)

46
{

try

ConnectionClass obj = new ConnectionClass();

String q = "insert into customer


values('"+username+"','"+name+"','"+age+"','"+dob+"','"+address+"','"+phone+"','"+e
mail+"','"+country+"','"+gender+"','"+aadhar+"')";

obj.stm.executeUpdate(q);

JOptionPane.showMessageDialog(null,"Details Successfully Inserted");

f.setVisible(false);

new HomePage();

catch(Exception ex)

System.out.println("The error is:"+ex);

if(e.getSource()==b1)

f.setVisible(false);

new HomePage();

47
public static void main(String[] args)

new Add_Customer();

Add_InterCity_Driver.java

package cab_booking;

import java.awt.event.*;

import java.awt.*;

import javax.swing.*;

import java.sql.*;

public class Add_InterCity_Driver extends JFrame implements ActionListener

JLabel l1,l2,l3,l4,l5,l6,l7;

JButton bt1,bt2;

JPanel p1,p2,p3;

JTextField tf1,tf2,tf3,tf4,tf5,tf6;

JPasswordField pf;

Font f,f1;

48
Add_InterCity_Driver()

super("Add Intercity Driver");

setLocation(450,50);

setSize(450,450);

f=new Font("Arial",Font.BOLD,20);

f1=new Font("Arial",Font.BOLD,15);

l1=new JLabel("Add Intercity Driver");

l2=new JLabel("Driver Name");

l3=new JLabel("Source");

l4=new JLabel("Destination");

l5=new JLabel("Car");

l6=new JLabel("Price");

l7=new JLabel("Type");

tf1=new JTextField();

tf2=new JTextField();

tf3=new JTextField();

tf4=new JTextField();

tf5=new JTextField();

49
tf6=new JTextField();

bt1=new JButton("Add Intercity Driver");

bt2=new JButton("Back");

l1.setHorizontalAlignment(JLabel.CENTER);

bt1.addActionListener(this);

bt2.addActionListener(this);

l1.setFont(f);

l2.setFont(f1);

l3.setFont(f1);

l4.setFont(f1);

l5.setFont(f1);

l6.setFont(f1);

l7.setFont(f1);

tf1.setFont(f1);

tf2.setFont(f1);

tf3.setFont(f1);

tf4.setFont(f1);

50
tf5.setFont(f1);

tf6.setFont(f1);

bt1.setFont(f1);

bt2.setFont(f1);

p1=new JPanel();

p1.setLayout(new GridLayout(1,1,10,10));

p1.add(l1);

p2=new JPanel();

p2.setLayout(new GridLayout(7,2,10,10));

p2.add(l2);

p2.add(tf1);

p2.add(l3);

p2.add(tf2);

p2.add(l4);

p2.add(tf3);

p2.add(l5);

p2.add(tf4);

p2.add(l6);

51
p2.add(tf5);

p2.add(l7);

p2.add(tf6);

p2.add(bt1);

p2.add(bt2);

setLayout(new BorderLayout(10,10));

add(p1,"North");

add(p2,"Center");

public void actionPerformed(ActionEvent e)

String name=tf1.getText();

String source=tf2.getText();

String destination=tf3.getText();

String car=tf4.getText();

String price=tf5.getText();

String type=tf6.getText();

if(e.getSource()==bt1)

try

52
{

ConnectionClass obj=new ConnectionClass();

String q="insert into


intercity_driver(driver,source,destination,car,price,type)
values('"+name+"','"+source+"','"+destination+"','"+car+"','"+price+"','"+type+"')";

int aa=obj.stm.executeUpdate(q);

if(aa==1)

JOptionPane.showMessageDialog(null, "your data successfully


Inserted");

this.setVisible(false);

else

JOptionPane.showMessageDialog(null, "Plese!, Fill all details


carefully");

catch(Exception ee)

ee.printStackTrace();

if(e.getSource()==bt2)

53
{

this.setVisible(false);

new AdminSection().setVisible(true);

public static void main(String[] args)

new Add_InterCity_Driver().setVisible(true);

Add_IntraCity_Driver.java

package cab_booking;

import java.awt.event.*;

import java.awt.*;

import javax.swing.*;

import java.sql.*;

public class Add_IntraCity_Driver extends JFrame implements ActionListener

JLabel l1,l2,l3,l4,l5,l6,l7;

JButton bt1,bt2;

54
JPanel p1,p2,p3;

JTextField tf1,tf2,tf3,tf4,tf5,tf6;

JPasswordField pf;

Font f,f1;

Add_IntraCity_Driver()

super("Add Intracity Driver");

setLocation(450,50);

setSize(450,400);

f=new Font("Arial",Font.BOLD,20);

f1=new Font("Arial",Font.BOLD,15);

l1=new JLabel("Add Intracity Driver");

l2=new JLabel("Driver Name");

l3=new JLabel("Source");

l4=new JLabel("Destination");

l5=new JLabel("Car");

l6=new JLabel("Price");

tf1=new JTextField();

55
tf2=new JTextField();

tf3=new JTextField();

tf4=new JTextField();

tf5=new JTextField();

bt1=new JButton("Add Intracity Driver");

bt2=new JButton("Back");

l1.setHorizontalAlignment(JLabel.CENTER);

bt1.addActionListener(this);

bt2.addActionListener(this);

l1.setFont(f);

l2.setFont(f1);

l3.setFont(f1);

l4.setFont(f1);

l5.setFont(f1);

l6.setFont(f1);

tf1.setFont(f1);

tf2.setFont(f1);

56
tf3.setFont(f1);

tf4.setFont(f1);

tf5.setFont(f1);

bt1.setFont(f1);

bt2.setFont(f1);

p1=new JPanel();

p1.setLayout(new GridLayout(1,1,10,10));

p1.add(l1);

p2=new JPanel();

p2.setLayout(new GridLayout(6,2,10,10));

p2.add(l2);

p2.add(tf1);

p2.add(l3);

p2.add(tf2);

p2.add(l4);

p2.add(tf3);

p2.add(l5);

p2.add(tf4);

57
p2.add(l6);

p2.add(tf5);

p2.add(bt1);

p2.add(bt2);

setLayout(new BorderLayout(10,10));

add(p1,"North");

add(p2,"Center");

public void actionPerformed(ActionEvent e)

String name=tf1.getText();

String source=tf2.getText();

String destination=tf3.getText();

String car=tf4.getText();

String price=tf5.getText();

if(e.getSource()==bt1)

try

ConnectionClass obj=new ConnectionClass();

58
String q="insert into intracity_driver(driver,source,destination,car,price)
values('"+name+"','"+source+"','"+destination+"','"+car+"','"+price+"')";

int aa=obj.stm.executeUpdate(q);

if(aa==1)

JOptionPane.showMessageDialog(null, "your data successfully


Inserted");

this.setVisible(false);

else

JOptionPane.showMessageDialog(null, "Plese!, Fill all details


carefully");

catch(Exception ee)

ee.printStackTrace();

if(e.getSource()==bt2)

this.setVisible(false);

new AdminSection().setVisible(true);

59
}

public static void main(String[] args)

new Add_IntraCity_Driver().setVisible(true);

Add_Transport_Driver.java

package cab_booking;

import java.awt.event.*;

import java.awt.*;

import javax.swing.*;

import java.sql.*;

public class Add_Transport_Driver extends JFrame implements ActionListener

JLabel l1,l2,l3,l4,l5,l6,l7;

JButton bt1,bt2;

JPanel p1,p2,p3;

JTextField tf1,tf2,tf3,tf4,tf5,tf6;

JPasswordField pf;

60
Font f,f1;

Add_Transport_Driver()

super("Add Transport Driver");

setLocation(450,50);

setSize(450,450);

f=new Font("Arial",Font.BOLD,20);

f1=new Font("Arial",Font.BOLD,15);

l1=new JLabel("Add Transport Driver");

l2=new JLabel("Driver Name");

l3=new JLabel("Source");

l4=new JLabel("Destination");

l5=new JLabel("Truck");

l6=new JLabel("Price");

l7=new JLabel("Distance");

tf1=new JTextField();

tf2=new JTextField();

tf3=new JTextField();

61
tf4=new JTextField();

tf5=new JTextField();

tf6=new JTextField();

bt1=new JButton("Add Transport Driver");

bt2=new JButton("Back");

l1.setHorizontalAlignment(JLabel.CENTER);

bt1.addActionListener(this);

bt2.addActionListener(this);

l1.setFont(f);

l2.setFont(f1);

l3.setFont(f1);

l4.setFont(f1);

l5.setFont(f1);

l6.setFont(f1);

l7.setFont(f1);

tf1.setFont(f1);

tf2.setFont(f1);

62
tf3.setFont(f1);

tf4.setFont(f1);

tf5.setFont(f1);

tf6.setFont(f1);

bt1.setFont(f1);

bt2.setFont(f1);

p1=new JPanel();

p1.setLayout(new GridLayout(1,1,10,10));

p1.add(l1);

p2=new JPanel();

p2.setLayout(new GridLayout(7,2,10,10));

p2.add(l2);

p2.add(tf1);

p2.add(l3);

p2.add(tf2);

p2.add(l4);

p2.add(tf3);

p2.add(l5);

63
p2.add(tf4);

p2.add(l6);

p2.add(tf5);

p2.add(l7);

p2.add(tf6);

p2.add(bt1);

p2.add(bt2);

setLayout(new BorderLayout(10,10));

add(p1,"North");

add(p2,"Center");

public void actionPerformed(ActionEvent e)

String name=tf1.getText();

String source=tf2.getText();

String destination=tf3.getText();

String truck=tf4.getText();

String price=tf5.getText();

String distance=tf6.getText();

if(e.getSource()==bt1)

64
{

try

ConnectionClass obj=new ConnectionClass();

String q="insert into


transport_driver(driver,source,destination,truck,price,distance)
values('"+name+"','"+source+"','"+destination+"','"+truck+"','"+price+"','"+distance+
"')";

int aa=obj.stm.executeUpdate(q);

if(aa==1)

JOptionPane.showMessageDialog(null, "your data successfully


Inserted");

this.setVisible(false);

else

JOptionPane.showMessageDialog(null, "Plese!, Fill all details


carefully");

catch(Exception ee)

ee.printStackTrace();

65
}

if(e.getSource()==bt2)

this.setVisible(false);

new AdminSection().setVisible(true);

public static void main(String[] args)

new Add_Transport_Driver().setVisible(true);

AdminSection.java

package cab_booking;

import java.awt.event.*;

import java.awt.*;

import javax.swing.*;

import java.sql.*;

public class AdminSection extends JFrame implements ActionListener

66
{

JLabel l1,l2;

JButton bt1,bt2,bt3,bt4;

JPanel p1,p2;

Font f,f1;

AdminSection()

super("Admin Section");

setLocation(450,250);

setSize(400,270);

f=new Font("Arial",Font.BOLD,20);

f1=new Font("Arial",Font.BOLD,15);

l1=new JLabel("Admin Section");

bt1=new JButton("Intercity Driver");

bt2=new JButton("Intracity Driver");

bt3=new JButton("Transport Driver");

bt4=new JButton("SignUp");

l1.setHorizontalAlignment(JLabel.CENTER);

67
bt1.addActionListener(this);

bt2.addActionListener(this);

bt3.addActionListener(this);

bt4.addActionListener(this);

ImageIcon img=new
ImageIcon(ClassLoader.getSystemResource("cab_booking/Icons/focus.png"));

Image
img2=img.getImage().getScaledInstance(100,180,Image.SCALE_DEFAULT);

ImageIcon img3=new ImageIcon(img2);

l2=new JLabel(img3);

l1.setFont(f);

l2.setFont(f1);

bt1.setFont(f1);

bt2.setFont(f1);

bt3.setFont(f1);

bt4.setFont(f1);

p1=new JPanel();

p1.setLayout(new GridLayout(5,1,10,10));

p1.add(l1);

68
p1.add(bt1);

p1.add(bt2);

p1.add(bt3);

p1.add(bt4);

p2=new JPanel();

p2.setLayout(new GridLayout(1,1,10,10));

p2.add(l2);

setLayout(new BorderLayout(10,10));

add(p1,"Center");

add(p2,"East");

public void actionPerformed(ActionEvent e)

if(e.getSource()==bt1)

new Add_InterCity_Driver().setVisible(true);

if(e.getSource()==bt2)

69
new Add_IntraCity_Driver().setVisible(true);

if(e.getSource()==bt3)

new Add_Transport_Driver().setVisible(true);

if(e.getSource()==bt4)

new Signup().setVisible(true);

public static void main(String[] args)

new AdminSection().setVisible(true);

Book_Cab.java

package cab_booking;

import java.awt.*;

import javax.swing.*;

import java.awt.event.*;

70
import java.sql.*;

import java.util.Random;

public class Book_Cab extends JFrame implements ActionListener

JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12;

JButton bt1,bt2;

JPanel p1,p2,p3;

JTextField tf1,tf2,tf3,tf4,tf5,tf6,tf7,tf8,tf9;

Font f,f1;

Choice ch1,ch2,ch3;

Book_Cab()

super("Book Intracity Cab");

setLocation(50,10);

setSize(1100,700);

f=new Font("Arial",Font.BOLD,25);

f1=new Font("Arial",Font.BOLD,18);

ch1=new Choice();

71
ch2=new Choice();

ch3=new Choice();

try

ConnectionClass obj=new ConnectionClass();

String q="select * from intracity_driver";

ResultSet rest=obj.stm.executeQuery(q);

while(rest.next())

ch1.add(rest.getString("source"));

rest.close();

catch(Exception e)

e.printStackTrace();

try

ConnectionClass obj=new ConnectionClass();

72
String q="select username from customer";

ResultSet rest=obj.stm.executeQuery(q);

while(rest.next())

ch3.add(rest.getString("username"));

rest.close();

catch(Exception e)

e.printStackTrace();

l1=new JLabel("Book Intracity Cab");

l2=new JLabel("Book ID");

l3=new JLabel("Source");

l4=new JLabel("Destination");

l5=new JLabel("Username");

l6=new JLabel("Name");

l7=new JLabel("Driver Name");

l8=new JLabel("Car");

l9=new JLabel("Destination from");

73
l10=new JLabel("Destination to");

l11=new JLabel("Price");

tf1=new JTextField();

tf3=new JTextField();

tf4=new JTextField();

tf5=new JTextField();

tf6=new JTextField();

tf7=new JTextField();

tf8=new JTextField();

tf1.setEditable(false);

tf3.setEditable(false);

tf4.setEditable(false);

tf5.setEditable(false);

tf6.setEditable(false);

tf7.setEditable(false);

tf8.setEditable(false);

Random r = new Random();

tf1.setText(""+Math.abs(r.nextInt() % 100000));

tf1.setForeground(Color.RED);

74
bt1=new JButton("Book Cab");

bt2=new JButton("Back");

l1.setHorizontalAlignment(JLabel.CENTER);

bt1.addActionListener(this);

bt2.addActionListener(this);

l1.setFont(f);

l2.setFont(f1);

l3.setFont(f1);

l4.setFont(f1);

l5.setFont(f1);

l6.setFont(f1);

l7.setFont(f1);

l8.setFont(f1);

l9.setFont(f1);

l10.setFont(f1);

l11.setFont(f1);

ch1.setFont(f1);

ch2.setFont(f1);

75
ch3.setFont(f1);

tf1.setFont(f1);

tf3.setFont(f1);

tf4.setFont(f1);

tf5.setFont(f1);

tf6.setFont(f1);

tf7.setFont(f1);

tf8.setFont(f1);

bt1.setFont(f1);

bt2.setFont(f1);

bt1.setBackground(Color.ORANGE);

bt2.setBackground(Color.RED);

bt1.setForeground(Color.BLACK);

bt2.setForeground(Color.WHITE);

p1=new JPanel();

p1.setLayout(new GridLayout(1,1,10,10));

p1.add(l1);

76
p2=new JPanel();

p2.setLayout(new GridLayout(11,2,10,10));

p2.add(l2);

p2.add(tf1);

p2.add(l3);

p2.add(ch1);

p2.add(l4);

p2.add(ch2);

p2.add(l5);

p2.add(ch3);

p2.add(l6);

p2.add(tf3);

p2.add(l7);

p2.add(tf4);

p2.add(l8);

p2.add(tf5);

p2.add(l9);

p2.add(tf6);

p2.add(l10);

p2.add(tf7);

77
p2.add(l11);

p2.add(tf8);

p2.add(bt1);

p2.add(bt2);

p3=new JPanel();

p3.setLayout(new GridLayout(1,1,10,10));

ImageIcon img=new
ImageIcon(ClassLoader.getSystemResource("cab_booking/Icons/cab7.png"));

Image
img1=img.getImage().getScaledInstance(680,500,Image.SCALE_DEFAULT);

ImageIcon ic1=new ImageIcon(img1);

l12 = new JLabel(ic1);

p3.add(l12);

setLayout(new BorderLayout(10,10));

add(p1,"North");

add(p2,"Center");

add(p3,"West");

ch3.addMouseListener(new MouseAdapter()

78
@Override

public void mouseClicked(MouseEvent arg0)

try

ConnectionClass obj=new ConnectionClass();

String username=ch3.getSelectedItem();

String q1="select name from customer where username='"+username+"'";

ResultSet rest1=obj.stm.executeQuery(q1);

while(rest1.next())

tf3.setText(rest1.getString("name"));

rest1.close();

catch(Exception exx)

exx.printStackTrace();

});

79
ch1.addMouseListener(new MouseAdapter()

@Override

public void mouseClicked(MouseEvent arg0)

ch2.removeAll();

try

ConnectionClass obj=new ConnectionClass();

String source=ch1.getSelectedItem();

String q1="select destination from intracity_driver where


source='"+source+"'";

ResultSet rest1=obj.stm.executeQuery(q1);

while(rest1.next())

ch2.add(rest1.getString("destination"));

catch(Exception exx)

exx.printStackTrace();

80
});

ch2.addMouseListener(new MouseAdapter()

@Override

public void mouseClicked(MouseEvent arg0)

try

ConnectionClass obj=new ConnectionClass();

String source=ch1.getSelectedItem();

String destination=ch2.getSelectedItem();

String q1="select * from intracity_driver where source='"+source+"' and


destination='"+destination+"'";

ResultSet rest1=obj.stm.executeQuery(q1);

while(rest1.next())

tf4.setText(rest1.getString("driver"));

tf5.setText(rest1.getString("car"));

tf6.setText(rest1.getString("source"));

tf7.setText(rest1.getString("destination"));

tf8.setText(rest1.getString("price"));

81
catch(Exception exx)

exx.printStackTrace();

});

public void actionPerformed(ActionEvent e)

if(e.getSource()==bt1)

String bid=tf1.getText();

String username=ch3.getSelectedItem();

String dname=tf4.getText();

String car=tf5.getText();

String source=tf6.getText();

String destination=tf7.getText();

String price=tf8.getText();

try

ConnectionClass obj3=new ConnectionClass();

82
String q1="insert into intracitycab
values('"+bid+"','"+username+"','"+dname+"','"+car+"','"+source+"','"+destination+"',
'"+price+"')";

int aa=obj3.stm.executeUpdate(q1);

if(aa==1)

JOptionPane.showMessageDialog(null, "Cab Booked Successfully");

this.setVisible(false);

new Update_Customer();

else

JOptionPane.showMessageDialog(null, "Please!, Fill all details


carefully");

catch(Exception ee)

ee.printStackTrace();

if(e.getSource()==bt2)

this.setVisible(false);

83
}

public static void main(String[] args)

new Book_Cab().setVisible(true);

}
Book_InterCity_Cab.java
package cab_booking;

import java.awt.*;

import java.awt.event.*;

import java.sql.*;

import java.util.Random;

import javax.swing.*;

public class Book_Intercity_Cab extends JFrame implements ActionListener

JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12,l13;

JButton bt1,bt2;

JPanel p1,p2,p3;

JTextField tf1,tf2,tf3,tf4,tf5,tf6,tf7,tf8,tf9;

Font f,f1;

84
Choice ch1,ch2,ch3,ch4;

Book_Intercity_Cab()

super("Book Intrecity Cab");

setLocation(50,10);

setSize(1100,650);

f=new Font("Arial",Font.BOLD,25);

f1=new Font("Arial",Font.BOLD,18);

ch1=new Choice();

ch2=new Choice();

ch3=new Choice();

try

ConnectionClass obj=new ConnectionClass();

String q="select * from intercity_driver";

ResultSet rest=obj.stm.executeQuery(q);

while(rest.next())

85
ch1.add(rest.getString("source"));

rest.close();

catch(Exception e)

e.printStackTrace();

try

ConnectionClass obj=new ConnectionClass();

String q="select username from customer";

ResultSet rest=obj.stm.executeQuery(q);

while(rest.next())

ch3.add(rest.getString("username"));

rest.close();

catch(Exception e)

e.printStackTrace();

86
}

ch4=new Choice();

ch4.add("Micro");

ch4.add("Mini");

ch4.add("SUV");

ch4.add("Royal");

l1=new JLabel("Book Intercity Cab");

l2=new JLabel("Book ID");

l3=new JLabel("Source");

l4=new JLabel("Destination");

l5=new JLabel("Username");

l6=new JLabel("Name");

l7=new JLabel("Driver Name");

l8=new JLabel("Car");

l9=new JLabel("Destination from");

l10=new JLabel("Destination to");

l11=new JLabel("Price");

l13=new JLabel("Car Type");

tf1=new JTextField();

87
tf3=new JTextField();

tf4=new JTextField();

tf5=new JTextField();

tf6=new JTextField();

tf7=new JTextField();

tf8=new JTextField();

tf1.setEditable(false);

tf3.setEditable(false);

tf4.setEditable(false);

tf5.setEditable(false);

tf6.setEditable(false);

tf7.setEditable(false);

tf8.setEditable(false);

Random r = new Random();

tf1.setText(""+Math.abs(r.nextInt() % 100000));

tf1.setForeground(Color.RED);

bt1=new JButton("Book Cab");

bt2=new JButton("Back");

88
l1.setHorizontalAlignment(JLabel.CENTER);

bt1.addActionListener(this);

bt2.addActionListener(this);

l1.setFont(f);

l2.setFont(f1);

l3.setFont(f1);

l4.setFont(f1);

l5.setFont(f1);

l6.setFont(f1);

l7.setFont(f1);

l8.setFont(f1);

l9.setFont(f1);

l10.setFont(f1);

l11.setFont(f1);

l13.setFont(f1);

ch1.setFont(f1);

ch2.setFont(f1);

ch3.setFont(f1);

ch4.setFont(f1);

89
tf1.setFont(f1);

tf3.setFont(f1);

tf4.setFont(f1);

tf5.setFont(f1);

tf6.setFont(f1);

tf7.setFont(f1);

tf8.setFont(f1);

bt1.setFont(f1);

bt2.setFont(f1);

bt1.setBackground(Color.ORANGE);

bt2.setBackground(Color.RED);

bt1.setForeground(Color.BLACK);

bt2.setForeground(Color.WHITE);

p1=new JPanel();

p1.setLayout(new GridLayout(1,1,10,10));

p1.add(l1);

p2=new JPanel();

90
p2.setLayout(new GridLayout(12,2,10,10));

p2.add(l2);

p2.add(tf1);

p2.add(l3);

p2.add(ch1);

p2.add(l4);

p2.add(ch2);

p2.add(l5);

p2.add(ch3);

p2.add(l6);

p2.add(tf3);

p2.add(l7);

p2.add(tf4);

p2.add(l8);

p2.add(tf5);

p2.add(l9);

p2.add(tf6);

p2.add(l10);

p2.add(tf7);

p2.add(l11);

p2.add(tf8);

91
p2.add(l13);

p2.add(ch4);

p2.add(bt1);

p2.add(bt2);

p3=new JPanel();

p3.setLayout(new GridLayout(1,1,10,10));

ImageIcon img=new
ImageIcon(ClassLoader.getSystemResource("cab_booking/Icons/cab3.png"));

Image
img1=img.getImage().getScaledInstance(680,500,Image.SCALE_DEFAULT);

ImageIcon ic1=new ImageIcon(img1);

l12 = new JLabel(ic1);

p3.add(l12);

setLayout(new BorderLayout(10,10));

add(p1,"North");

add(p2,"Center");

add(p3,"West");

ch3.addMouseListener(new MouseAdapter()

92
@Override

public void mouseClicked(MouseEvent arg0)

try

ConnectionClass obj=new ConnectionClass();

String username=ch3.getSelectedItem();

String q1="select name from customer where username='"+username+"'";

ResultSet rest1=obj.stm.executeQuery(q1);

while(rest1.next())

tf3.setText(rest1.getString("name"));

rest1.close();

catch(Exception exx)

exx.printStackTrace();

});

93
ch1.addMouseListener(new MouseAdapter()

@Override

public void mouseClicked(MouseEvent arg0)

ch2.removeAll();

try

ConnectionClass obj=new ConnectionClass();

String source=ch1.getSelectedItem();

String q1="select destination from intercity_driver where


source='"+source+"'";

ResultSet rest1=obj.stm.executeQuery(q1);

while(rest1.next())

ch2.add(rest1.getString("destination"));

catch(Exception exx)

exx.printStackTrace();

94
});

ch2.addMouseListener(new MouseAdapter()

@Override

public void mouseClicked(MouseEvent arg0)

try

ConnectionClass obj=new ConnectionClass();

String source=ch1.getSelectedItem();

String destination=ch2.getSelectedItem();

String q1="select * from intercity_driver where source='"+source+"' and


destination='"+destination+"'";

ResultSet rest1=obj.stm.executeQuery(q1);

while(rest1.next())

tf4.setText(rest1.getString("driver"));

tf5.setText(rest1.getString("car"));

tf6.setText(rest1.getString("source"));

tf7.setText(rest1.getString("destination"));

tf8.setText(rest1.getString("price"));

95
}

catch(Exception exx)

exx.printStackTrace();

});

public void actionPerformed(ActionEvent e)

if(e.getSource()==bt1)

String bid=tf1.getText();

String username=ch3.getSelectedItem();

String dname=tf4.getText();

String car=tf5.getText();

String source=tf6.getText();

String destination=tf7.getText();

String price=tf8.getText();

String name=tf3.getText();

String type=ch4.getSelectedItem();

96
try

ConnectionClass obj3=new ConnectionClass();

String q1="insert into intercityCab


values('"+bid+"','"+username+"','"+name+"','"+dname+"','"+source+"','"+destination
+"','"+type+"','"+car+"','"+price+"')";

int aa=obj3.stm.executeUpdate(q1);

if(aa==1)

JOptionPane.showMessageDialog(null, "your cab successfully booked");

this.setVisible(false);

else

JOptionPane.showMessageDialog(null, "Please!, Fill all details


carefully");

catch(Exception ee)

ee.printStackTrace();

if(e.getSource()==bt2)

97
{

this.setVisible(false);

public static void main(String[] args)

new Book_Intercity_Cab().setVisible(true);

Book_Package.java

package cab_booking;

import java.awt.*;

import java.awt.event.*;

import java.sql.*;

import java.util.Random;

import javax.swing.*;

public class Book_Package extends JFrame implements ActionListener

JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12,l13,l14;

JButton bt1,bt2;

98
JPanel p1,p2,p3;

JTextField tf1,tf2,tf3,tf4,tf5,tf6,tf7,tf8,tf9;

Font f,f1;

Choice ch1,ch2,ch3,ch4;

Book_Package()

super("Book Truck");

setLocation(50,10);

setSize(1000,700);

f=new Font("Arial",Font.BOLD,25);

f1=new Font("Arial",Font.BOLD,18);

ch1=new Choice();

ch2=new Choice();

ch3=new Choice();

try

ConnectionClass obj=new ConnectionClass();

String q="select DISTINCT source from transport_driver";

99
ResultSet rest=obj.stm.executeQuery(q);

while(rest.next())

ch1.add(rest.getString("source"));

rest.close();

catch(Exception e)

e.printStackTrace();

try

ConnectionClass obj=new ConnectionClass();

String q="select username from customer";

ResultSet rest=obj.stm.executeQuery(q);

while(rest.next())

ch3.add(rest.getString("username"));

rest.close();

100
catch(Exception e)

e.printStackTrace();

ch4=new Choice();

ch4.add("0 - 10 KG");

ch4.add("10 - 50 KG");

ch4.add("50 - 100 KG");

ch4.add("100 - 500 KG");

ch4.add("500 - 1000 KG");

ch4.add(" > 1000 KG");

l1=new JLabel("Book Truck package");

l2=new JLabel("Book ID");

l3=new JLabel("Source");

l4=new JLabel("Destination");

l5=new JLabel("Username");

l6=new JLabel("Name");

l7=new JLabel("Driver Name");

l8=new JLabel("Truck");

l9=new JLabel("Destination from");

101
l10=new JLabel("Destination to");

l11=new JLabel("Price");

l13=new JLabel("Weight");

l14=new JLabel("Distance");

tf1=new JTextField();

tf2=new JTextField();

tf3=new JTextField();

tf4=new JTextField();

tf5=new JTextField();

tf6=new JTextField();

tf7=new JTextField();

tf8=new JTextField();

tf1.setEditable(false);

tf2.setEditable(false);

tf3.setEditable(false);

tf4.setEditable(false);

tf5.setEditable(false);

tf6.setEditable(false);

tf7.setEditable(false);

tf8.setEditable(false);

102
Random r = new Random();

tf1.setText(""+Math.abs(r.nextInt() % 100000));

tf1.setForeground(Color.RED);

bt1=new JButton("Book Truck");

bt2=new JButton("Back");

l1.setHorizontalAlignment(JLabel.CENTER);

bt1.addActionListener(this);

bt2.addActionListener(this);

l1.setFont(f);

l2.setFont(f1);

l3.setFont(f1);

l4.setFont(f1);

l5.setFont(f1);

l6.setFont(f1);

l7.setFont(f1);

l8.setFont(f1);

l9.setFont(f1);

103
l10.setFont(f1);

l11.setFont(f1);

l13.setFont(f1);

l14.setFont(f1);

ch1.setFont(f1);

ch2.setFont(f1);

ch3.setFont(f1);

ch4.setFont(f1);

tf1.setFont(f1);

tf2.setFont(f1);

tf3.setFont(f1);

tf4.setFont(f1);

tf5.setFont(f1);

tf6.setFont(f1);

tf7.setFont(f1);

tf8.setFont(f1);

bt1.setFont(f1);

bt2.setFont(f1);

bt1.setBackground(Color.ORANGE);

104
bt2.setBackground(Color.RED);

bt1.setForeground(Color.BLACK);

bt2.setForeground(Color.WHITE);

p1=new JPanel();

p1.setLayout(new GridLayout(1,1,10,10));

p1.add(l1);

p2=new JPanel();

p2.setLayout(new GridLayout(13,2,10,10));

p2.add(l2);

p2.add(tf1);

p2.add(l3);

p2.add(ch1);

p2.add(l4);

p2.add(ch2);

p2.add(l5);

p2.add(ch3);

p2.add(l6);

p2.add(tf3);

105
p2.add(l7);

p2.add(tf4);

p2.add(l8);

p2.add(tf5);

p2.add(l9);

p2.add(tf6);

p2.add(l10);

p2.add(tf7);

p2.add(l11);

p2.add(tf8);

p2.add(l13);

p2.add(ch4);

p2.add(l14);

p2.add(tf2);

p2.add(bt1);

p2.add(bt2);

p3=new JPanel();

p3.setLayout(new GridLayout(1,1,10,10));

ImageIcon img=new
ImageIcon(ClassLoader.getSystemResource("cab_booking/Icons/truck1.png"));

106
Image
img1=img.getImage().getScaledInstance(600,500,Image.SCALE_DEFAULT);

ImageIcon ic1=new ImageIcon(img1);

l12 = new JLabel(ic1);

p3.add(l12);

setLayout(new BorderLayout(10,10));

add(p1,"North");

add(p2,"Center");

add(p3,"West");

ch3.addMouseListener(new MouseAdapter()

@Override

public void mouseClicked(MouseEvent arg0)

try

ConnectionClass obj=new ConnectionClass();

String username=ch3.getSelectedItem();

String q1="select name from customer where username='"+username+"'";

ResultSet rest1=obj.stm.executeQuery(q1);

while(rest1.next())

107
{

tf3.setText(rest1.getString("name"));

rest1.close();

catch(Exception exx)

exx.printStackTrace();

});

ch1.addMouseListener(new MouseAdapter()

@Override

public void mouseClicked(MouseEvent arg0)

ch2.removeAll();

try

ConnectionClass obj=new ConnectionClass();

String source=ch1.getSelectedItem();

108
String q1="select DISTINCT destination from transport_driver where
source='"+source+"'";

ResultSet rest1=obj.stm.executeQuery(q1);

while(rest1.next())

ch2.add(rest1.getString("destination"));

catch(Exception exx)

exx.printStackTrace();

});

ch2.addMouseListener(new MouseAdapter()

@Override

public void mouseClicked(MouseEvent arg0)

try

ConnectionClass obj=new ConnectionClass();

109
String source=ch1.getSelectedItem();

String destination=ch2.getSelectedItem();

String q1="select * from transport_driver where source='"+source+"' and


destination='"+destination+"'";

ResultSet rest1=obj.stm.executeQuery(q1);

while(rest1.next())

tf4.setText(rest1.getString("driver"));

tf5.setText(rest1.getString("truck"));

tf6.setText(rest1.getString("source"));

tf7.setText(rest1.getString("destination"));

tf8.setText(rest1.getString("price"));

tf2.setText(rest1.getString("distance"));

catch(Exception exx)

exx.printStackTrace();

});

public void actionPerformed(ActionEvent e)

110
{

if(e.getSource()==bt1)

String bid=tf1.getText();

String username=ch3.getSelectedItem();

String dname=tf4.getText();

String truck=tf5.getText();

String source=tf6.getText();

String destination=tf7.getText();

String price=tf8.getText();

String name=tf3.getText();

String distance=tf2.getText();

String weight=ch4.getSelectedItem();

try

ConnectionClass obj3=new ConnectionClass();

String q1="insert into intransport


values('"+bid+"','"+username+"','"+name+"','"+dname+"','"+source+"','"+destination
+"','"+weight+"','"+truck+"','"+distance+"','"+price+"')";

int aa=obj3.stm.executeUpdate(q1);

if(aa==1)

111
JOptionPane.showMessageDialog(null, "Truck successfully Boooked");

this.setVisible(false);

else

JOptionPane.showMessageDialog(null, "Please!, Fill all details


carefully");

catch(Exception ee)

ee.printStackTrace();

if(e.getSource()==bt2)

this.setVisible(false);

public static void main(String[] args)

new Book_Package().setVisible(true);

112
}

CheckBill.java

package cab_booking;

import java.awt.*;

import javax.swing.*;

import java.awt.event.*;

import java.sql.*;

import java.util.Random;

public class CheckBill extends JFrame implements ActionListener

JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12;

JButton bt1,bt2,bt3,bt4;

JPanel p1,p2,p3;

JTextField tf1,tf2,tf3,tf4,tf5,tf6,tf7,tf8,tf9;

Font f,f1;

Choice ch1,ch2,ch3;

public int price=0;

CheckBill()

113
super("Check Total Cab Bill");

setLocation(50,10);

setSize(1100,500);

f=new Font("Arial",Font.BOLD,25);

f1=new Font("Arial",Font.BOLD,18);

ch1=new Choice();

ch2=new Choice();

ch3=new Choice();

try

ConnectionClass obj=new ConnectionClass();

String q="select username from customer";

ResultSet rest=obj.stm.executeQuery(q);

while(rest.next())

ch1.add(rest.getString("username"));

rest.close();

114
catch(Exception e)

e.printStackTrace();

l1=new JLabel("Check Total Cab Bill");

l2=new JLabel("Username");

l3=new JLabel("Name");

l4=new JLabel("Email");

l5=new JLabel("Address");

l6=new JLabel("Price");

tf1=new JTextField();

tf2=new JTextField();

tf3=new JTextField();

tf4=new JTextField();

tf1.setEditable(false);

tf2.setEditable(false);

tf3.setEditable(false);

tf4.setEditable(false);

115
bt1=new JButton("Intercity Cab");

bt2=new JButton("Intracity Cab");

bt3=new JButton("Transport");

bt4=new JButton("Back");

l1.setHorizontalAlignment(JLabel.CENTER);

bt1.addActionListener(this);

bt2.addActionListener(this);

bt3.addActionListener(this);

l1.setFont(f);

l2.setFont(f1);

l3.setFont(f1);

l4.setFont(f1);

l5.setFont(f1);

l6.setFont(f1);

tf1.setFont(f1);

tf2.setFont(f1);

tf3.setFont(f1);

tf4.setFont(f1);

116
ch1.setFont(f1);

bt1.setFont(f1);

bt2.setFont(f1);

bt3.setFont(f1);

bt4.setFont(f1);

bt1.setBackground(Color.ORANGE);

bt2.setBackground(Color.ORANGE);

bt3.setBackground(Color.ORANGE);

bt4.setBackground(Color.BLACK);

bt1.setForeground(Color.BLACK);

bt2.setForeground(Color.BLACK);

bt3.setForeground(Color.BLACK);

bt4.setForeground(Color.WHITE);

tf1.setBackground(Color.WHITE);

tf2.setBackground(Color.WHITE);

tf3.setBackground(Color.WHITE);

tf4.setBackground(Color.WHITE);

tf4.setForeground(Color.RED);

117
p1=new JPanel();

p1.setLayout(new GridLayout(1,1,10,10));

p1.add(l1);

p2=new JPanel();

p2.setLayout(new GridLayout(7,2,10,10));

p2.add(l2);

p2.add(ch1);

p2.add(l3);

p2.add(tf1);

p2.add(l4);

p2.add(tf2);

p2.add(l5);

p2.add(tf3);

p2.add(l6);

p2.add(tf4);

p2.add(bt1);

p2.add(bt2);

p2.add(bt3);

p2.add(bt4);

118
p3=new JPanel();

p3.setLayout(new GridLayout(1,1,10,10));

p1.setBackground(Color.WHITE);

p2.setBackground(Color.WHITE);

p3.setBackground(Color.WHITE);

ImageIcon img=new
ImageIcon(ClassLoader.getSystemResource("cab_booking/Icons/bill1.png"));

Image
img1=img.getImage().getScaledInstance(700,280,Image.SCALE_DEFAULT);

ImageIcon ic1=new ImageIcon(img1);

l7 = new JLabel(ic1);

p3.add(l7);

setLayout(new BorderLayout(0,0));

add(p1,"North");

add(p2,"Center");

add(p3,"West");

ch1.addMouseListener(new MouseAdapter()

119
@Override

public void mouseClicked(MouseEvent arg0)

try

ConnectionClass obj=new ConnectionClass();

String username=ch1.getSelectedItem();

String q1="select * from customer where username='"+username+"'";

ResultSet rest1=obj.stm.executeQuery(q1);

while(rest1.next())

tf1.setText(rest1.getString("name"));

tf2.setText(rest1.getString("email"));

tf3.setText(rest1.getString("address"));

rest1.close();

catch(Exception exx)

exx.printStackTrace();

120
});

public void actionPerformed(ActionEvent e)

if(e.getSource()==bt1)

price=0;

String username=ch1.getSelectedItem();

try

ConnectionClass obj2=new ConnectionClass();

String q2="select price from intercitycab where username='"+username+"'";

ResultSet rest1=obj2.stm.executeQuery(q2);

while(rest1.next())

price=price+Integer.parseInt(rest1.getString("price"));

tf4.setText(price+"");

rest1.close();

catch(Exception ee)

121
{

ee.printStackTrace();

if(e.getSource()==bt2)

price=0;

String username=ch1.getSelectedItem();

try

ConnectionClass obj3=new ConnectionClass();

String q3="select price from intracitycab where username='"+username+"'";

ResultSet rest1=obj3.stm.executeQuery(q3);

while(rest1.next())

price=price+Integer.parseInt(rest1.getString("price"));

tf4.setText(price+"");

rest1.close();

catch(Exception ee)

122
ee.printStackTrace();

if(e.getSource()==bt3)

price=0;

String username=ch1.getSelectedItem();

try

ConnectionClass obj4=new ConnectionClass();

String q4="select price from intransport where username='"+username+"'";

ResultSet rest1=obj4.stm.executeQuery(q4);

while(rest1.next())

price=price+Integer.parseInt(rest1.getString("price"));

tf4.setText(price+"");

rest1.close();

catch(Exception ee)

ee.printStackTrace();

123
}

public static void main(String[] args)

new CheckBill().setVisible(true);

ConnectionClasss.java

package cab_booking;

import java.sql.*;

public class ConnectionClass

Connection con;

Statement stm;

public ConnectionClass()

try

Class.forName("com.mysql.cj.jdbc.Driver");

124
con
=DriverManager.getConnection("jdbc:mysql://localhost:330/cab_booking","root","8
858@Pranjal");

stm =con.createStatement();

if(con.isClosed())

System.out.println("yes");

else

System.out.println("No");

catch(Exception e)

e.printStackTrace();

System.out.println(e);

public static void main(String args[])

new ConnectionClass();

125
}

Delete_Customer.java

package cab_booking;

import java.awt.*;

import javax.swing.*;

import java.awt.event.*;

import java.sql.*;

public class Delete_Customer extends JFrame implements ActionListener

JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12;

JButton bt1,bt2;

JPanel p1,p2,p3;

JTextField tf1,tf2,tf3,tf4,tf5,tf6,tf7,tf8,tf9;

Font f,f1;

Choice ch;

Delete_Customer()

super("Delete Customer");

126
setLocation(50,10);

setSize(980,700);

f=new Font("Arial",Font.BOLD,25);

f1=new Font("Arial",Font.BOLD,18);

ch=new Choice();

try

ConnectionClass obj=new ConnectionClass();

String q="select username from customer";

ResultSet rest=obj.stm.executeQuery(q);

while(rest.next())

ch.add(rest.getString("username"));

catch(Exception e)

e.printStackTrace();

127
l1=new JLabel("Delete Customer");

l2=new JLabel("Username");

l3=new JLabel("Name");

l4=new JLabel("Age");

l5=new JLabel("Date of birth");

l6=new JLabel("Address");

l7=new JLabel("Phone");

l8=new JLabel("Email");

l9=new JLabel("Country");

l10=new JLabel("Gender");

l11=new JLabel("Aadhar");

tf1=new JTextField();

tf2=new JTextField();

tf3=new JTextField();

tf4=new JTextField();

tf5=new JTextField();

tf6=new JTextField();

tf7=new JTextField();

tf8=new JTextField();

tf9=new JTextField();

128
tf1.setEditable(false);

tf2.setEditable(false);

tf3.setEditable(false);

tf4.setEditable(false);

tf5.setEditable(false);

tf6.setEditable(false);

tf7.setEditable(false);

tf8.setEditable(false);

tf9.setEditable(false);

bt1=new JButton("Delete Customer");

bt2=new JButton("Back");

l1.setHorizontalAlignment(JLabel.CENTER);

bt1.addActionListener(this);

bt2.addActionListener(this);

l1.setFont(f);

l2.setFont(f1);

l3.setFont(f1);

129
l4.setFont(f1);

l5.setFont(f1);

l6.setFont(f1);

l7.setFont(f1);

l8.setFont(f1);

l9.setFont(f1);

l10.setFont(f1);

l11.setFont(f1);

ch.setFont(f1);

tf1.setFont(f1);

tf2.setFont(f1);

tf3.setFont(f1);

tf4.setFont(f1);

tf5.setFont(f1);

tf6.setFont(f1);

tf7.setFont(f1);

tf8.setFont(f1);

tf9.setFont(f1);

bt1.setFont(f1);

bt2.setFont(f1);

130
bt1.setBackground(Color.BLACK);

bt2.setBackground(Color.RED);

bt1.setForeground(Color.WHITE);

bt2.setForeground(Color.WHITE);

p1=new JPanel();

p1.setLayout(new GridLayout(1,1,10,10));

p1.add(l1);

p2=new JPanel();

p2.setLayout(new GridLayout(11,2,10,10));

p2.add(l2);

p2.add(ch);

p2.add(l3);

p2.add(tf1);

p2.add(l4);

p2.add(tf2);

p2.add(l5);

p2.add(tf3);

131
p2.add(l6);

p2.add(tf4);

p2.add(l7);

p2.add(tf5);

p2.add(l8);

p2.add(tf6);

p2.add(l9);

p2.add(tf7);

p2.add(l10);

p2.add(tf8);

p2.add(l11);

p2.add(tf9);

p2.add(bt1);

p2.add(bt2);

p3=new JPanel();

p3.setLayout(new GridLayout(1,1,10,10));

ImageIcon img=new
ImageIcon(ClassLoader.getSystemResource("cab_booking/Icons/delete.png"));

Image
img1=img.getImage().getScaledInstance(400,500,Image.SCALE_DEFAULT);

ImageIcon ic1=new ImageIcon(img1);

132
l12 = new JLabel(ic1);

p3.add(l12);

setLayout(new BorderLayout(10,10));

add(p1,"North");

add(p2,"Center");

add(p3,"West");

ch.addMouseListener(new MouseAdapter()

@Override

public void mouseClicked(MouseEvent arg0)

try

ConnectionClass obj2=new ConnectionClass();

String username=ch.getSelectedItem();

String q1="select * from customer where username='"+username+"'";

ResultSet rest1=obj2.stm.executeQuery(q1);

while(rest1.next())

133
tf1.setText(rest1.getString("name"));

tf2.setText(rest1.getString("age"));

tf3.setText(rest1.getString("dob"));

tf4.setText(rest1.getString("address"));

tf5.setText(rest1.getString("phone"));

tf6.setText(rest1.getString("email"));

tf7.setText(rest1.getString("country"));

tf8.setText(rest1.getString("gender"));

tf9.setText(rest1.getString("aadhar"));

catch(Exception exx)

exx.printStackTrace();

});

public void actionPerformed(ActionEvent e)

if(e.getSource()==bt1)

134
{

String username=ch.getSelectedItem();

String name=tf1.getText();

String age=tf2.getText();

String dob=tf3.getText();

String address=tf4.getText();

String phone=tf5.getText();

String email=tf6.getText();

String country=tf7.getText();

String gender=tf8.getText();

String aadhar=tf9.getText();

try

ConnectionClass obj3=new ConnectionClass();

String q="delete from customer where username='"+username+"'";

String q1="delete from intransport where username='"+username+"'";

String q2="delete from intercitycab where username='"+username+"'";

String q3="delete from intracitycab where username='"+username+"'";

int aa=obj3.stm.executeUpdate(q);

if(aa==1)

135
JOptionPane.showMessageDialog(null, "your record successfully
Deleted");

obj3.stm.executeUpdate(q1);

obj3.stm.executeUpdate(q2);

obj3.stm.executeUpdate(q3);

this.setVisible(false);

new View_Customer().setVisible(true);

else

JOptionPane.showMessageDialog(null, "Please!,check all details


carefully");

catch(Exception ee)

ee.printStackTrace();

if(e.getSource()==bt2)

this.setVisible(false);

136
}

public static void main(String args[])

new Delete_Customer().setVisible(true);

HomePage.java

package cab_booking;

import java.awt.*;

import javax.swing.*;

import java.awt.event.*;

public class HomePage extends JFrame implements ActionListener

JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10;

Font f,f1,f2;

JPanel p1;

HomePage()

super("Cab Booking Home Page");

137
setLocation(0,0);

setSize(1550,800);

f=new Font("Lucida Fax",Font.BOLD,20);

f2=new Font("Gadugi",Font.BOLD,35);

f1=new Font("MS UI Gothic",Font.BOLD,18);

ImageIcon ic=new
ImageIcon(ClassLoader.getSystemResource("cab_booking/Icons/1.jpg"));

Image
img=ic.getImage().getScaledInstance(1550,800,Image.SCALE_DEFAULT);

ImageIcon ic1=new ImageIcon(img);

l1=new JLabel(ic1);

JMenuBar m1=new JMenuBar();

JMenu men1=new JMenu("Customer Profile");

JMenuItem ment1=new JMenuItem("Add Customer Profile");

JMenuItem ment2=new JMenuItem("View Customer Profile");

JMenu men2=new JMenu("Manage Customer");

JMenuItem ment3=new JMenuItem("Update Customer Details");

JMenu men3=new JMenu("Book Intracity Cab");

138
JMenuItem ment5=new JMenuItem("Book Cab");

JMenuItem ment6=new JMenuItem("View Booked Cab");

JMenu men4=new JMenu("Book Intercity Cab");

JMenuItem ment7=new JMenuItem("Book Intercity Cab");

JMenuItem ment8=new JMenuItem("View Intercity Booked Cab");

JMenu men5=new JMenu("Transport");

JMenuItem ment9=new JMenuItem("Book Package");

JMenuItem ment10=new JMenuItem("View Booked Pacakage");

JMenu men6=new JMenu("Bill");

JMenuItem ment11=new JMenuItem("Check Bill");

JMenu men7=new JMenu("Delete");

JMenuItem ment12=new JMenuItem("Delete Customer");

JMenu men8=new JMenu("About");

JMenuItem ment13=new JMenuItem("About");

JMenuItem ment14=new JMenuItem("Exit");

men1.add(ment1);

139
men1.add(ment2);

men2.add(ment3);

men3.add(ment5);

men3.add(ment6);

men4.add(ment7);

men4.add(ment8);

men5.add(ment9);

men5.add(ment10);

men6.add(ment11);

men7.add(ment12);

men8.add(ment13);

men8.add(ment14);

m1.add(men1);

m1.add(men2);

m1.add(men3);

m1.add(men4);

m1.add(men5);

m1.add(men6);

m1.add(men7);

m1.add(men8);

140
men1.setFont(f);

men2.setFont(f);

men3.setFont(f);

men4.setFont(f);

men5.setFont(f);

men6.setFont(f);

men7.setFont(f);

men8.setFont(f);

ment1.setFont(f1);

ment2.setFont(f1);

ment3.setFont(f1);

ment5.setFont(f1);

ment6.setFont(f1);

ment7.setFont(f1);

ment8.setFont(f1);

ment9.setFont(f1);

ment10.setFont(f1);

ment11.setFont(f1);

ment12.setFont(f1);

ment13.setFont(f1);

ment14.setFont(f1);

141
m1.setBackground(Color.BLACK);

men1.setForeground(Color.GRAY);

men2.setForeground(Color.GRAY);

men3.setForeground(Color.GRAY);

men4.setForeground(Color.GRAY);

men5.setForeground(Color.GRAY);

men6.setForeground(Color.GRAY);

men7.setForeground(Color.GRAY);

men8.setForeground(Color.RED);

ment1.setBackground(Color.BLACK);

ment2.setBackground(Color.BLACK);

ment3.setBackground(Color.BLACK);

ment5.setBackground(Color.BLACK);

ment6.setBackground(Color.BLACK);

ment6.setBackground(Color.BLACK);

ment7.setBackground(Color.BLACK);

ment8.setBackground(Color.BLACK);

ment9.setBackground(Color.BLACK);

ment10.setBackground(Color.BLACK);

142
ment11.setBackground(Color.BLACK);

ment12.setBackground(Color.BLACK);

ment13.setBackground(Color.BLACK);

ment14.setBackground(Color.BLACK);

ment1.setForeground(Color.YELLOW);

ment2.setForeground(Color.YELLOW);

ment3.setForeground(Color.YELLOW);

ment5.setForeground(Color.YELLOW);

ment6.setForeground(Color.YELLOW);

ment7.setForeground(Color.YELLOW);

ment8.setForeground(Color.YELLOW);

ment9.setForeground(Color.YELLOW);

ment10.setForeground(Color.YELLOW);

ment11.setForeground(Color.YELLOW);

ment12.setForeground(Color.YELLOW);

ment13.setForeground(Color.RED);

ment14.setForeground(Color.RED);

ment1.addActionListener(this);

ment2.addActionListener(this);

ment3.addActionListener(this);

143
ment5.addActionListener(this);

ment6.addActionListener(this);

ment7.addActionListener(this);

ment8.addActionListener(this);

ment9.addActionListener(this);

ment10.addActionListener(this);

ment11.addActionListener(this);

ment12.addActionListener(this);

ment13.addActionListener(this);

ment14.addActionListener(this);

setJMenuBar(m1);

add(l1);

public void actionPerformed(ActionEvent e)

String comnd=e.getActionCommand();

if(comnd.equals("Add Customer Profile"))

new Add_Customer();

else if(comnd.equals("View Customer Profile"))

144
{

new View_Customer().setVisible(true);;

else if(comnd.equals("Update Customer Details"))

new Update_Customer().setVisible(true);

else if(comnd.equals("Book Cab"))

new Book_Cab().setVisible(true);

else if(comnd.equals("View Booked Cab"))

new View_BookedCab().setVisible(true);

else if(comnd.equals("Book Intercity Cab"))

new Book_Intercity_Cab().setVisible(true);

else if(comnd.equals("View Intercity Booked Cab"))

new View_Intercity_Booked_Cab().setVisible(true);

145
}

else if(comnd.equals("Book Package"))

new Book_Package().setVisible(true);

else if(comnd.equals("View Booked Pacakage"))

new View_Booked_Pacakage().setVisible(true);

else if(comnd.equals("Check Bill"))

new CheckBill().setVisible(true);

else if(comnd.equals("Delete Customer"))

new Delete_Customer().setVisible(true);

else if(comnd.equals("About"))

new About().setVisible(true);

else if(comnd.equals("Exit"))

146
{

System.exit(0);

public static void main(String[] args)

new HomePage().setVisible(true);

Index.java

package cab_booking;

import java.awt.event.*;

import java.awt.*;

import javax.swing.*;

public class Index extends JFrame implements ActionListener

JLabel l1,l2,l3,l4;

JButton bt1,bt2;

JPanel p1,p2,p3;

Font f,f1;

147
Index()

super("Home Page");

setLocation(450,250);

setSize(500,200);

f=new Font("Arial",Font.BOLD,20);

f1=new Font("Arial",Font.BOLD,15);

l1=new JLabel("Admin Login");

l2=new JLabel("Customer Login");

bt1=new JButton("Login");

bt2=new JButton("Login");

bt1.addActionListener(this);

bt2.addActionListener(this);

ImageIcon c=new
ImageIcon(ClassLoader.getSystemResource("cab_booking/Icons/login.png"));

Image i=c.getImage().getScaledInstance(130,100,Image.SCALE_DEFAULT);

ImageIcon c1=new ImageIcon(i);

148
l3=new JLabel(c1);

l4=new JLabel("Cab Booking Management");

l4.setHorizontalAlignment(JLabel.CENTER);

l4.setFont(f);

l1.setFont(f1);

l2.setFont(f1);

bt1.setFont(f1);

bt2.setFont(f1);

p1=new JPanel();

p1.setLayout(new GridLayout(2,2,10,10));

p1.add(l1);

p1.add(bt1);

p1.add(l2);

p1.add(bt2);

p2=new JPanel();

p2.setLayout(new GridLayout(1,1,10,10));

p2.add(l3);

149
p3=new JPanel();

p3.setLayout(new GridLayout(1,1,10,10));

p3.add(l4);

setLayout(new BorderLayout(10,10));

add(p3,"North");

add(p2,"West");

add(p1,"Center");

public void actionPerformed(ActionEvent e)

if(e.getSource()==bt1)

new AdminSection().setVisible(true);

if(e.getSource()==bt2)

new Login();

public static void main(String[] args)

150
new Index().setVisible(true);

Login.java

package cab_booking;

import java.awt.*;

import javax.swing.*;

import java.awt.event.*;

import java.sql.*;

public class Login extends JFrame implements ActionListener

JPanel panel;

JFrame f;

JLabel l1,l2,l3,l4,l5;

JTextField t1;

JPasswordField pf1;

JButton b1,b2,b3;

Login()

151
f=new JFrame("Login Account");

f.setBackground(Color.WHITE);

f.setLayout(null);

l1=new JLabel();

l1.setBounds(0,0,580,350);

l1.setLayout(null);

ImageIcon img=new
ImageIcon(ClassLoader.getSystemResource("cab_booking/Icons/signup.jpg"));

Image
i1=img.getImage().getScaledInstance(580,350,Image.SCALE_DEFAULT);

ImageIcon img1=new ImageIcon(i1);

l1.setIcon(img1);

l2=new JLabel("Login Account");

l2.setBounds(190,30,500,50);

l2.setFont(new Font("Airal",Font.BOLD,30));

l2.setForeground(Color.PINK);

l1.add(l2);

f.add(l1);

l3=new JLabel("Username : ");

l3.setBounds(120,120,150,30);

152
l3.setForeground(Color.ORANGE);

l3.setFont(new Font("Arial",Font.BOLD,20));

l1.add(l3);

t1=new JTextField();

t1.setBounds(320,120,150,30);

l1.add(t1);

l4 = new JLabel("Password : ");

l4.setBounds(120,170,150,30);

l4.setForeground(Color.ORANGE);

l4.setFont(new Font("Airal",Font.BOLD,20));

l1.add(l4);

pf1 = new JPasswordField();

pf1.setBounds(320,170,150,30);

l1.add(pf1);

b1 = new JButton("Login");

b1.setBackground(Color.BLACK);

b1.setForeground(Color.WHITE);

b1.setBounds(120,220,150,40);

153
l1.add(b1);

b2=new JButton("SignUp");

b2.setBackground(Color.RED);

b2.setForeground(Color.WHITE);

b2.setBounds(320,220,150,40);

l1.add(b2);

b1.addActionListener(this);

b2.addActionListener(this);

f.setVisible(true);

f.setSize(580,350);

f.setLocation(300,100);

f.setResizable(false);

public void actionPerformed(ActionEvent ae)

if(ae.getSource() == b1)

154
try

Class.forName("com.mysql.cj.jdbc.Driver");

Connection con
=DriverManager.getConnection("jdbc:mysql://localhost:330/cab_booking","root","8
858@Pranjal");

ConnectionClass obj=new ConnectionClass();

String name=t1.getText();

String pass=pf1.getText();

String q="select * from signup where username='"+name+"' and


password='"+pass+"'";

ResultSet rs=obj.stm.executeQuery(q);

if(rs.next())

new HomePage().setVisible(true);

f.setVisible(false);

else

JOptionPane.showMessageDialog(null,"You have entered Wrong


Username and Password !");

f.setVisible(false);

f.setVisible(true);

155
}

catch(Exception e)

e.printStackTrace();

if(ae.getSource()==b2)

this.f.setVisible(false);

new Signup();

public static void main(String[] args)

new Login();

Signup.java

package cab_booking;

import java.awt.*;

156
import java.awt.event.*;

import javax.swing.*;

import java.sql.*;

import java.util.Locale;

public class Signup extends JFrame implements ActionListener

JFrame f;

JLabel l1,l2,l3,l4,l5;

JTextField t1,t2,t3;

JPasswordField p1;

JButton b1,b2;

Signup()

f=new JFrame("Create New Account");

f.setBackground(Color.WHITE);

f.setLayout(null);

l1=new JLabel("UserName");

l1.setBounds(40,20,100,30);

157
f.add(l1);

l2=new JLabel("Name");

l2.setBounds(40,70,100,30);

f.add(l2);

l3=new JLabel("Password");

l3.setBounds(40,120,100,30);

f.add(l3);

l4=new JLabel("Phone No");

l4.setBounds(40,170,100,30);

f.add(l4);

t1=new JTextField();

t1.setBounds(150,20,150,30);

f.add(t1);

t2=new JTextField();

t2.setBounds(150,70,150,30);

f.add(t2);

158
p1=new JPasswordField();

p1.setBounds(150,120,150,30);

f.add(p1);

t3=new JTextField();

t3.setBounds(150,170,150,30);

f.add(t3);

ImageIcon i1=new
ImageIcon(ClassLoader.getSystemResource("cab_booking/Icons/signup1.png"));

Image
i2=i1.getImage().getScaledInstance(150,150,Image.SCALE_DEFAULT);

ImageIcon i3=new ImageIcon(i2);

JLabel l5=new JLabel(i3);

l5.setBounds(350,70,150,150);

f.add(l5);

b1=new JButton("SignUp");

b1.setBackground(Color.BLACK);

b1.setBounds(40,240,120,30);

b1.addActionListener(this);

b1.setForeground(Color.WHITE);

f.add(b1);

159
b2=new JButton("Back");

b2.setBackground(Color.BLACK);

b2.setBounds(180,240,120,30);

b2.addActionListener(this);

b2.setForeground(Color.WHITE);

f.add(b2);

f.getContentPane();

f.setVisible(true);

f.setSize(550,340);

f.setLocation(400,300);

public void actionPerformed(ActionEvent ee)

if(ee.getSource()==b1)

String username = t1.getText();

String name = t2.getText();

String password = p1.getText();

String phone = t3.getText();

160
try

ConnectionClass obj=new ConnectionClass();

String q = "insert into signup values('"+username+"', '"+name+"',


'"+password+"', '"+phone+"')";

int aa=obj.stm.executeUpdate(q);

if(aa==1)

JOptionPane.showMessageDialog(null, "Account Created


Successfully");

this.setVisible(false);

new Login();

else

JOptionPane.showMessageDialog(null, "Please!, Fill all details


carefully");

this.f.setVisible(false);

this.f.setVisible(true);

catch(Exception e)

161
e.printStackTrace();

if(ee.getSource()==b2)

this.f.setVisible(false);

new Login();

public static void main(String[] args)

new Signup();

Update_Custumer.java

package cab_booking;

import java.awt.*;

import javax.swing.*;

import java.awt.event.*;

import java.sql.*;

162
public class Update_Customer extends JFrame implements ActionListener

JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12;

JButton bt1,bt2;

JPanel p1,p2,p3;

JTextField tf1,tf2,tf3,tf4,tf5,tf6,tf7,tf8,tf9;

Font f,f1;

Choice ch;

Update_Customer()

super("Update Customer");

setLocation(450,10);

setSize(740,700);

f=new Font("Arial",Font.BOLD,25);

f1=new Font("Arial",Font.BOLD,18);

ch=new Choice();

try

163
ConnectionClass obj=new ConnectionClass();

String q="select username from customer";

ResultSet rest=obj.stm.executeQuery(q);

while(rest.next())

ch.add(rest.getString("username"));

catch(Exception e)

e.printStackTrace();

l1=new JLabel("Update Customer");

l2=new JLabel("Username");

l3=new JLabel("Name");

l4=new JLabel("Age");

l5=new JLabel("Date of birth");

l6=new JLabel("Address");

l7=new JLabel("Phone");

l8=new JLabel("Email");

l9=new JLabel("Country");

164
l10=new JLabel("Gender");

l11=new JLabel("Aadhar");

tf1=new JTextField();

tf2=new JTextField();

tf3=new JTextField();

tf4=new JTextField();

tf5=new JTextField();

tf6=new JTextField();

tf7=new JTextField();

tf8=new JTextField();

tf9=new JTextField();

bt1=new JButton("Update Data");

bt2=new JButton("Back");

l1.setHorizontalAlignment(JLabel.CENTER);

bt1.addActionListener(this);

bt2.addActionListener(this);

l1.setFont(f);

165
l2.setFont(f1);

l3.setFont(f1);

l4.setFont(f1);

l5.setFont(f1);

l6.setFont(f1);

l7.setFont(f1);

l8.setFont(f1);

l9.setFont(f1);

l10.setFont(f1);

l11.setFont(f1);

ch.setFont(f1);

tf1.setFont(f1);

tf2.setFont(f1);

tf3.setFont(f1);

tf4.setFont(f1);

tf5.setFont(f1);

tf6.setFont(f1);

tf7.setFont(f1);

tf8.setFont(f1);

tf9.setFont(f1);

166
bt1.setFont(f1);

bt2.setFont(f1);

bt1.setBackground(Color.BLACK);

bt2.setBackground(Color.RED);

bt1.setForeground(Color.WHITE);

bt2.setForeground(Color.WHITE);

p1=new JPanel();

p1.setLayout(new GridLayout(1,1,10,10));

p1.add(l1);

p2=new JPanel();

p2.setLayout(new GridLayout(11,2,10,10));

p2.add(l2);

p2.add(ch);

p2.add(l3);

p2.add(tf1);

p2.add(l4);

p2.add(tf2);

167
p2.add(l5);

p2.add(tf3);

p2.add(l6);

p2.add(tf4);

p2.add(l7);

p2.add(tf5);

p2.add(l8);

p2.add(tf6);

p2.add(l9);

p2.add(tf7);

p2.add(l10);

p2.add(tf8);

p2.add(l11);

p2.add(tf9);

p2.add(bt1);

p2.add(bt2);

p3=new JPanel();

p3.setLayout(new GridLayout(1,1,10,10));

ImageIcon img=new
ImageIcon(ClassLoader.getSystemResource("cab_booking/Icons/update.png"));

168
Image
img1=img.getImage().getScaledInstance(200,500,Image.SCALE_DEFAULT);

ImageIcon ic1=new ImageIcon(img1);

l12 = new JLabel(ic1);

p3.add(l12);

setLayout(new BorderLayout(10,10));

add(p1,"North");

add(p2,"Center");

add(p3,"West");

ch.addMouseListener(new MouseAdapter()

@Override

public void mouseClicked(MouseEvent arg0)

try

ConnectionClass obj2=new ConnectionClass();

String username=ch.getSelectedItem();

String q1="select * from customer where username='"+username+"'";

ResultSet rest1=obj2.stm.executeQuery(q1);

169
while(rest1.next())

tf1.setText(rest1.getString("name"));

tf2.setText(rest1.getString("age"));

tf3.setText(rest1.getString("dob"));

tf4.setText(rest1.getString("address"));

tf5.setText(rest1.getString("phone"));

tf6.setText(rest1.getString("email"));

tf7.setText(rest1.getString("country"));

tf8.setText(rest1.getString("gender"));

tf9.setText(rest1.getString("aadhar"));

catch(Exception exx)

exx.printStackTrace();

});

public void actionPerformed(ActionEvent e)

170
{

if(e.getSource()==bt1)

String username=ch.getSelectedItem();

String name=tf1.getText();

String age=tf2.getText();

String dob=tf3.getText();

String address=tf4.getText();

String phone=tf5.getText();

String email=tf6.getText();

String country=tf7.getText();

String gender=tf8.getText();

String aadhar=tf9.getText();

try

ConnectionClass obj3=new ConnectionClass();

String q1="update customer set


name='"+name+"',age='"+age+"',dob='"+dob+"',address='"+address+"',phone='"+pho
ne+"',email='"+email+"',country='"+country+"',gender='"+gender+"',aadhar='"+aadh
ar+"' where username='"+username+"'";

int aa=obj3.stm.executeUpdate(q1);

if(aa==1)

171
JOptionPane.showMessageDialog(null, "your data Successfully
updated");

this.setVisible(false);

new View_Customer().setVisible(true);

else

JOptionPane.showMessageDialog(null, "Please!, Fill all details


carefully");

catch(Exception ee)

ee.printStackTrace();

if(e.getSource()==bt2)

this.setVisible(false);

public static void main(String[] args)

172
new Update_Customer().setVisible(true);

View_BookedCab.java

package cab_booking;

import java.awt.*;

import javax.swing.*;

import java.awt.event.*;

import java.sql.*;

public class View_BookedCab extends JFrame

JTable t;

JButton bt1;

JTextField tf1;

JPanel p1,p2,p3;

String x[]={"Book ID","Username","Driver


Name","Car","Source","Destination","Price"};

String y[][]=new String [20][7];

int i=0,j=0;

Font f,f1;

JLabel l1,l2;

173
View_BookedCab()

super("All Booked Cab records");

setSize(1300,400);

setLocation(0,10);

f=new Font("MS UI Gothic",Font.BOLD,17);

try

ConnectionClass obj=new ConnectionClass();

String q="select * from intracitycab";

ResultSet rest=obj.stm.executeQuery(q);

while(rest.next())

y[i][j++]=rest.getString("BookID");

y[i][j++]=rest.getString("username");

y[i][j++]=rest.getString("drivername");

y[i][j++]=rest.getString("car");

y[i][j++]=rest.getString("source");

y[i][j++]=rest.getString("destination");

y[i][j++]=rest.getString("price");

174
i++;

j=0;

t=new JTable(y,x);

catch(Exception ex)

ex.printStackTrace();

t.setFont(f);

t.setBackground(Color.BLACK);

t.setForeground(Color.WHITE);

JScrollPane js=new JScrollPane(t);

add(js);

public static void main(String args[])

new View_BookedCab().setVisible(true);

View_Booked_Package.java

175
package cab_booking;

import java.awt.*;

import javax.swing.*;

import java.awt.event.*;

import java.sql.*;

public class View_Booked_Pacakage extends JFrame

JTable t;

JButton bt1;

JTextField tf1;

JPanel p1,p2,p3;

String x[]={"Book ID","Username","Name","Driver


Name","Source","Destination","Weight","Truck","distance","Price"};

String y[][]=new String [20][10];

int i=0,j=0;

Font f,f1;

JLabel l1,l2;

View_Booked_Pacakage()

super("All Booked Transport Truck records");

176
setSize(1300,400);

setLocation(0,10);

f=new Font("MS UI Gothic",Font.BOLD,17);

try

ConnectionClass obj=new ConnectionClass();

String q="select * from intransport";

ResultSet rest=obj.stm.executeQuery(q);

while(rest.next())

y[i][j++]=rest.getString("BookID");

y[i][j++]=rest.getString("username");

y[i][j++]=rest.getString("name");

y[i][j++]=rest.getString("drivername");

y[i][j++]=rest.getString("source");

y[i][j++]=rest.getString("destination");

y[i][j++]=rest.getString("weight");

y[i][j++]=rest.getString("truck");

y[i][j++]=rest.getString("distance");

y[i][j++]=rest.getString("price");

i++;

177
j=0;

t=new JTable(y,x);

catch(Exception ex)

ex.printStackTrace();

t.setFont(f);

t.setBackground(Color.BLACK);

t.setForeground(Color.WHITE);

JScrollPane js=new JScrollPane(t);

add(js);

public static void main(String args[])

new View_Booked_Pacakage().setVisible(true);

View_Customer.java

package cab_booking;

178
import java.awt.*;

import javax.swing.*;

import java.awt.event.*;

import java.sql.*;

public class View_Customer extends JFrame

JTable t;

JButton bt1;

JTextField tf1;

JPanel p1,p2,p3;

String x[]={"Username","Name","Age","Date of
birth","Address","Phone","Email","Country","Gender","Aadhar"};

String y[][]=new String [20][10];

int i=0,j=0;

Font f,f1;

JLabel l1,l2;

View_Customer()

super("All Customer records");

setSize(1300,400);

179
setLocation(0,10);

f=new Font("MS UI Gothic",Font.BOLD,17);

try

ConnectionClass obj=new ConnectionClass();

String q="select * from customer";

ResultSet rest=obj.stm.executeQuery(q);

while(rest.next())

y[i][j++]=rest.getString("username");

y[i][j++]=rest.getString("name");

y[i][j++]=rest.getString("age");

y[i][j++]=rest.getString("dob");

y[i][j++]=rest.getString("address");

y[i][j++]=rest.getString("phone");

y[i][j++]=rest.getString("Email");

y[i][j++]=rest.getString("country");

y[i][j++]=rest.getString("gender");

y[i][j++]=rest.getString("aadhar");

i++;

j=0;

180
}

t=new JTable(y,x);

catch(Exception ex)

ex.printStackTrace();

t.setFont(f);

t.setBackground(Color.BLACK);

t.setForeground(Color.WHITE);

JScrollPane js=new JScrollPane(t);

add(js);

public static void main(String args[])

new View_Customer().setVisible(true);

View_InterCity_Booked_Cab.java

181
package cab_booking;

import java.awt.*;

import javax.swing.*;

import java.awt.event.*;

import java.sql.*;

public class View_Intercity_Booked_Cab extends JFrame

JTable t;

JButton bt1;

JTextField tf1;

JPanel p1,p2,p3;

String x[]={"Book ID","Username","Name","Driver


Name","Source","Destination","type","Car","Price"};

String y[][]=new String [20][9];

int i=0,j=0;

Font f,f1;

JLabel l1,l2;

View_Intercity_Booked_Cab()

super("All intercity Booked Cab records");

182
setSize(1300,400);

setLocation(0,10);

f=new Font("MS UI Gothic",Font.BOLD,17);

try

ConnectionClass obj=new ConnectionClass();

String q="select * from intercitycab";

ResultSet rest=obj.stm.executeQuery(q);

while(rest.next())

y[i][j++]=rest.getString("BookID");

y[i][j++]=rest.getString("username");

y[i][j++]=rest.getString("name");

y[i][j++]=rest.getString("drivername");

y[i][j++]=rest.getString("source");

y[i][j++]=rest.getString("destination");

y[i][j++]=rest.getString("type");

y[i][j++]=rest.getString("car");

y[i][j++]=rest.getString("price");

i++;

j=0;

183
}

t=new JTable(y,x);

catch(Exception ex)

ex.printStackTrace();

t.setFont(f);

t.setBackground(Color.BLACK);

t.setForeground(Color.WHITE);

JScrollPane js=new JScrollPane(t);

add(js);

public static void main(String args[])

new View_Intercity_Booked_Cab().setVisible(true);

184
CHAPTER - 5 IMPLEMENTATION

5.1 Implementation

5.1.1 Project Run Screen

185
186
5.1.2 ADD CUSTOMER

187
5.1.3 BOOK CAB
5.1.3.1 BOOK INTERCITY CAB

5.1.3.2 BOOK PACKAGE

188
5.1.3.2 GENERATE BILL

189
CHAPTER - 6 TESTING

6.1 INTRODUCTION
Testing is the process of executing a program with the intent of finding errors. It
is a major quality measure employed during software development. During
testing, the program is executed with a set of conditions known as test cases, and
the output is evaluated to determine whether the program is performing as
expectation the programmer. Testing is the process of executing a program with
the intent of finding errors.

190
6.1.1 TESTING OBJECTIVES
• Testing is the process of executing a program with the intent of finding an
error.

• A successful test uncovers a yet undiscovered error.

• A good test case has a high probability of finding errors if it exists.

• The tests are inadequate to detect possibly present errors.

• The software confirms different perspectives on the quality and reliability


standards.

6.2 LEVELS OF TESTING


To uncover the errors, present in different phases we have the concept of levels of
things. The basic levels of testing are

Figure 5.1: Levels of testing

6.3 TESTING TECHNIQUE USED (TYPES OF TESTING)


6.3.1 UNIT TESTING
• Unit Testing is done on individual modules as they are completed and
become executable.

• It is confined only to the designer’s requirements.

• Each module can be tested using the following two strategies.

191
6.3.2 BLACK BOX TESTING
• In this strategy some test cases are generated as the input conditions that
fully execute all the functional requirements for the program. This testing
has been used to find errors in the following categories:
• Incorrect or missing function

• Interface errors

• Errors in a data structure or external database access

• Performance errors

• Initialization and termination errors.

• In this testing only output is checked for correctness. The logical flow of
data is not checked.

6.3.3 WHITE BOX TESTING


• In this the test cases are generated on the logic of each module by drawing
flow graphs of that module and logical decisions are tested on all the cases.
• It has been used to generate the test cases in the following cases:

• Guarantee that all independent paths have been executed.

• Execute all logical decisions on their true and false sides.

• Execute all loops at their boundaries and within their operational bounds.

• Execute internal data structure to ensure their validity.

6.3.4 INTEGRATION TESTING


Integration testing ensures that the software and the subsystems work together as
a whole. It tests the interface of the entire module to make sure that the modules
behave properly when integrated.

192
6.3.5 SYSTEM TESTING
System testing involves in-house testing of the entire system before delivery to
the user.
It aims to satisfy the user that the system meets all requirements of the client’s
specifications.

6.3.6 USER ACCEPTANCE TESTING


User acceptance of a system is the key factor to the success of any system. The
system under study is tested for user acceptance by constantly keeping in touch
with the prospective system users at the time of developing and making changes
whenever required.
It is pre-delivery testing in which the entire system is tested at the client’s site on
real-world data to find errors.

6.3.7 VALIDATION TESTING


The system has been tested and implemented successfully and thus ensured that
all the requirements as listed in the software required specification are completely
fulfilled. In case of erroneous input, corresponding error messages are displayed.

6.3.8 OUTPUT TESTING


After performing validation testing, the next step is output testing of the proposed
system since no system could be useful if it does not produce the required specified
format. Asking the users about the format required by the tests and the output
generated by the system under consideration. Here the output format is considered in
two ways, one is on the screen and the other is in printed format. The output format
on the screen is found to be correct as the format was designed in the system design
phase according to the user’s needs. For the hard copy also output comes as the
specified requirements by the users. Hence output testing does not result in any
corrections in the system.

193
6.4 TEST CASE

Sr. No. Test Case Expected Result Log File’s Message Status

Text

1 Splash Screen The run button should Pass


open stay disabled so that
Project should not
proceed

2 The login Id and The standard Thanks for choosing Pass


Password did not Confirmation message, the cab management,
fetch then the Thanks Project. Have a Good
Message. Day.

3 cab details are Standard Message, your Please check your Pass
Empty data is empty. details.
Fill in the cab details
carefully.

4 The Home Error message Your System Pass


screen did not connection is slow or
open the database
connection may be
off, Thanks.

5 cab details did Error message This is not found, or Pass


not find the data is incorrect.
Please check. Thanks

194
6 Cab booking id Error message Cab booking id is Pass
is wrong incorrect. Please
check. Thanks

7 Wrong Email id Error message In the Input file, Pass


in input file Email-id is incorrect.
Please check. Thanks

195
CHAPTER - 7 MAINTENANCE

7.1 SYSTEM MAINTENANCE

Maintenance is the process of modifying a software system or component after its


delivery to correct faults, improve performance and other attributes, or adapt to
the changing environment. Maintenance covers a wide range of activities
including correcting code and design errors, updating the documentation and test
data, and upgrading user support. There is an aging process that calls for periodic
maintenance of hardware and software. Maintenance is always necessary to keep
the system to its standards.

196
As the number of computer-based systems, libraries of computer software began
to expand. In-house developed projects produced tons of thousands of soft
program source statements. Software products purchased from the outside added
hundreds of thousands of new statements. In all these programs, all of those
source’s statements had to be corrected when false were detected, modified as user
requirements changed, or adapted to new hardware that was purchased. These
activities were collectively called software Maintenance.
The maintenance phase focuses on change that is associated with error
correction, adaptations required as the software's environment evolves, and
changes due to enhancements brought about by changing customer requirements.
Four types of changes are encountered during the maintenance phase.
1. Correction
2. Adaptation
3. Enhancement
4. Prevention

• Correction
Even with the best quality assurance activities is light that the customer
will uncover defects in the software. Corrective maintenance changes the
software to correct defects. Maintenance is a set of software engineering
activities that occur after the software has been delivered to the customer
and put into operation. Software configuration management is a set of
tracking and control activities that began when a software project begins
and terminates only when the software is taken out of operation. Only
about 20 percent of all maintenance work is spent "fixing mistakes". The
remaining 80 percent is spent adapting existing systems to changes in their
external environment, making enhancements requested by users, and
reengineering an application for use.

197
1. Adaptation
Over time, the original environment (EG: CPU, operating system, business
rules, external product characteristics) for which the software was
developed is likely to change. Adaptive maintenance results in a
modification to the software to accommodate the change to its external
environment.
2. Enhancement
As software is used, the customer/user will recognize additional functions
that will provide benefits. Perceptive maintenance extends the software
beyond its original function requirements.
3. Prevention
Computer software deteriorates due to change, and because of this,
preventive maintenance often called software re-engineering and must be
conducted to enable the software to serve the needs of its end users. In
essence, preventive maintenance makes changes to computer programs so
that they can be more easily corrected, adapted, and enhanced. Software
configuration management (SCM) is an umbrella activity that is applied
throughout the software process.

198
CHAPTER - 8 CONCLUSION & FUTURE SCOPE

8.1 CONCLUSION & FUTURE SCOPE


Here are some parameters we need to aware whenever we want develop a
cab Booking System

• The fare must be economical so that it must be in reach/budget of every


person.
• Cab must be reach on time on the defined destination.
• There must be a large fleet of cabs (AC/Non-AC).
• Provide the functionality to make your own bookings
• Update your system site without the need to get a system designer involved.
• Provide the customer with cab availability.

199
• Track your customers.
• Engage your customers through interaction such as feedback forms.
• Easy payment facility must be provided in cab i.e. by cash or by card.
• Payment bill must be provided by cab driver.
• Driver’s identification data must be given i.e. driver’s name, id & photo
• graph at the time of booking of cab.
• Estimated time for a particular journey must be provided.
• Details of the route must be provided to the customer. Customers
can my take the cab by his/her own route.
• Customer satisfaction is necessary.
• The user interface must be friendly so that the user can easily
book a cab in a few minutes by doing few clicks.
• Payment modes can be also of prepaid or post-paid.
• Peak and Surge time charges are also added to the total fare based
on per kilometre.
• In the end the report must be generated which shows the customer’s
name, address, source and destination, total fare, driver details and
timings i.e., the invoice must be generated If the payment is made at
the time of booking i.e. prepaid then it must be shown in the report.
• The information must be provided to the customer on its email id
and to the driver on its job sheet
• In the future it can be modified according to the input data format and re-
designed with many other modules.

200
References

[1]Kathy Sierra, Bert Bates, Trisha Gee, “Head First Java”, O'Reilly Media, 12 May 2022

[2] Joseph Gradecki, Mark Matthews, “MySQL and Java Developer's Guide”, Wiley, 2003

[3] GeeksforGeeks.com, “Java Database Connectivity with MySQL",


Available: https://www.geeksforgeeks.org/java-database-connectivity-with-
mysql/, [January 23, 2024]

[4] Javatpoint.com, “AWT and Swing in Java”, Available:


https://www.javatpoint.com/awt-and-swing-in-java, [January 30, 2024]

[5] Edureka.co, “A Beginner’s guide to NetBeans IDE”, Available:


https://www.edureka.co/blog/java-frameworks/, [January 23, 2024]

201

You might also like