0% found this document useful (0 votes)
28 views49 pages

Driving license registration 1-3

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

Driving license registration 1-3

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

CHAPTER ONE

INTRODUCTION

1.1 BACKGROUND OF STUDY


Driving license registration in Nigeria began over 100 years ago and the records have been
essentially manual which in turn has not helped to raise the efficiency of general automotive
services in recent years. Today, the computer has been discovered as a very efficient instrument,
which has played a very significant role in the adequate management of information. Besides, it
has played more roles in the country. However, computerization has helped in many areas of life
and due to the great number of vehicle owners, the thought of computerization of this operation
becomes of great importance to wipe out the manual data processing system from which many
problems have originated. The problems, which have engulfed the objectives of motor vehicle
registration, are extensively discussed in this project together with the new method that was
innovated. This work is conducted towards the computerization of the various problems in
processing data to identify the various problems that are been encountered in the registration of
vehicles manually. This theory also compares the existing system with the new system, which is
exact, and a faster way of processing data and the problem faced by customers when they are
registering their vehicles. Different programming languages can be used to develop such
programs, PASCAL, JAVA (Just Another Vague Acronym), VISUAL BASIC, C++ (C Object-
Oriented Programming Language), etc. But the researcher will be making use of PHP, and
Database (MySQL) they are both working with Apache server (XAMPP).

The World is experiencing an information knowledge revolution that is fundamentally


transforming how human activities are carried out. Governments worldwide are adopting e-
government as a means of improving their services to businesses and citizens, promoting
economic and social development, and enhancing the effectiveness and efficiency of government
operations. The computer plays vital role in the development of any company it also saves some
of the complex problems that are been faced by man and processes voluminous data within a
short period or at an incredible speed. Recent emphasis on information and data processing in
most of our business has grown adversely as in the case of motor driving license and plate
registration. In as much as motor driving license registration has been in existent for ages now,
the old system of registration has been in adoption which did not play a significant role in

1
highway safety until the development of the new system of driving license registration was a
reflective sheeting which is more visible to read even in the dark. This new system of a motor
vehicle and plate number registration, which is the main focus of this project, came into
existence on the 19th of March 1997 and was handled by the motor licensing officer. It was
introduced to enforce strict compliance with traffic rules and regulations as well as to provide
proper data as to the behavior of road users. Thus the role this study is going to play is to
computerize the motor vehicle and plate number registration thereby bringing about more
efficiency, effectiveness, and improved competence.The proposed system is to develop an online
drivin licensees registration wia th theft and recovery system. The objective oa f vehicle theft
detection system is to provide prevention of theft activity for any vehicle. Electronic gadgets
being a great advancement in the field of technology, these can be used to solve many-to-day
problems. If we talk about theft activity then this mainly happens with vehiclesTechnologygy has
also given resolutions on for these activities. The purpose of this project is to prevent vehicle
theft detection. The issue of vehicle theft has increased tremendously.

1.2 STATEMENT OF THE PROBLEM


These day’s car theft cases are higher than ever, give your car an excellent protection with the
only reliable anti-theft device. Car Electronic control unit ensures the best guarantee to protect
your car from different kinds of theft cases. It is a car security device that offers excellent
protection to your car. A car with Electronic control unit security system helps the user to lock
and unlock doors at the press of a button. Mainly two types of Electronic control unit are used in
Auto industry -Automatic Electronic control unit and Manual Electronic control unit that ensures
smoother and secured operation. Again this system could not prove to provide complete security
and accessibility of the vehicle in case of theft. Based on the discussion and data related to stolen
cars, it is observed that the car theft is a global problem. Nobody likes his or her car to get stolen.
The car manufacturers installed a minimum standard security system such as an alarmbased
security system. Due to the inefficient conventional car security alarm system, the possibility of
the car can be stolen is high However, this device is not effective enough. It does not have any
pager system attached to it. The car thief takes only a few minutes to deactivate the security
system. Furthermore, nobody will pay an attention when the car alarm goes off.

2
1.3 OBJECTIVES
As we have seen from the statement of the problems, the things that stand as a puzzle in the
manual system of motor driving license registration aim at introducing a better system which is
the computerized system that will contribute to providing solutions to the problems.
i. To review the existing system
ii. To detect stolen vehicles using the adequate requirement eg. Engine number, license plate
information, vehicle identification number (VIN)
iii. recover lost vehicles

1.4 SIGNIFICANCE OF THE PROJECT


Due to the constant rise in technology, it is necessary to use computers to Process voluminous
data within a short period or at an incredible speed. This project is to help provide efficiency, and
effectiveness and improve competence in detecting a stolen vehicle immediately after vital
details are provided eg. plate number, and other related activities. The importance of this study
includes:

i. To expedite the efficiency of a principal licensing officer in the processing of driving


license registration documents.
ii. To develop a method that will allow easy storage and retrieval of vehicle and owner’s
registration information at any time in the future.
iii. To develop a highly accurate method of generating and assigning plate numbers and how
to interpret them.
iv. To determine the easiest and fastest way to access vehicle owners’ registration
information and missing vehicles.
v. To enable security agencies to find missing vehicles.
vi. To develop an easy method for generating and assigning plate numbers or identification
marks.

1.5 SCOPE OF THE STUDY

3
The scope of the project is to make sure a stolen vehicle is detected after been report by the
rightful owner with the details that was previously provided for proper tracking. This also
intends to provide a common database of registered vehicles from which enquires can be made at
any time in case of identification if there is a loss. Also, if one breaks traffic rules and regulations
and tries to escape, the registration number driver’s license will aid in tracing him/her out. There
is a need to elaborate on the system to be computerized and maintained.
Since it is an academic exercise, the project is designed to handle only some of the activities of
the department namely. The

1.6 PROJECT REPORT ORGANIZATION

This research work has five distinct chapters. Chapter one contains an introduction n, the
background of the study, a statement of the problem, the objectives of the study, the significance
of the study, and the scope of the study. Chapter two is the review of related literature, while
chapter three is the system analysis and design. Chapter four presents the system implementation
with the choice of programming language and the system requirements. Chapter five contains a
summary, recommendations, and a conclusion. There are also references and an appendix.

1.7 DEFINITION OF TERMS

The following are some of the terminologies used in the project work.

i. Vehicle Plate Number: This is a metallic or plastic plate attached to a motor vehicle for
official identification purposes. The number is made up of alphanumeric characters or
numbers. Vehicle Registration: is the process where we add a vehicle’s details to the
motor vehicle register and issue its registration plates. You have to license your vehicle
regularly at least annually and you must display a current license label on your vehicle
windscreen.
ii. Vehicle Licensing: A regular fee paid to permit the use of one’s vehicle on the public
roads. The fee helps to pay for road projects and road safety programs. Your vehicle must
be both registered and licensed for you to legally drive it on the road.
iii. Vehicle owner: is a person who has met up with the entire necessary requirement for
owning a vehicle and has the right to drive it on public roads.

4
iv. Vehicle Registration and Enquiry Software (VehRES) System: This is application
software that is a customizable data collection system, which can be used by law
enforcement and motor vehicle agencies (i.e. Liaison Offices) nationwide. The VehRES
are compatible with both laptop and desktop personal computers (PC) can be used to
collect registered vehicle information for registration, renewal, updating, correction and
tracking.
v. Licensing office: A place where vehicle registration, licenses and other vehicle related
documents are performed. Licensing officers: Is a person who registers vehicles in the
licensing office.
vi. Vehicle: A mechanically propelled and wheeled object used for conveyance.
vii. Computerization: Introduction of the use of computer in an application area by writing a
program that will suit the work.
viii. ICT: This is an acronym for Information and Communication Technology.
ix. Federal Road Safety Commission (FRSC): They serve as law enforcement agency
charged with responsibilities for, among others, policymaking, organization and
administration of road safety in Nigeria. E-Government: There is no one common
definition of E – Government, although the term is widely used. (Norris, 2005) view E –
Government as a technology exercise, integrating individual database and websites of
government, while (Batschneider, 1990) view it as a means of bringing the government
closer to the common citizen through provision of public services online.
x. Driver's license or driving license: is an official document, which states that a person
may operate a motorized vehicle, such as a motorcycle, car, truck or a bus, on a public
roadway. The laws relating to the licensing of drivers vary between jurisdictions. In some
jurisdictions, a license is issued after the recipient has passed a driving test, while in
others; a person acquires a license before beginning to drive.

xi. AutoReg Vehicle license: Is the automated vehicle license registration and renewal
system, which is for all vehicle owners to register or renew their vehicle license with the
state government. It is renewed annually; it shows the details of the vehicle owner and
Vehicle details.

5
CHAPTER TWO
LITERATURE REVIEW

2.1 VEHICLE TRACKING SYSTEMS

Vehicle tracking systems are commonly used by fleet operators for fleet management functions
such as fleet tracking, routing, dispatching, driving behavior, on-board information and security.
Some vehicle tracking systems are bundled with or interface with fleet management software.
Along with commercial fleet operators, urban transit agencies use the technology for a number of
purposes, including monitoring schedule adherence of buses in service, triggering automatic
changes of buses' destination sign displays once the vehicle approaches the bus terminus (or
other set location along a bus route such as a particular bus stop along the route), and triggering
pre-recorded (or even synthetic speech) bus stop, route (and its destination) or service
announcements for passengers.

The American Public Transportation Association estimated that, at the beginning of 2009,
around half of all transit buses in the United States were already using a GPS-based vehicle
tracking system to trigger automated stop announcements. This can refer to external
announcements (triggered by the opening of the bus's door) at a bus stop, announcing the
vehicle's route number and destination, primarily for the benefit of visually impaired customers,
or to internal announcements (to passengers already on board) identifying the next stop, as the
bus (or tram) approaches a stop, or both; the latter are often also displayed on an internal LED
display or LCD monitor connected to the system while the loudspeakers play them. Data
collected as a transit vehicle follows its route is often continuously fed into a computer program
which compares the vehicle's actual location and time with its schedule, and in turn produces a
frequently updating display for the driver, telling him/her how early or late he/she is at any given
time, potentially making it easier to adhere more closely to the published schedule.

6
Such programs are also used to provide customers with real-time information as to the waiting
time until arrival of the next bus or tram/streetcar at a given stop, based on the nearest vehicles'
actual progress at the time, rather than merely giving information as to the scheduled time of the
next arrival. Transit systems providing this kind of information assign a unique number to each
stop, and waiting passengers can obtain information by entering the stop number into an
automated telephone system or an application on the transit system's website.

Some transit agencies provide a virtual map on their website, with icons depicting the current
locations of buses in service on each route, for customers' information, while others provide such
information only to dispatchers or other employees.

Other applications include monitoring driving behavior, such as an employer of an employee, or


a parent with a teen driver.

Vehicle tracking systems are also popular in consumer vehicles as a theft prevention, monitoring
and retrieval device. Police can simply follow the signal emitted by the tracking system and
locate the stolen vehicle. When used as a security system, a Vehicle Tracking System may serve
as either an addition to or replacement for a traditional car alarm. Some vehicle tracking systems
make it possible to control the vehicle remotely, including block doors or engine in case of
emergency. The existence of vehicle tracking device then can be used to reduce the insurance
cost, because the loss-risk of the vehicle drops significantly.

Vehicle tracking systems are an integrated part of the "layered approach" to vehicle protection,
recommended by the National Insurance Crime Bureau (NICB) to prevent motor vehicle theft.
This approach recommends four layers of security based on the risk factors pertaining to a
specific vehicle. Vehicle Tracking Systems are one such layer and are described by the NICB as
"very effective" in helping police recover stolen vehicles.

Some vehicle tracking systems integrate several security systems, for example by sending an
automatic alert to a phone or email if an alarm is triggered or the vehicle is moved without
authorization, or when it leaves or enters a geofence.

Other scenarios in which this technology is employed include:

 Stolen vehicle recovery: Both consumer and commercial vehicles can be outfitted with
RF or GPS units to allow police to do tracking and recovery. In the case of LoJack, the

7
police can activate the truck or car tracking unit in the vehicle directly and follow
tracking signals.
 Asset tracking: Companies needing to track valuable assets for insurance or other
monitoring purposes can now plot the real-time asset location on a map and closely
monitor movement and operating status.
 Field service management: Companies with a field service workforce for services such
as repair or maintenance, must be able to plan field workers’ time, schedule subsequent
customer visits and be able to operate these departments efficiently. Vehicle tracking
allows companies to quickly locate a field engineer and dispatch the closest one to meet a
new customer request or provide site arrival information.
 Field sales: Mobile sales professionals can access real-time locations. For example, in
unfamiliar areas, they can locate themselves as well as customers and prospects, get
driving directions and add nearby last-minute appointments to itineraries. Benefits
include increased productivity, reduced driving time and increased time spent with
customers and prospects.
 Trailer tracking: Haulage and Logistics companies often operate lorries with detachable
load carrying units. The part of the vehicle that drives the load is known as the cab and
the load carrying unit is known as the trailer. There are different types of trailer used for
different applications, e.g., flat bed, refrigerated, curtain sider, box container.
 Surveillance: A tracker may be placed on a vehicle to follow the vehicle's movements.[7]
 Transit tracking: temporary tracking of assets or cargoes from one point to another.
Users will ensure that the assets do not stop on route or do a U-Turn in order to ensure
the security of the assets.
 Fuel Monitoring: monitor the fuel through tracking device (with help of fuel sensor
connected to the device).
 Distance Calculation: calculate the distance travelled by the fleet.
 OBD II – Plug and play interface which provides most engine diagnostics information.

Vehicle tracking systems are widely used worldwide. Components come in various shapes and
forms but most use GPS technology and GSM services. Newer Vehicle tracking systems also use
the latest NB-IoT technology that can provide low power consumption and optimized data

8
transmission rates. Additionally, these systems may also feature short range data communication
systems such as WiFi. While most will offer real-time tracking, others record real time data and
store it to be read, in a fashion similar to data loggers. Systems like these track and record and
allow reports after certain points have been solved

2.1.1 VEHICLE OBD TRACKING SYSTEMS

Vehicle OBD tracking systems make use of OBD GPS trackers that plug into the onboard
diagnostic (OBD) port of light, medium, or heavy-duty vehicle. A cellular OBD GPS tracker
directly communicates with the cell tower for sending the location and other vehicle performance
data to the server over the cellular wireless network. Usually, the tracker device draws power
from the OBD port itself and contains a built-in antenna along with a GPS module for receiving
the GPS signal. In addition, OBD trackers communicate with the different vehicle subsystems
for receiving vehicle diagnostic and fuel consumption related data. Users can view the
information using standalone software or web browser from a desktop/laptop computer or using
smartphone apps.

2.1.2 FLEET MANAGEMENT TRACKING


Aside from theft-prevention, the most common use of vehicle tracking is in logistics and
transport. These systems make use of GPS(Global Positioning System) and GSM(Global System
for Mobile Communication) technology to provide precise and constant location telematics to an
individual fleet manager. These systems are typically equipped with features to monitor statistics
such as; fuel consumption, average speed, current driver time and location. There has been a
recent increase in demand for this technology as EU regulations place increased restrictions on
the hours driver are allowed to work in a given day. It is currently limited to 9 hours per day.
Companies are legally obligated to install a tachograph in any vehicle that is expected to carry
goods. This obligation has led many to attempt to cauterize this potentially onerous obligation,
instead turning it into a benefit. Fleet management systems use GPS & GSM technology. Much
like other forms of trackers, although due to their nature they are equipped with more thorough
diagnostic features. Other uses such as Trailer Tracking, Fuel Monitoring, Distance Calculation,
Asset Tracking, and Field Sales can all be incorporated into a fleet management solution.

9
2.3 DIFFERENT NIGERIAN PLATE NUMBERS

10
Fig. 1: Different Nigerian Plate Numbers

2.4 QUALITY OF VEHICLE REGISTRATION DATA

Quality is a major factor for the Vehicle Registration data collected. In Nigeria, Vehicle
Registration data such as vehicle license, car insurance, driver’s license and other vehicle –
related documents are usually collected by officials of both the Federal Road Safety Commission
(FRSC) and the State Liaison Office for both the Federal and State Governments respectively.
Sometimes the data forms are collected away from the scene. These data collected often have
problems including errors, incomplete information, illegibility due to poor handwriting, and
errors due to multiple data entries at various levels. The data obtained might not be of acceptable
quality.

(O’Day, 1993) defines data quality as accuracy, precision, timeliness, and completeness of the
data. The various components of quality listed by O’Day are ascertainment (completeness of data
coverage), consistency of coverage, missing data, consistency of interpretation, and the right
data, appropriate level of detail, correct entry procedures, and freedom from response error.
(Pfefer et al 2007). defined data quality as a set of dimensions which includes accuracy,
precision, completeness, coverage, timeliness, and consistency. The most commonly observed
attributes of data quality are data accuracy, data completeness, data consistency, and timeliness
of the data.

2.5 NEW VEHICLE NUMBER PLATE, DRIVER’S LICENSE MIRED IN


CONTROVERSY IN NIGERIA
Recently, the Senate ordered the Federal Road Safety Commission (FRSC) to stop the issuance
of new vehicle number plates and drivers’ licenses, a position sequel to a motion by Dahiru Kuta
alleging that the FRSC had abandoned its primary mandate of ensuring safety on Nigerian roads.
It also alleged that by so doing, the commission has turned itself into a revenue generating
agency which it is not. During the debate on the motion, many of the lawmakers described the
new vehicle number plates being issued by the commission as “illegal”. The senators also
alleged that the Act setting up the commission did not empower it to issue vehicle number plates.

11
The floodgate to shoot down the FRSC’s new number plates was opened when the Chairman of
the Rules and Business Committee of the House of Representatives claimed that its investigation
had revealed that a syndicate, whose identity it did not disclose, has flooded the country with
fake vehicle number plates. However, the row over the introduction of the new number plate and
drivers’ license continued as government road safety managers had to face the drilling of law
makers. The gradual phase-out of the old plates number and driver license by Federal Roads
Safety Commission (FRSC) was initially opposed by Nigerians and National Assembly who
raised concern over the recommended cost of obtaining new ones.

But stakeholders in the road sub-sector including Road Transport Employers Association of
Nigeria (RTEAN), Nigeria Bar Association (NBA) and Department of Road Inspection,
popularly called VIO, expressed support for the introduction of the new vehicle plate number
and driver license considering its security strengthening. Price details for the new number plate
as approved by the Joint Tax Board (JTB) including all the state tax boards reveal the following
N3,000 (new price) as against N750 old price for motorcycle; N15,000 ( new price)as against
N2,500 old price; N20,000 (new price) as against N3,000 old price for articulated vehicle.
Furthermore, the new price for Out of Series is put at N40,000 as against N6,000 being the old
price. The price for Fancy is put at N80, 000 as against N18, 000 (old price). Aside this, the new
price for dealers is placed at N30,000 as against N7,500 as well as N15,000 against N5,000 old
price for Government and N40,000 against N10,000 old price for Government Fancy.

2.6 AUTOMATIC NUMBER PLATE RECOGNITION


Automatic number plate recognition (ANPR) is a mass surveillance method that uses optical
character recognition on images to read vehicle registration plates. They can use existing closed-
circuit television or road-rule enforcement cameras, or ones specifically designed for the task.
They are used by various police forces and as a method of electronic toll collection on pay-per-
use roads and cataloging the movements of traffic or individuals. ANPR can be used to store the
images captured by the cameras as well as the text from the license plate, with some configurable
to store a photograph of the driver. Systems commonly use infrared lighting to allow the camera
to take the picture at any time of the day. ANPR technology tends to be region-specific, owing to
plate variation from place to place. Concerns about these systems have centered on privacy fears

12
of government tracking citizens' movements, misidentification, high error rates, and increased
government spending.

2.6.1 ALGORITHMS REQUIRMENT FOR IDENTIFYING A LICENSE PLATE


There are six primary algorithms that the software requires for identifying a license plate:
i. Plate localization – responsible for finding and isolating the plate on the picture.
ii. Plate orientation and sizing – compensates for the skew of the plate and adjusts the
dimensions to the required size.
iii. Normalization – adjusts the brightness and contrast of the image.
iv. Character segmentation – finds the individual characters on the plates.
v. Optical character recognition.
vi. Syntactical/Geometrical analysis – check characters and positions against country-
specific rules.
The complexity of each of these subsections of the program determines the accuracy of the
system. During the third phase (normalization), some systems use edge detection techniques to
increase the picture difference between the letters and the plate backing. A median filter may
also be used to reduce the visual noise on the image.

2.6.2 AUTOMATION AND LAW ENFORCEMENT


Cronkhite (1974) stated that ‘information is the life blood’ of any law enforcement agency. The
accurate and rapid flow of information is essential for effective law enforcement. Without
information, police work would come to a standstill. Without a fast and reliable means of
obtaining and communicating police information, manpower is wasted and police operations are
degraded. As the rate at which vehicle crime increased from 1999 through 2007 (65% increase in
major crimes nationally) so has the amount of information the police have to handle (The Punch
Newspaper, 2007). It has reached such volume in most police agencies that information no
longer can be manually manipulated with any degree of accuracy and efficiency. Automation can
assist law enforcement to be more effective, particularly in relationship to two major problems
areas:
 Reducing crime
 Optimizing police manpower
 Tracking Vehicle Online

13
 Gathering information to locate owners of recovered vehicles.
But, one problem, which seems to plague all of the automation systems, was the length of time it
took to get data into the computer. Northrop (1995) in a study conducted discussing the
effectiveness of police computer use and the problems that exist with this use. It was found in
that study that the respondents in forty-four cities across the United States view computers as a
major force in the fight against crime. This too could be applied in Nigeria if properly
established and managed.
2.6.3 CATERGORY OF VEHICLES AND THEIR COLOR STRIPES
 Private vehicles
 Commercial vehicles
 Government vehicles
 Dealers vehicles
 Special or Customize vehicles

2.7 THE NEED FOR TECHNOLOGIES AND COMMERCIAL SOFTWARE FOR


COLLECTING VEHICLE REGISTRATION DATA
A variety of technologies have been tested and used by many law enforcement agencies in
Nigeria. The technologies used in data collection and processing include a variety of systems
such as optical scanners, Mobile Phones, printers, optical storage disks, portable computers, and
digital cameras. The current computer technologies allow shareholders to pay their
collection/renewal bills at the designated banks or existing offices, electronically transfer the
payment to the state agency account and provide deposit slips for the collection of receipts at the
state agencies. The use of on – line error checks, and subsequently the needs for reentering
Vehicle detailed data are not inevitable. At the beginning, these devices seem to be the best
solution to all the registration problems because it tackles the issues of payment of vehicles
registration dues into the government’s cover.

However, it still has its limitation, as they have not met up with the demands to the masses that
spend endless time anxiously waiting for their demands to be met at the Licensing/Commission
offices. Hence, the full computerization has not been effected as expected while technology and
software programming has advanced in other countries. Shall we continue to wait for the
14
criminals to get away with our stolen vehicles? Shall we keep spending endless time waiting on
queues in which have been divulged are corrupt practices of officials based on personalities?
Shall we spend endless time searching for owners of whose vehicles have been recovered when
software can be developed to tackle such problem like these? The merit of automation is far
reacting more than just saving time and holding down persons cost, automating gives motor
vehicle licensing the means to truly streamline the vehicle registration processes. Automating
manual processing tasks let registration officers eliminate duplicate data entry, move towards a
completely paperless environment and process multi-day function. Emphasizing the use of
technology in vehicle registration. Peter Jacobs K., and Moses Abiola B. (2019), opinion was
that “in developing computerized system which can help motor licensing officers and offices to
automatically register with ease, so that the process becomes an automatic day-to-day operation.
The solution can help motor licensing officers and offices to:
 Improve registration: By automating the manual based process, error caused by manual
interventions can be reduced and electronic process support enables faster processing
time.
 Meet regulatory demands: Archive, email and documentation so that it is easily
accessible, usable and quickly retrievable for legal demands.
 Reduce costs: By reducing the administrative burden of paper management and error
prone and repetitive data entry.
For a computerized system to work efficiently and effectively, a strong and reliable database is
needed. According to Microsoft encyclopedia, database is;
i. A structured format for organizing and maintaining information that can be easily
retrieved. A simple example of a database or a spreadsheet.
ii. Data stored in a computer in such a way that the computer can easily retrieve and
manipulate the data.
iii. A collecting of records describing information resources usually computerized.

According to Ahmed Suleiman T. (1991), “there are many reason for vehicle registration, take
for instance, if you just bought a vehicle and completed all the registration requirement and you
are given your vehicle license, then on your way back from the village, you were attacked at gun
point and the vehicle snatched from you, you reported to the nearest police station and if you are

15
lucky, your vehicle will be found”. It would be difficult for you to get your vehicle within a short
period because of the existing manual system.

According to Balogun, Segun A. (2006), sates in his Road Safety Practice in Nigeria that “the
method of vehicle and plate number registration and identification has caused a lot of people
pains, a pregnant woman die on the queue in her quest for vehicle registration.”

According to Dr. Ikechukwu David N. (1995), states that “our vehicle registration offices today
are faced with potential rise and inefficiencies associated with manual i.e. paper based processes
which are costly, prone to error and require mental and manual labor. Heightened regulation in
the country is also placing these vehicle owners under pressure to meet litigation needs”.
According to Oyeyemi, Biodun O. (2003), states in his stand in his Stand in Road Traffic
Administration states “the level of tediousness the manual system of vehicle registration is so
alarming that requires a new modified method that will be easy and simple.”

According to (Bishop, A., 2003), vehicle crime accounts for a quarter of all recorded crime; it
costs over £3 billion a year and causes immense distress and inconvenience to its victims to track
their records. That is why there is need to setup a national target of reducing vehicle crime by
30% over the next five years in Nigeria.

According to Dr. Marcellina Hembadoon A. (2006), “the vehicle plate number is very important
because it is an identification mark that distinguishes vehicle from each other. It shows the
country a vehicle belongs”.

16
CHAPTER THREE
DESIGN METHODOLOGY
3.1 INTRODUCTION

In the present-day scenario, there is a rise in the number of vehicle thefts exponentially.
Criminals are becoming smarter day by day and have reached the stage of applications present
against the existing vehicle safety system. Vehicle theft has become a major issue that should be
traced and prevented. The proposed system overcomes most of the limitations and cost-
effectiveness. There is a need for one to design a system by showing what the system entails, and
identifying and defining the various components of the system before the actual implementation.
The whole aim is to determine how the information can be built. This gives the designer the
chance of making a choice of the way the problem can best be solved.

3.2 RESEARCH METHODOLOGY

Robinson et al, 1970 define system analysis as the methodological study of a system, its current
and the future required objectives and procedures in order to inform a basis for the system and
the design. Jerry, 1989 also define system analysis as the process of analyzing system with the
potential goals of improving and modifying it. In other words, system analysis is the detailed
look at the current system and what a new system will be required to do; system analysis always
leads to system design which is the development of new system that will meet the future
requirements. The basic tool of system analysis is the ability is to prove, enquire, observe more
and reconciles all what happens in any situation. With this alone, the information gathered is
analyzed to identify the components of the system, creating a structure from which the essential
requirements can most efficiently be met.

3.3 METHODS OF DATA COLLECTION

17
The data used in the study were collected from two sources of data collection, the primary and
secondary source.

 Primary Source: This involves oral interviews conducted with various personnel in the
licensing office Enugu state, the licensing office and the Board of Internal Revenue in
reviewing and sharing their experience about the difficulties they undergo in using the
manual system in vehicle and plate number registration issuance and allocation.

 Secondary Source: These include the use of textbooks, dictionary, journals newspaper
and Internet downloads to collect data in order to understand what the vehicle and plate
number registration and identification is all about.

3.4 TOOLS TO USE


The tools use for developing Integrated Computer Based Test includes:

XAMP server, VSO, MySQL, Java Programming Language and JavaFX will be utilized to
implement the project.

VSO: is an integrated development environment (IDE) for WEB development or any


programming language. Visual Studio allows applications to be developed from a set of modular
software components called modules.

Xampp: it is an open source web server with all the tools and language support built-in to it. It is
ready to use and makes it easier for developers to take their code and host it locally and test the
same.

18
3.5 USE CASE DIAGRAM

19
Fig. 2: System flow chart

3.6 SYSTEM FLOW CHART

Fig. 3: System flow chart

20
3.7 SYSTEM ARCHIITECTURE

Fig. 4: System Archiitecture

21
CHAPTER FOUR

SYSTEM IMPLEMENTATION AND EVALUATION

4.1 SYSTEM IMPLEMENTATION

This chapter covers the processes involved in the design and implementation of the new system.
Also, it contains the system flowchart, choice and reason for choosing the preferred
programming language and steps of efficient maintenance to ensure adequate functionality of the
system.

4.2 SYSTEM REQUIREMENTS

A requirement states what a product or service is intended to perform. It takes into consideration
the attributes and characteristics that a system is expected to possess so as to meet the need of a
user. The web based car theft system is developed to digitize all manual activities carried out
during car registration and monitor theft activities during registeration . These activities may be
independent or inter-related for the user groups.

4.2.1 HARDWARE REQUIREMENT

 Processor Speed: Pentium III-class processor, 600 MHz processor


 Recommended: 1 GHz processor
 RAM: 192 MB or onwards Recommended.
 Hard Disk Space: 45 MB of available space required on system drive of available or
more.
 Enhanced / Virtual keyboard.
 Mouse.
 Uninterrupted Power Supply (UPS) Unit.
 Working Internet Connection.

22
4.2.2 SOFTWARE REQUIREMENT

The software requirements for this application include:

 Operating System (Windows 7,8,10, MAC OS, Linux, Mobile OS)


 Web browser (Mozilla Firefox 24 /Opera 20.0 onwards or any browser that supports
HTML 5)
 Software (MySQL v5.1, PHP, Apache server or Wamp server)

4.3 CHOICE OF PROGRAMMING LANGUAGE

There are various languages used for the implementation of the website, these languages includes
the following;
PHP: PHP stands for Hypertext Pre-processor. Taken directly from PHP's home, PHP.net, "PHP
is an HTML-embedded scripting language. Much of its syntax is borrowed from C, Java and Perl
with a couple of unique PHP-specific features thrown in. The goal of the language is to allow
web developers to write dynamically generated pages quickly" this is generally a good definition
of PHP. When someone visits your PHP webpage, your web server processes the PHP code. It
then sees which parts it needs to show to visitors (content and pictures) and hides the other stuff
(file operations, math calculations, etc.) then translates your PHP into HTML. After the
translation into HTML, it sends the webpage to your visitor's web browser.

CSS: This means Cascading Style Sheet. The layout of the document is taken care of by the CSS
with the use of formatting tags, without the use of style sheets, the designing of a page
would became more and more difficult to create as HTML documents was clearly separated
from the document's presentation layout. Styles were created by the World Wide Web
Consortium (W3C) a non-profit, standard setting consortium responsible for standardizing
HTML in addition to HTML4.0. Cascading Style Sheet is supported on Netscape, Internet
Explorer, Firefox and other web browsers.
Java Script: JavaScript is used in millions of Web pages to improve the design, validate forms,
and much more. JavaScript was developed by Netscape and is the most popular scripting
language on the internet. JavaScript works in all major browsers that are version 3.0 or higher.

23
4.4 TESTING

After implementation and sometimes during design, the application must be subjected to testing
verities which are:

4.4.1 Alpha Test: I test the designed application for any syntax bugs or exceptions. This test is
done by the programmers during the design completion.

4.4.2 Beta Test: I released to the knowledge workers used as a case study for testing to see the
suitability of system usage.

4.5 IMPLEMENTATION SCREENSHOTS

4.5.1 USER REGISTRATION INTERFACE

This interface shows the user personal information and car details during registration

24
Fig. 5: User Registration Interface

4.5.2 EMAIL NOTIFICATION

25
Fig. 6: Email Notification

4.5.2 REGISTERED CAR INTERFACE

This interface shows the registered car at the admin dashboard

26
Fig. 7: Registered car interface

4.5.3 CAR DETAILS

27
This interface shows the car details which includes engine number, plate number, tracking id and
model number

Fig. 8: Car Details

4.5.4 USER REPORTING CAR INTERFACE

28
This interface shows when the user has to report the car if it was stolen or missing

Fig. 9: User Reporting Car Interface

4.5.5 REPORTED CAR INTERFACE

29
This interface shows the information about a stolen or missing car that was reported by the
previous user

Fig. 10: Reported Car Interface

4.5.6 ADMIN LOGIN PAGE


This interface allows admin to login into the system using the correct details.

30
Fig. 11: Admin Login Page

4.5.7 ADMIN DASHBOARD


This interface allows admin to monitor every details and information or report that was
submitted by the users

Fig. 12: Admin Dashboard

CHAPTER FIVE

31
SUMMARY, CONCLUSION AND RECOMMENDATION

5.1 SUMMARY

Stolen vehicle has been one of the issues in Nigeria till date and user has find it difficults
recovering there vehicle. Vehicle registration and theft detection used to involve manual
recording of vehicles information, which ranges from cars to buses and later to truck and heavy
duty equipment. Vehicle registration in Nigeria began over 100 years ago and the records have
been essentially manual which in turn is not helped to raise the efficiency of general automotive
services in recent years. The design system will help user to recover there stolen vehicle. The
vehicle registration system is a must for any user in the country that wants to be information and
communication technology inclined and ready to reduce the vehicle crime rate and corruption in
her system.

5.2 CONCLUSION

The understanding of the problems that very peculiar to stolen vehicle and registration system
was opened up also in the chapter one and three of this project these problems includes
ineffective, time consuming, tedious, in accurate, inconsistent etc. which vary from operating
system compatibility to machine dependencies. However big a software project is, these
problems and more are what they face and the bigger the software are project the more probable
it is that they face these problems. When the first computer was designed, the development of all
that came after the first computer is founded on the concept of the very first and now it has gone
from development of just computers to the development of software as this project is done so far.
Vehicle Registration in Nigeria began over 100 years ago and the records have been essentially
manual which in turn has not help to raise the efficiency of general automotive services in recent
years. This is only focused on vehicle registration and inspection, and vehicle tracking, learner’s
and crime report.

32
5.3 RECOMMENDATION
If one thing must be researched in the Computerization of vehicle registration and theft detecting
system with the mind of perfecting it and making it more useful in the real sense of things, it is
the security of information handling software. The security of vehicle registration system is very
crucial considering the prevention of vehicle crime and similar vices so it is worth further
researching. Therefore, I Recommend that motor licensing office Abuja should set up a computer
based system.

33
REFERENCES

Adeniji, K. (1993), Transport subsidies in Nigeria: A Synopsis of Workshop Proceedings,


NISER, Ibadan and Friedrich Ebert Foundation, Germany.

Adesanya, S. (1996), “Public transport operation in Nigeria”.

Agbola. T. and Agbola. E.O. (1997), “The Development of Urban and Regional
Planning Legislations and their impact on the Morphology of
Nigerian Cities”. The Nigerian Journal of Economic
and Social Studies, Vol. 39, No. 1, p. 123-144.

Agbola, T. (1989), “Perspective planning: the urban and regional planning dimensions”
The Nigerian Journal of Economic and Social Studies Vol. 31.

Ahmed, S.T. (1991), “Essentials of Vehicle Registration in Nigeria”. Ibadan: University Press
Plc.

Ikechukwu, D.N. (1995). Nigeria and Traffic Regulations. Ibadan: Africana FEB publishers Ltd.

Jerry, N.A (2000). Benefits and Barriers: People with Disabilities and the National
information infrastructure. Boston: Little, Brown and Company.

Jing Xu,TaoLu,LinglingGao, “ Design and Application of In-VehicleTerminal for Car


Netwotk System Based on ARM9”,IEEE InternationalWorkshop
on Education Technology and Training,2008,p.324-327.

Punitha K, S Arun Kumar and n Vijay Ganesh, “ Control Area neyworkfor Reliable
Car Communication”, I Proc. International Journal ofComputer
Application(ICVCI),34-38,2011.

Robert Bosch Gmbh Controller Area Network (CAN). Avaliable: http://www .


semiconductor .bosch/en/20/can/indexx/asp

“Real Time Web based Vehicle Tracking using GPS”, World Academyof Science,
Engineering and Technology 2010 Ph.D. Associate ProfessorCollege of
Computer and Information Sciences Prince Sultan University.

34
Montaser N. Ramadan, Mohammad A. Al-Khedher, Sharaf A. Al-Kheder, (2012)“Intelligent
Anti-
Theft and Tracking System for Automobiles”.

Karan Siyal and G. Gugapriya,” (2016) Anti-Theft Vehicle Locking System using CAN”.

Nagaraja B.G., Ravi Rayappa, M. Mahesh, (2017) Chandrasekhar M. Patil, Dr. T.C. Manjunath,
“Design & Development of a GSM Based Vehicle Theft Control System”.

Liu Anqi Zhang, Shaojun Li, (2013) “Vehicle anti-theft tracking system based on Internet of
things,” Vehicular Electronics and Safety.

Zhao J. and G. Cao, (2006) “VADD: Vehicle-Assisted Data Delivery in Vehicular Ad


Hoc Networks,” IEEE INFOCOM.

Le-Tien and Thuong, (2010) “Routing and tracking system for mobile vehicles in large area”,
Electronic Design, Test and Application.

35
APPENDIX I
PROGRAM SOURCE CODE
Database connection to the application

package rps;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.Vector;
import javax.swing.JOptionPane;

public class Conn


{
public Connection getconnection()
{
Connection cn = null;
try
{
Class.forName("com.mysql.jdbc.Driver") ;
cn = DriverManager.getConnection("jdbc:mysql://localhost:3306/rps?user=root&password=");
}
catch(Exception ex)
{
System.out.println("Error in db connect");
}
return cn;
}

public Vector getTableData(String query, int nCols)


{
Vector<Vector<String>> data = new Vector<Vector<String>>();

try{
Connection c = getconnection();
stmt = c.createStatement();
rs=stmt.executeQuery(query);

while (rs.next())
{
Vector<String> rowData = new Vector<String>();

for(int i=0;i<nCols;i++)
rowData.add(rs.getString(i+1));

36
data.add(rowData);
}

}
catch(Exception ex){ System.out.println("error in procedure getTableData --> "+ex.toString()); }

return data;
}
public boolean executeCommand(String task,String s)
{ boolean flag = false;

try{
Conn conn = new Conn();
Connection c = conn.getconnection();
stmt = c.createStatement();
if(task.equals("select"))
{
rs=stmt.executeQuery(s);
if (rs.next())
flag = true;
}
else
{
stmt.executeUpdate(s);
flag = true;
}

}
catch(Exception excp)
{ JOptionPane.showMessageDialog(null,"Not Stored Successfully! --
>"+excp,"Error",JOptionPane.ERROR_MESSAGE); }
return flag;
}

public String getData(String query,String column_name)


{
String result="";

try{
Conn conn = new Conn();
Connection c = conn.getconnection();
stmt = c.createStatement();
rs=stmt.executeQuery(query);

if (rs.next())
result = rs.getString(column_name);

}
catch(Exception ex){ System.out.println("error in procedure getData --> "+ex.toString()); }

37
return result;
}

public boolean exists(String query,String column_name)


{
boolean res=false;
String data = getData(query,column_name);
if(!data.equals(""))
res = true;

return res;
}

//Method for selecting from a single column in a table


public ArrayList<String> getAllSingleColumnData(String instr,String column_name)
{
ArrayList<String> arl = new ArrayList<String>();

try{
Conn conn = new Conn();
Connection c = conn.getconnection();
stmt = c.createStatement();
rs = stmt.executeQuery(instr);

while(rs.next())
{
arl.add(rs.getString(column_name));
}

stmt.close();
c.close();
}
catch(Exception excp)
{ JOptionPane.showMessageDialog(null, ""+excp.toString()); }

return arl;
}

//Method for selecting from multiple columns in a table


public ArrayList<ArrayList<String>> getAllMultipleColumnData(String instr,String[] column_names)
{
ArrayList<ArrayList<String>> aarl = new ArrayList<ArrayList<String>>();

try{
Conn conn = new Conn();
Connection c = conn.getconnection();
stmt = c.createStatement();

38
for(int i=0; i<column_names.length;i++)
{ArrayList<String> arl = new ArrayList<String>();
rs = stmt.executeQuery(instr);
while(rs.next())
{
arl.add(rs.getString(column_names[i]).trim());
}
aarl.add(arl);
}

stmt.close();
c.close();
}
catch(Exception excp)
{ }

return aarl;
}

private Statement stmt;


private ResultSet rs;
}

Course information registration

import java.util.ArrayList;
import javax.swing.ButtonGroup;
import javax.swing.JOptionPane;
/
public class CourseF extends javax.swing.JInternalFrame {

boolean register = true, edit = false;


UT ut = new UT();
Conn cn = new Conn();
String course_id="";

/** Creates new form CourseF */


public CourseF() {
initComponents();
String query = "select code from departments";
ArrayList<String> depts = cn.getAllSingleColumnData(query,"code");

try{
for(int i=0;i<depts.size();i++)
{
dresC.addItem(depts.get(i));
}
}catch(Exception Ex)

39
{JOptionPane.showMessageDialog(this, "could not get department residents", "Error",
JOptionPane.ERROR_MESSAGE);}

public void clearAll()


{
codeF.setText(null);
codeF2.setText(null);
titleA.setText(null);
unitC.setSelectedIndex(-1);
levelC.setSelectedIndex(-1);
semesterC.setSelectedIndex(-1);
typeC.setSelectedIndex(-1);
dresC.setSelectedIndex(-1);
}

public ArrayList<String> getDepartments(String college)


{
ArrayList<String> depts=null;
String q = "select code from departments where college_code = '"+college+"'";
depts = cn.getAllSingleColumnData(q, "code");

return depts;
}

private void saveBActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
ArrayList<String> arl = new ArrayList<String>();
boolean stored = false;
String code = codeF.getText();
String Title = titleA.getText();
String Unit = unitC.getSelectedItem().toString();
String type = typeC.getSelectedItem().toString();
String dres = dresC.getSelectedItem().toString();
String level = levelC.getSelectedItem().toString();
String semester = semesterC.getSelectedItem().toString();

if(!cn.exists("select id from courses where code = '"+code+"'", "id"))


{
arl.add(code); arl.add(Unit); arl.add(dres); arl.add(semester);
arl.add(Title); arl.add(type); arl.add(level);

int n = ut.emptyFields(arl);

if (n>0)
{
String f = n==1?"field":"fields";
JOptionPane.showMessageDialog(this,n+" required "+f+" empty!","Error",
JOptionPane.ERROR_MESSAGE);
}
else

40
{
code = code.toUpperCase();

String command = "insert into courses(code,title,unit,level,semester,type,dept_res) "


+
"values('"+code+"','"+Title+"','"+Unit+"','"+level+"','"+semester+"','"+type+"','"+dres+"')";

stored = cn.executeCommand("insert", command);

if(stored)
{
clearAll();
JOptionPane.showMessageDialog(this,"Course Registered!", "Success",
JOptionPane.INFORMATION_MESSAGE);
}
else
JOptionPane.showMessageDialog(this,"Could not register Course!", "Error",
JOptionPane.ERROR_MESSAGE);
}

}
else
{
JOptionPane.showMessageDialog(this,"A Course with that code already exits", "Error",
JOptionPane.ERROR_MESSAGE);
}

private void clearBActionPerformed(java.awt.event.ActionEvent evt) {

clearAll();
}

private void goBActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
String code2 = codeF2.getText();

boolean exists = cn.exists("select id from courses where code='"+code2+"'", "id");

if(exists)
{
int resp= JOptionPane.showConfirmDialog(this, "Are you sure you want to delete "+code2+" ?",
"Confirm Delete",JOptionPane.YES_NO_OPTION);

if(resp==0)
{
String query = "delete from courses where code='"+code2+"'";
boolean deleted = cn.executeCommand("delete", query);

if(deleted)

41
{
JOptionPane.showMessageDialog(this, "Course Deleted!", "Success",
JOptionPane.INFORMATION_MESSAGE);
}
else
{
JOptionPane.showMessageDialog(this, "Was unable to delete Course!", "Error",
JOptionPane.ERROR_MESSAGE);
}
}
}
else
{
JOptionPane.showMessageDialog(this, "Course with the specified Code does not exist!", "Error",
JOptionPane.ERROR_MESSAGE);
}

Student information registration

import java.io.File;
import java.util.ArrayList;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import javax.swing.JFileChooser;
import org.apache.commons.io.FileUtils;

public class StudentFr extends javax.swing.JInternalFrame {

JFileChooser flch = new JFileChooser("Upload Picture");


String directory=null;
Conn cn = new Conn();
UT ut = new UT();

/** Creates new form StudentFr */


public StudentFr() {
initComponents();
try{
ArrayList<String> colleges= cn.getAllSingleColumnData("select code from colleges", "code");

for(int i=0; i<colleges.size();i++)


{
collegeC.addItem((Object) colleges.get(i));
}

}catch(Exception ex) { System.out.println("Cannot retreive college infos -->"+ex.toString()); }


}

private void collegeCItemStateChanged(java.awt.event.ItemEvent evt) {

42
// TODO add your handling code here:
String college = collegeC.getSelectedItem()==null?"":collegeC.getSelectedItem().toString();

if(!college.equals(""))
{
try {

String query = "select code from departments where college_code = '"+college+"'";


ArrayList<String> depts = cn.getAllSingleColumnData(query, "code");

if(departmentC.getItemCount()>0)
departmentC.removeAllItems();

if(programmeC.getItemCount()>0)
programmeC.removeAllItems();

for(int i=0; i<depts.size();i++)


{
departmentC.addItem(depts.get(i));
}

}catch(Exception ex) { System.out.println("Cannot retreive department infos -->"+ex.toString());


ex.printStackTrace();}
}
}

private void departmentCItemStateChanged(java.awt.event.ItemEvent evt) {


// TODO add your handling code here
String department =
departmentC.getSelectedItem()==null?"":departmentC.getSelectedItem().toString();

if(!department.equals(""))
{
try {

String query = "select title from programmes where department_code = '"+department+"'";


ArrayList<String> progs = cn.getAllSingleColumnData(query, "title");

if(programmeC.getItemCount()>0)
programmeC.removeAllItems();

for(int i=0; i<progs.size();i++) {


programmeC.addItem((Object) progs.get(i));
}
}catch(Exception ex) { System.out.println("Cannot retreive department infos -->"+ex.toString()); }
}
}

private void goBActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:

43
String matno2 = matnoF2.getText();

boolean exists = cn.exists("select sname from student_biodata where matric_no='"+matno2+"'",


"sname");

if(exists)
{
int resp= JOptionPane.showConfirmDialog(this, "Are you sure you want to delete "+matno2+" ?",
"Confirm Delete",JOptionPane.YES_NO_OPTION);

if(resp==0)
{
String query= "select pix from student_biodata where matric_no = '"+matno2+"'";
String address = cn.getData(query,"pix");

query = "delete from student_biodata where matric_no='"+matno2+"'";


boolean deleted = cn.executeCommand("delete", query);

System.out.println("Add = "+address);
File f = new File(address);
boolean deleted2 = false;
try
{ f.delete(); deleted2= true; }
catch(Exception ex){ deleted2= false;}

if(deleted && deleted2)


{
JOptionPane.showMessageDialog(this, "Student Deleted!", "Success",
JOptionPane.INFORMATION_MESSAGE);
}
else
{
JOptionPane.showMessageDialog(this, "Was unable to delete Student!", "Error",
JOptionPane.ERROR_MESSAGE);
}
}
}
else
{
JOptionPane.showMessageDialog(this, "Student with the specified Matric Number does not
exist!", "Error", JOptionPane.ERROR_MESSAGE);
}
}

private void registerBActionPerformed(java.awt.event.ActionEvent evt) {

ArrayList<String> fields = new ArrayList<String>();


String title = titleC.getSelectedItem()==null?"": titleC.getSelectedItem().toString();
String sname = snameF.getText();
String oname = onameF.getText();
String in_camp_add = in_camp_addF.getText();

44
String out_camp_add = out_camp_addF.getText();
String sponsor = sponsorF.getText();
String sponsor_add = sponsor_addF.getText();
String college = collegeC.getSelectedItem()==null?"": collegeC.getSelectedItem().toString();
String department = departmentC.getSelectedItem()==null?"":
departmentC.getSelectedItem().toString();;
String programme = programmeC.getSelectedItem()==null?"":
programmeC.getSelectedItem().toString();;
String matno = matnoF.getText();
String ses_ad = ses_adF.getText();
String sem_ad = sem_adC.getSelectedItem()==null?"": sem_adC.getSelectedItem().toString();
String mode_of_entry = mode_of_entryC.getSelectedItem()==null?"":
mode_of_entryC.getSelectedItem().toString();
String level = entryC.getSelectedItem().toString();
String gender = genderC.getSelectedItem().toString();

fields.add(title); fields.add(sname); fields.add(oname);


fields.add(college); fields.add(department); fields.add(programme);
fields.add(matno); fields.add(level);

int n = ut.emptyFields(fields);

if(n>0)
{
JOptionPane.showMessageDialog(this, n+" required field(s) not answered!", "Error",
JOptionPane.ERROR_MESSAGE);
}
else
{
if(cn.exists("select sname from student_biodata where matric_no = '"+matno+"'", "sname"))
{
JOptionPane.showMessageDialog(this, "Student with the specified matric number already
exists!", "Error", JOptionPane.ERROR_MESSAGE);
}
else
{boolean img_stored = false;
directory = directory==null?"":directory;

String dest ="";


if(!directory.equals(""))
{
File f = new File(directory);

dest ="images/"+f.getName();

File f2 = new File(dest);

45
if(f2.exists())
{ JOptionPane.showMessageDialog(this,"Picture with the file name already exists!","Image Upload
Error",JOptionPane.ERROR_MESSAGE);
}
else
img_stored = storeImage(f,f2,dest);
}
System.out.println("Image stored = "+img_stored);

if(img_stored)
{
directory = dest;

matno = matno.toUpperCase();
boolean inserted = false;
String query =
"insert into
student_biodata(pix,title,sname,oname,in_camp_address,out_camp_address,"
+ "name_of_sponsor,address_of_sponsor,college,department,programme,matric_no,"
+ "ses_of_ad,sem_of_ad,mode_of_entry,level,gender) "
+ "values('"+directory+"','"+title+"','"+sname+"','"+oname+"','"+in_camp_add+
"','"+out_camp_add+"','"+sponsor+"','"+sponsor_add+"','"+college+
"','"+department+"','"+programme+"','"+matno+"','"+ses_ad+"','"+sem_ad+"',"
+ "'"+mode_of_entry+"','"+level+"','"+gender+"')";

try
{
inserted = cn.executeCommand("insert", query);
}
catch(Exception ex)
{ JOptionPane.showMessageDialog(this,"Could not register Student!", "Error",
JOptionPane.ERROR_MESSAGE);}

if(inserted)
{
JOptionPane.showMessageDialog(this, "Student Registered!", "Success",
JOptionPane.INFORMATION_MESSAGE);
clear();
}
}
else
{ directory = directory==null?"":directory;
if(directory.equals(""))
{
JOptionPane.showMessageDialog(this, "Picture not Uploaded", "Error",
JOptionPane.ERROR_MESSAGE);
}
}

}
}

46
}

private void uploadBActionPerformed(java.awt.event.ActionEvent evt) {

int resp = flch.showDialog(this, "Upload");


if(resp == JFileChooser.APPROVE_OPTION)
{

directory = flch.getSelectedFile().getPath();

if(directory.toLowerCase().contains("gif")||directory.toLowerCase().contains("jpg"))
{
pixL.setIcon(thumbnail.Sized(new ImageIcon(directory).getImage(), 152, 152));
JOptionPane.showMessageDialog(this, directory, "info",
JOptionPane.INFORMATION_MESSAGE);
}
else
{
JOptionPane.showMessageDialog(this, "Document format not recognised", "Error",
JOptionPane.ERROR_MESSAGE);
}
}
else
directory=null;
}

public void clear()


{
titleC.setSelectedIndex(-1);
snameF.setText("");
onameF.setText("");
in_camp_addF.setText("");
out_camp_addF.setText("");
sponsorF.setText("");
sponsor_addF.setText("");
collegeC.setSelectedIndex(-1);
programmeC.setSelectedIndex(-1);
departmentC.setSelectedIndex(-1);
matnoF.setText("");
ses_adF.setText("");
sem_adC.setSelectedIndex(0);
mode_of_entryC.setSelectedIndex(0);
entryC.setSelectedIndex(0);
genderC.setSelectedIndex(0);
}
private void clearBActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
clear();
}

47
private boolean storeImage(File f,File f2,String dest)
{boolean stored = false, error=false;

try
{
System.out.println("No error");
FileUtils.copyFile(f, f2);
stored = true;

if(stored)
directory = dest;

}
catch(Exception ex)
{ /*JOptionPane.showMessageDialog(this, ex.toString(), "Error", JOptionPane.ERROR_MESSAGE);
ex.printStackTrace(); */}
return stored;
}

Score input

import java.awt.Color;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Vector;
import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

public class ScoreInputFrame extends javax.swing.JInternalFrame {


String code="";
Conn cn = new Conn();
DefaultListModel l = new DefaultListModel();
ArrayList<String> list = new ArrayList<String>();

/** Creates new form ScoreInputFrame */


ArrayList<String> title = cn.getAllSingleColumnData("select title from courses order by code",
"title");
HashMap<String,Integer> scoreMap = new HashMap<String,Integer>();
public ScoreInputFrame() {
String [] cols = {"matric_no"};
String query = "select matric_no from course_reg where course_code = '"+code+"'";
initComponents();

l = (DefaultListModel) studentsLI.getModel();
try{
ArrayList<String> colleges= cn.getAllSingleColumnData("select code from courses order by code",
"code");

48
for(int i=0; i<colleges.size();i++)
{
codeC.addItem((Object) colleges.get(i));
}

}catch(Exception ex) { System.out.println("Cannot retreive code infos -->"+ex.toString()); }


}

public ArrayList<ArrayList<String>> getCourses()


{
String[] cols= {"id","code","title","level","semester"};
String query = "select id,code,title,level,semester from courses order by code";
ArrayList<ArrayList<String>> courses = cn.getAllMultipleColumnData(query, cols);
return courses;
}

public ArrayList<String> getRegisteredStudents(String course_code)


{
String query = "select matric_no from course_reg where course_code = '"+course_code+"'";
ArrayList<String> students = cn.getAllSingleColumnData(query, course_code);
return students;
}

public boolean scoreIsValid(String score)


{ int n = 0;
try{
n = Integer.parseInt(score);
}catch(Exception ex)
{ return false; }

if(n>100 || n<0)
return false;

return true;
}

public String getGrade(int score)


{
String grade="";
if(score>100 || score <0)
return grade;

if(score>=70)
grade = "A";

49

You might also like