Final Project
Final Project
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
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.
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.
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.
1. Requirement Gathering
2. Documentation/Design
3. Development
4. Coding
5. Testing
Table of Content
1.6 Objectives 10
18
1.7 Significance 11
19
1.8 Limitation 11
19
3.5 UML 24
29
Refrences [201]
[153]
CHAPTER - 1 INTRODUCTION
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.
2
o Email
o Password
o Mobile number
o Date of Birth
o Identity Number
o Car details (In the case of the driver)
Features related to the most frequented destinations and routes will add to
app usability and makes cab booking easy for riders.
● More manpower
● Time-consuming
The system needs to be automated to avoid all these limitations and make the work
more accurate.
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.
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.
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.
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
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.
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.
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:
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.
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.
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 −
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
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:
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
12
point at which the Project Team prepares to capture the detailed functional,
technical, operational, and transitional requirements of the system.
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.
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.
14
1. Economic Feasibility
2. Technical Feasibility
3. Operational Feasibility
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
17
Bubbles are annotated with the names of the corresponding functions.
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.
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
20
3.2.2 FIRST LEVEL DFD
Manage all
activities/Get
Admin Cab booking records of
management system successful or
unsuccessful
transactions
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.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:
23
3.4 DEPENDENCIES USED
• import java.awt.*;
• import java.awt.event.*;
• import javax.swing.*;
• import java.sql.*;
• import java.util.*;
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
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
Table DriverDetails
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
1 EID int PK
31
9 Gender varchar(50) Allownull
Table RouteDetails
1 RTID Int PK
32
5 Destination varchar(50) NotNULL
Table Biiling
1 BillNo varchar(50) PK
2 VehicleID varchar(50) FK
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;
JButton b1;
JLabel l1;
TextArea t1;
String s;
public About()
36
setLayout(null);
add(b1);
b1.addActionListener(this);
setFont(f);
+ "can view available cabs; register the cabs, view profile and "
+ "book cabs\n\n"
+ "\nIt’s user-friendly as they can book cabs from the comfort of "
37
TextArea t1 = new TextArea(s, 10, 40, Scrollbar.VERTICAL);
t1.setEditable(false);
add(t1);
t1.setFont(f1);
t1 = new TextArea();
add(l1);
l1.setForeground(Color.red);
l1.setFont(f2);
38
setLayout(null);
setVisible(true);
dispose();
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.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);
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.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.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.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);
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.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.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.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.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);
String username=t1.getText();
if(e.getSource()==b)
46
{
try
obj.stm.executeUpdate(q);
f.setVisible(false);
new HomePage();
catch(Exception 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.*;
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()
setLocation(450,50);
setSize(450,450);
f=new Font("Arial",Font.BOLD,20);
f1=new Font("Arial",Font.BOLD,15);
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();
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");
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
{
int aa=obj.stm.executeUpdate(q);
if(aa==1)
this.setVisible(false);
else
catch(Exception ee)
ee.printStackTrace();
if(e.getSource()==bt2)
53
{
this.setVisible(false);
new AdminSection().setVisible(true);
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.*;
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()
setLocation(450,50);
setSize(450,400);
f=new Font("Arial",Font.BOLD,20);
f1=new Font("Arial",Font.BOLD,15);
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();
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");
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
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)
this.setVisible(false);
else
catch(Exception ee)
ee.printStackTrace();
if(e.getSource()==bt2)
this.setVisible(false);
new AdminSection().setVisible(true);
59
}
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.*;
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()
setLocation(450,50);
setSize(450,450);
f=new Font("Arial",Font.BOLD,20);
f1=new Font("Arial",Font.BOLD,15);
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();
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");
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
int aa=obj.stm.executeUpdate(q);
if(aa==1)
this.setVisible(false);
else
catch(Exception ee)
ee.printStackTrace();
65
}
if(e.getSource()==bt2)
this.setVisible(false);
new AdminSection().setVisible(true);
new Add_Transport_Driver().setVisible(true);
AdminSection.java
package cab_booking;
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
import java.sql.*;
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);
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);
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");
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);
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;
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()
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
ResultSet rest=obj.stm.executeQuery(q);
while(rest.next())
ch1.add(rest.getString("source"));
rest.close();
catch(Exception e)
e.printStackTrace();
try
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();
l3=new JLabel("Source");
l4=new JLabel("Destination");
l5=new JLabel("Username");
l6=new JLabel("Name");
l8=new JLabel("Car");
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);
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);
p3.add(l12);
setLayout(new BorderLayout(10,10));
add(p1,"North");
add(p2,"Center");
add(p3,"West");
ch3.addMouseListener(new MouseAdapter()
78
@Override
try
String username=ch3.getSelectedItem();
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
ch2.removeAll();
try
String source=ch1.getSelectedItem();
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
try
String source=ch1.getSelectedItem();
String destination=ch2.getSelectedItem();
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();
});
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
82
String q1="insert into intracitycab
values('"+bid+"','"+username+"','"+dname+"','"+car+"','"+source+"','"+destination+"',
'"+price+"')";
int aa=obj3.stm.executeUpdate(q1);
if(aa==1)
this.setVisible(false);
new Update_Customer();
else
catch(Exception ee)
ee.printStackTrace();
if(e.getSource()==bt2)
this.setVisible(false);
83
}
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.*;
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()
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
ResultSet rest=obj.stm.executeQuery(q);
while(rest.next())
85
ch1.add(rest.getString("source"));
rest.close();
catch(Exception e)
e.printStackTrace();
try
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");
l3=new JLabel("Source");
l4=new JLabel("Destination");
l5=new JLabel("Username");
l6=new JLabel("Name");
l8=new JLabel("Car");
l11=new JLabel("Price");
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);
tf1.setText(""+Math.abs(r.nextInt() % 100000));
tf1.setForeground(Color.RED);
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);
p3.add(l12);
setLayout(new BorderLayout(10,10));
add(p1,"North");
add(p2,"Center");
add(p3,"West");
ch3.addMouseListener(new MouseAdapter()
92
@Override
try
String username=ch3.getSelectedItem();
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
ch2.removeAll();
try
String source=ch1.getSelectedItem();
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
try
String source=ch1.getSelectedItem();
String destination=ch2.getSelectedItem();
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();
});
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
int aa=obj3.stm.executeUpdate(q1);
if(aa==1)
this.setVisible(false);
else
catch(Exception ee)
ee.printStackTrace();
if(e.getSource()==bt2)
97
{
this.setVisible(false);
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.*;
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
99
ResultSet rest=obj.stm.executeQuery(q);
while(rest.next())
ch1.add(rest.getString("source"));
rest.close();
catch(Exception e)
e.printStackTrace();
try
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");
l3=new JLabel("Source");
l4=new JLabel("Destination");
l5=new JLabel("Username");
l6=new JLabel("Name");
l8=new JLabel("Truck");
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);
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);
p3.add(l12);
setLayout(new BorderLayout(10,10));
add(p1,"North");
add(p2,"Center");
add(p3,"West");
ch3.addMouseListener(new MouseAdapter()
@Override
try
String username=ch3.getSelectedItem();
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
ch2.removeAll();
try
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
try
109
String source=ch1.getSelectedItem();
String destination=ch2.getSelectedItem();
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();
});
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
int aa=obj3.stm.executeUpdate(q1);
if(aa==1)
111
JOptionPane.showMessageDialog(null, "Truck successfully Boooked");
this.setVisible(false);
else
catch(Exception ee)
ee.printStackTrace();
if(e.getSource()==bt2)
this.setVisible(false);
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;
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;
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
ResultSet rest=obj.stm.executeQuery(q);
while(rest.next())
ch1.add(rest.getString("username"));
rest.close();
114
catch(Exception e)
e.printStackTrace();
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");
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);
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
try
String username=ch1.getSelectedItem();
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
});
if(e.getSource()==bt1)
price=0;
String username=ch1.getSelectedItem();
try
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
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
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
}
new CheckBill().setVisible(true);
ConnectionClasss.java
package cab_booking;
import java.sql.*;
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);
new ConnectionClass();
125
}
Delete_Customer.java
package cab_booking;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
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
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");
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);
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);
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
try
String username=ch.getSelectedItem();
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();
});
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
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
catch(Exception ee)
ee.printStackTrace();
if(e.getSource()==bt2)
this.setVisible(false);
136
}
new Delete_Customer().setVisible(true);
HomePage.java
package cab_booking;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10;
Font f,f1,f2;
JPanel p1;
HomePage()
137
setLocation(0,0);
setSize(1550,800);
f2=new Font("Gadugi",Font.BOLD,35);
ImageIcon ic=new
ImageIcon(ClassLoader.getSystemResource("cab_booking/Icons/1.jpg"));
Image
img=ic.getImage().getScaledInstance(1550,800,Image.SCALE_DEFAULT);
l1=new JLabel(ic1);
138
JMenuItem ment5=new JMenuItem("Book Cab");
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);
String comnd=e.getActionCommand();
new Add_Customer();
144
{
new View_Customer().setVisible(true);;
new Update_Customer().setVisible(true);
new Book_Cab().setVisible(true);
new View_BookedCab().setVisible(true);
new Book_Intercity_Cab().setVisible(true);
new View_Intercity_Booked_Cab().setVisible(true);
145
}
new Book_Package().setVisible(true);
new View_Booked_Pacakage().setVisible(true);
new CheckBill().setVisible(true);
new Delete_Customer().setVisible(true);
else if(comnd.equals("About"))
new About().setVisible(true);
else if(comnd.equals("Exit"))
146
{
System.exit(0);
new HomePage().setVisible(true);
Index.java
package cab_booking;
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
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);
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);
148
l3=new JLabel(c1);
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");
if(e.getSource()==bt1)
new AdminSection().setVisible(true);
if(e.getSource()==bt2)
new Login();
150
new Index().setVisible(true);
Login.java
package cab_booking;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
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);
l1.setIcon(img1);
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.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.setBounds(120,170,150,30);
l4.setForeground(Color.ORANGE);
l4.setFont(new Font("Airal",Font.BOLD,20));
l1.add(l4);
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);
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");
String name=t1.getText();
String pass=pf1.getText();
ResultSet rs=obj.stm.executeQuery(q);
if(rs.next())
new HomePage().setVisible(true);
f.setVisible(false);
else
f.setVisible(false);
f.setVisible(true);
155
}
catch(Exception e)
e.printStackTrace();
if(ae.getSource()==b2)
this.f.setVisible(false);
new Signup();
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;
JFrame f;
JLabel l1,l2,l3,l4,l5;
JTextField t1,t2,t3;
JPasswordField p1;
JButton b1,b2;
Signup()
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.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);
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);
if(ee.getSource()==b1)
160
try
int aa=obj.stm.executeUpdate(q);
if(aa==1)
this.setVisible(false);
new Login();
else
this.f.setVisible(false);
this.f.setVisible(true);
catch(Exception e)
161
e.printStackTrace();
if(ee.getSource()==b2)
this.f.setVisible(false);
new Login();
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();
ResultSet rest=obj.stm.executeQuery(q);
while(rest.next())
ch.add(rest.getString("username"));
catch(Exception e)
e.printStackTrace();
l2=new JLabel("Username");
l3=new JLabel("Name");
l4=new JLabel("Age");
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();
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);
p3.add(l12);
setLayout(new BorderLayout(10,10));
add(p1,"North");
add(p2,"Center");
add(p3,"West");
ch.addMouseListener(new MouseAdapter()
@Override
try
String username=ch.getSelectedItem();
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();
});
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
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
catch(Exception ee)
ee.printStackTrace();
if(e.getSource()==bt2)
this.setVisible(false);
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.*;
JTable t;
JButton bt1;
JTextField tf1;
JPanel p1,p2,p3;
int i=0,j=0;
Font f,f1;
JLabel l1,l2;
173
View_BookedCab()
setSize(1300,400);
setLocation(0,10);
try
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);
add(js);
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.*;
JTable t;
JButton bt1;
JTextField tf1;
JPanel p1,p2,p3;
int i=0,j=0;
Font f,f1;
JLabel l1,l2;
View_Booked_Pacakage()
176
setSize(1300,400);
setLocation(0,10);
try
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);
add(js);
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.*;
JTable t;
JButton bt1;
JTextField tf1;
JPanel p1,p2,p3;
String x[]={"Username","Name","Age","Date of
birth","Address","Phone","Email","Country","Gender","Aadhar"};
int i=0,j=0;
Font f,f1;
JLabel l1,l2;
View_Customer()
setSize(1300,400);
179
setLocation(0,10);
try
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);
add(js);
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.*;
JTable t;
JButton bt1;
JTextField tf1;
JPanel p1,p2,p3;
int i=0,j=0;
Font f,f1;
JLabel l1,l2;
View_Intercity_Booked_Cab()
182
setSize(1300,400);
setLocation(0,10);
try
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);
add(js);
new View_Intercity_Booked_Cab().setVisible(true);
184
CHAPTER - 5 IMPLEMENTATION
5.1 Implementation
185
186
5.1.2 ADD CUSTOMER
187
5.1.3 BOOK CAB
5.1.3.1 BOOK INTERCITY CAB
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.
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
• Performance errors
• In this testing only output is checked for correctness. The logical flow of
data is not checked.
• Execute all loops at their boundaries and within their operational bounds.
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.
193
6.4 TEST CASE
Sr. No. Test Case Expected Result Log File’s Message Status
Text
3 cab details are Standard Message, your Please check your Pass
Empty data is empty. details.
Fill in the cab details
carefully.
194
6 Cab booking id Error message Cab booking id is Pass
is wrong incorrect. Please
check. Thanks
195
CHAPTER - 7 MAINTENANCE
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
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
201