Traffic Management System Final Project Report
Traffic Management System Final Project Report
SUBMITTED BY
NAME ID NUMBER
ADVISOR SIGNATURE
SCHOOL OF COMPUTING
DEBRE MARKOS
JUNE 2019
Web and Mobile based Traffic Management system | 2019
1. Natnael Negussie……………………Ter/1409/08
2. Kasawmar Ayalew………………...Ter/1408/08
3. Eyob Engidaw ……………. ...Ter/1400/08
4. Nigusu Mekuanint ……………. …. Ter/1423/08
5. Dagnachew Belayhun………. ……Ter/1394/08
Acknowledgment
First, we would like to thank GOD for helping us through this project. Secondly, we would like
to express our deepest gratitude to our advisor Nigussie Abate for his great contribution
guidance, support and gives us continuous initiation and encouragement from the begging up to
the end of the project. Next, we would like to thank Debremarkos city Traffic management
offices for giving the required information for us. In addition to this we would like tanks for our
classmate students for sharing their knowledge and different idea and gives us suggestions and
comments to correct this project. Finally, we would like thanks for our family for helped by
allocating the budget for us to complete this project.
Abstract
The project is targeted at developing fully functional and highly interactive web and mobile-
based traffic management system for Debremarkos Town. The finding and analysis of the project
is greatly expected to be essential driving power to address the current problems encountered in
using a manual system to provide its service, and in order to reduce human labor, time
consumption as well as improving the quality, speed, accuracy and effectiveness of service in
information sharing. In designing the new proposed system, all the relevant data collection
techniques, tools, models which used in object-oriented development environment are applied
with estimated work plan and cost. After determining requirement specifications then the system
is designed in accordance with specifications to satisfy the requirements and then implement
with MY Structured Query Language (MySQL), Hypertext Pre-Processor (PHP) and Hypertext
Markup Language (HTML), Extensible markup Language (XML) and mobile programming
language. The proposed system is designed to be an interactive, comfortable in management of
the system and will provide integrated services. This system will help for the employee of
Debremarkos town traffic police station to communicate and access their data easily and for
customers of the organization. In general, the system will enable the transactions to be easy,
faster and efficient.
Contents
1 CHAPTER ONE ...................................................................................................................... 1
1.1 Introduction ................................................................................................................................... 1
1.2 Background ................................................................................................................................... 1
1.3 Statements of the problem............................................................................................................. 3
1.4 Objective of the Project................................................................................................................. 4
1.4.1 General Objective ................................................................................................................. 4
1.4.2 Specific Objective ................................................................................................................. 4
1.5 Scope of the project ...................................................................................................................... 4
1.6 Significance of the project ............................................................................................................ 5
1.7 System Requirement ..................................................................................................................... 7
1.7.1 Hardware Requirement ......................................................................................................... 7
1.7.2 Software Requirement........................................................................................................... 7
1.7.3 Programming language Tool ................................................................................................. 8
1.8 Data Collection Methodologies .................................................................................................. 10
1.8.1 Data Collection ................................................................................................................... 10
1.9 Feasibility Study ......................................................................................................................... 11
1.9.1 Economic Feasibility........................................................................................................... 11
1.9.2 Operational feasibility: ........................................................................................................ 12
1.9.3 Technical Feasibility ........................................................................................................... 13
1.9.4 Legal Feasibility.................................................................................................................. 13
2 System Analysis .................................................................................................................... 14
2.1 Overview of the Existing System................................................................................................ 14
2.1.1 Users of the Existing System .............................................................................................. 15
2.2 Over view of proposed system .................................................................................................... 16
2.3 System requirement specification ............................................................................................... 16
2.3.1 Functional Requirements .................................................................................................... 17
2.3.2 Non-Functional Requirement .............................................................................................. 18
2.3.3 Business Rules .................................................................................................................... 19
2.4 System Requirement Analysis .................................................................................................... 20
2.4.1 Actor and Use Case Identification ...................................................................................... 20
2.4.2 Use case diagram ................................................................................................................ 24
2.4.3 Use case Description ........................................................................................................... 25
2.4.4 Sequence diagram ............................................................................................................... 28
List of tables
Table 1 use case description for traffic police ............................................................................................ 24
Table 2 use case description for login ......................................................................................................... 26
Table 3 use case description for register accident....................................................................................... 27
Table 4 use case description for post news ................................................................................................. 27
Table 5 Use case description for create account ......................................................................................... 28
List of figures
Figure 1 Development Cost ........................................................................................................................ 12
Figure 2 benefit of cost ............................................................................................................................... 12
Figure 3 work flow structure for Traffic Management system ................................................................... 15
Figure 4 use case diagram of web based and mobile app for Traffic Management System ....................... 25
Figure 5 sequence diagram for login........................................................................................................... 29
Figure 6 sequence diagram for user registration ......................................................................................... 30
Figure 7 sequence diagram for accident registration .................................................................................. 30
Figure 8 activity diagram for login ............................................................................................................. 32
Figure 9 activity diagram for create account .............................................................................................. 32
Figure 10 activity diagram for notify .......................................................................................................... 33
Figure 11 class diagram for traffic management system ............................................................................ 35
Figure 12 Design Class Diagram for TMS ................................................................................................. 37
Figure 13 user account table for TMS ........................................................................................................ 38
Figure 14 accident table for TMS ............................................................................................................... 38
Figure 15 vehicle table for TMS ................................................................................................................. 39
Figure 16 new user table for TMS .............................................................................................................. 39
Figure17 Deployment Diagram for Traffic Management system ............................................................... 40
Figure 18 Login page .................................................................................................................................. 41
Figure 19 login page for web ...................................................................................................................... 42
Figure 20 Public page in android ................................................................................................................ 43
Figure 21 Traffic police page for android ................................................................................................... 44
Figure 22 traffic police page in web ........................................................................................................... 45
Figure 23 dispatcher page in web ............................................................................................................... 46
Figure 24 Administrator Page ..................................................................................................................... 47
HZ …………………………………………… hertz
UC………………………………………………Use case
1 CHAPTER ONE
1.1 Introduction
As the number of vehicles is increasing on road the load on traffic police officers is increasing in
a day to day. Their work has increased. Along with increase in number of vehicles, the related
problems have started to rise which includes violation of rules, identifying the vehicle owner etc.
As the number of rule violation increase, the fine collection also increases. These records are
collected manually and filled into the receipt book. There is no reliable system to collect and store
this information. This proposed system aims to tackle problem of maintaining data- in an efficient
manner. It aims to replace the traditional ways managing system with digital records. The current
system has many drawbacks. It is paper-pen based system. The traffic police officers have to carry
the receipt book to register the complaints.
Our system solves the problems of traditional manual system of traffic management system. This
proposed system provides register and report accident by traffic police and send to dispatcher.
Every one that registered to the system as public and traffic police can nominate and check vehicle.
This system implemented both web and mobile application. The whole activities are implemented
fully in php some activities done in mobile programming language. We made activities in mobile
programming that have mobile feature and easily write by mobile like send and view message,
send nomination, register accident, check vehicle plate number, check driver license, send and
view notification, send and view complain or feedback and update accounts.
Generally, this system plays great role to manage every activity that occurs on the traffic case in
Ethiopia specially in DebereMarkos city.
1.2 Background
Now a day the development of a country is analyzed and measured from different perspectives.
This includes the living standard and living atmosphere of peoples and their properties in peaceful
and clear from danger. This is done by traffic management station workers such as dispatcher,
field officer, peoples and accident management system as a whole. The institution of accident
management station is standing for people’s wellness, peaceful living, and security and to protect
their property from danger.
Debre Markos town is one of the cities of East Gojam. The town has different institutions to serve
the public need of the serving society. So, the town needs to have Web Based and Mobile
Application for Traffic management system.
Debre Markos town police station is the institutions of traffic accident management station that
was established long years ago to give service and protect Debre Markos town peoples, and their
property from accident and damage.
The stations are responsible for receiving the accident sound and having quick response to the
received accident sound and storing the nature of the accident, the location details, the sequence
of the accident, information on victims.
Basically, there is no computerized Traffic police station in the town, the police station that give
this service use manual way of information gathering and documenting or recording data about the
accident and the technique of response or generate reports to the accident, no reliable
communication between different stations, as well as there is no optimized service.
Some of accidents natural/man-made are traffic accident, fire accident, killing or murder, flood,
electric current accident, earth quake, harassment, etc. But we are mainly initiated to develop web
based mobile application for Traffic management system.
The technology which surrounds almost everyone in the modern society, affects both work and
leisure activities. It influences minds in good and bad ways, and it allows people to share
information which they would otherwise not be able to attain. It also gives another form of
communication and exchange of information which was not available before. One of the best
innovations in technology is mobile phones. It is a wireless handheld device that allows users to
make and receive calls and to send text messages. The earliest generation of mobile phone could
only make and receive calls. Today’s mobile phones are packed with many additional features
such as web browsers, games, cameras, video players etc. Mobile phones are common now and
every person seems to have one.
Mobile phones have many operating systems such as android operating system, iOS and window
phone operating system. From this will see android operating system. Android is a mobile
operating system (OS) currently developed by Google, based on the Linux kernel and designed
primarily for touch screen mobile devices such as smart phones and tablets.
Relating to this manual working process, the system faces many problems.
Some of the problems identified to be addressed by our study in the existing system are:
➢ The traffic police cannot know if the driver is the first time or done the fouls before this.
➢ The traffic police officer cannot easily check weather the driver's license is valid or not
➢ People cannot make a flagellation/nomination
➢ The traffic police cannot know if the car is done a foul or not
➢ The people cannot know if the car is done a foul or not
➢ The people and traffic policemen can’t know the position of the car. if the car is done
foul/mistake
➢ The record can be thrown out.
➢ Low data handling and security,
➢ Traffic police must report the incident directly to the administrator
➢ Difficult to handle when drivers make fault and escape and change his work area
➢ The lack of communication and exchange of information as much as possible at the
fastest growing sites and defenders.
➢ Time duration
➢ When the people point out
➢ When Duration of the Traffic Police Report
➢ Previously registered information about an accident history is difficult to obtain.
✓ To report information
✓ To check the driver crime whether the first time or not by using his license number
Basically, there are numbers of traffic management center, but our study is limited only on Debre
Markos Town Traffic management.
The scopes of the proposed system are:
❖ Traffic police and public nominate any information about the action takers
❖ Dispatcher send notification of serous issue to public
❖ Dispatcher send notification of serous issue for traffic police and public
❖ Traffic police check the vehicles either foul or not using number plate
❖ public check the vehicles either legal or not using number plate
❖ Any users and public report any information related with traffic accident
❖ Traffic police check the driver crime whether the first time or not by using his license
number
❖ Dispatcher can send warning message and also driver accept warning messages
❖ Traffic police check the driver’s crime case whether it is for the first time or done
previously
✓ The society can get full traffic information at every place and time.
✓ It will be accurate, easy to use and efficient to detect accident records and share
information.
✓ The traffic police can easily know if the driver is the first time or repeatedly for done the
fouls
✓ The traffic police officer can easily know if the driver's license is valid or not
✓ People can make a flagellation/nomination
✓ The traffic police can know if the car is done a foul or not
✓ The people can know if the car is done a foul or not
✓ The people and traffic policemen can know the position of the car. if the car is done
foul/mistake
✓ Previously registered information about an accident history is easily to obtain.
✓ The communication and exchange of information as much as possible at the fastest
growing sites and defenders.
✓ Reduce time duration
✓ When the people point out/nomination
✓ When Duration of the Traffic Police Report
For developers:
➢ Good experience on how to develop such types of projects and solving of problems.
Front End Programming: We use Mobile programming, CSS, HTML, Bootstrap as a front-end
programming.
➢ User Interface Interactivity: JavaScript used to fill web page data dynamically such as
drop-down list for a Country and State. Base on selected Country, State drop down list
dynamically filled. Another one is Form validation, missing/incorrect fields you can alert
to a user’s using alert box.
➢ Rapid Development: JavaScript syntaxes are easy and flexible for the developers.
JavaScript small bit of code you can test easily on Console Panel (inside Developer
Tools) at a time browser interpret return output result. In-short easy language to get pick
up in development.
Easy: - This server-side scripting language is extremely easy to learn, as compared to other
languages. Access to support: - As PHP is being used by a huge number of people, a large
community is formed. So, you need not worry if you get stuck somewhere. You will easily get
the support from them.
Platform independent: - Whether it is Windows, MacOS, Linux or UNIX; it supports all the
major web browsers.
Supports all servers: - PHP also supports all the major web servers; be it Apache or Microsoft
IIS. It also supports Netscape and personal web server.
Speedy: - PHP uses its own memory, so the workload of the server and loading time gets
reduced automatically, which results into the faster processing speed.
Secured: - it has got a security layer to protect against viruses and threats.
✓ JSON is Faster: JSON syntax is very easy to use. We have to use only -> as a
syntax which provides us an easy parsing of the data and faster execution of the
data. Since its syntax is very small and light weighted that’s the reason that it
executes the response in the faster way.
✓ Server Parsing: On the server-side parsing is the important part that developers want if
the parsing will be fast on the server side then the only user can get the fast response of
their response so in this case JSON server-side parsing is the strong point that indicates
us to use the JSON on the server side.
✓ Tool for sharing data: JSON stores the data in the arrays so data transfer makes
easier. For this reason, JSON is a superior file format for web APIs and for web
development etc.
Feasibility study is made to see if the project on completion will serve the purpose of the
organization for the amount of work, effort and the time that spend on it. It lets the developer
predict the future of the project and the usefulness.
We do feasibility study from different perspectives. We can see from its technical, operational,
economical and legal points of view.
The system which we have developed is economically feasible. It is financially affordable. And
have economic benefit. The costs that we used to develop this project are lower than the cost that
will cost to the customer after it is developed. Since computer devices, and different materials
are available, there is no more cost to develop our system.
✓ Operating costs - costs that recur throughout the lifetime of the system.
✓ Benefit of Cost: At the end of the project the whole can save money by using this
system.
The system which we developed is operationally feasible. Because in the existing system
there are many problems to attain its objective; and organization is willing to find solution to
these problems. So, our project is best solution to solve these all problems. It works well all
the user requirements in the traffic management system. This system is web-based system
and mobile application for Traffic management system in Debremarkos city. So, it attains its
desired objectives. It will solve the problems in this system; therefore, it will minimize the
amount of effort to do all through manually. And it performs the basic functionalities that
planned to use.
After we develop the system, Network infrastructure in the institution is available, so staff
members can operate all requirements as they went. Not only network infrastructure, the cost
of organization incurred to perform service is also reduced. Therefore, our system is
operationally feasible.
The system which we developed will be technically feasible. The system is technically
feasible since the teams can develop it easily by using simple programming languages and
software’s like: html, JavaScript, MySQL, Android studio. Because we have familiar
knowledge about those. These languages are simple, open source and already known, so the
team can develop the system easily. We expect that, the system can be operated in simple
way and all users can access easily by giving simple training for them. Because most
customers are familiar with mobile device, it doesn’t require any technical expertise.
The system can also handle error easily because the programming language that we use is
capability to handle errors. Not only error handler, but they are also platform independent
because of they are object oriented. So, our system can run in any operating system (OS).
CHAPTER TWO
2 System Analysis
This section deals with analyzing the general work flow and its major players or participants of
the existing system. It produces a broad outline of the system that identifies the function to be
performed and the technical aspect that the system must fulfill and briefly describes the existing
system functionality, problem of the existing system. It also deals the functional and non-
functional requirements of the proposed system. The business rule is also identified here.
Different activities are performed manually as follow: If Customers need to enter new case first,
they consider the rule and regulation of the system. First, customers allow to officer to enter traffic
office and if officer allowed, then enter office and thought their problems to officer. Record officer
write the case in paper and send to administrator. Administrator decide the case.
If driver make fault and escape at that time and change his work area then traffic administrator
calls any station to catch foul driver by sending complete information about driver.
When accident occurs in specific place, the people inform it for the police located around. Then
these police report it’s for the admin in the main station. The admin checks the availability of
resources and then assigns accident controlling team.
➢ System administrator
➢ Traffic police
➢ Public or society
➢ Driver
➢ Dispatcher
➢ Finance officer
Generally, the new system will eliminate/reduce problems related to time accuracy, speed,
security, and complexity in information sharing among distributed stations. The proposed system
will enable to retrieve, insert, delete and modify needed information simply for the admin. It
includes an attractive user interface that facilitates fast access to the database and register
accidental detail easily.
around the problem, solidifies ideas, and helps break down the problem into its
component parts in an orderly fashion.
➢ It serves as an input to the design specification. The system specific requirement serves
as the parent document to subsequent documents, such as the software design
specification and statement of work. Therefore, the system specific requirement must
contain sufficient detail in the functional system requirements so that a design solution
can be devised.
➢ It serves as a product validation check. The system specific requirement also serves as the
parent document for testing and validation strategies that will be applied to the
requirements for verification.
✓ Enables to register traffic police, finance officer, driver, public, admin and dispatcher,
✓ Enables to view traffic police, finance officer, driver, public, admin and dispatcher,
✓ Enables to user can create account
✓ send notification for all user
✓ Enables to check the vehicles using plate number done foul or not
✓ Enables to check the driver crime whether the first time or not by using his license number
A non-functional requirement is a requirement that specifies criteria that can be used to judge the
operation of a system, rather than specific behaviors. It defines how a system is supposed to be.
Non-functional requirements are often called qualities of a system.
➢ Security: Security requirements are important factors in this system as classified data
will be stored in the database. User validation done during login to ensure that the user is
valid and that the user only has access to his/her permitted data.
In order to keep data security, we have to design the system in such a way that, only important
feature must be available in customers page. The database operations must be performed on
server computer. And backup and recovery are also very important concept.
➢ Extensibility: web and mobile -based traffic management system might be easily
extensible to add new features at a later stage. To make the system extensible the
software development approach is main issue. In our case we used Incremental model,
which supports the system to be extensible.
➢ User friendly interface: The system will have consistent interface formats and button
sets for all forms in the application. It will be user friendly if we format the user interface
more appropriately.
When we use php programming language we can make the system user-friendly. Since php
language uses different templates like bootstrap, jQuery etc. In each user action we can add
different glyph icons, which describes the user action.
➢ Response time: In order to meet client’s satisfaction, the system use a fast internet to
perform the required transaction in few second response time and with maximum
throughput.
We can make the system with short response time by using server computer with high processor.
When we use server with maximum RAM the response time will be short.
➢ Portability: the system that we propose should be accessed at any platform. So, we will
develop the system by php programming and mobile programming so as to access in any
operating system, since php programming language is platform independent.
➢ Maintenance: Our system should be easily modifiable to make changes to the features
and functionalities. By documenting our documentation carefully, we can make our
system maintainable.
To make our system maintainable the software development approach is also another factor to
measure maintainability. So, by using incremental development method we can make our system
more maintainable.
BR1: any police must report daily traffic accident to the dispatcher or administrator effectively.
BR2: society or public should send crime report that clearly identify when the accident is
occurred and attach crime information the crime to traffic police or administrator.
BR3: Only appropriately licensed and authorized personnel allowed operating the vehicle.
BR5: any vehicles must have identification number; the identification numbers of vehicles are
combination of numbers and letters which the appropriate organ shall assign to a vehicle upon
certification of its title;
BR11: Implement a rule to keep gap to the left for person on foot.
BR12: Drivers must wait pedestrian crossing road at zebra lines and make their use mandatory.
✓ Register
➢ Vehicle
➢ Traffic police
➢ Driver
➢ Finance officer
➢ Dispatcher
✓ View
➢ Vehicle
➢ Traffic police
➢ Driver
➢ Finance officer
➢ Dispatcher
Dispatcher
✓ View
➢ Vehicle
➢ Traffic police
➢ Driver
➢ Report
➢ Location
➢ Complaints or feedback
➢ Nomination
➢ Finance officer
➢ Admin
➢ Fine
✓ Send
➢ News
➢ Notification
➢ message
✓ Mange account
➢ Update Account
➢ Create account
Traffic Police
Driver
Public
✓ View
➢ Notification
➢ View News
✓ Send
➢ Nomination
✓ Check Vehicles number Plate
✓ Use case Identification: Use case is interactions between actor and a system, to achieve
a goal. Derive from the scenarios that completely represent the future system. This is
primarily done in the form of a scenario that describes a sequence of steps.
Some of use case is listed below:
No. Use cases name ID Include
1. Login UC1
2. Register Accident UC2 UC1
3. Nomination UC3 UC1
4. send report UC4 UC1
5. Manage account (update UC5 UC1
and create)
6. View notification UC6 UC1
7. post news UC7 UC1
8. View news UC8 UC1
9. Check vehicle number- UC9 UC1
plate
10. Create account UC10 UC1
11. Send Notification UC11 UC1
12. Send warning UC12 UC1
13. Accept warning UC13 UC1
14. Register traffic police UC14
15. View traffic police UC15 UC1
16. Register vehicles UC16
17. View vehicles UC17 UC1
18. Send complaints or UC18 UC1
feedback
Figure 4 use case diagram of web based and mobile app for Traffic Management System
Describing each use case process helps to clarify the concept of the use case.
Identifier UC1
Help Users to login into the system by their user name and
Description
password.
Participate actor Admin, traffic police, driver and finance officer and
Dispatcher
Post condition The authenticated user can be able to login into the system.
Alternative course of action If invalid “username or password” is provided, the system displays
error message and the process resume from step 3 above
Alternative action If you fill Invalid information entry error message will display go to
step 3
Pre –condition Open the activity and login his /her account
Pre-condition Login to the system and open post news on the menu
4. Click on Post
Alternative action If you inter Invalid information entry the system provides
error message go to step 3
Pre- condition Login to the system select user type on the login as menu
Alternative course of action If you insert Invalid information entry the system provides error
message go to step 3
Forward Message
Return Message
In activity diagrams, you use activity nodes and activity edges to model the flow of control and
data between actions.
The header of the activity frame displays the name of the activity, Activity1, and the body of the
activity frame displays the nodes and edges that describe the activity.
Activities: in UML, activities are container elements that describe the highest level of behavior
in an activity diagram. Activities contain several activity nodes and activity edges that represent
the sequence of tasks in a workflow that result in a behavior.
Controls: In activity diagrams, a control node is an abstract activity node that coordinates the
flow of control in an activity.
Objects: In activity diagrams, an object node is an abstract activity node that helps to define the
object flow in an activity.
Activity edge: in activity diagrams, an activity edge is a directed connection between two
activity nodes. When a specific action in an activity is complete, the activity edge continues the
flow to the next action in the sequence.
Show the classes of the system, their inter-relationships, and the operations and attributes of the
classes. Class diagrams are typically used, although not all at once, to:
Class Diagram provides an overview of the target system by describing the objects and classes
inside the system and the relationships between them. It provides a wide variety of usages; from
modeling the domain-specific data structure to detailed design of the target system. With the
share model facilities, you can reuse your class model in the interaction diagram for modeling
4th year software engineering academic program industrial project 2 33 | P a g e
Web and Mobile based Traffic Management system | 2019
the detailed design of the dynamic behavior. The Form Diagram allows you to generate diagram
automatically with user-defined scope.
CHAPTER THREE
3 SYSTEM DESIGN
The purpose of design is to determine how the system is going to build and to obtain the
information needed to drive the actual implementation of the system. It focuses on
understanding the model how the software built. System design is the detail investigation
of system elements from logical view. After the determination of the requirements, it is
the design that follows. The design is all about stating the design goals of the system and
subdividing the system into smaller parts to improve the problem in a modular approach.
The output of this phase includes description of each subsystems and the deployment of
the subsystems. To give right service for the right user at the right time on subject of
his/her need make the design properly. The design goals are deriving from the non-
functional requirement, which is the part of the analysis document, and they describe the
quality of the system.
the hardware of our system, the software that to be installing in that hardware. It also shows how
hard ware and software components work together.
Deployment diagrams are made to focus on hardware topology of a system. The purpose of
deployment diagrams can be described as:
CHAPTER FOUR
4 IMPLEMENTATION
System implementation is the final stage in software development stage in which the design
is Putting in to coding or real application.
in great detail and provides programmers a detailed template for the next step of writing
code in a specific programming language.
The purpose of using pseudo code is that it is easier for people to understand than
conventional programming language code, and that it is an efficient and environment-
independent description of the key principles of an algorithm.
We use md5 with encrypt key encryption algorithm.MD5 (technically called MD5 Message-
Digest Algorithm) is a cryptographic hash function
The MD5 function is a cryptographic algorithm that takes an input of arbitrary length and
produces a message digest that is 128 bits long. The digest is sometimes also called the
"hash" or "Fingerprint" of the input. MD5 is used in many situations where a potentially
long message needs to be processed and/or compared quickly.
If (Form is filled)
If (valid)
Connect to database
Else
Read session
If session exists on database, user is already logged in, Display the page
Else
If they're correct
Create session ID
</head>
<body class="nav">
<div class="container">
<br/><br/><br/><br/><br/><br/><br/>
<div class="row">
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-primary">
<div class="panel-heading">
<h4>User Login</h4>
</div>
<div class="panel panel-body">
<?php
if(isset($_POST["btn_login"])) {
$un = $_POST['un'];
$password = $_POST['pass'];
$pass=md5($password);
$start_time = date("d M Y @ h:i:s");
$_SESSION['$start_time'] = $start_time;
$q = "select * from account where uname='$un' and password='$pass'";
$r = mysqli_query($conn, $q) or die("not feched " . mysqli_error($conn));
$x = mysqli_fetch_assoc($r);
$role = $x['role'];
if ($x) {
$_SESSION['uname'] = $x['uname'];
$_SESSION['roleid']=$x['roleid'];
$_SESSION['role'] = $x['role'];
$id = $x['roleid'];
if ($_SESSION['role'] == "admin")
header("location:" . $ROOT_URL .
"index.php?logedid=$_SESSION[roleid]");
else if ($_SESSION['role'] == "driver")
header("location:" . $ROOT_URL .
"driver/index.php?logedid=$_SESSION[roleid]");
else if ($_SESSION['role'] == "dispatcher")
header("location:" . $ROOT_URL .
"dispatcher/index.php?logedid=$_SESSION[roleid]");
else if ($_SESSION['role'] == "police")
header("location:" . $ROOT_URL .
"traffic_police/index.php?logedid=$_SESSION[roleid]");
else if ($_SESSION['role'] == "finance")
header("location:" . $ROOT_URL .
"finance_officer/index.php?logedid=$_SESSION[roleid]");
}
?>
<div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-
label="Close"><span aria-hidden="true">×</span></button>
Incorrect user name or password. Please try again.
</div>
<?php
}
if (isset($_POST['public']))
header("location:public/index.php");
?>
<script>
function myFunction() {
var x = document.getElementById("myInput");
x.type = "text";
} else {
x.type = "password";
}
}
</script>
password?</a>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<script src="bootstrap/js/jquery3.3.1.min.js"></script>
</body>
Sample code for login in android
package com.example.group_5pcproject.mobilebasedtrafficcmangementsysetm;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.util.Log;
import
com.example.group_5pcproject.mobilebasedtrafficcmangementsysetm.Dispatcher.Dispatcher;
import
com.example.group_5pcproject.mobilebasedtrafficcmangementsysetm.Driver.Driver_page;
import com.example.group_5pcproject.mobilebasedtrafficcmangementsysetm.Public.Public;
import
com.example.group_5pcproject.mobilebasedtrafficcmangementsysetm.Trafficpolice.Traffic_Poli
ce;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.sql.Driver;
public class LoginTask extends AsyncTask<String,String, String> {
Context context;
//print result
return response.toString();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
@Override
break;
case "public":
to = new Intent(context, Public.class);
break;
}
context.startActivity(to);
return;
}else{
Log.w("Errror", "Invalid usernname or password");
}
} catch (JSONException e) {
e.printStackTrace();
}
super.onPostExecute(s);
}
}
sample code for accident register in android
package com.example.group_5pcproject.mobilebasedtrafficcmangementsysetm.Trafficpolice;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.Bundle;
import android.os.StrictMode;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import com.example.group_5pcproject.mobilebasedtrafficcmangementsysetm.R;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class AccidentRegister extends AppCompatActivity {
Button b1;
Spinner atype,aweight;
EditText resource,adate,location,trafficid,penality,accid ;
private ArrayAdapter<String> listAdapter ;
String driverid;
int session;
TextView tx1,tx2;
int counter = 3;
StrictMode.ThreadPolicy policy = new
StrictMode.ThreadPolicy.Builder().permitAll().build();
SharedPreferences sharedpreferences;
public static final String MyPREFERENCES = "session" ;
public static final String role_id = "role_id";
public static final String user_id = "user_id";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_accident_register);
resource = (EditText)findViewById(R.id.resource);
adate = (EditText)findViewById(R.id.adate);
location = (EditText)findViewById(R.id.location);
trafficid = (EditText)findViewById(R.id.trafficid);
penality = (EditText)findViewById(R.id.penality);
accid = (EditText)findViewById(R.id.accid);
atype = (Spinner)findViewById(R.id.atype);
aweight = (Spinner)findViewById(R.id.aweight);
b1 = (Button)findViewById(R.id.send);
Intent i=getIntent();
String x=i.getStringExtra("role_id");
trafficid.setText(x);
// ed_password = (EditText)findViewById(R.id.password);
//id1=(EditText)findViewById(R.id.password);
String [] weight={"simple","medium","danger"};
ArrayAdapter<String> adapter=new
ArrayAdapter<String>(this,android.R.layout.simple_spinner_dropdown_item,weight);
aweight.setAdapter(adapter);
String [] Atype={"car","road","electric"};
ArrayAdapter<String> adapter1=new
ArrayAdapter<String>(this,android.R.layout.simple_spinner_dropdown_item,Atype);
atype.setAdapter(adapter1);
//b2 = (Button)findViewById(R.id.);
tx2 = (TextView)findViewById(R.id.success);
Intent intent = getIntent();
StrictMode.setThreadPolicy(policy);
sharedpreferences = getSharedPreferences(MyPREFERENCES,
Context.MODE_PRIVATE);
String result = "";
InputStream is = null;
ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
// nameValuePairs.add(new
BasicNameValuePair("user_id",Integer.valueOf(session).toString()));
try {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new
HttpPost("http://10.129.13.241:80/mobile%20_based_traffic_management_system/selectdri
ver.php");
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
is = entity.getContent();
Toast.LENGTH_SHORT).show();
} catch (Exception e) {
Log.e("log_tag", "Error in http connection " + e.toString());
Toast.makeText(getApplicationContext(), "Connection fail",
Toast.LENGTH_SHORT).show();
}
//convert response to string
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(is, "iso-8859-
1"), 8);
StringBuilder sb = new StringBuilder();
String line=null;
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
is.close();
result = sb.toString();
} catch (Exception e) {
Log.e("log_tag", "Error converting result " + e.toString());
for(int k=0;k<length;k++){
JSONObject no = object.getJSONObject(String.valueOf(k));
ArrayList<String> mylist = new ArrayList<String>();
adapter2.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
s.setAdapter(adapter2);
s.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position,
long id) {
driverid = (String) parent.getItemAtPosition(position);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
} catch (JSONException e) {
Log.e("log_tag", "Error parsing data " + e.toString());
//Toast.makeText(getApplicationContext(), "JsonArray fail",
Toast.LENGTH_SHORT).show();
}|
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String result = null;
InputStream is = null;
String resourceholder = resource.getText().toString();
String adateholder = adate.getText().toString();
String locationholder = location.getText().toString();
String trafficholder = trafficid.getText().toString();
String penalityHolder = penality.getText().toString();
String acciddHolder = accid.getText().toString();
String weightholder= aweight.getSelectedItem().toString();
String atypeHolder = atype.getSelectedItem().toString();
ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("acciid",acciddHolder));
nameValuePairs.add(new BasicNameValuePair("dname",driverid));
nameValuePairs.add(new BasicNameValuePair("location",locationholder));
nameValuePairs.add(new BasicNameValuePair("penality",penalityHolder));
nameValuePairs.add(new BasicNameValuePair("tid",trafficholder));
nameValuePairs.add(new BasicNameValuePair("dresource",resourceholder));
nameValuePairs.add(new BasicNameValuePair("adate",adateholder));
nameValuePairs.add(new BasicNameValuePair("type",atypeHolder));
nameValuePairs.add(new BasicNameValuePair("weight",weightholder));
// nameValuePairs.add(new BasicNameValuePair("from",
Integer.valueOf(session).toString()));
try
{
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new
HttpPost("http://10.129.13.241:80/mobile%20_based_traffic_management_system/accident.
php");
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
is = entity.getContent();
}
//convert response to string
try{
BufferedReader reader = new BufferedReader(new InputStreamReader(is,"iso-
8859-1"),8);
StringBuilder sb = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null)
{
sb.append(line + "\n");
}
is.close();
result=sb.toString();
}
catch(Exception e)
{
Log.e("log_tag", "Error converting result "+e.toString());
}
catch(JSONException e)
{
Log.e("log_tag", "Error parsing data "+e.toString());
Toast.makeText(getApplicationContext(), "JsonArray fail",
Toast.LENGTH_SHORT).show();
}
}
});
}
}
CHAPTER FIVE
5 TESTING
Testing is a process of analyzing a system or system component to detect the deference between
specified (required) and observed behavior. The procedures that we used are described below.
The requirements that are tested by the project team during the implementation are correctness,
accuracy, security and others.
Testing the correctness: -correctness determines how users can interact with the
software and how the software should behave when it is used correctly. Users can easily
interact with application since it has easily understandable interface and the application
responds correctly.
Testing the Accuracy: The system gives only valid result, if no data is found with the
specified criteria the system should not give invalid response. Since, our application
fulfills this characteristic it is accurate.
Testing the security: -To ensure the security of our application user must login to the
system with user name and password. The system allows only authorized users to login
i.e. users that have previously created account through user name and password.
CHAPTER SIX
The analysis helps the team to well understand the major functional areas and processes of the
system. Through this method we evaluate the existing system weakness and strength.
6.2.1 Recommendation
According to scope of our project the team develops web and mobile-based application.
Because of the time and security problem constraint we may have limitation which should
be consideration in, but in the feature the team believes that this system should be fully
operationally by adding some functionality that are not included in the proposed system.
We also want to recommend this project can be expanded and more automated with
additional functionalities by integrating with many new technologies. We recommend
also to the user use this system properly.
4th year software engineering academic program industrial project 2 64 | P a g e
Web and Mobile based Traffic Management system | 2019
The system that we have tried to automate is not the whole system of the traffic
management. Because of time limitation and security problem we can’t develop all parts of
the system, but we tried to automate some sub systems and functionalities.
The system we have developed is a automate web and mobile based Traffic management
system for Debremarkos city and it needs a skilled person to work with the system. So,
we recommend the system should be required the responsible and skilled person. We
highly recommend the system should be kept in highly safe and favorable condition.
APPENDIX
Deployment diagram: diagrams are special diagrams used to focus on software
Components and hardware components.
Action: is the fundamental unit of behavior specification and represents some transformation or
processing in the modeled system, such as invoking a method of a class or a sub activity.
Actor: a role that a user takes when invoking a use case. Also see actor modeling.
Activity: carrying out behavior in a State machine diagram.
Activity-diagram: a diagram that describes procedural logic, business process and work flow
supporting parallelism.
Diagram: a visual representation of a subset of features of a UML Mode
Sequence diagram: describes the Messages sent between a number of participating Objects in a
Scenario
Class: the primary declarative construct of Object-Oriented Programming; a cohesive unit of
Attributes and Operations; a compile-time template for an Object
Class diagram: a type of static structure diagram that describes the structure of a system by
showing the system's classes, their attributes, and the relationships between the classes.
References
1. ,Mohammed Hassan and malik AL Amayrch, "Web Based Traffic System", Jordan: AL
Salwa Publishing House, 2012.
5. Chen and quek, "Academic study on traffic accidents," calfornia, calfornia press, 1997,
p. 249.