You are on page 1of 49

ROCKY IGNITE BUS BOOKING SYSTEM

PRESENTOR: SAMWEL NJOROGE KARANJA

INDEX NUMBER: 411020052

INSTITUITION: JEREMIAH NYAGAH TECHNICAL INSTITUTE

SUPERVISOR: MR. KAMWENGU

AWARD: SUBMITTED TO KNEC FOR AWARD OF DIPLOMA IN INFORMAYION


AND COMMUNICATION TECHNOLOGY

DATE: YEAR 2023


DECLARATION
I Samwel Njoroge Karanja of Jeremiah Nyagah Technical Institute of Admission Number
9443 do here declare that this Bus Booking system is my original work and have never been
presented in the Kenya National Examination Council.

SIGNATURE...........................................

DATE.......................................................

SUPERVISOR

SIGNATURE...........................................

DATE.......................................................
ACKNOWLEDMENT

I would like to thank my classmates who have assisted me in the writing and designing of this
online bus system from beginning to the end. Mostly I would like to thank very much my unit
teacher Mr. John Kamwengu for the guidance that he has help me in completion of this
business plan, lastly all thanks to my international friend Afolabi who was of grate help.
DEDICATION
I would like to dedicate this project to the ICT class of 2023 who have been my grate friends
and have help me to come up with better ways of designing the system although there were
some challenges, but due to them I was able to tackle the project all thanks to my friend
Afolabi who is a full stack developer.
ABSTRACT
The Rocky Ignite Bus Booking system is an online system that enables users of different type
to register in order for them to access the system. Rocky Ignite is system that is designed to
have three different users i.e.
 Admin
 Local User
 Client
Each user has a different role when redirected to their own pages. Main intention of Ignite
bus booking system is to make our local transport system to be easier and simple for instance
one does not have to visit any station bay in order to buy a ticket which saves time and also
reduce congestion in bus bays.

Ignite system is 24/7 basis system thus enables passengers to book any time they wished to
travel it also enhances the security of passenger personal details because receipts have been
eliminated. The system also enables the company to be able to keep record of their bus and
passenger information whenever a report is required it can be generated and downloaded by
admin because Admin is the only person to access such confidential reports of the bus
company.
Table of Contents
DECLARATION..................................................................................................................................i
ACKNOWLEDMENT..........................................................................................................................ii
DEDICATION....................................................................................................................................iii
ABSTRACT.........................................................................................................................................iv
CHAPTER ONE..................................................................................................................................1
INTRODUCTION.................................................................................................................................1
1.1 BACKGROUND INFORMATION...........................................................................................1
1.2 STATEMENT TO THE PROBLEM.........................................................................................1
1.3 JUSTIFICATION OF THE PROJECT......................................................................................2
1.4 OBJECTIVE OF THE SYSTEM...............................................................................................3
1.5 SCOPE OF THE PROJECT......................................................................................................3
1.6 BENEFITS OF THE SYSTEM.................................................................................................3
CHAPTER TWO.................................................................................................................................4
LITERATURE REVIEW..................................................................................................................4
2.0 INTRODUCTION.....................................................................................................................4
2.1 PROBLEM RECORDED..........................................................................................................4
2.2 IGNITE BUS BOOKING SOLUTION.....................................................................................4
CHAPTER THREE...............................................................................................................................5
METHODOLOGY................................................................................................................................5
3.1 INTRODUCTION.................................................................................................................5
3.2 REQUIREMENT SPECIFICATIONS..................................................................................5
Hardware Requirements.............................................................................................................5
Software Requirements...............................................................................................................5
3.2 SYTEM DESIGN..................................................................................................................5
3.3 FULL SYSTEM DATA FLOW DIAGRAM OF ROCKY IGNITE BUS BOOKING SYSTEM....6
3.4 PROGRAM DESIGN......................................................................................................................7
FLOW CHART OF ADMIN ACCOUNT.....................................................................................8
FLOW CHART OF LOCAL USER ACCOUNT..........................................................................9
FLOW CHART OF CLIENT USER ACCOUNT.......................................................................10
3.5 SYSTEM TEST PLAN..................................................................................................................11
b) Module testing.............................................................................................................................11
c) System testing..............................................................................................................................11
3.6 CHANGE OVER METHOD.........................................................................................................12
3.7 SYSTEM ROLL OUT IMPLEMENTATION...............................................................................12
3.7 SECURITY REQUIREMENTS....................................................................................................13
3.8 USER MANUAL..........................................................................................................................13
HOME PAGE......................................................................................................................................13
LOGIN PAGE.....................................................................................................................................14
LOGIN PAGE.....................................................................................................................................14
Admin page.........................................................................................................................................14
Local User page...................................................................................................................................15
Client User page..................................................................................................................................16
About Local User page when logged in...............................................................................................16
About Client User page and Local User page in proceed to payment..................................................17
About Client User page and Local User page in ticket cancellation....................................................17
CHAPTER FOUR...............................................................................................................................18
EXPECTED OUTPUTS AND IMPACTS..........................................................................................18
4.0 EXPECTED RESULTS.......................................................................................................18
4.1 EXPECTED IMPACT.........................................................................................................18
CHAPTER FIVE.................................................................................................................................20
: CONCLUSIONS AND RECOMMENDATIONS.............................................................................20
5.0 RECOMMENDATIONS...........................................................................................................20
5.1 Reduction in strictness of the Time deadlines........................................................................20
5.2 Provision of project finances to the students..........................................................................20
5.3 Compelling some institutions to pave way for the students to develop..................................20
5.4 Future improvements.............................................................................................................20
5.5 CONCLUSION.........................................................................................................................21
APPENDIX 1......................................................................................................................................21
COST AND MATERIAL ESTIMATES.............................................................................................21
APPENDIX 2......................................................................................................................................22
CODE LISTINGS...............................................................................................................................22
HOME PAGE..................................................................................................................................22
LOGIN PAGE.....................................................................................................................................25
REGISTRATION FORM....................................................................................................................30
REGISTRATION FORM VALIDATION..........................................................................................31
LOCAL USER REGISTRATION.......................................................................................................37
APPENDIX 4......................................................................................................................................41
REFERENCES....................................................................................................................................41
CHAPTER ONE

INTRODUCTION

1.1 BACKGROUND INFORMATION

Rocky Ignite Bus Booking System is aimed at automating the station day to day booking with
its customer. Most of the task done in in bus bay is mainly booking, loading of passengers
backs and luggage’s and receiving of cash payment from passengers. In most region
especially rural areas most people still prefer the user of local ways of booking but with the
help pf technology Ignite is solving that problem.

As the system developer was visiting different booking system he realized that a lot of time is
used in making of long ques which is makes the process slow and tedious due to writing of
receipts and also calculating of passenger’s balance. Also this long que can lead to spread of
contagious diseases. In developer view decided to come up with a system to solve those
problems.

Rocky Ignite Bus booking is web based system which is hosted locally in the developer’s
device. The system users PHPMYADMIN as server where all the data that are POST and
FETCHED are stored. It is also integrated with XAMPP which has capability of running
APACHE, MYSQLI and also without XAMP PHPMYADMIN cannot be used as a server
locally

1.2 STATEMENT TO THE PROBLEM


The developer was able to identify some of the recurring problem that were recorded in most
of the researched areas conducted. It came to the attention that most of the local bus bays and
station they do not have a service system thus making their services to be more slow. One of
the problem that was recorded during the investigation was congestion of people in bus
station. Such congestion may lead to spread of diseases a good example is that of COVID19
which was contagious and can be easily be spread in bus bays.

Through research the developer realized that many of the passengers lost their luggage when
travelling due to reckless of conductors and those in charge with the help of this system
clients bags and luggage are able to be kept safely.

1
Developer also aims at reducing the rate of conductors and “Manambaz” in bus bays thus
reducing a lot of conflict among them with clients or passengers during boarding of bus
because most of conductors do harass the passengers when boarding and others ending up to
an extend of snatching their bags and luggage forcing them to enter their bus unwillingly
with the help of an online bus booking system it’s going to totally reduce the rate of
congestion because one will book the bus at comfort at their own workplace or home thus
reducing the rate spread of contagious diseases and any other. The developer also aims at
reducing of jam in bus bay thus easy navigation of busses in bus bays and station.

1.3 JUSTIFICATION OF THE PROJECT


Why choose Bus booking system? In Kenya most of the big Companies have their own build
booking system but when you come to local bus station they don’t have their own booking
system thus making their tusk to be difficult the main aim of me choosing this project is to
reduce Jam in Bus bay stations. Ignite Bus system will be of great help to the community at
large because there will be easy Change return to both conductors and customers. Have you
ever travel in bus you will find out that most conductors might forget to return change to their
clients or if they remember they might give out more change to the client due to large
carriage and each client paying with different amount? With the help of my system such
scenarios will be reduced because all the payment will be made through the counter and with
the help of the system customers will be able to be given back their extra money thus making
it efficient than that of manual also Easy management and keeping records of their customers
Most buses in city uses tickets when it comes to identification of customers who have paid
and when the ticket book is full the owners will require to have a new one and they may end
up throwing or forgetting where they had keep the carbon tickets ending up losing their
customers record thus had to get their progress in their bus sector. Efficiency in Bus Booking
Sectors with the help and building up of this system a lot time will be saved. For instance,
when one walks into a bus bay one will realize that the so called “Manambaz in local
language” or Conductors will come running to you and each one of them will want you to
enter into their bus but with the help of the system it will be easy to know which client will
go to a particular because the next bus will be boarded only if the first one is full. This will
reduce time in bus industry. Security of customers and their luggage’s most of the travelers
do lost their good due to careless of the conductors they can misplace the customers’ goods
with or without knowing ad without a system is difficult to track them. The system will also
provide order in station It has come to my attention that most bus drivers and conductors do
fights over customer to enter their buses without minding to know which bus is supposed to
be bored first thus making the station to be inconvenience to others and with the help of a
system they will be able to know which car will be next to be bored thus reducing jam and
creating order in the bus bay. Customer confidentiality privilege most busses use tickets and
when the tickets book is full they will end up throwing the carbon book thus making it
possible for the travelers’ personal details to be accessed by anyone but with the help of the
system only authorized personnel are allowed to see the customer’s personal details which it
is easy to track when customer’s details has been expose

2
1.4 OBJECTIVE OF THE SYSTEM
The main objective of the project is to come up with a bus booking system that will do away
with manual and physical why of booking a bus ticket, by enhancing it to be an online system
thus available to every person who would like to travel. This will be more convenient than
the old way of booking the bus, also the system is intended to reduce workers from the firm
thus the income will be large compared to previous one.
Another objective of the system is to ensure the safety of the passengers onboard and also to
reduce extra passengers from entering in short the bus will only carry the capacity that is
required to also the driver was to be instructed not to over speed making the clients and
passengers to be priority number one.

1.5 SCOPE OF THE PROJECT


The project was made especially for small and remote areas in our city but also the system
when enhanced with some few features the system could also work in both small bus bay and
large bus bay. The system basically focuses on registration of busses, passengers, drivers any
other personnel that are required to make the functioning of the bus bay or station to run
smoothly. The system is tailored made for passengers, local users and admin. When
implemented and followed correctly the system would be of great important both to the firm
and community at large and also will make the day to day activities to run smoothly.

1.6 BENEFITS OF THE SYSTEM


Needless to say, there is a better way to do it. We are of course talking about
simplifying reservations, booking online and accepting payments. Online booking systems
like Rocky Ignite Bus Booking System work by providing a secure and customizable booking
platform through which your guests can check the availability, view the property, and pay
directly on your website benefits of online booking can be:
i. Online booking systems and scheduling software save your staff time
ii. Removing the bottleneck of phone booking systems
iii. Greater sales and marketing synergy
iv. Increased revenue thanks to upselling
v. A modern approach to booking
vi. Secure and fast payments
vii. Make bookings accessible through resellers
viii. Online booking systems simplify reservation process

3
CHAPTER TWO
LITERATURE REVIEW

2.0 INTRODUCTION
The system was designed after a thorough investigation on bus booking system compared to
other larger company it came to our attention that most of local travelers that most of the
local bus station they do not have a system that enables the work of the firm to run smoothly.
We realized that most bays they have a lot of people and if not given task correctly most of
the workers end up being late.

2.1 PROBLEM RECORDED


After a well investigation the following problems were identified during the research that was
conducted
i. No Customer confidentiality privilege
ii. Congestion of vehicle
iii. Difficult in bus booking manually
iv. Tiring and boring ques to customer
v. Difficult in management and keeping records of their customers
vi. Trouble during change return to both conductors and customers
vii. Insecurity of customers and their luggage’s

2.2 IGNITE BUS BOOKING SOLUTION


The above problems were recorded and the developer came up with a structure on how the system
was going to solve the above problem. The developer designed the Rocky Ignite Bus Booking system
which it reduces the above problems when used and utilize properly.

4
CHAPTER THREE
METHODOLOGY
3.1 INTRODUCTION

It is important to fulfill the planning of the implementation phase. This can only be done if

proper methodology is selected. Methodology is important to make sure all project life cycle

activities are being carried out without any shortcuts. Methodology helps the system

developers to take one step at a time towards accomplishing the full system. The following

section discusses on the choice of methodology towards the implementation of Online Bus

Ticketing System Rocky Ignite Bus Booking System

3.2 REQUIREMENT SPECIFICATIONS


This section defines the minimum hardware and software needed in order for the system to
run in accordance and how it was intended to be
Hardware Requirements
Rocky Ignite Bus booking system is an online system thus it won’t require any hardware
preference this is because when hosted the system could be able to be accessed with anybody
provided they have a device that supports internet connectivity.

Software Requirements
The system is intended to be compatible with any browser and engines and one will be able
to access the service of booking with us.
3.2 SYTEM DESIGN
This section demonstrates how data flows in the whole system. The data flow is shown
inform of dataflow diagram for both programmers and non-programmers to be able to
understand how the program runs theoretically through representation in form of pictorial
diagrams. The developer will show how data flows from beginning where the users select
their user type insert their password login book a ticket and print or download the ticket and
then sign off and also clients with no account they have to sign up in order for them to access
the system.

5
3.3 FULL SYSTEM DATA FLOW DIAGRAM OF ROCKY IGNITE BUS
BOOKING SYSTEM

Register
Save

User local

User
Select your Admin Select Save bus a
user type destination
and login date of travel
and search bus

User Local Save local user


User

Customer Info
Perform other administrative privileges

Select
destination Save bus a
date of travel
and search bus
Proceed to
payment &
Save and print
choose mode of
Proceed to payment
payment &
choose Save and print
mode of
payment

User Signoff

User Signoff

6
3.4 PROGRAM DESIGN
In this sub chapter we are going to look at flow charts that will be drawn representing few
parts of Rocky Ignite Bus Booking system. With this pictorial representation one is able to
picture how the user will be interacting with the system.
The developer decided to present three different flow charts of three user types which are
found in Ignite Bus Booking system which are
 Admin Account
 Local User Account
 Client Account

7
FLOW CHART OF ADMIN ACCOUNT

START

ENTER USER CREDENTIALS

FALSE

CONFIRMING
AND
VARIFICATION OF
USER DETAILS

TRUE

USER LOGGED IN AS ADMIN AND


REDICTATED TO ADMIN PANEL

STOP

8
FLOW CHART OF LOCAL USER ACCOUNT

START

ENTER USER CREDENTIALS

FALSE

CONFIRMING
AND
VARIFICATION OF
USER DETAILS

TRUE

USER LOGGED IN AS LOCAL USER


AND REDICTATED TO ADMIN PANEL

STOP

9
FLOW CHART OF CLIENT USER ACCOUNT

START

ENTER USER CREDENTIALS

FALSE

CONFIRMING
AND
VARIFICATION OF
USER DETAILS

TRUE

USER LOGGED IN AS CLIENT AND


REDICTATED TO CLIENT HOME PAGE

STOP

10
3.5 SYSTEM TEST PLAN
In this title the developer tested the system and see how it was running. The developer tried to
be sure that all the modules of the system were running as it was intended to in the actual
world; that is whether the system functionality input output recording and processing of data
is running smoothly.
The developer tested the system in three different phases that is
 Unit testing
 Module Testing
 System testing
a) Unit Testing
In this unit testing the developer tested different part of the pages on its own and confirm
whether the pages were working correctly. After confirming that each module was working
correctly the developer then combined all the pages and ensured that relevant output was
given from the input of the system.

b) Module testing
The developer tested various modules in the system, the developer tested and assed each
module to ensure that it produces correct input and also to confirm that the user is entering
corrects inputs to the given field required or requested in the system.

c) System testing
The whole system was evaluated, verified and validated to detect whether the system is
working the way it was intended to do that is the input and output that the system generated
was the way it was intended thus it passed the test. The system was also placed on a different
operating system and different browser in order for the developer to observe its behavior,
where it was observed and concluded working in a satisfactory manner.
Various test data plans were carried out and few of the test carried out are as shown below:

LOGIN FORM TEST

User RESULT
User Name Email Phone Number
Type
client samwelnjroge samwelnjoroge757@gmail.com 2147483647 System Accepted
client MkenyaJames mkenyajames@gmail.com 721119005 System Accepted
Admin samwelnjoroge Samwel67@gmail.com 1234567890 System Accepted

11
CUSTOMER DETAILS
Passport/ First Last Gende Emerg Emerg Relatio Emergency
D.O.B
ID Name Name r F Name L Name n Contact
1999-
987654321 Joyce Wamboi Female James Kamau Sister 704480323
06-12
2023-
43435345 Samwel Karanja Male Samwel Karanja Sister 758670508
06-20
2023-
43435345 Samwel Karanja 0 Samwel Karanja Father 8900000
06-07
2023-
5 Samwelw Karanja 0 sammy Karanja Father 1890
05-30

3.6 CHANGE OVER METHOD


After a lot of consideration, the developer opted to use the direct change over way of
implementing the system into the firm. The new system was to be implemented on a
particular day and time, the developer decided that the system will be implemented overnight
that is in the morning the old way or the manual way will no longer be used.
Developer considered this method because of the cost consideration developer realized that
the direct changeover is more cheap than parallel method and also he wanted to make the
work of the cashier to be more simple and also to reduce the long and tiring que that had been
experiencing before the implementation of the new system.

3.7 SYSTEM ROLL OUT IMPLEMENTATION


In this section the developer wanted to show us on how the system will be rolled out
immediately after the direct changeover has been put into place and operating
The developer will start by training the Admin users on how they are going to man-over in
the new system that is on how they are going to add new local user, drivers, buses and how
they are going to generate particular reports when needed.
On the same day local users after being added by the admins they are going to be shown on
how they are going to register users who have come to the bus bays and also confirmation of
client who had booked their receipt online whether they booked as required after this the
system operators should be able to do all the necessary things required for them to do.

12
3.7 SECURITY REQUIREMENTS
Rocky Ignite Bus booking system will be highly secured that is only an authorized will the
only people who will be able to interact with the system database. The security of the system
is well secured by ensuring that each user will only be redirected to the pages that their role
has been assigned to them Local user can not access admin page and also can not access the
client page by this implementation the system will be secured.
The developer has only authorized admins to be the only person who can view the customer
and client’s information.
The following measures have been put into place to ensure confidentiality of user and
customers information.
i). The system shall be checking the access level of every user as they log into the
system.
ii). The system database and server will be secured with strong password that will only be
accessible to the system administrator meaning no one will be able to alter with
database information.
iii).The system data will be regularly backed up to the google drive of the firm to ensure
that any data can be retrieved back in case of loss of data.

3.8 USER MANUAL

HOME PAGE
This is the first page that the user will see after searching the name of the web and it also
contain more about Ignite and the user will choose whether to register or Login

13
LOGIN PAGE
On this section after registration the client will be redirected to the login page where it is the
main page. It contains selection of the user type i.e. Admin, Local User and Client. The last
part is inserting their credentials and they will be redirected to their pages respectively if the
password is incorrect the users won’t be able to access the service of the system.

LOGIN PAGE
Entail selection of User Type and entering of credentials

Admin page

14
Local User page
In this section it will show the user page and what it contains

15
Client User page

About Local User page when logged in


When the local user has accessed there account they will be required to click the Customer
details button that they will be required to enter the new customer details who they have
come physically to book the bus. Which will look as shown below.

Each text is validated that is only required data type characters will be allowed to be keyed in.

16
About Client User page and Local User page in proceed to payment
On this part when a particular mode of payment the client or local user want to use one part
will not be accessible that is, it won’t accept any input.

About Client User page and Local User page in ticket cancellation
On ticket cancellation one will be required to enter the receipt number where it will be searched in the
database and return ticket cancellation succefully.

17
CHAPTER FOUR

EXPECTED OUTPUTS AND IMPACTS


4.0 EXPECTED RESULTS
These requirements are those that enable the system to operate. These requirements focus
mainly on what the system should do. They include:
 Users have to register themselves by creating accounts to gain access to the
system’s services.
 Users should be able to book
 Each user with different role as only admin is the only person with capability
of adding a local user.
 User authentication by use of password.
 The system has one database views; the super administrator has more
privileges than the other users. The system shall validate users accessing data
in the system through use of password and username validation and
verification. A login dialog box will be used for these purposes.
 The system is expected to accept three user type that is:

i. Administrator
ii. Local User
iii. Customers(Clients)

 The categories of users allowed to access data in the system:

i). Administrator,
The super Admin will be responsible for making changes to the database while the members
will only be allowed to perform other services

4.1 EXPECTED IMPACT


Rocky Ignite Booking system will bring great impact and example of these impacts are

a. The system should be able to handle an unlimited number of users at a time.


b. Privacy and confidentiality of client will be more secure than the previous
days of manual system
c. Paper system will be thrown away thus the local users task will be simplified

18
d. Documentation: the system will be documented and PDF manuals will be
available for users when the system goes live.
e. Recover-ability: the system will be regularly backed up so that it can be
recovered in case data is lost for some reason.
f. Design constraints: The software will be developed with PHPMYADMIN
database back end.
g. The system will only allow the super admin to change data on the database
and not any other user.

19
CHAPTER FIVE

: CONCLUSIONS AND RECOMMENDATIONS

5.0 RECOMMENDATIONS

In order to reverse the risks and problems involved in the project and realize improvements in
succeeding developments, I would like to make the following recommendations.

5.1 Reduction in strictness of the Time deadlines

Since some of the issues in this system cover new concepts, I would recommend that the
students be allowed to begin the project development at a quite early time to build up on their
Ideas and to complete early and meet the set deadlines by the requirements.

5.2 Provision of project finances to the students

Due to the fact that some of the students are unable to meet the threshold required for data
and requirements capture, I would recommend that some special finances be provided to act
as the support for the students who face difficulties in the development and research process.

5.3 Compelling some institutions to pave way for the students to develop

Some institutions have been a major bottleneck in the development of the projects and the
higher-level institutions should compel them to release and loosen the restrictions they have
over their intellectual property such API (Application Programming Interface).

5.4 Future improvements

I would like to say that my system did not capture everything that would be required and
would therefore recommend for future improvements on the following:
 A feature to allow the admin message the clients within the system
 Features to enable clients give their feedback and suggestions.

20
5.5 CONCLUSION

It is clear that the existing systems of booking are limited to fixed bus company services and
do not provide mobile bus company service feature. This is therefore a bit expensive to the
clients as compared to when the bus company itself visits the clients who sometimes might be
a singing group of 20 members or a band. Therefore, proposed system provides a module to
select the nature of the bus company, i.e. either mobile or fixed and this helps the clients
make order for the bus company itself to visit them. This will reduce unnecessary costs and
time consumption.
The problems associated with the current system will be addressed with the new proposed
system. The whole design of the proposed system was a clear automation of the current
system at Rocky Ignite bus booking system and therefore the problems associated with the
manual system are well addressed by this design.
Also, the new system has been developed with a graphical user interface that is simple for use
and is therefore going to simplify the entire booking process. Despite a few challenges in the
implementation process, the process was a successful one as the developer was able to come
up with a system that did not only work but also got acceptance form users.
Taking this project all through has been a wonderful experience for me and for the practical
knowledge that I acquired, this would not have materialized. This is a very important part of
my course and has helped me understand the concepts behind a number of web scripting
languages as well as familiarize with the market expectations of the course at large.

APPENDIX 1

COST AND MATERIAL ESTIMATES


ITEM/SERVICE QUANTITY
Internet Research 1GB @ ksh20 50hrs 1000
Travelling cost 5 local bus bay 1500
Printing 50 pages @15 2 copies 1500
Binding 50 per copy 100
Burning Disk 50 50
Token to tutors 1 500
TOTAL 4650

21
APPENDIX 2

CODE LISTINGS
HOME PAGE
<!DOCTYPE html>
<html>
<head>
<title>Rocky Home Page</title>
<link rel="shortcut icon" href="Flavicon Yellow White.jpg" type="image/x-icon">
<link rel="stylesheet" href="Home_page.css">
<style>
#nav {
margin-left: 90%;
padding-top: -3em;
margin-top: -2.5em;
}
.reg {
margin-top: -2.5em;
margin-left: 75%;
}
h1{
color: white;
margin-left: 18%;
padding-top: 1%;
}
</style>
</head>
<body>
<div class="main">
<div class="top">
<div id="name">

22
<h1>ROCKY IGNITE BUS BOOKING SYSTEM</h1>
</div>
<div id="nav">
<a href="login_form.php"><button type="button">Login</button></a>
</div>
<div class="reg">
<a link href="Registration.php"> <button type="button">Register
Here</button></a>
</div>
</div>
<div class="DEC1">
<div id="dec1_content">
<p> Rocky Ignite bus booking is a convinience bus that makes your travel symple
and enjoyable we offer
everthing<br> you ask for. With up-to-date and current bus schedules, helpfull
staff and
friendly<br>
on-site bus drivers, there isn't a thing that you need to worry while travelling
with us.<br>
<h2>Comfort</h2>
<p>Our fleet of coaches is best-in-class and regularly maintained. Super-
comfortable seats and free
WiFi<br>
More so their is nothing that we value more than time and hence ensure on time
departure we
deperture on time
</p>
</p>
</div>
<img src="Naks.jpg" alt="">
</div>
</div>

23
<div class="down">
<h2 style="margin-top: -15%;">Hire Us</h2>
<p>
With Rocky we are able to provide you with capability of travelling with your<br>
own family through hiring our bus. Private functions and travel are well maintained
by our esteem<br>
staff who will serve you with skill Love and care. With Rocky we make your life and
travel smooth
</p>
<img src="getty.jpg" alt="" style="margin-top: -10%;">
</div>
<div class="prove">
<h3>Why Us?</h3>
<ul type="disc">
<li>Enter your departure and arrival destinations and travel dates.</li>
<li>Compare the different train, bus and flight routes available between the two
destinations.</li>
<li>Choose the best route for you and book your tickets on our website.</li>
<li>Pay using your preferred payment method print and download tickets.</li>
<li>Have a great trip!.</li>
</ul>
</div>
<footer>
<strong>Designed by Samwel KN</strong>
</footer>
</body>
</html>

24
LOGIN PAGE
<?php

session_start();

session_unset();

$extra="/bus/login_form.php";

echo "<script>window.location.href='".$extra."'</script>";

exit();

?>

<?php
// Database connection parameters
$servername = "localhost";
$username = "root";
$password = "";
$database = "bus_booking_system";

// Create a connection
$conn = new mysqli($servername, $username, $password, $database);

// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}

$User_Type = $_POST['User_Type'];
$User_Name = $_POST['User_Name'];
$password = $_POST['password'];

if($User_Type== "Client"){

25
$tablename="registration";
$uname= "User_Name";
}
else{
$tablename="Local_registration";
$uname= "UserName";

session_start();
//error_reporting(0);

if(isset($User_Name))
{
$adminusername=$_POST['$User_Name'];
$pass=($_POST['password']);
$ret=mysqli_query($conn,"SELECT * FROM $tablename WHERE $uname='$adminusername' and
password='$pass'");
$num=mysqli_fetch_array($ret);
if($num>0)
{

if($User_Type == "Admin"){

$extra="../Admin_panel.php";
$_SESSION['login']=$User_Name;
$_SESSION['admindets']=$num;
$_SESSION['id']=$num['id'];
echo "<script>window.location.href='".$extra."'</script>";
exit();

}elseif($User_Type == "Local User"){

26
$extra="../Local_User.php";
$_SESSION['login']=$User_Name;
$_SESSION['admindets']=$num;
$_SESSION['id']=$num['id'];
echo "<script>window.location.href='".$extra."'</script>";
exit();

}else{

$extra="../Client_page.php";
$_SESSION['login']=$User_Name;
$_SESSION['admindets']=$num;
$_SESSION['id']=$num['id'];
echo "<script>window.location.href='".$extra."'</script>";
exit();

}
else
{
$_SESSION['action1']="*Invalid username or password";
$extra="../login_form.php";
echo "<script>window.location.href='".$extra."'</script>";
exit();
}
}

?>

<!DOCTYPE html>
<head>

27
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="login_style.css">
<link rel="shortcut icon" href="Flavicon Yellow.jpg" type="image/x-icon">
<title>Login</title>
</head>
<body>
<form action="PHP/login.php" method="POST">
<div class="login">
<div class="loginform">
<div class="controls">
<h3>Login with your credentials</h3>
<img src="Flavicon Yellow White.jpg" alt="">
<select name="User_Type" id="role">
<option>Select User Type</option>
<option>Admin</option>
<option>Local User</option>
<option>Client</option>
</select>
<input type="text" name="User_Name" placeholder="Username" required>
<input type="password" name="password" placeholder="Password" required
min="6" max="9">
<div class="remember">
<input type="checkbox" name="checkbox">
<span>Remember Me</span>
</div>
<button name="Login" type="submit"> LOGIN </button>
</div>
</div>
</form>

28
</body>
</html>

29
REGISTRATION FORM

<?php
// Database connection parameters
$servername = "localhost";
$username = "root";
$password = "";
$database = "bus_booking_system";

// Create a connection
$conn = new mysqli($servername, $username, $password, $database);

// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}

// Get form data


$User_Type = $_POST[ 'User_Type'];
$First_Name = $_POST['First_Name'];
$Last_Name=$_POST['Last_Name'];
$User_Name = $_POST['User_Name'];
$Email = $_POST['Email'];
$Phone_Number = $_POST['Phone_Number'];
$Password = $_POST['Password'];
$Confirm_Password = $_POST['Confirm_Password'];

$stmt = mysqli_query($conn," insert into


registration(User_Type,First_Name,Last_Name,User_Name,Email,
Phone_Number,Password,Confirm_Password)

30
VALUES ('$User_Type', '$First_Name', '$Last_Name', '$User_Name', '$Email',
'$Phone_Number', '$Password', '$Confirm_Password')");

if($stmt)
{
echo "regristration successful";
}else{
echo "something went wrong";
}

$conn->close();
?>

REGISTRATION FORM VALIDATION

const form = document.getElementById('registrationForm');


const userType = document.getElementById('userType');
const firstName = document.getElementById('firstName');
const lastName = document.getElementById('lastName');
const userName = document.getElementById('userName');
const email = document.getElementById('email');
const phone = document.getElementById('phone');
const password = document.getElementById('password');
const confirmPassword = document.getElementById('confirmPassword');

form.addEventListener('submit', function (event) {


event.preventDefault();
resetErrors();

if (validateForm()) {
// Form validation succeeded, you can perform further actions here

31
//form.reset();
// alert("submitted")
this.submit()
}
});

function resetPage() {
history.go(-1); // Go back to the previous page
}

// Example usage
resetPage();

function validateForm() {
let isValid = true;

if (userType.value === '') {


displayError(userTypeError, 'Invalid' );
isValid = false;
}

if (firstName.value === '') {


displayError(firstNameError, 'Invalid');
isValid = false;
}

if (lastName.value === '') {


displayError(lastNameError, 'Invalid');
isValid = false;
}

32
if (userName.value === '') {
displayError(userNameError, 'Invalid');
isValid = false;
}

if (email.value === '') {


displayError(emailError, 'Invalid Email Address');
isValid = false;
} else if (!validateEmail(email.value)) {
displayError(emailError, 'Enter Valid Email Address (e.g., example@gmail.com or
example@yahoo.com)');
isValid = false;
}

if (phone.value === '') {


displayError(phoneError, 'Invalid');
isValid = false;
} else if (!validatePhone(phone.value)) {
displayError(phoneError, 'Please enter a valid phone number (digits only)');
isValid = false;
}

if (password.value === '') {


displayError(passwordError, 'Please enter a password');
isValid = false;
}

if (confirmPassword.value === '') {


displayError(confirmPasswordError, 'Please confirm your password');
isValid = false;

33
} else if (password.value !== confirmPassword.value) {
displayError(confirmPasswordError, 'Passwords do not match');
isValid = false;
}

return isValid;
}

function validateEmail(email) {
const emailPattern = /^[^\s@]+@(gmail|yahoo)\.com$/;
return emailPattern.test(email);
}

function validatePhone(phone) {
const phonePattern = /^\d+$/;
return phonePattern.test(phone);
}

function displayError(element, message) {


element.textContent = message;
}

function resetErrors() {
const errorElements = form.getElementsByClassName('error');
for (let i = 0; i < errorElements.length; i++) {
errorElements[i].textContent = '';
}
}

// Prevent entering non-digit characters in the phone field

34
phone.addEventListener('input', function (event) {
event.target.value = event.target.value.replace(/\D/g, '');
});
<!DOCTYPE html>
<html>

<head>
<title>Registration</title>
<link rel="stylesheet" href="Registration.css">
<style>
input {
width: 200px;
margin-top: 3%;
margin-left: 20%;
text-align: center;
font-size: 15px;
border: none;
font-weight: bolder;
outline: none;
color: white;

.container {
height: 37rem;
margin-top: 2%;
}
</style>
</head>

35
<body>

<form id="registrationForm" action="PHP/regstration.php" method="post" >


<div class="container">
<h2>ENTER YOUR CREDENTIALS</h2>
<label for="userType">User_Type</label>
<select id="userType" name="User_Type">
<option value="">Select User Type</option><br>
<option value="client">Client</option>
</select>
<span id="userTypeError" class="error"></span><br>

<label for="firstName">First Name</label>


<input type="text" id="firstName" name="First_Name" placeholder="First Name" >
<span id="firstNameError" class="error"></span><br>

<label for="lastName">Last Name</label>


<input type="text" id="lastName" name="Last_Name" placeholder="Last Name">
<span id="lastNameError" class="error"></span><br>

<label for="userName">User Name</label>


<input type="text" id="userName" name="User_Name" placeholder="User Name">
<span id="userNameError" class="error"></span><br>

<label for="email">Email</label>
<input type="email" id="email" name="Email" placeholder="Valid email contain
@gmail.com">
<span id="emailError" class="error"></span><br>

<label for="phone">Phone Number</label>

36
<input type="tel" id="phone" name="Phone_Number" placeholder="Phone
Number">
<span id="phoneError" class="error"></span><br>

<label for="password">Password</label>
<input type="password" id="password" name="Password" placeholder="Enter
Password">
<span id="passwordError" class="error"></span><br>

<label for="confirmPassword">Confirm Password</label>


<input type="password" id="confirmPassword" name="Confirm_Password"
placeholder="Confirm Password">
<span id="confirmPasswordError" class="error"></span><br>

<button type="submit" value="Register">Register</button>


</div>
</form>

</body>

</html>

LOCAL USER REGISTRATION


<?php
// Database connection parameters
$servername = "localhost";
$username = "root";
$password = "";
$database = "bus_booking_system";

// Create a connection

37
$conn = new mysqli($servername, $username, $password, $database);

// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}

// Get form data


$ID_Passport_Number = $_POST['ID_Passport_Number'];
$First_Name = $_POST['First_Name'];
$Last_Name = $_POST['Last_Name'];
$UserName = $_POST['UserName'];
$Phone_Number = $_POST['Phone_Number'];
$password = $_POST['password'];
$confirm = $_POST['confirm'];
$User_Type = $_POST['User_Type'];
$stmt->bind_param("sss", $name, $email, $password, $UserType);
$stmt->execute();*/
$stmt = mysqli_query($conn, "insert into
local_registration(ID_Passport_Number,First_Name,Last_Name,UserName,
Phone_Number,password,confirm,User_Type) values
('$ID_Passport_Number','$First_Name','$Last_Name','$UserName','$Phone_Number','$pass
word','$confirm','$User_Type')");
if ($stmt) {
echo 'regristration successful';
} else {
echo "something went wrong";
}
$conn->close();
?>
<!DOCTYPE html>

38
<html lang="eng">

<head>
<title>Local Registration</title>
<link rel="stylesheet" href="Local_User registration.css">
<link rel="shortcut icon" href="Flavicon Yellow White.jpg" type="image/x-icon">
<style>
#id {
margin-left: -7%;
margin-top: 2%;
padding-bottom: 0%;
}

form {
border-radius: 10%;
margin-top: 2%;
height: 38rem;
}
#casp{
padding: 0%;
}
</style>
</head>

<body>
<form action="PHP/local_user_registration.php" method="post">
<h2><strong>Local User Account Creation</strong></h2>
<div id="detail">
<div id="id">
<label>ID/Pasport Number</label>

39
<input type="text" placeholder="ID Number" name="ID_Passport_Number"
required>
</div>
<div id="detail">
<label>First Name</label>
<input type="text" id="fname" name="First_Name" placeholder="First Name"
required>
</div>

<div id="name">
<label>Last Name</label>
<input type="text" name="Last_Name" placeholder="Last Name" required>
</div>

<div id="phone">
<label>Phone Number</label>
<input type="text" name="Phone_Number" placeholder="Contact" required>
</div>
<div class="user">

<label>User Name</label>
<input type="text" name="UserName" placeholder="User Name" required style="
margin-left: 10%;">
</div>
<div class="user1">

<label>Password</label>
<input type="password" name="password" placeholder="Password" required
style=" margin-left: 10%;">
</div>

<label id="casp">Confirm Password</label>

40
<input type="password" name="confirm" placeholder="Confirm Password" required
style=" margin-left: 10%;">

<label>User_Type</label>
<select name="User_Type">
<option> Select User </option>
<option> Local User </option>
<option> Admin </option>
</select>
<div id="but">
<a link href="Admin_panel.php"> <button type="submit">Save
Credentials</button></a>
</div>
</div>
</form>
</body>

</html>

APPENDIX 4
REFERENCES
 Afolabi a Nigerian full stack developer
 Online research tutorialspoint and javapoint

41

You might also like