You are on page 1of 69

A LOGISTICS AND FLEET MANAGEMENT SYSTEM

EMMANUEL MWADEGHU MWAELE

BSIT/253J/2018

Mr. BADAR MUHAMMAD

RESEARCH PROJECT PROPOSAL SUBMITTED IN PARTIAL FULFILLMENT


FOR THE DEGREE IN BACHELOR OF SCIENCE IN INFORMATION
TECHNOLOGY OF TECHNICAL UNIVERSITY OF MOMBASA.

DECEMBER 2022
DECLARATION

This project is my original work and has not been presented for a degree in any other University or for any other
award.

Students Name: Emmanuel Mwadeghu Mwaele

Registration number: BSIT/253J/2018

Signature …………………………… Date …………………………

I confirm that the work reported in this project was carried out by the candidate under my supervision.

Supervisor: Mr. Badar Mohammed

Signature ……………………………. Date …………………………

ii
DEDICATION

This work is dedicated to my family members who provided all the moral support that I required during the
period of my studies.

iii
ACKNOWLEDGEMENT

I wish to express my heartfelt gratitude to the Lord Almighty who granted me good health and the capacity to
carry out this project. I also thank my supervisor Mr. Badar for his immense guidance and support that created
the synergy force that would allow me confront any challenges in completing the task. Acknowledgement also
goes to my classmates and colleagues for their technical support during the entire period of the course. I also
recognize the administration of Institute of Computing and Informatics (ICI) at the Technical University of
Mombasa who went out of their way to facilitate my studies. Lastly, I acknowledge my research assistant Mr.
Philip Limo Ngetich for his assistance in data collection and editing of my work.

iv
ABSTRACT

In the mid-1990s, the combination of vehicles and communication was expected to bolster the stagnant car
industry by offering a flood of new revenues. In-vehicle computing systems provide safety and control systems
needed to operate the vehicle as well as infotainment, edutainment, entertainment, and mobile commerce
services in a safe and responsible manner. Since 1980 the word "telematics" has meant the blending of
telecommunications and informatics. Lately, telematics has been used more and more to mean "automotive
telematics" which use informatics and telecommunications to enhance the functionality of motor vehicles such
as wireless data applications, intelligent cruise control, and GPS in vehicles. This definition identifies
telecommunications transferring information as the key enabling technology to provide these advanced services.
In fact, a recent report by Transparency Market Research (TMR) on the global IoT fleet management
market found that smartphone integrated real-time data is driving demand for fleet management services
worldwide. The study notes that an increasing number of transportation companies are integrating their tracking
and monitoring, routing, fuel management and remote diagnostic processes using mobile technology. This
clearly tells you how technology is growing and the defining effect it is having in the logistics and retail industry.

v
Table of Contents
DECLARATION ................................................................................................................................................................ii
DEDICATION ...................................................................................................................................................................iii
ACKNOWLEDGEMENT ................................................................................................................................................ iv
ABSTRACT ........................................................................................................................................................................v
CHAPTER ONE: INTRODUCTION .............................................................................................................................. 4
1.0 Introduction ............................................................................................................................................................. 4
1.1 Background of the study ......................................................................................................................................... 4
1.2 Problem Statement .................................................................................................................................................. 4
1.3 Objectives of Study .................................................................................................................................................. 5
1.3.1 General Objective ............................................................................................................................................. 5
1.3.2 Specific Objectives ............................................................................................................................................ 5
1.4 Research Questions.................................................................................................................................................. 5
1.5 Significance of the Study ......................................................................................................................................... 5
1.6 Limitations of the Study .......................................................................................................................................... 5
1.7 Scope of the Study.................................................................................................................................................... 6
CHAPTER TWO: LITERATURE REVIEW................................................................................................................. 7
2.0 Introduction – Overview of chapter contents........................................................................................................ 7
2.1 Similar Systems ........................................................................................................................................................ 7
2.2.1 Case Study 1: Fleetio ........................................................................................................................................ 7
2.2 Critical Review and Research Gap identification ................................................................................................. 8
2.3 Chapter Summary ................................................................................................................................................... 8
CHAPTER THREE: METHODOLOGY ..................................................................................................................... 10
3.1 Introduction ........................................................................................................................................................... 10
3.2 Research Design ..................................................................................................................................................... 10
3.2.1 Target population ........................................................................................................................................... 10
3.2.2 Sample size ...................................................................................................................................................... 11
3.2.3 Data collection procedure & instruments ..................................................................................................... 11
3.2.3.1 Interviews ................................................................................................................................................. 11
3.2.3.2 Questionnaires ......................................................................................................................................... 11
3.3 System Development methodology....................................................................................................................... 12
3.3.1 Methodology Justification .............................................................................................................................. 13
3.4 System Requirement Analysis .............................................................................................................................. 14
3.4.1 Functional requirements ................................................................................................................................ 14
3.4.2 Nonfunctional requirements .......................................................................................................................... 14
3.4.3 Unified Modeling Language........................................................................................................................... 15
3.4.3.1 Use case Modeling .................................................................................................................................... 15
3.4.3.2 Activity Diagram...................................................................................................................................... 16
3.4.3.3 Sequence diagram .................................................................................................................................... 19
3.4.3.4 Class Diagram .......................................................................................................................................... 21
3.4.3.5 Component diagram ................................................................................................................................ 22
3.5 Database Design ..................................................................................................................................................... 23
3.6 Testing Design ........................................................................................................................................................ 26
3.6.1 Test cases ......................................................................................................................................................... 26
3.7 Chapter Summary ................................................................................................................................................. 26
CHAPTER FOUR: RESEARCH FINDINGS AND DISCUSSION ........................................................................... 27
4.1 Introduction ........................................................................................................................................................... 27
4.2 Presentation of Findings. ...................................................................................................................................... 27
4.2.1 Objective 1 ....................................................................................................................................................... 27
4.2.2 Objective 2 ....................................................................................................................................................... 27

 Logging in screenshot....................................................................................................................................... 27
 Data Entry form screenshot ............................................................................................................................ 28
 Query output screenshot .................................................................................................................................. 31
 Reports screenshot ........................................................................................................................................... 35
 Validation screenshot ....................................................................................................................................... 36
4.3 Chapter Summary ................................................................................................................................................. 41
CHAPTER FIVE: SUMMARY, CONCLUSIONS AND RECOMMENDATIONS ................................................. 42
5.1 Introduction ........................................................................................................................................................... 42
5.2 Summary of Findings ............................................................................................................................................ 42
5.2.1 Objective one. .................................................................................................................................................. 42
5.2.2 Objective two................................................................................................................................................... 42
5.2.3 Objective three. ............................................................................................................................................... 42
5.2.4 Objective four. ................................................................................................................................................ 43
5.3 Conclusions............................................................................................................................................................. 43
REFERENCES ................................................................................................................................................................ 44
APPENDICES.................................................................................................................................................................. 45
A. Questionnaire .............................................................................................................................................................. 45

2
........................................................................................................................................................................................... 46
B. Budget .......................................................................................................................................................................... 47
C. Work plan .................................................................................................................................................................... 47
D. Program code .............................................................................................................................................................. 48
Log In code ........................................................................................................................................................... 48
Frontend booking code ........................................................................................................................................ 49
Fuel management code ........................................................................................................................................ 53
Reminder code ..................................................................................................................................................... 55
Vehicle management code ................................................................................................................................... 56
Users management code ...................................................................................................................................... 59
Driver management code .................................................................................................................................... 61
Reports management code .................................................................................................................................. 63

3
CHAPTER ONE: INTRODUCTION
1.0 Introduction
In today’s society, technology has been changing at an unprecedented pace. When you consider that tablets
sales are now about to overtake the combined sales of desktops and laptops, it becomes apparent. The logistics
and retail industry, which includes fleet management, vehicle and asset tracking and much more has not been
left out either in the move towards a more technological future.

Emerging mature markets like Kenya and other African countries are now part of this growth strategy. In fact,
a recent report by Transparency Market Research (TMR) on the global IoT fleet management market found
that smartphone integrated real-time data is driving demand for fleet management services worldwide. The
study notes that an increasing number of transportation companies are integrating their tracking and monitoring,
routing, fuel management and remote diagnostic processes using mobile technology. This clearly tells you how
technology is growing and the defining effect it is having in the logistics and retail industry.

The advent of these technologies has made it possible for automobiles for example to seamlessly connect to
smartphones, and provide emergency roadside assistance as well as real-time traffic alerts. For the retail
industry, businesses are able to monitor individual goods using simple technology.

1.1 Background of the study


In the mid-1990s, the combination of vehicles and communication was expected to bolster the stagnant car
industry by offering a flood of new revenues. In-vehicle computing systems provide safety and control systems
needed to operate the vehicle as well as infotainment, edutainment, entertainment, and mobile commerce
services in a safe and responsible manner. Since 1980 the word "telematics" has meant the blending of
telecommunications and informatics. Lately, telematics has been used more and more to mean "automotive
telematics" which use informatics and telecommunications to enhance the functionality of motor vehicles such
as wireless data applications, intelligent cruise control, and GPS in vehicles. This definition identifies
telecommunications transferring information as the key enabling technology to provide these advanced services.
In this project proposal, a possible framework for future telematics is proposed. This proposal also introduces
and compares a number of existing technologies and the terms of their capabilities to support a suite of services.
This proposal suggests and analyzes possible directions for future telematics from current telematics techniques.

1.2 Problem Statement


Theft and illegal dumping of goods in transit has been on the rise recently. This leads to drastic loss of time and
money to both the truck owners, stakeholders and investors. Local truck owners and drivers transporting cargo
4
or containers need to be acquainted with laid down rules and regulations governing the movement of goods and
services with the region.

1.3 Objectives of Study


1.3.1 General Objective
The main objective of this study is to develop a vehicle management system to track vehicle movements on a
computerized map.

1.3.2 Specific Objectives


1. To analyze methods currently used for fleet tracking and monitoring systems.
2. To design a system that will encompass three functionalities; basic route planning, monitoring driver
behaviour, and maintenance scheduling.
3. To develop a simple to use yet feature-rich and powerful system to encompass all the functionalities
4. To implement a system that will satisfy the needs of vehicle owners, consignor and consignee together with
the investors and stakeholders.

1.4 Research Questions


1. What are the methods currently used for Telematics and Fleet Management?
2. What is the most appropriate design for a Telematics and Fleet Management System?
3. What is the best Software Development Life Cycle method to realize development of the system?
4. What is the most effective, efficient and reliable deployment method for implementation of the system?

1.5 Significance of the Study


For vehicle owners, tracking technologies can help them optimize their fleet in a number of ways, with features
ranging from basic route planning to monitor driver behaviour, integrating with packing and deliveries,
maintenance scheduling and much more. These technologies are capable of analyzing the driving style and
providing comprehensive feedback to both fleet managers and drivers in real time. Early versions of these
technologies only provided route planning and compliance, but modern versions now come with add-on features
including temperature monitoring, fuel monitoring and audio communication among others.

1.6 Limitations of the Study


The fleet management application will require a computer literate administrator to ensure maximum
functionality and high throughput.

5
1.7 Scope of the Study
The design, development and implementation of a Telematics and Fleet Management application was
undertaken. This involves a super admin entity where a super administrator manage users and full vehicle
management system operations, a system user entity where a system user manages vehicle, driver, oil, booking
and customer and a customer entity where customers can book vehicles, view invoices and make payment. The
proposed system will have a Short Message Service(SMS) to notify the stakeholders should anything happen.

6
CHAPTER TWO: LITERATURE REVIEW
2.0 Introduction – Overview of chapter contents
Literature review is the evaluation and analysis of the existing literature related to selected area of study. It is
an assessment of the existing literature and systems for identification of the research gap with a view of
developing a better system. For a decade, different Vehicle management systems have been developed for
different governments, organizations, institutions, and business entities. However, little focus has been directed
to such systems that have been developed to meet certain target customer population based on their
specifications.

2.1 Similar Systems


2.2.1 Case Study 1: Fleetio

This framework can be utilized by organizations large or little. In vehicles, the telematics framework is a
blend of a GPS beneficiary, a telematics gadget, and a specialized gadget.

These gadgets gather data on vehicle use and execution and hand-off it to a concentrated data set. The team
investigates the data acquired by them to improve the productivity of their work. With the presentation of
telematics armada chiefs for trucks like to utilize this framework to simplify their positions and more efficient.
Fleet directors would now be able to have constant correspondence with transporters. This guarantees the
drivers that the armada directors will assist them with packaging inconvenience. With Fleetio, one can
likewise advance courses effectively and efficiently.

7
Minimization of Operation Costs is another amazing advantage that it furnishes alongside the alarm planning
of certain maintenance communities. Last however not least it gives work fulfillment and helps in checking
the performance.

2.2 Critical Review and Research Gap identification


Managing a fleet is a challenge, to say the least, but the incorporation of a fleet management system can make
the entire process very simple and efficient.

Fleet management can provide massive benefits to your business. From saving money on fuel, optimizing
productivity through efficient time management software, improved customer service quality and increase
employees’ satisfaction, this are just some of the benefits you can enjoy when you implement the system to
your business.

Below are some of the advantages of a fleet management system

i. Reduce operational costs and increase efficiency: By optimizing fleet’s fuel efficiency, managing
drivers’ performance, streamlining reporting and improving routing, business can save plenty of money
on their operational costs. This helps them increase their profitability.
ii. Improve fleet safety: Having a fleet management system in place can provide an opportunity for better
safety habits. Fleet Managers can be able to analyze patterns, behaviours and habits of individual drivers.
With this information, businesses can be able to make informed decisions on how to improve driver
habits and more.
iii. Improves customer service and satisfaction: A fleet management system improves cargo delivery
times. The system ensure businesses are able to provide a more effective and efficient service to all your
clients regardless of the operation you run. When your customers get high quality service, it improves
the overall customer satisfaction they will be more likely to stay loyal to your company and return for
additional service.
iv. Automated fleet reports: Fleet management systems deliver reports hourly, daily, or even weekly
depending on the criteria you need fulfilled. This helps you to understand the habits of your fleet to be
able to make adjustments based on the analysis.

2.3 Chapter Summary


Fleet management means managing a company’s vehicle fleet. This includes commercial motor vehicles like
trucks, vans and cars with the aim of getting the best of out of it.

8
Fleet Management includes functions like vehicle telematics, vehicle maintenance, driver management, fuel
management, safety management and vehicle tracking. With these functions, fleet management is considered
as one of the most important functions in any organisation.

Business should therefore consider investing in a fleet management system as it helps them get the most out of
their vehicle and even their staff. Having a good fleet management system in place does not only help companies
monitor individual driving habits of their drivers but also collect critical information about the vehicle status.

9
CHAPTER THREE: METHODOLOGY
3.1 Introduction
This chapter involves the research design in the study, analysis of the methodology technique that was used to
aid the development of the proposed system. It involves design method to be used, fact finding approaches –
diagrams and database design, research design, target population, the sample size and sampling techniques, and
methods used to collect data and analysis. It simply involves the development process and procedures that were
used in the development of the Logistics and Fleet Management System.

3.2 Research Design


The study employed a descriptive survey and exploratory design sampling techniques. Descriptive and
exploratory design is regarded as the most appropriate research design to measure perceptions of the respondents
in a study. It enables the researcher to collect a cross-sectional data important for comparative analysis. In
addition, they are advantageous in terms of cost, extensiveness, flexibility, dependability among others.
Sampling is a technique where one selects a group of subjects for study from a large group. The probability
sampling design technique is used by simple random method as it is simple, not biased and not time consuming.

3.2.1 Target population


The target population for the study was 49 respondents who are technical officers from the National Transport
and Safety Authority (NTSA) that is mandated to undertake road safety. This is the department mandated to
register and licence vehicles in Kenya, to legally operate on the Kenyan roads and also to carry out motor vehicle
inspection and certification. The targeted population was drawn from three categories of staff namely transport
management officers who were in the top management, management assistants who were middle level managers
and Artisans who were at the operational level. The target population details are captured in table 3.1

Table 3.1 Target population


Institution Strata Population size
National Transport and Transport management officers 32
Safety Authority (NTSA) Management assistant 6
Officers 11
Total 49

10
3.2.2 Sample size
The respondents were selected using proportionate stratified random sampling to ensure representation by
division and rank variables. The respondents were then divided into stratum according to their departments in
the organization since the population is heterogeneous. Here, the number of elements allocated to the various
strata is proportional to the representation of the strata in the target population. This technique was best for the
study as it ensured that respondents from different divisions are equally selected and the sample be part of the
population. It also gives better comparison amongst subgroups and has more statistical precision because the
variability within the subgroups is lower as compared to the variations of dealing with the entire population
(Gupta, Sarker, & Pal, 2015).

3.2.3 Data collection procedure & instruments


The research used primary data, employing well predesigned structured questionnaires and interviews to collect
the data. Other relevant methods of collecting data such as experiments, relevant books and the internet were
also considered. Graphs, tables, and charts were used for data measurement, analysis, storage and presentations
for the study.

3.2.3.1 Interviews
This is a purposeful discussion between two or more people, or a form of questioning characterized by the fact
that verbal questioning is used as its principle technique of data collection (Spradley, 2016). Face-to-face
interviews were used to collect data from the target population as it provided a clear and explanatory
information. Interviews were used to collect data from the departmental heads since they spared me some time
as an individual.

3.2.3.2 Questionnaires
Questionnaire is a set of printed or written questions with a choice of answers, devised for the purpose of survey
or statistical study (Brace, 2018). The questionnaire administered contained closed questions and were hand-
delivered to the target group. This method best suited because most staff could only spare a short time to
complete the questionnaire and 14 since they were pressured with the nature of their work, there was no time
for long discussion.

11
3.3 System Development methodology
Prototyping
The methodology used was Prototyping. Prototyping, also known as heuristic development, which is an
incremental and iterative process of developing a system through controlled trial and error with the creation of
models/prototypes which can be tested. It is a method, primarily using high speed development tools such as
4GLs that allows a user to see a high-level view of the workings of the proposed system within a short period
of time (Sautot, Bimonte, Journaux, &Faivre, 2014). This model or a program is not based on strict planning
but is an early approximation of the final product which is flexible to change. A prototype act as a sample to
test the process. This type of methodology is employed when the customer requirements are expected to change
during the development process, and when it is very difficult to obtain exact requirements from the customer
while making the model. User keeps giving feedbacks from time to time and based on it, a prototype is made.
Completely built sample model is shown to user and based on this feedback, the SRS (System Requirements
Specifications) document is prepared. After completion of this, a more accurate SRS is prepared, and now
development work can start using Rapid Application Development (RAD). Figure 6 shows the Phases of
Prototyping Methodology.

Figure 3.1 shows the Phases of Prototyping Methodology

Phases of Prototyping Methodology:


1. Requirement Collection: In this phase, the requirements for the development process are identified and
brought together. Users, managers, and IT specialists discuss and agree on business needs, project scope,
constraints, and system requirements. This process ends when there is a mutual agreement among the parties.

12
2. Feasibility Study: Is an analysis of the ability to complete a project successfully, taking into account legal,
economic, technological, scheduling and other factors. The feasibility study focuses on helping answer the
essential question of “should I proceed with the proposed project idea?”. All activities of the study are directed
toward helping answer this question.
3. Develop Prototype: In this phase, the software engineers build a sample model to test the concept to be
replicated.
4. Prototype Testing: Here, the prototype that has been developed tested with the intent of finding defects
before the system goes live. The main aim is to experience some aspects of the service idea with customers,
stakeholders or professionals in order to improve the solutions before they are realized.
5. Customer Evaluation: The prototype developed is then presented to the customers and other important
stakeholders in the project. The feedback is collected in an organized manner and used for further enhancement
in the system under development. .
6. Design: In this phase the architecture is established. It starts with the requirement document delivered by the
requirement phase and maps the requirements into an architecture. The architecture defines the components,
their interfaces and behaviors.
7. Coding: The coding phase of the software life-cycle is concerned with the development of code that will
implement the design. This code is written is a formal language called a programming language. The goal of
the coding phase (development of software) is to translate the design of the system into code in a given
programming language.
8. Testing: Software/System testing involves the execution of a software component or system component to
evaluate one or more properties of interest. In this phase, an investigation is conducted to provide stakeholders
with information about the quality of the product or service under test. The product is tested to confirm its
quality.
9. Installation & Maintenance: Here, the system is handed over to the users. This is performed when the
system or software passes the testing phase successfully. Software can be installed, modified, updated to a new
version, or removed.
In the maintenance stage, the system is assessed to ensure it does not become obsolete. Here, changes are also
made to initial system. It involves continuous evaluation of the system in terms of its performance.

3.3.1 Methodology Justification


Prototyping is chosen because of the following advantages it has over the rest of the methodologies
1. Flexibility: Prototyping allows changes at every stage of development. In waterfall once a phase is complete
no changes can be made. Also helps to eliminate ambiguities and improve accuracy in interpretation of system
requirements and functionality
13
2. Code re-use: Prototype methodology allows the re use of the codes used in developing other systems.
3. Reduced Risk: Prototyping method has a high amount of risk analysis. It reduces risk of failure, as potential
risks can be identified early and mitigation steps can be taken.
4. Reduced Time and Cost: Prototyping method is easy to manage and helps the developer to estimate
development costs, timescale, skills and potential resource requirements.
5. Involve user feedback and help to do multiple-test. It’s a key factor to iterate and update. It gives the client
and end-user a greater sense of involvement, ownership and a better appreciation of the final solution
6. Chance of success: In waterfall there is lower chance of success since it is a traditional method while in
prototyping method the project’s success is highly dependent on the risk analysis phase.
7. Simplicity: Prototyping method is simple and easy to use compared to spiral.
8. Expertise requirement: Lower expertise is required in prototyping method since it is an easy to use and
understand while the spiral, Rad Case and other methods requires high specific expertise.

3.4 System Requirement Analysis


This determines the expectations and functionalities of the proposed system. Here, functional and non-
functional requirements of the system are described and modeled using Unified Modeling Language – UML
models.

3.4.1 Functional requirements


Functional requirements describe what services the system provides, the features expected of a system, and
how the system reacts to inputs from users and other systems. They include:
a. User registration – the system should allow for registration of new users.
b. Authentication – users should be identified and authorized to access the system.
c. Manage vehicle – system user should be able to manage the movement of the vehicle.
d. Manage users – at the web system, super admin and system user should be authorized to view all vehicles
and users.

3.4.2 Nonfunctional requirements


Non-functional requirements place constraints on how the system meets the functional requirements. They
include the properties of the system in terms of security of data stored in the database. These requirements
include:
i. Availability: The online system is available anywhere at any time provided there is an internet connectivity.
ii. Reliability: The system ensures trustworthy and perform consistently well by maintaining security and
integrity during operations.

14
iii. Usability: The system performs all its tasks and has a user-friendly interface that will be easy to use and
manage without requiring training of the system users.
iv. Security: Each user has a different set of access support with the three security rules of confidentiality,
integrity, and availability (CIA).
v. Privacy: The system ensures limited access by applying the privacy rules; authentication, accountability, and
authorization.
vi. Flexibility: The system allows operations anywhere at any time and can be accessed from any device.
vii. User -friendly: The system has a user-friendly interface that conforms to the principles of HCI.

3.4.3 Unified Modeling Language


UML Diagrams produces analysis models which focuses on structuring and formalizing system requirements.
Analysis models contains three models; functional, object and dynamic models. Functional model can be
described by use case diagrams. Class diagrams describe the Object model. Dynamic model is described by
sequence, state chart, and activity diagrams.

3.4.3.1 Use case Modeling


This Use Case Diagram is a graphic depiction of the interactions among the elements of Vehicle Management
System. It represents the methodology used in system analysis to identify, clarify, and organize system
requirements of Vehicle Management System. The main actors of Vehicle Management System in this Use
Case Diagram are: Super Admin, System User, Dealer and Customer, who perform the different type of use
cases such as Manage Vehicle, Manage Driver, Manage Fuel, Manage Vehicle Group, Manage Booking,
Manage Reminder, Manage Customer, Manage Users and Full Vehicle Management System Operations. Major
elements of the UML use case diagram of Vehicle Management System are shown on the picture below.
The relationships between and among the actors and the use cases of Vehicle Management System:
 Super Admin Entity: Use cases of Super Admin are Manage Vehicle, Manage Driver, Manage Oil,
Manage Vehicle History, Manage Booking, Manage Vehicle Group, Manage Customer, Manage Users and
Full Vehicle Management System Operations
 System User Entity: Use cases of System User are Manage Vehicle, Manage Driver, Manage Oil, Manage
Vehicle History, Manage Booking, Manage Vehicle Type, Manage Customer, View Invoices, Create
Booking

15
Manage Users and Full Add Vehicle
Application

Manage Vehicle Create


Quotations

Manage Driver Create booking Dealer


Super
admin

Login and Logout from


system

Update my profile

Change account
password

Manage oil Book vehicle


System user Customer

Manage vehicle View Invoices


history

Manage vehicle Make payment


type

Figure 3.2 shows the Use Case Diagram for a Vehicle Management System

3.4.3.2 Activity Diagram


This is the Activity UML diagram of Vehicle Management System which shows the flows between the activity
of Customer, Vehicle Type, Vehicle Driver, and Booking. The main activity involved in this UML Activity
Diagram of Vehicle Management System are as follows:
 Customer Activity
 Vehicle Group Activity
 Vehicle Activity
 Driver Activity
 Booking Activity
16
Features of the Activity UML Diagram of Vehicle Management System:
 Admin User can search Customer, view description of a selected Customer, add Customer, update Customer
and delete Customer.
 Its shows the activity flow of editing, adding and updating of Vehicle Type.
 User will be able to search and generate report of Vehicle, Driver, and Booking.
 All objects such as (Customer, Vehicle Type. Booking) are interlinked.
 It is shows the full description and flow of Customer, Driver, Booking, Vehicle, Group

Login to the
Vehicle
Management
Start System.

Check User Level


and Permissions
End

Check Check Check Check Check


permission permission permission permission permission

Manage Vehicle Manage Driver Manage Booking Manage Vehicle Manage Customer
Group

Logout from the


System

Figure 3.3 shows the Activity Diagram for vehicle management system

17
Login Activity Diagram of Vehicle Management System:
This is the Login Activity Diagram of Vehicle Management System, which shows the flows of Login
Activity, where admin will be able to login using their username and password. After login user can manage all
the operations on Vehicle, Customer, Vehicle Group, Booking and Driver. All the pages such as Vehicle Group,
Booking and Driver are secure and user can access these page after login. The diagram below helps demonstrate
how the login page works in a Vehicle Management System. The various objects in the Booking, Vehicle,
Customer, Vehicle Type, and Driver page-interact over the course of the Activity, and user will not be able to
access this page without verifying their identity

Admin is registered

Admin
Login ID and Password

Check Login
ID Invalid Login/Password
Password

Login to the System


Successfully

Set User level and


Permissions

Access the Internal


Functionalities according
to permission

18
3.4.3.3 Sequence diagram
This is the UML sequence diagram of Vehicle Management System which shows the interaction between the
objects of Booking, Customer, Vehicle Group, Driver, and Vehicle. The instance of class objects involved in
this UML Sequence Diagram of Vehicle Management System are as follows:
 Booking Object
 Customer Object
 Vehicle Group Object
 Driver Object
 Vehicle Object

Login Page Forgot Password Verification Database Authenticate Page


Admin Check Authenticity for
Forgot Password access

Provide Authorization for


Login to Page Valid Login
Check Login Details access
Details

Check Security
Question and Allow user to
Answer Access the Internal
Send email to the user to reset Password Pages on base of
User Token and
Invalid Log in Details Session

Allow User to Access the Pages.

Logout from application

Login Destroy Session and


Successfully tokens from database.

Figure 3.4 shows the Sequence Diagram of Vehicle Management System

19
Login Sequence Diagram of Vehicle Management System:
This is the Login Sequence Diagram of Vehicle Management System, where admin will be able to login in their
account using their credentials. After login user can manage all the operations on Vehicle Type, Booking,
Customer, Vehicle, and Driver. All the pages such as Customer, Vehicle, and Driver are secure and user can
access these page after login. The diagram below helps demonstrate how the login page works in a Vehicle
Management System. The various objects in the Vehicle, Vehicle Type, Booking, Customer, and Driver page-
interact over the course of the sequence, and user will not be able to access this page without verifying their
identity.
This is the UML sequence diagram of Vehicle Management System which shows the interaction between
the objects of Booking, Customer, Vehicle Type, Driver, and Vehicle. The instance of class objects involved in
this UML Sequence Diagram of Vehicle Management System are as follows:
 Customer Object
 Vehicle Group Object
 Driver Object
 Vehicle Object

Login Success Vehicle Driver Management Booking Vehicle Type Customer Management
Management Manage
Admin Add/Edit Add/Edit Add/
Add/Edit Add/Edit
Driver Vehicle Edit
Vehicle Booking
type Customer
Login to Page Save/Updat Save/
Save/Updat Update Save/
e Driver
e Booking Vehicle Update
Manage Vehicle Save/Updat
Type Customer
e Driver

Manage Driver Details List/Delete List/Delete List/Delete List/


Driver Booking Vehicle Delete
Type Customer

Manage Booking Details

Manage Vehicle Type Details

Manage Customer Details


List/Delete
Vehicle

20
3.4.3.4 Class Diagram
Vehicle Management System Class Diagram describes the structure of a Vehicle Management System classes,
their attributes, operations (or methods), and the relationships among objects. The main classes of the Vehicle
Management System are Vehicle, Driver, Fuel, Vehicle History, Booking and Vehicle Type.
Classes of Vehicle Management System Class Diagram:
 Vehicle Class: Manage all the operations of Vehicle
 Driver Class: Manage all the operations of Driver
 Fuel Class: Manage all the operations of Fuel
 Vehicle Group Class: Manage all the operations of Vehicle Group
 Booking Class: Manage all the operations of Booking
 Reminder Class: Manage all the operations of Reminders
Classes and their attributes of Vehicle Management System Class Diagram:
 Vehicle Attributes: v_id, v_registration_no, v_name, v_model, v_chassis_no.
 Driver Attributes: d_id, d_name, d_mobile, d_address, d_age, d_licenseno, d_license_expdate,
d_total_exp, d_doj, d_ref, d_is_active, d_created_by, d_created_date, d_modified_date
 Fuel Attributes: v_fuel_id, v_id, v_fuel_quantity, v_odometerreading, v_fuelprice, v_fuelfilldate,
v_fueladdedby, v_fuelcomments, v_created_date
 Vehicle Group Attributes: gr_id, gr_name, gr_desc, gr_created_date
 Booking Attributes: b_id, b_vehicle_id, b_title, b_type, b_date, b_description.
 Reminders Attributes: r_id, r_vehicle_id, r_date, r_message, r_isread, r_created_date.
Classes and their methods of Vehicle Management System Class Diagram:
 Vehicle Methods: index(), addVehicle(), insertVehicle(), editVehicle(), updateVehicle(), viewVehicle(),
 Driver Methods: index(), adddrivers(), insertdriver(), editdriver(), updatedriver().
 Fuel Methods: index(), addfuel(), insertfuel(), editfuel(), updatefuel().
 Vehicle Group Methods: Vehiclegroup(), vehiclegroup_delete(), addgroup().
 Booking Methods: addBooking(), editBooking(), deleteBooking(), updateBooking(), saveBooking(),
searchBooking()
 Reminder Methods: index(), addreminder(), insertreminder(), deletereminder()

21
Role class Customer Class
+r_id: int Permission Class +c_id:int
+r_title: string +p_id: int +c_name: string
+r_description: string +p_role_id: int +c_mobile: string
+addRole() +p_title: string +c_email: string
+insertRole() +p_module: string +c_address: string
+deleteRole() +p_description: string +c_username: string
+updateRole() +addPermission(); +c_password: string
+assignRole() +insertPermission(); +addCustomer()
+deletePermission(); +insertCustomer()
+updatePermission(); +deleteCustomer()
User class +updateCustomer()
+u_id: int
+u_role_id: int
+u_name: string Vehicle class
+u_email: string +v_id: int
+u_dob: date +v_registration_no: int
+u_address: string +v_name: string
+addUser() +v_model: string
+insertUser() +v_chassis_no: int
+editUser() +addVehicle()
+updateUser() +editVehicle()
Driver class
+deleteVehicle()
+d_id: int
+insertVehicle()
Fuel class +d_name: string
+viewVehicle()
+v_fuel_id: int +d_mobile: int
+d_address: string Vehicle Group Class
+v_fuel_quantity: string
+d_age: int +gr_id: int
+v_odometerreading: int +gr_name: string
+v_fuelprice: int +d_licenseno: int
+d_license_expdate: date +gr_description: string
+v_fuelfilldate: date
+d_total_exp: int +gr_created_date: date
+v_fueladdedby: string
+addDriver() +Vehiclegroup()
+addFuel()
+insertDriver() +vehiclegroup_delete()
+insertFuel()
+editDriver() +addgroup()
+editFuel()
+updateFuel() +updateDriver()

Figure 3.5 shows the Class Diagram of a Vehicle Management system

3.4.3.5 Component diagram


This is a Component diagram shows components, provided and required interfaces, ports, and relationships
between the Vehicle Group, Driver, Fuel, Booking and Vehicle.
Components of UML Component Diagram of Vehicle Management System:
 Booking Component
 Vehicle Component
 Vehicle Group Component
 Driver Component
22
 Fuel Component
Features of Vehicle Management System Component Diagram:
 You can show the models the components of Vehicle Management System.
 Model the database schema of Vehicle Management System.
 Model the executables of an application of Vehicle Management System.
 Model the system's source code of Vehicle Management System.

Vehicle
Data Access

Encryption
Driver
Security
Data Access
Access Control
Vehicle Booking
Management Encryption
System Data Access
Persistence

Access Control
Vehicle Group
System Admin Data Access
of Vehicle
Management Database Connector
System Fuel Database
Data Access

Figure 3.6 shows the Component Diagram of Vehicle Management System

3.5 Database Design


This ER (Entity Relationship) Diagram represents the model of Vehicle Management System Entity. The entity-
relationship diagram of Vehicle Management System shows all the visual instrument of database tables and the
relations between Driver, Vehicle History, Vehicle, Vehicle Type etc. It used structured data and to define the
relationships between structured data groups of Vehicle Management System functionalities. The main entities
of the Vehicle Management System are Vehicle, Driver, Fuel, Vehicle History, Booking and Vehicle Type.
Vehicle Management System entities and their attributes:
Vehicle Entity: Attributes of Vehicle are v_id, v_customer_id, v_number, v_type, _description.
Driver Entity: Attributes of Driver are d_id, d_name, d_mobile, d_email, d_username, d_password, d_address.
Fuel Entity: Attributes of Fuel are f_id, f_vehicle_id, f_name, f_expences, f_type, f_description.

23
Vehicle History Entity: Attributes of Vehicle History are v_history_id, v_history_name, vehicle_history_type,
v_history_description.
Booking Entity: Attributes of Booking are b_id, b_vehicle_id, b_title, b_type, b_date, b_description.

Vehicle Group Entity: Attributes of Vehicle Type are gr_id, gr_name, gr_desc, gr_created_date
Description of Vehicle Management System Database:
 The details of Vehicle is store into the Vehicle tables respective with all tables.
 Each entity ( Vehicle Type, Fuel, Booking, Driver, Vehicle) contains primary key and unique keys.
 The entity Fuel, Booking has binded with Vehicle, Driver entities with foreign key.
 There is one-to-one and one-to-many relationships available between Booking, Vehicle History, Vehicle
Type, Vehicle
 All the entities Vehicle, Booking, Fuel and Vehicle Type are normalized and reduce duplicacy of records.
 We have implemented indexing on each tables of Vehicle Management System tables for fast query
execution.

24
login_role_id
login_username
#login_id

user_password
#user_id Login
#user_name
#role_id

#user_mobile
User Has role_name
Roles

#user_email
role_desc

#user_address
#per_id

Permission
#per_role_id

#per_name #per_module

cus_pass

#cus_id Manage
veh_cus_id

cus_name dri_pass
customer vehicle #veh_id

cus_mobile driver
dri_add veh_desc

cus_add Has dri_mobile veh_num


#dri_id
veh_type
cus_email dri_name

fuel

#fuel_desc
#fuel_id

#fuel_type

Figure 3.7shows the Entity Relationship Diagram for Vehicle Management System

25
3.6 Testing Design
Test design is the act of creating and writing test suites for testing the software system to justify its usability.
Test analysis and identifying test conditions gives us a generic idea for testing, which covers quite a large
range of possibilities.
Test design techniques include:
 Domain Testing: Domain consists of one or more variables in the software a software system. A variable
can be text fields, date fields, number fields, etc. These 22 variables might be independent, or the value
might affect the values another field can accept.
 Scenario Testing: Scenario testing is used to expose problems in scenarios that a real user might do in
the system.
 Risk Based Testing: Risk based testing is a test design technique that focuses on things that might go
wrong. For example, a text field might have a risk of inserting bad data into the database or submitting
long strings might expose a buffer overflow.

3.6.1 Test cases


Test Case is a set of actions (conditions & variables) executed to verify a particular feature or functionality or
satisfaction of requirements of a software application. It is a document which consists of a set of conditions or
actions which are performed on the software application in order to verify the expected functionality of the
feature.
Test Scenario: Check the Login Functionality of the vehicle management system
Test Case 1: Check results on entering valid vehicle details
Test Case 2: Check results on entering Invalid vehicle details.
Test Case 3: Check response when User ID is Empty & Login Button is pressed.

3.7 Chapter Summary


At this point, when a huge gathering of vehicles is claimed by one business, there must be some framework to
deal with the armada so things don't leave hand. The presentation of telematics is changing frameworks.
Basically, it is the way to manage business private vehicles, expert vehicles, and railcars. This assistance
causes organizations to keep up and arrange work vehicles to improve effectiveness and offer better types of
assistance. This ordinarily incorporates vehicles, trucks, and vans. Organizations can monitor their vehicles
through armada the executives to check whether they are working as indicated by the public authority
guidelines, organization guidelines and to ensure that there is no standing by time and in this manner a
diminished expense.
26
CHAPTER FOUR: RESEARCH FINDINGS AND DISCUSSION
4.1 Introduction
The results of this study are discussed in this chapter.

4.2 Presentation of Findings.


4.2.1 Objective 1
 To analyze methods currently used for fleet tracking and monitoring systems.

4.2.2 Objective 2
 To design a system that will encompass three functionalities; basic route planning, monitoring driver
behaviour, and maintenance scheduling
4.2.3 Objective 3
 To develop a simple to use yet feature-rich and powerful system to encompass all the functionalities.
4.2.4 Objective 4
 To implement a system that will satisfy the needs of vehicle owners, consignor and consignee together with
the investors and stakeholders.

 Logging in screenshot

27
 Data Entry form screenshot

Figure 1: Add vehicle

Figure 2: Add driver

28
Figure 3: Add booking

Figure 4: Add customer

29
Figure 5: Add fuel

Figure 6: Add reminder

30
Figure 7: Add income/expense

 Query output screenshot

Figure 8: Vehicle list


31
Figure 9: Driver list

Figure 10: Bookings list

32
Figure 11: Customer list

Figure 12: Fuel list

33
Figure 13: Reminders list

Figure 14: Income expense list

34
 Reports screenshot

Figure 15: Booking report

Figure 16: Income and expenses report


35
Figure 17: Fuel report

 Validation screenshot

Figure 18: Add vehicle form validation

36
Figure 19: Add driver form validation

Figure 20: Add booking form validation

37
Figure 21: Add customer form validation

Figure 22: Add fuel form validation

38
Figure 23: Add reminder form validation

Figure 24: Add income/expense form validation

39
Figure 25: Booking report form validation

Figure 26: Income and expenses report form validation

40
Figure 27: Fuel report form validation

4.3 Chapter Summary


From the screenshots provided the system has been tested and no visible errors have been found. The sample
data used to examine the system proves the system is reliable and can be implemented.

41
CHAPTER FIVE: SUMMARY, CONCLUSIONS AND RECOMMENDATIONS
5.1 Introduction
The following chapter concludes this report. This chapter summarizes the contents of the previous chapter
through explanations rather than visual representation. A summary of the research is presented and findings
are discussed and interpreted.

5.2 Summary of Findings


i. Lack of reliable data from other similar systems to compare and test since most of them are foreign and do
not factor in local conditions.
ii. The system requires reliable internet access for full functionality.

5.2.1 Objective one.


 To analyze methods currently used for fleet tracking and monitoring systems.
For the sake of establishing the user requirements for my study, the research used primary data, employing
well predesigned structured questionnaires and interviews to collect the data. Other relevant methods of
collecting data such as experiments, relevant books and the internet were also considered. Graphs, tables, and
charts were used for data measurement, analysis, storage and presentations for the study.

5.2.2 Objective two.


 To design a system that will encompass three functionalities; basic route planning, monitoring driver
behaviour, and maintenance scheduling

Rapid Application Development (RAD) was the methodology used to design the vehicle management system.
This type of methodology is employed when the customer requirements are expected to change during the
development process, and when it is very difficult to obtain exact requirements from the customer while
making the model. User keeps giving feedbacks from time to time and based on it, a prototype is made.

5.2.3 Objective three.


 To develop a simple to use yet feature-rich and powerful system to encompass all the functionalities.
I developed the car price calculation system using PHP programming language due to its reliability in dealing
with the various data types. I also implemented bootstrap framework for the front-end part of the system since
it allowed for good visual representation. This incorporated the use of HTML, PHP, JavaScript and CSS
technologies. I used phpMyAdmin as a relational database manager for the backend.

42
5.2.4 Objective four.
 To implement a system that will satisfy the needs of vehicle owners, consignor and consignee together with
the investors and stakeholders.
I tested the system using a variety of mock up data to prove its functionality. I also tested its validation
attributes which worked to perfection.

5.3 Conclusions
In this project, the main objective was to create a system that could manage fleets and enabling booking
vehicles for logistics. This was to enable both the drivers and customers have control of their cargo while in
transit.

I successfully developed a website with the required functionality to enable a user that is administrator and
client to interact with the system accordingly and generate reports regarding incomes, expenses, fuel and
bookings available for the administrator. The website can perform all major functionalities required by a user.

5.4 Recommendations
Improving the vehicle management system using Internet of Things (IoT) to gain high throughput from the
system.

5.5 Suggestions for further study


Future studies should implement the newer technological trends so as to allow even more variables to be used
in tracking the vehicle movement.

Information security should be improved and applied in order to meet the current standards of confidentiality,
integrity and accountability in data processing.

5.6 Chapter Summary


This chapter contained the concluded findings and recommendations for further development for effective and
smooth running.

43
REFERENCES
A model for vehicle tracking and monitoring systems adoption in the Kenya Police Service
http://hdl.handle.net/11071/4845
RFID based model for tracking vehicles
http://hdl.handle.net/11071/5681
Watson, Michael & Johnson, Stephen. (2007). A Theory of Vehicle Management Systems. 1 - 8.
10.1109/AERO.2007.352948.
https://www.researchgate.net/publication/224699155_A_Theory_of_Vehicle_Management_Systems
Fallon, M.P. & Blanken, C.L. & Montanye, P. & Kashawlic, B. & Labus, G. & Grill, I. & Campbell, K. & Shue,
J. & Schillings, J. & Horn, J.H.. (2012). Transformational vehicle management systems. 3. 1545-1567.
https://www.researchgate.net/publication/290626186_Transformational_vehicle_management_systems
Harrison, C.G.. (1998). A vehicle management system. 8/1 - 8/4. 10.1049/ic:19980194.
https://www.researchgate.net/publication/3743044_A_vehicle_management_system
Sutar, Shivani. (2018). Fleet Management System. International Journal for Research in Applied Science and
Engineering Technology. 6. 4933-4937. 10.22214/ijraset.2018.4805.
https://www.researchgate.net/publication/325786661_Fleet_Management_System
Rathnayaka, R.P.D.T. & Ekanayake, K.V.J.P. & Ratnayake, Uditha & Jayetileke, H.R.. (2021). Fleet
management with real-time data analytics. 1-6. 10.1109/ICITR54349.2021.9657406.
https://www.researchgate.net/publication/357601255_Fleet_management_with_real-time_data_analytics
Rozumenko, S. (2020). Introduction of modern logistics management systems. Scientific papers OF DMYTRO
MOTORNYI TAVRIA STATE AGROTECHNOLOGICAL UNIVERSITY (ECONOMIC SCIENCES). 41.
189-194. 10.31388/2519-884X-2020-41-189-194.
https://www.researchgate.net/publication/347646470_Introduction_of_modern_logistics_management_system
s
Yan, Xiao-Hui & LI, Lei-Jun. (2013). Logistics Management System Based on Workflow. 10.1007/978-1-
4471-4847-0_76.
https://www.researchgate.net/publication/296676701_Logistics_Management_System_Based_on_Workflow

44
APPENDICES

A. Questionnaire

45
46
B. Budget

Item/Resource. Price. Unit/rate. Cost


Laptop Ksh. 36,000 1 Ksh. 36,000.00
Windows 10 Available - Ksh. 0.00
Flash Disk 16GB Ksh. 1,000 1 Ksh. 1000.00
Notebook Ksh. 100 1 Ksh. 100.00
Google collaborator Free - Ksh. 0.00
Pens Ksh. 25 3 Ksh. 75.00
PHP Free - Ksh. 0.00
Jupiter notebook Free - Ksh. 0.00
HTML,CSS & Free - Ksh. 0.00
Javascript
Miscellaneous Ksh. 4,000 - Ksh. 4,000.00
Total Ksh. 41,175.00

C. Work plan
Task Name Duration Start Finish
INITIATION 2 days Monday 14/5/2022 Tuesday 22/5/2022
PLANNING 3 days Wednesday 16/5/2022 Friday 18/5/2022
Feasibility Study 1 days Wednesday 16/5/2022 Wednesday 16/5/2022
User Requirement 1 day Wednesday 16/5/2022 Wednesday 16/5/2022
Project Scheduling 2 day Thursday 17/5/2022 Friday 18/5/2022
ANALYSIS 3 days Monday 21/5/2022 Wednesday 23/5/2022
Functional specification 2 days Monday 21/5/2022 Tuesday 22/5/2022
document
Project plan review 3 days Monday 21/5/2022 Wednesday 23/5/2022
DESIGN 7 days Thursday 27/5/2022 Friday 3/6/2022
Physical design 3 days Thursday 27/5/2022 Monday 1/6/2022
Logical design 4 days Tuesday 1/6/2022 Friday 4/6/2022
CODING AND TESTING 14 days Monday 5/6/2022 Wednesday 14/6/2022
IMPLEMENTATION 8 days Wednesday 14/6/2022 Friday 23/6/2022

47
D. Program code
Log In code

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Login extends CI_Controller {
//To load initial libraries, functions
function __construct( )
{
parent::__construct();
$this->load->helper('url');
$this->load->helper('directory');
$this->load->helper('form');
$this->load->library('form_validation');
$this->load->library('session');
$this->load->database();
}
//To load login page
public function index() //Login Controller
{
if (isset($this->session->userdata['session_data'])) {
$url = base_url() . "dashboard";
header("location: $url");
} else {
$this->load->view('login');
}
}
//To login functionality check
public function login_action()
{

$this->form_validation->set_rules('username', 'Username', 'required');


$this->form_validation->set_rules('password', 'Password', 'required');
if($this->form_validation->run() == FALSE)
{
$this->session->set_flashdata('warningmessage', "Email and Password is required
and can't be empty.");
redirect('login');
}
else
{
$this->load->model('login_model');
$result = $this->login_model->check_login($this->input->post());
if($result != FALSE)
{

48
$session_data = array('u_id' => $result['u_id'],
'name' => $result['u_name'],
'email' => $result['u_username'],
'u_isactive' =>$result['u_isactive']);
$userroles = $this->login_model->userroles($result['u_id']);
if($result['u_isactive']==0) {
$this->session->set_flashdata('warningmessage', 'User not active.Please
contact admin');
redirect('login');
} else if(empty($userroles)) {
$this->session->set_flashdata('warningmessage', 'User role is not
defined.Please contact admin');
redirect('login');
} else {
$this->session->set_userdata('userroles', $userroles);
}
$this->session->set_userdata('session_data', $session_data);
redirect('dashboard');
}
else
{
$this->session->set_flashdata('warningmessage', 'Invalid email or Password !');
redirect('login');
}
}
}
//To logout session from browser
public function logout() {
// Removing session data
$sess_array = array('u_id' => '');
$this->session->unset_userdata('session_data', $sess_array);
$this->session->unset_userdata('userroles', array());
$this->session->set_flashdata('successmessage', 'Successfully Logged out !');
redirect('login');
}
}

Frontend booking code

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Frontendbooking extends CI_Controller {

function __construct()

49
{
parent::__construct();
$this->load->database();
$this->load->model('customer_model');
$this->load->helper(array('form', 'url','string'));
$this->load->library('form_validation');
$this->load->library('session');
}

public function index()


{
$this->load->model('trips_model');
$data['vechiclelist'] = $this->trips_model->getall_vechicle();
$this->load->view('frontend_booking',$data);
}
public function mybookings()
{
$this->load->model('trips_model');
$data['mybookings'] = $this->trips_model->getall_mybookings($this->session-
>userdata['session_data_fr']['c_id']);
$this->load->view('frontend_booking_history',$data);
}
public function signup()
{
$this->form_validation->set_rules('c_name', 'Name', 'required');
$this->form_validation->set_rules('c_mobile', 'Mobile',
'required|min_length[9]|max_length[12]');
$this->form_validation->set_rules('c_email', 'Email', 'required|valid_email');
$this->form_validation->set_rules('c_pwd', 'Password', 'required');
$this->form_validation->set_rules('c_address', 'Address', 'required');
if($this->form_validation->run() == FALSE)
{
$this->session->set_flashdata('warningmessage', validation_errors());
redirect('/');
}
else
{
$testxss = xssclean($_POST);
if($testxss){
$exist = $this->db->select('*')->from('customers')->where('c_email',$this-
>input->post('c_email'))->get()->result_array();
if(count($exist)==0) {
$response = $this->customer_model->add_customer($this->input->post());
if($response) {
$this->session->set_flashdata('successmessage', 'Account created
successfully..');
50
} else {
$this->session->set_flashdata('warningmessage', 'Something went
wrong.Please try again..');
}
} else {
$this->session->set_flashdata('warningmessage', 'Account already exist
with same email. Please login..');
}
redirect('/');
} else {
$this->session->set_flashdata('warningmessage', 'Error! Your input are not
allowed.Please try again');
redirect('/');
}
}
}
public function login()
{
$this->db->where('c_email', $this->input->post('username'));
$this->db->where('c_pwd', md5($this->input->post('password')));
$query = $this->db->get("customers");
if ($query->num_rows() >= 1) {
$result = $query->row_array();
$session_data = array('c_id' => $result['c_id'],
'c_name' => $result['c_name'],
'c_email' => $result['c_email']);
if($result['c_isactive']==0) {
$this->session->set_flashdata('warningmessage', 'User not active.Please
contact admin');
redirect('/');
} else {
$this->session->set_flashdata('successmessage', 'You got logged in
successfully..');
$this->session->set_userdata('session_data_fr', $session_data);
redirect('/');
}
} else {
$this->session->set_flashdata('warningmessage', 'Invalid email or Password !');
redirect('/');
}
}
public function logout() {
$sess_array = array('c_id' => '');
$this->session->unset_userdata('session_data_fr', $sess_array);
$this->session->set_flashdata('successmessage', 'Successfully Logged out !');
redirect('/');
51
}
public function book() {
$this->load->model('trips_model');
if($this->input->post('t_created_by')!='') {
$this->form_validation->set_rules('t_trip_fromlocation', 'From Location',
'required');
$this->form_validation->set_rules('t_trip_tolocation', 'To Location',
'required');
$this->form_validation->set_rules('t_start_date', 'Date', 'required');
if($this->form_validation->run() == FALSE) {
$this->session->set_flashdata('warningmessage', validation_errors());
redirect('/');
} else {
$response = $this->trips_model->add_trips($this->input->post());
$bookingemail = $this->input->post('bookingemail');
if(isset($bookingemail)) {
$this->sendtripemail($this->input->post());
}
if($response) {
$this->session->set_flashdata('successmessage', 'Booking completed
successfully.We will contact you shortly..');
} else {
$this->session->set_flashdata('warningmessage', 'Unexpected error..Try
again');
}
redirect('/');
}
} else {
$this->session->set_flashdata('warningmessage', 'Please login before trying to
book..');
redirect('/');
}
}
public function sendtripemail($data) {
$this->load->model('email_model');
$gettemplate = $this->db->select('*')->from('email_template')-
>where('et_name','booking')->get()->result_array();
if(!empty($gettemplate)) {
$emailcontent = $gettemplate[0]['et_body'];
$value = '<b>Trip Details :</b><br><br> '.$data['t_trip_fromlocation']. '
<br><b>to</b><br> ' . $data['t_trip_tolocation']. ' <br>on<br> ' .$data['t_start_date'];
$body = str_replace('{{bookingdetails}}', $value, $emailcontent);
$email = $this->email_model-
>sendemail($data['bookingemail'],$gettemplate[0]['et_subject'],$body);
}
}
52
}

Fuel management code

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Fuel extends CI_Controller {

function __construct()
{
parent::__construct();
$this->load->database();
$this->load->model('fuel_model');
$this->load->helper(array('form', 'url','string'));
$this->load->library('form_validation');
$this->load->library('session');

public function index()


{
$data['fuel'] = $this->fuel_model->getall_fuel();
$this->template->template_render('fuel',$data);
}
public function addfuel()
{
$this->load->model('trips_model');
$data['driverlist'] = $this->trips_model->getall_driverlist();
$data['vechiclelist'] = $this->trips_model->getall_vechicle();
$this->template->template_render('fuel_add',$data);
}
public function insertfuel()
{
$testxss = xssclean($_POST);
if($testxss){
$response = $this->fuel_model->add_fuel($this->input->post());
if($response) {
$is_include = $this->input->post('exp');
if(isset($is_include)) {
$addincome = array('ie_v_id'=>$this->input-
>post('v_id'),'ie_date'=>date('Y-m-d'),'ie_type'=>'expense','ie_description'=>'Added fuel -
'.$this->input->post('v_fuelcomments'),'ie_amount'=>$this->input-
>post('v_fuelprice'),'ie_created_date'=>date('Y-m-d'));

53
$this->db->insert('incomeexpense',$addincome);
}
$this->session->set_flashdata('successmessage', 'Fuel details added
successfully..');
} else {
$this->session->set_flashdata('warningmessage', 'Something went wrong..Try
again');
}
redirect('fuel');
} else {
$this->session->set_flashdata('warningmessage', 'Error! Your input are not
allowed.Please try again');
redirect('fuel');
}
}
public function editfuel()
{
$f_id = $this->uri->segment(3);
$this->load->model('trips_model');
$data['vechiclelist'] = $this->trips_model->getall_vechicle();
$data['driverlist'] = $this->trips_model->getall_driverlist();
$data['fueldetails'] = $this->fuel_model->editfuel($f_id);
$this->template->template_render('fuel_add',$data);
}

public function updatefuel()


{
$testxss = xssclean($_POST);
if($testxss){
$response = $this->fuel_model->updatefuel($this->input->post());
if($response) {
$this->session->set_flashdata('successmessage', 'Fuel details updated
successfully..');
redirect('fuel');
} else
{
$this->session->set_flashdata('warningmessage', 'Something went wrong..Try
again');
redirect('fuel');
}
} else {
$this->session->set_flashdata('warningmessage', 'Error! Your input are not
allowed.Please try again');
redirect('fuel');
}
}
54
}
Reminder code

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Reminder extends CI_Controller {

function __construct()
{
parent::__construct();
$this->load->database();
$this->load->model('reminder_model');
$this->load->model('trips_model');
$this->load->helper(array('form', 'url','string'));
$this->load->library('form_validation');
$this->load->library('session');
}

public function index()


{
$data['reminderlist'] = $this->reminder_model->getall_reminder();
$this->template->template_render('reminder_management',$data);
}
public function addreminder()
{
$data['vechiclelist'] = $this->trips_model->getall_vechicle();
$this->template->template_render('reminder_add',$data);
}
public function insertreminder()
{
$testxss = xssclean($_POST);
if($testxss){
$response = $this->reminder_model->add_reminder($this->input->post());
if($response) {
$this->session->set_flashdata('successmessage', 'New reminder added
successfully..');
} else {
$this->session->set_flashdata('warningmessage', validation_errors());
}
redirect('reminder');
} else {
$this->session->set_flashdata('warningmessage', 'Error! Your input are not
allowed.Please try again');
redirect('reminder');
}
55
}
public function deletereminder()
{
$r_id = $this->uri->segment(3);
$returndata = $this->reminder_model->deletereminder($r_id);
if($returndata) {
$this->session->set_flashdata('successmessage', 'Reminder deleted
successfully..');
redirect('reminder');
} else {
$this->session->set_flashdata('warningmessage', 'Error..! Try again..');
redirect('reminder');
}
}
}

Vehicle management code

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Vehicle extends CI_Controller {
function __construct()
{
parent::__construct();
$this->load->database();
$this->load->model('vehicle_model');
$this->load->model('incomexpense_model');
$this->load->model('geofence_model');
$this->load->helper(array('form', 'url','string'));
$this->load->library('form_validation');
$this->load->library('session');
}
public function index()
{
$data['vehiclelist'] = $this->vehicle_model->getall_vehicle();
$this->template->template_render('vehicle_management',$data);
}
public function addvehicle()
{
$data['v_group'] = $this->vehicle_model->get_vehiclegroup();
$this->template->template_render('vehicle_add',$data);
}
public function insertvehicle()
{

56
$this->form_validation->set_rules('v_registration_no','Registration
Number','required|trim|is_unique[vehicles.v_registration_no]');
$this->form_validation->set_message('is_unique', '%s is already exist');
$this->form_validation->set_rules('v_model','Model','required|trim');
$this->form_validation->set_rules('v_chassis_no','Chassis No','required|trim');
$this->form_validation->set_rules('v_engine_no', 'Engine No', 'required|trim');
$this->form_validation->set_rules('v_manufactured_by','Manufactured
By','required|trim');
$this->form_validation->set_rules('v_type','Vehicle Type','required|trim');
$this->form_validation->set_rules('v_color','Vehicle Color','required|trim');
$testxss = xssclean($_POST);
if($this->form_validation->run()==TRUE && $testxss){
$response = $this->vehicle_model->add_vehicle($this->input->post());
if($response) {
$this->session->set_flashdata('successmessage', 'New vehicle added
successfully..');
redirect('vehicle');
}
} else {
$errormsg = validation_errors();
if(!$testxs) {
$errormsg = 'Error! Your input are not allowed.Please try again';
}
$this->session->set_flashdata('warningmessage',$errormsg);
redirect('vehicle/addvehicle');
}
}
public function editvehicle()
{
$v_id = $this->uri->segment(3);
$data['v_group'] = $this->vehicle_model->get_vehiclegroup();
$data['vehicledetails'] = $this->vehicle_model->get_vehicledetails($v_id);
$this->template->template_render('vehicle_add',$data);
}

public function updatevehicle()


{
$testxss = xssclean($_POST);
if($testxss){
$response = $this->vehicle_model->edit_vehicle($this->input->post());
if($response) {
$this->session->set_flashdata('successmessage', 'Vehicle updated
successfully..');
redirect('vehicle');
} else
{
57
$this->session->set_flashdata('warningmessage', 'Something went
wrong..Try again');
redirect('vehicle');
}
} else {
$this->session->set_flashdata('warningmessage', 'Error! Your input are not
allowed.Please try again');
redirect('vehicle');
}
}
public function viewvehicle()
{
$v_id = $this->uri->segment(3);
$vehicledetails = $this->vehicle_model->get_vehicledetails($v_id);
$bookings = $this->vehicle_model->getall_bookings($v_id);
$vgeofence = $this->geofence_model->getvechicle_geofence($v_id);
$vincomexpense = $this->incomexpense_model->getvechicle_incomexpense($v_id);
$geofence_events = $this->geofence_model->countvehiclengeofence_events($v_id);
if(isset($vehicledetails[0]['v_id'])) {
$data['vehicledetails'] = $vehicledetails[0];
$data['bookings'] = $bookings;
$data['vechicle_geofence'] = $vgeofence;
$data['vechicle_incomexpense'] = $vincomexpense;
$data['geofence_events'] = $geofence_events;
$this->template->template_render('vehicle_view',$data);
} else {
$this->template->template_render('pagenotfound');
}
}
public function vehiclegroup()
{
$data['vehiclegroup'] = $this->vehicle_model->get_vehiclegroup();
$this->template->template_render('vehicle_group',$data);
}
public function vehiclegroup_delete()
{
$gr_id = $this->uri->segment(3);
$returndata = $this->vehicle_model->vehiclegroup_delete($gr_id);
if($returndata) {
$this->session->set_flashdata('successmessage', 'Group deleted successfully..');
redirect('vehicle/vehiclegroup');
} else {
$this->session->set_flashdata('warningmessage', 'Error..! Some vechicle are
mapped with this group. Please remove from vechicle management');
redirect('vehicle/vehiclegroup');
}
58
}
public function addgroup()
{
$response = $this->db->insert('vehicle_group',$this->input->post());
if($response) {
$this->session->set_flashdata('successmessage', 'Group added successfully..');
redirect('vehicle/vehiclegroup');
} else
{
$this->session->set_flashdata('warningmessage', 'Something went wrong..Try
again');
redirect('vehicle/vehiclegroup');
}
}
}

Users management code

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Users extends CI_Controller {

function __construct()
{
parent::__construct();
$this->load->database();
$this->load->model('user_model');
$this->load->helper(array('form', 'url','string'));
$this->load->library('form_validation');
$this->load->library('session');
}

public function index()


{
$data['userlist'] = $this->user_model->getall_user();
$this->template->template_render('user_management',$data);
}
public function adduser()
{
$this->template->template_render('user_add');
}
public function insertuser()
{

59
if(isset($_POST)){
$response = $this->user_model->add_user($this->input->post());
if($response) {
$this->session->set_flashdata('successmessage', 'New user added
successfully..');
} else {
$this->session->set_flashdata('warningmessage', 'Error in creating new
user..');
}
redirect('users');
} else {
$this->session->set_flashdata('warningmessage', 'Error! Your input are not
allowed.Please try again');
redirect('users');
}
}
public function edituser()
{
$u_id = $this->uri->segment(3);
$data['userdetails'] = $this->user_model->get_userdetails($u_id);
$this->template->template_render('user_add',$data);
}

public function updateuser()


{
if(isset($_POST)){
$response = $this->user_model->update_user($this->input->post());
if($response) {
$this->session->set_flashdata('successmessage', 'user updated
successfully..');
redirect('users');
} else
{
$this->session->set_flashdata('warningmessage', 'Something went
wrong..Try again');
redirect('users');
}
} else {
$this->session->set_flashdata('warningmessage', 'Error! Your input are not
allowed.Please try again');
redirect('users');
}
}
}

60
Driver management code

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Drivers extends CI_Controller {

function __construct()
{
parent::__construct();
$this->load->database();
$this->load->model('drivers_model');
$this->load->helper(array('form', 'url','string'));
$this->load->library('form_validation');
$this->load->library('session');

public function index()


{
$data['driverslist'] = $this->drivers_model->getall_drivers();
$this->template->template_render('drivers_management',$data);
}
public function adddrivers()
{
$this->template->template_render('drivers_add');
}
public function insertdriver()
{
$this->form_validation->set_rules('d_licenseno','License
Number','required|trim|is_unique[vehicles.v_registration_no]');
$this->form_validation->set_message('is_unique', '%s is already exist');
$this->form_validation->set_rules('d_name','Name','required|trim');
$this->form_validation->set_rules('d_mobile','Mobile','required|trim');
$this->form_validation->set_rules('d_address', 'Address', 'required|trim');
$this->form_validation->set_rules('d_age','Age','required|trim');
$this->form_validation->set_rules('d_licenseno','License Number','required|trim');
$this->form_validation->set_rules('d_license_expdate','License Exp
Date','required|trim');
$this->form_validation->set_rules('d_total_exp','Total Experiance','required|trim');
$this->form_validation->set_rules('d_doj','Date of Joining','required|trim');
$testxss = xssclean($_POST);
if($this->form_validation->run()==TRUE && $testxss){
$response = $this->drivers_model->add_drivers($this->input->post());
if($response) {

61
$this->session->set_flashdata('successmessage', 'New driver added
successfully..');
redirect('drivers');
}

} else
{
$errormsg = validation_errors();
if(!$testxs) {
$errormsg = 'Error! Your input are not allowed.Please try again';
}
$this->session->set_flashdata('warningmessage',$errormsg);
redirect('drivers/adddrivers');
}
}
public function editdriver()
{
$d_id = $this->uri->segment(3);
$data['driverdetails'] = $this->drivers_model->get_driverdetails($d_id);
$this->template->template_render('drivers_add',$data);
}

public function updatedriver()


{
$testxss = xssclean($_POST);
if($testxss){
$response = $this->drivers_model->edit_driver($this->input->post());
if($response) {
$this->session->set_flashdata('successmessage', 'Driver updated
successfully..');
redirect('drivers');
} else
{
$this->session->set_flashdata('warningmessage', 'Something went
wrong..Try again');
redirect('drivers');
}
} else {
$this->session->set_flashdata('warningmessage', 'Error! Your input are not
allowed.Please try again');
redirect('drivers');
}
}
}

62
Reports management code

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Reports extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->helper('url');
$this->load->database();
$this->load->model('vehicle_model');
$this->load->model('incomexpense_model');
$this->load->model('fuel_model');
$this->load->model('trips_model');
$this->load->library('session');
}
public function booking() {
if(isset($_POST['bookingreport'])) {
$triplist = $this->trips_model->trip_reports($this->input-
>post('booking_from'),$this->input->post('booking_to'),$this->input-
>post('booking_vechicle'));
if(empty($triplist)) {
$this->session->set_flashdata('warningmessage', 'No bookings found..');
$data['triplist'] = '';
} else {
unset($_SESSION['warningmessage']);
$data['triplist'] = $triplist;
}
}
$data['vehiclelist'] = $this->vehicle_model->getall_vehicle();
$this->template->template_render('report_booking',$data);
}
public function incomeexpense() {
if(isset($_POST['incomeexpensereport'])) {
$incomeexpensereport = $this->incomexpense_model->incomexpense_reports($this-
>input->post('incomeexpense_from'),$this->input->post('incomeexpense_to'),$this->input-
>post('incomeexpense_vechicle'));
if(empty($incomeexpensereport)) {
$this->session->set_flashdata('warningmessage', 'No data found..');
$data['incomexpense'] = '';
} else {
unset($_SESSION['warningmessage']);
$data['incomexpense'] = $incomeexpensereport;
}
}
$data['vehiclelist'] = $this->vehicle_model->getall_vehicle();
$this->template->template_render('report_incomeexpense',$data);
63
}
public function fuels() {
if(isset($_POST['fuelreport'])) {
$fuelreport = $this->fuel_model->fuel_reports($this->input-
>post('fuel_from'),$this->input->post('fuel_to'),$this->input->post('fuel_vechicle'));
if(empty($fuelreport)) {
$this->session->set_flashdata('warningmessage', 'No data found..');
$data['fuel'] = '';
} else {
unset($_SESSION['warningmessage']);
$data['fuel'] = $fuelreport;
}
}
$data['vehiclelist'] = $this->vehicle_model->getall_vehicle();
$this->template->template_render('report_fuel',$data);
}
}

64

You might also like