Crime Reporting Book
Crime Reporting Book
August 2019
DEDICATION
This proposal is dedicated to our supervisor Abdullahi Omar Abdullahi for his patience and good
i
ABSTRACT
The project titled as “Online Crime Reporting Information System” is a web based application. This
software provides facility for reporting online crimes, complaints, missing persons, show criminal details.
This software is developed with scalability in mind. Additional modules can be easily added when
necessary. The software is developed with modular approach. All modules in the system have been tested
with valid data and invalid data and everything work successfully. Thus the system has fulfilled all the
objectives identified and is able to replace the existing system. The project has been completed
successfully with the maximum satisfaction of the organization. The constraints are met and overcome
successfully. The system is designed as like it was decided in the design phase. The project gives good
idea on developing a full-fledged application satisfying the user requirements. This software has a user-
friendly screen that enables the user to use without any inconvenience. Validation checks induced have
greatly reduced errors. Provisions have been made to upgrade the software. The application has been
tested with live data and has provided a successful result. Hence the software has proved to work
efficiently.
ii
ACKNOWLEDGEMENT
First and foremost we thanks the almighty for the good health and the strength and his blessings
for our research. Secondly we would like to express our sincere graditude to our supervisor Eng
Abdullahi Omar Abdullahi for his patience, motivation and the enthusiasm and the immense and
knowladge. We could not really imagined to having a better advisor and mentor for our batchelor
study. We would also like to knowladge our friends who supported us during this difficult time,
Eng Abdi Hamed, Eng Abdi Salan Yusuf Jarane, Eng Taakow.
We would also like to aknowladge Uncle Abdi Wiish Warsame Karie for helping us to meet with
police officers in Mogadishu Somalia, during the tough times that we have been doing the research.
We will be failing in duty if we do not acknowledge with grateful thanks to the authors of the
We express our thanks to all the Professors and all staff members and friends for all the help
And co-ordination extended in bringing out this project report successfully in time.
We will be failing in duty if we do not acknowledge with grateful thanks to the authors of
Finally we would like to acknowladge our mothers namely Luul Mataan Dhiblawe,Nadifo Salaad
Dishe,Maryan Elmi Jimale,Dahabo Farah Hashi for their enabless prayers and support during the
iii
Table of Contents
Chapter I Introduction ................................................................................................................ 1
1.1 Introduction ........................................................................................................................ 1
1.2 Background Of The Study .................................................................................................. 2
1.3 Problem Statement ............................................................................................................ 4
1.4 Research Objectives ....................................................................................................... 4
1.4.1 General Objective ............................................................................................................ 4
1.4.2 Specific Objective............................................................................................................ 5
1.5 Research Questions.......................................................................................................... 5
1.6 Scope Of The Study.......................................................................................................... 5
1.7 Significant Of The Study .................................................................................................. 5
1.8 Organization of the Study ................................................................................................ 6
Chapter II Literature Review ........................................................................................................ 7
2.1 Introduction ........................................................................................................................ 7
2.2 History of Crime Reporting ................................................................................................ 9
2.3 Relationship between Police and Crime ......................................................................... 12
2.4 Crime Management .......................................................................................................... 14
2.5 Crime Reporting ............................................................................................................... 14
2.6 Reporting Methods ........................................................................................................... 15
2.7 Types of Crime ................................................................................................................. 17
2.8 Advantages of Crime Reporting System ........................................................................ 18
2.9 Disadvantages of Crime Reporting System ...................................................................... 19
2.10 Existing Crime Information System ............................................................................... 20
Chapter Summary ....................................................................................................................... 24
Chapter III Methodology .......................................................................................................... 25
3.1 Introduction ...................................................................................................................... 25
3.2 Methodology..................................................................................................................... 26
3.3 System Description ........................................................................................................... 27
3.4 System Development Environment ................................................................................ 28
3.4.1 Front End Tool: ................................................................................................... 28
3.5 Why Did You Choose That Specific Environment? ........................................................ 30
3.6 System Features ................................................................................................................ 30
iv
3.7 Development Methodology Requirements ....................................................................... 31
3.8 Hardware Requirement ..................................................................................................... 31
3.9 Software Requirement ...................................................................................................... 32
Chapter Summary ....................................................................................................................... 33
Chapter IV System Analysis and Design .................................................................................. 34
4.1 Introduction ...................................................................................................................... 34
4.2 Current System ................................................................................................................. 35
4.2.1 Drawbacks of Current System ................................................................................... 35
4.3 System Requirements ....................................................................................................... 36
4.3.1 User Requirements .................................................................................................... 36
4.3.2 User Characteristics ....................................................................................................... 37
4.4 Administrator Requirements............................................................................................. 37
4.4.1 Admin Characteristics ................................................................................................... 37
4.5 Functional Requirements .................................................................................................. 38
4.6 Non- Functional Requirements ......................................................................................... 39
4.7 System Design .................................................................................................................. 40
4.7.1 Logical System Design .............................................................................................. 40
4.7.2 Use case Diagram ...................................................................................................... 40
4.7.3 Activity Diagram ....................................................................................................... 41
4.8 Database Design ............................................................................................................... 45
4.8.1 Entity Relationship Diagram ..................................................................................... 47
4.9 Database Tables ................................................................................................................ 50
Chapter Summary ................................................................................................................... 54
Chapter V System Implementation .......................................................................................... 55
5.1 Introduction ...................................................................................................................... 55
5.2 Coding .............................................................................................................................. 55
5.3 Testing the System............................................................................................................ 56
5.4 Documenting the System .................................................................................................. 57
5.5 Overview of Implementation Environment ...................................................................... 57
5.6 Snapshots of the Forms..................................................................................................... 58
Chapter Summary ................................................................................................................... 74
Chapter VI Conclusion and Recommendation ......................................................................... 75
6.1 Introduction ...................................................................................................................... 75
6.2 Conclusion ........................................................................................................................ 75
v
6.3 Achievement of the Project Objective .............................................................................. 75
Strengths ................................................................................................................................. 76
weaknesses.............................................................................................................................. 76
6.3.1 Accomplishment of the Objectives............................................................................ 76
Chapter Summary ................................................................................................................... 79
References .............................................................................................................................. 80
Appendix A: Police_Station.php ............................................................................................ 85
Appendix B: Insert.php........................................................................................................... 88
Appendix C:UpdatePstation.php ............................................................................................ 89
Appendix D: DeletePstation.php ............................................................................................ 89
Appedndix E: police _station_Table.php ............................................................................... 89
Appendix F: cases.php ............................................................................................................ 95
Appendix G: insert.php........................................................................................................... 98
Apendex H: updateCases.php ................................................................................................. 99
Appedix I: deletecases.php ..................................................................................................... 99
Appedix J: cases_table.php..................................................................................................... 99
Appendix K: crime_registration.php .................................................................................... 102
Appendix L: insert_crime.php .............................................................................................. 106
Appendix M: updateCrimes.php........................................................................................... 106
Appendix N: deletecrimes.php ............................................................................................. 107
Apendix O: crimeregistration_table.php .............................................................................. 107
Appendix P: users.php .......................................................................................................... 114
Appendix Q: insert_wanted.php ........................................................................................... 117
Appendix R: updatewanted.php ........................................................................................... 117
Appendix S: deletewanted.php ............................................................................................. 118
Appebdix T: wanted_table.php............................................................................................. 118
Appendix U: missing_person.php ........................................................................................ 125
Appendix V: insert_missing.php .......................................................................................... 128
Appendix W: updateMperson.php ........................................................................................ 129
Appendix X: deletemperson.php .......................................................................................... 129
Appendix Y: missingperson_table.php................................................................................. 130
APPENDIX Z: Login Form.php ........................................................................................... 136
Appendix AA: Login Check.php .......................................................................................... 138
Appendix AB: index.php ...................................................................................................... 141
vi
Appendix AC: Citizens Form.php ........................................................................................ 152
Appendix AD: Citizens Table.php ....................................................................................... 155
Appendix AE: Update Citizens.php ..................................................................................... 161
Appendix AF: Delete Citizens.php ....................................................................................... 161
Appendix AG:Citizens Table.php ........................................................................................ 161
Appendix AH: Complaints.php ............................................................................................ 167
Appendix AI: Users Fom.php ............................................................................................... 175
Appendix AJ: Insert Users.php ............................................................................................. 177
Appendix AK: Users Table.php ........................................................................................... 178
Appendix AL; Update Users.php ......................................................................................... 183
AppendiM AO: Delete Users ............................................................................................... 184
vii
List of figures
viii
List of Tables
ix
List of Abbreviation and Acronyms
x
Chapter I Introduction
1.1 Introduction
Crime is a human experience and is as old as the human race, Crime is geographical. It occurs at a
specific place, specific time and for a specific reason. It can affect everyone and anyone at any time,
vulnerability relating to levels of risk posed by internal and external security threats. Inside this
bodies and people to screen and decrease chance, there has been an acknowledgment that the criminal
equity framework is restricted in its ability to control crime which has prompted the investigate of
different roads for handling wrongdoing And this has given a market to privately owned businesses to
This system was gone for execute a Criminal Records Management System, It is a database
framework in which the police keep the record of offenders who have been captured, to be captured, or
got away. This will help the police division in improved administration of data. The principle
substances in the entire procedure includes, the applicant (the person who documents a First Incident
Report (FIR)), injured person, charged or criminal, case, and examining officer, CRMS tracks the
candidate, unfortunate casualty, denounced, FIR, case and examination officer elements. The system
strength lay in that it takes into account stockpiling of many information for a criminal, the proposed
CRMS improves the wrongdoing recording tasks of the NPF. The information used by the CRMS is
stored in a centralized database which holds information about criminals, wrongdoing and clients of
the framework. The database is the reason for all activities in the framework and can be easily updated
and used to help in the majority of the framework's rules, that is, the all the required data is put away
in one central area and in this way is effectively available. (Awodele, O. et al, 2015).
1
1.2 Background Of The Study
In the late 1980's the London Metropolitan Police imagined CRIS as an Electronic framework to
supplant the paper based wrong doing announcing the framework with a
in light of new elite PCs and information arranges that the vision could be understood, The data is put
away in an Ingress database appropriated crosswise over two VAX 7600 focal PCs that reflects every
one of the 63 Divisional databases and is refreshed progressively, the information is put away
continuously any solicitations for data will naturally incorporate the most a la mode result, the
framework has created data that has prompted numerous captures, the primary detailed, being
identified with vehicle wrongdoing, officers utilized the framework to develop an image of a vehicle
wrongdoing wave in Surbitan, Southwest London and found that they pursued an example of time,
area, technique and kind of vehicle Stolen, The Police built up a distraction vehicle and got the guilty
parties inside two hours. This is an illustrative case of how a modernized criminal Examination
programming can be utilized for master dynamic policing. (Adderley et al, 2001).
"The criminal record" is definitely not a self-characterizing term. Police, prosecutorial, legal,
Probation and Jail records all contain data about people who have been captured, Charged, Mediated,
condemned and exposed to network and institutional control and discipline. These offices' records all
contain data that, whenever revealed to potential Bosses and others, would probably have negative
ramifications for the record- subject. Accordingly, it may be progressively precise to discuss criminal
records, In the U.S., individuals typically signify, “Criminal record" to allude to a person's history of
captures and in addition feelings Jacobs 2015, there is an across the country police-made – and kept up
2
However not all businesses, approach. In any case, all businesses and every other person do approach
state-level criminal court records. Today, these court records are digitized. Utilizing this data source,
private data merchants duplicate and pitch criminal record data to managers and any other person
willing to pay an unobtrusive charge. Every European nation has a National Register (NCR)
Conviction that records data about its natives' feelings. Captures and different contacts with law
requirement offices are not part of the 'criminal record', another essential inquiry is to what extent
Criminology scientists have encouraged the making of elective announcing strategies that fill in as an
intervening example between observer’s dread of reaching the police and police objective for
counteracting and fathoming wrongdoing [22, 28]. Occurrences of Internet use to report wrongdoing
presently exist. The FBI Tips and Public Leads System and the Claremont University Consortium's
Silent Witness Program are precedents. Utilizing the Internet, these frameworks address the worries
and fears of exploited people Stood up to with the choice to document or not record a report. (Iriberri,
A, et al 2010).
We are building up a PC based wrongdoing detailing and talking framework that witnesses could use
to report wrongdoing or suspicious exercises to strategy secretly while guaranteeing the data is of such
quality that police can start an examination. The wrongdoing revealing and talking framework use
characteristic dialect handling innovation and psychological meeting strategies to give observers a
human conversational-style interface to facilitate the meeting procedure and expand memory review.
The framework speaks to the primary PC use of the intellectual meeting. In this article we portray one
experimental assessment to test the adequacy of the PC framework contrasted with the viability of up
close and personal (human) psychological meeting. (Iriberri, A. 2014). Crime is "A demonstration
submitted or overlooked disregarding a law precluding or telling it and for which discipline is forced
3
upon conviction", Recorded wrongdoing measurements have been gathered since 1857. Police
recorded wrongdoing insights gave a decent measure of patterns in all around detailed wrongdoing
Notwithstanding, they do exclude violations that have not been accounted for to police or that the
Crime Reporting System is the ground-breaking system that works Criminal arrangement sites. In CID
is utilizing manual enrollment of MS-applications, for example, get to database, and exceed
expectations spreadsheet to keep record the subjects. This task is being made by CID in Mogadishu.
It's proposed to utilize Somali natives to advise their objections to police headquarters, however the
office has numerous issues including residents can't contact straightforwardly to the Police station
when the experience some unit-security issues. They need to go straightforwardly to the police
headquarters to report Crime. So this undertaking will help encourage individuals to transmit their
worries or grievances through online to the CID by utilizing on the web wrongdoing revealing
framework.
Our main objective is to solve the problem of the CID on Criminal Records system, CID Did not have
online Registration Criminal Reports management system, So that we discover the needs of Crime
4
1.4.2 Specific Objective
ii. How to retrieve criminals already stored in the system for their information?
iii. How to reduce the number of lost records for the criminals?
iv. How to allow the citizens report crimes online at any place?
Web based crime reporting management system. This project concerned for police and
population. The time needed this project to collect from December 2018 to Jun 2019.
Web-based tool that enables user to manage the crime on tasks completed as part of project
The important thing of this research first is to get new knowledge. Second is to discover the needs of
CID crime reporting system because of every police station needs Online Crime Reporting
Management System. This project has significant importance, because it will provide assistance to the
citizens of Somalia. First Allow citizens report crimes online at any place without having them to
physically appear to police stations for reporting the crimes. It allows the citizens to send complaints
by online, And Provides platform to the report missing persons and their property.
5
1.8 Organization of the Study
• Chapter 1 – Introduction. This chapter discusses with introduction, background of the study,
problem statement, Research objectives, Research Questions, Scope of the study, and
• Chapter 2 – Literature Review. This chapter reviews works done in the earlier studies or
researches which are related to the project Web based crime reporting system.
The differences between crime and criminal also will be discussed in this chapter. This chapter
• Chapter 3 – Methodology. This chapter discusses the methodological development of this project,
which includes the techniques used. Flowcharts of the software programming are included, Even
though this project just includes the software parts, but the best hardware selections are also
discussed.
• Chapter 4 - Design and Analysis- in this chapter the researchers are going to demonstrate the
logical design of the system that is to be developed by drawing the Entity Relationship Diagrams
(ERDs) and the Data Flow Diagrams (DFDs) to show the flow of the data within the system
• Chapter 5 - Implementation and Coding- this chapter is where the system is developed
• Chapter 6 - Conclusion and Recommendation This chapter highlights the overall summary of
this project based on the objectives and results. Problems and recommendations for future works
to improve it.
6
Chapter II Literature Review
In this section, we analyze systems that are akin to the proposed system. We will focus on the
systems that are closest in functionality to the CRMS, highlighting their key features, similarities,
history, relationship b/w crime and police, advantages and disadvantages and existing system.
2.1 Introduction
Crimes are a typical social issue influencing the personal satisfaction and the monetary
development of a general public. In spite of the fact that wrongdoings could happen all over,
usually offenders chip away at wrongdoing openings they face in most natural regions for them,
by giving an information mining way to deal with decide the most criminal hotspots and discover
the sort, area and time of perpetrated violations, we want to raise individuals' mindfulness in
exact, succinct, clear and complete way, which at that point turns into a record of an offered
episode to an invested individual for choice to be made. There are numerous sorts of
wrongdoings, lawbreakers and unfortunate casualties. There are not kidding wrongdoings and
Crime Reporting System will address the refered to explanations behind not announcing, yet in
addition the need of police offices for progressively precise, complete, and reusable data that may
save their time and assets to designate them to policing the roads an online arrangement is
valuable as the arrangement is innately distributive. This distributive normal for the online
arrangement helps in getting the diverse police headquarters to share data and get in contact with
7
each other. It likewise enhances work proficiency of the office. Utilizing this application data
dealing with will be simple and quick and illuminating cases will be quick (Jaiswal, et al., 2013).
Crime Report System is a system used to report crimes. It very well may be utilized to report
Crime. This venture is primarily valuable for police headquarters. This framework will deal with
every one of the exercises in a police headquarters utilizing PCs. As of now, every one of the
works are done physically, by mechanizing every one of the exercises inside a police
headquarters can be overseen effectively and successfully, This framework will deal with every
one of the exercises in a police headquarters utilizing PCs, It is a critsical thinking movement that
requires concentrated correspondence between the framework clients and framework engineers.
The goals of this application is to keep up a mechanized record of all the F.I.R against
Many researchers trust that revealed wrongdoing information are defiled by estimation mistake
emerging from contrasts in police division detailing rehearses crosswise over locales, innovative
after some time. Regardless of whether such issues exist, be that as it may, they don't really block
the utilization of revealed wrongdoing measurements for deciding the adequacy of strategies
Lately police powers have been improving their conventional strategy for wrongdoing revealing
with new mechanical progressions to build their yield by effectively recording violations to help
their examination (Adderley and Musgrove 1999). Information isn't only a record of
wrongdoings, and it likewise contains important data that could be utilized to connect
8
wrongdoing scenes dependent on the usual way of doing things (MO) of the offender(s),
recommend which guilty parties might be in charge of the wrongdoing and furthermore
distinguish those wrongdoers who work in groups (guilty party systems) and so forth. In this day
and age, PCs are assuming a noteworthy job in the examination of a wide range of wrongdoing
from those that are considered as volume wrongdoing (thievery, vehicle wrongdoing and so on.)
to significant wrongdoing, for example, misrepresentation, medicate dealing, murder, and so on.(
The role of computers has been increased in all walks of life from the finance sector to
supermarkets. In recent years police forces have been enhancing their traditional method of crime
reporting with new technological advancements to increase their output by efficiently recording
crimes to aid their investigation (Adderley and Musgrove 1999), Data is not just a record of
crimes, it also contains valuable information that could be used to link crime scenes based on the
modus operandi (MO) of the offender(s), suggest which offenders may be responsible for the
crime and also identify those offenders who work in teams (offender networks) etc, In today’s
world, computers are playing a major role in the investigation of all types of crime from those that
are considered as volume crime (burglary, vehicle crime, etc.) to major crime such as fraud, drug
trafficking, murder etc., It is not an easy task for a Police analyst to manually unravel the inherent
complexities within police data and this problem is compounded when the analysis is undertaken
by a team. The distribution of the data to the team may cause significant information, which could
be useful to solve the crimes, to be missed as each member is not in possession of all relevant
facts. For a long time, criminologists and statisticians have been applying their skills and
knowledge trying to predict when and where the next set of crimes will occur, with varying
degrees of success. The volume of crime and the greater awareness of modern criminals put a
9
strain on the existing methods. Human reasoning fails when presented with millions of records.
Therefore, there is clearly a requirement for a tool kit to assist in analyzing the data which will
Crime is one of the human security problems confronting humanity across the world. Nations
have grappled to contain the rising incidence of homicide, armed robbery, and kidnap, drug
trafficking, sex trafficking, illegal gun running and host of others, United Nations Office on
Drugs and Crime in 2011 reported that homicides globally were estimated at 468,000 and more
than a third (36%) was estimated to have occurred in Africa, 31% in The Americas, 27% in Asia,
5% in Europe and 1% in the tropical Pacific region 3, Africa has been on the forefront on global
statistics on crime. South Africa and Nigeria have recorded high incidents of violent and non-
violent crimes in recent times. According to Africa Check, that incidents of murder increased
from 15 609 murders in 2011/12 to 16 259 murders in 2012/13 in South Africa, with increase of
650 murder cases or a 4,2% increase when comparing the total numbers of murders with the
previous years5. According to the same report, murders and attempted murders that take place
during aggravated robbery or inter-group conflict (such as gang or taxi violence), and vigilantism
make up between 35% and 45% of all murders and attempted murders 6. (Osawe, et al., 2015).
Between 1971 and 1975, the United States Department of Justice conducted victimization surveys
in 26 large American cities. Approximately 10,000 household interviews were conducted in each
city. Information was collected on victimization and reporting for a variety of crimes and is
collected in the United States Department of Justice (1975 a, b, 1976) reports. The strength of
these data is the availability of city identifiers that can be linked to the police staffing data
10
The concept of Crime can be viewed as an: illegal act (an action prohibited by Law or failure to
act as required by law); illegal activity that involves breaking the Law; immoral activity that is
considered unacceptable act that is shameful, unwise or regrettable. Crime by the Law of the
Federal republic of Nigeria (FRN, 1999) is defined as „An act or omission which renders the
person doing the act or making the omission liable to punishment under the criminal code, or any
Act or Law” Crime is brought about by the violation of the Law as established by the government
at all levels, Crime is an infraction of both the basic principles of law and order and the norms of
civilized behavior, Crime is an offence against the value system of a society. The cost and effects
of crime vary among the various segments of the population and touch almost everyone by some
degree and in general as the economic growth and development of countries increase, it would be
expected that crime level reduces, this may not necessarily be. The various cost of crime to
victims and the society or the economy include; loss of income, property losses, loss in
community productivity, etc. Some other cost of crime, which are less tangible; include
psychological trauma on victims and their family and friends, pain and suffering and a lower
quality of life. In all of these and other associated losses, the ultimate cost is loss of life (Osawe,
et al., 2015).
Deterrence Theory and Crime Schelling developed deterrence theory in 1966 as a preventative
military strategy during the Cold War (Paternoster, 2011). The emphasis of deterrence theory is
that punishment serves as a way to minimize and prevent criminal behaviors (Ritchey &
Nicholson-Crotty, 2011; Rizzolli & Stanca, 2012). Deterrence operates in two ways (a) specifics
and (b) generals (Paternoster, 2010; Piquero, Paternoster, Pograsky, & Loughran, 2011). Specific
deterrence pertains to deterring an individual from committing another crime, whereas general
2016).
11
Montaldo (2013) said that crime occurs when someone breaks the law by an overt act, omission
or neglect that can result in punishment. A person who has violated a law, or has breached a rule,
is said to have committed a criminal offense. According to National Crime Prevention Strategy
(1996), Crime results in the deprivation of the rights and dignity of citizens, and poses a threat to
peaceful resolution of differences and rightful participation of all in the democratic process. It
inhibits our citizens from communicating with one another freely, from engaging in economic
activity and prevents entrepreneurs and investors from taking advantage of the opportunities,
which our country offers. Government regards the prevention of crime as a national priority.
The measure of the police force systematically influences the willingness of exploited people to
wrongdoing reports, at that point UCR information will downplay the genuine adequacy of police
in decreasing wrongdoing. Exploited people might be bound to report violations to the police
when the apparent probability of a wrongdoing being understood is high. Moreover, the prepared
accessibility of a cop at the scene of a wrongdoing may likewise prompt more wrongdoing
reports, and it is anything but difficult to envision that increments in police labor will influence
the probability that native grumblings are authoritatively recorded by police divisions.
On the off chance that detailing/recording inclination (from now on alluded to as "revealing"
predisposition for quickness) is available, announced wrongdoing rates may increment with the
extent of the police constrain, regardless of whether the genuine exploitation rate is falling. The
way that considerably not exactly 50% of all wrongdoings secured by the FBI's Uniform Crime
Reports are really answered to the police uplifts worry over the significance of announcing
12
inclination. Announcing inclination is often refered to as a clarification for the inability to reveal a
connection between detailed wrongdoings and police nearness e.g., Greenwood and Wadycki,
1973; Swimmer, 1974; Thaler, 1977, 1978; CarrHill and Stern, 1979; Cameron, 1988; Devine et
clients to store police office's case subtleties, Complaint Details, First Information Report (FIR)
Details, and so forth. This Software Package permits Police Departments to store every one of the
subtleties identified with the office and use them at whatever point fundamental. The task reports
different cases, FIR report, charge sheet report, Most Wanted Criminals record, finance,
participation reports and furthermore can transfer and view criminal photographs and filtered
archives. The prerequisites for this framework was gathered from Manglaore Police Station
The center mission of the police is to control wrongdoing. Nobody question this. To be sure,
proficient wrongdoing battling appreciates wide open help as the essential system of policing
definitely in light of the fact that it epitomizes a profound promise to this goal. Interestingly, other
proposed methodologies, for example, critical thinking or network policing show up superficially
to obscure this center.' If these techniques were to leave the network increasingly helpless against
criminal exploitation, they would be unwanted options. In making a decision about the estimation
control genuine wrongdoing, the police search for hastening causes. While it might be helpful to
analyze what some call the underlying drivers of wrongdoing (e.g., social unfairness, unequal
financial chance, poor tutoring, frail family structures, or dysfunctional behavior), such things are
moderately irrelevant from a police viewpoint since the police practice little impact over them.
13
The police work on the outside of public activity. They should deal with episodes, circumstances,
and individuals as they are presently not social orders or individuals as they may have been.
Hence, the promptly hastening reasons for genuine wrongdoing are definitely more vital to the
police than are more extensive inquiries regarding the main drivers of wrongdoing. (Moore, et al.,
1998).
The event of wrongdoing isn't irregular. It is spatially conveyed in examples a few examples are
found while others are most certainly not. Factor, for example, social class, salary level and the
condition plays parts in the sorts of wrongdoing that are submitted. Assets and additionally an
absence of assets can impact the likelihood of wrongdoings submitted in some random region. As
definitions relying upon which viewpoint one is taking a gander at it from. For this exploration
state." Management, then again, is the way toward coordinating and controlling the assets of an
association such As its staff, materials, and hardware to accomplish the objectives of the
organizing police assets (cash, gear, and faculty) to keep the infringement of law and where it has
been damaged, to secure the culprits and indict them (Jimoh, R. G. et al, 2014).
The past discoveries are enough to persuade readers regarding the significance that detailing
conduct has for the criminal equity framework and the network. Residents, through the detailing
of their wrongdoing encounters begin the criminal equity hardware which thusly empowers
examination of violations by police, the preliminary of guilty parties, and their discipline. The
14
deterrent impact of criminal equity is potentiated too, then again, non-announcing blocks access
to remuneration plans, guilty parties not being captured, and the objective of an increasingly
evenhanded criminal equity framework being accomplished. Be that as it may, not all the
exploitation occurrences are wrongdoings in a specialized sense, and of those which are, some are
minor for sure, the police will total criminal offense reports in just few these episodes. Expanded
readiness to report what individuals see as violations would result in expanded police endeavors
in managing minor episodes, not all of which may result in attractive results to the people in
question; an issue with possibly pessimistic ramifications for the detailing of maybe progressively
going from earnestness of episodes to trust in the criminal equity framework, A progressively
total comprehension of non-announcing, its dispersion and its associates will enable us to
• Oral reports
The tip box usually consists of several locked boxes at key points around the school or
neighborhood. Each box has a slot for inserting written reports. Boxes need to be located in
places that are reasonably populated - not deserted and not in the middle
15
Of heavy traffic. The box (and education about using it) should remind students and citizens of
what's needed For a good report - a dated, legible note describing as much as possible what
happened where, when, how and by whom. Advantages of the tip box include low cost, low
reliance of technology and written records. Disadvantages include unreadable reports and limited
access. Tip boxes also require that someone physically visit and collect reports from each of the
boxes.
hotline. Calls left on a voicemail or answering machine can be retrieved from anywhere. The
report taker doesn't have to visit boxes. The telephone approach allows students to call from
school, from home, from a friend or from a pay phone. People tend to be comfortable talking on
the phone, so this approach leaves no lasting record of the report, unless messages taped or
transcribed and checked for accuracy. It also requires resources - funds or in-kind donations for
the equipment, the telephone service, and a secure area in which to house the Equipment.
E-mail and web sites have proved successful in reaching out to those who are electronically
literate. Some systems have both an e-mail box and a web site for crime reports. Both email and
web approaches can provide printed reports to send to appropriate authorities. There are
drawbacks - setting up the web page or e-mail properly (though a youth can probably provide
help). The fact that many Nigerians still may not have convenient access to computers and the
need to ensure security of the system to protect reporters' anonymity is required at all cost.
Written and oral reports have the advantage that many people trust the human link more than
the plastic box or the electronics of phones and e-mails. (Jimoh, R. G. et al, 2014).
16
2.7 Types of Crime
There are many different types of crimes but generally Crime occurs in a variety of forms, crimes
1. Major crimes: this crime is most genuine than different violations and incorporates (murders and
assaults, and so forth.) it is helpful to quickly investigate what has occurred over the most recent
30 years in appreciation of crime examination. Neyroud and Disley (2007) brought up, since the
survey into the imperfect Yorkshire Ripper enquiry (Byford, 1981) there has been a drive to
'institutionalize the way significant wrongdoing examinations are overseen', Major wrongdoing
comprises of the prominent violations, for example, murder, equipped burglary and non-date
assault. These violations can either be unique cases or sequential. On account of sequential
regarding business as usual or portrayals of guilty parties. This connecting is conceivable because
of the similarly low volume of such violations. Significant violations as a rule have a group of
2. Volume crimes: there are many different types under volume violations and incorporate (thievery,
vehicle wrongdoing, burglary, robbery, harm, and so forth.) Volume wrongdoing examinations. It
expected to give a diagram of the analytical procedure and, in doing as such, recognize compelling
and effective ways to deal with the examination and recognition of volume wrongdoing. The audit
especially intended to feature from the examination proof those insightful practices and Actions
that are probably going to prompt positive results, conversely volume wrongdoings, for example,
theft and shoplifting are undeniably increasingly predominant. They are normally sequential in
nature as wrongdoers proceed to perpetrate numerous such violations. Property violations, for
example, household theft offenses, submitted by various people are profoundly comparable and it
is uncommon to have a portrayal of the wrongdoers. This makes it hard to interface violations
17
together, most wrongdoing isn't major. Singular wrongdoings are of a less genuine nature to society
all in all
(Albeit still genuine to the people in question). The shear volume of such violations makes
diverse kinds of issues for the specialist. The high level of comparability among violations and
the absence of assets for nitty gritty examination of any one specific wrongdoing makes issues in
both fathoming a wrongdoing and anticipating comparative future violations. The test for cutting
edge programming designers is to apply current example coordinating and perception procedures
According to (Brahan, J., et al 1998) their overall project objective was: To develop a knowledge-
based system that will assist the police in the investigation of residential break & enter incidents
that will illustrate the potential for other applications in support of police investigations. Eight
iii. Provide the investigator with easy access to: - case parameters, other incidents in the vicinity, similar
cases, patrol officer report narrative, witness information, sighting reports, investigators' notes.
18
viii. Provide a graphics display capability.
ix. This will help the police department to manage their records easily.
x. There is no need for a user to go to the police station to file any complaint.
xi. If the police doesn’t react to the complaints the user can forward it to higher authorities.
According to (Brahan, J., et al 1998) there are some drawbacks written below.
i. Time consuming.
19
iii. Consumers large volume of pare work.
vii. The size of the database increases day-by-day, increasing the load on the database.
ix. Training for simple computer operations is necessary for the users working on the system.
An information system (IS) is any framework that changes over information into valuable data.
Kiirya (2007) depicted data frameworks to comprise of segments that associate to accomplish the
goal of giving data about everyday exercises that administrators can use to control business
activities. A data framework contains such components as equipment, programming, work force,
databases, and systems to achieve its destinations. Wrongdoing Information System (CIS) is any
framework that could be utilized to track violations or criminal cases which can likewise help in
getting data relating to specific wrongdoings. CIS can be utilized to complete measurement
examination of wrongdoing submitted with in an area for example South-Eastern district, Nigeria.
20
Figure 2.1 Exsisting System
Existing online crime reporting management system does not have such medium by clients can put
their protest from any area. They need to visit their closest police area and take a duplicate of the
protest for future reference. Numerous residents falter to visit any police headquarters and
subsequently source data can't be kept classified. Now and again clashes happens between the
police headquarters with respect to region, implies which region goes under their police
headquarters and the individual get baffled before setting their gripes. In the event that any resident
is a sufferer of wrongdoing, even in the wake of dialing crisis number, police individual don't ready
to find the precise area of that subject. In this present framework, client's data will be kept secret
and just clients whine will be sent to its closest police headquarters. Clients gripe number will be
sent from the server side naturally. For distinguishing area and true individual, idea of treats and IP
tending to has been utilized. To dispense with the area clashes between police headquarters, the
server will assume an imperative job. It will look through the location table utilizing IP address and
forward message to that police area from where the message has been gotten. It stores only the
21
i. Existing applications manage the data and various information’s about the criminals and their crimes.
In present manual system the total process of criminal report generation is not so fast and friendly.
The National Crime Information Center (NCIC) is a USA automated database of archived criminal
equity data accessible to practically every law requirement organization across the nation. It is an
across the country framework worked by the Federal Bureau of Investigation (FBI) devoted to
serving and supporting locally, state, and government criminal equity offices in their main goal to
maintain the law and secure people in general. The NCIC ended up operational on January 27,
1967, with the objective of helping law requirement in securing criminals and finding stolen
property. This objective has since extended to incorporate finding missing people and further
securing law implementation faculty and the general population. (Ugwuishiwu, et al., 2013).
22
Figure 2.3 Existing System
23
Chapter Summary
The project entitled as "Web based of Online Crime Reporting System" is the web based application it
will be very useful for the police department as well as common peoples. This software provides facility
for reporting online crimes, complaints, missing persons and show related sections. This software is
developed with scalability in mind. Additional modules can be easily added when necessarily. The
software is developed with the modular approach. All modules in the system have been tested with valid
data and invalid data and everything work successfully. Thus, the system has fulfilled all the objectives
identified and is able to replace the existing system. The project provides much security. The Application
is made users friendly to the maximum so that anyone can run the application provided that could access
to the system via the login password. This project manages all details without any risk. All the objectives
were met with satisfaction. The performance of the system is found to be satisfactory. From a proper
analysis of positive points and constraints on the component, it can be safely concluded that the product is
a highly efficient GUI based component. This application is working properly and meeting to all user
24
Chapter III Methodology
This chapter discusses the procedures and methods used in this project. It also includes the research
design of the project and how the data were gathered, as well as, the research instruments.
3.1 Introduction
Police provides safety to citizens. It always remains steady for arresting any criminal who is a threat for
the safety of society. After registering the FIR from any citizen, police starts its work and on that basis it
arrests the criminals if proofs are found against them. Once the criminals are arrested, police starts
investigation from them. After getting all the proofs against the criminal, it is the duty of the police to
present all the proofs honestly to the court so that the right man can get right punishment. The true and
right information provided by the people to police helps a lot in arresting the criminals who try to spoil
The objective of the project was to develop a site in which any citizen can report crimes. If anybody
wants to report any kind of crime he/she can do it through the site. The Crime Management and Reporting
System make the crime reporting easier. This project will be useful for the Police Department.
25
Figure 4 3.1 Crime Reporting System
3.2 Methodology
A systematic process was followed for the development of the project. The overall system
development process was carried out into different phases like requirement analysis, design, coding,
At first the present system, that is, manual system was overviewed in brief so that the deficits and
irregularities in the current system would be pointed out. The helped the authors to identify the
26
The development process was then started with data collection phase which supported the authors in
The authors of the project have used data provided in the internet and some dummy data for various
OCRMS is a system which aims at making records of crimes easier and complaints of users easier.
This system provides an easy way to admin to keep track of records of all the crimes and saves him
loads of manual work, this system makes updating of records easier by both users and admin and
provides updated information about the current crimes status in happening. The developed system was
This project was provided an efficient and reliable way to handle all the daily operations of the
organization ranging from entering the personal information of a crimes or society complains and to
updating the same information or even deleting To standardize the database required for smooth
operation, Integrate subsystem within the organization into base system for integrated service.
Disseminate information about the organization crimes. To maintain proper record of every criminals.
27
3.4 System Development Environment
The system has developed in PHP as front end and MYSQL as back end.
PHP is a server side programming language which was designed by Rasmus Lerdof in 1994 the
reference implementation is now produced by The PHP Group. As of January 2013, more than 240
This language will help to get the information from MySQL database to android mobile application
and also help to insert data to MySQL database from android mobile Application. PHP is a server
scripting language, and it is a powerful tool for making dynamic and interactive Web pages quickly,
Alternative to competitors such as Microsoft's ASP. PHP combined with MySQL are cross-platform
MySQL Database
MySQL Database is a free open source database software which will help us to save our data and to
retrieve data through php. MySQL is the second most widely used database in the world. MySQL was
named after the daughter of co-founder Michael Widenius, My. The SQL stands for Structured Query
Language.
MySQL was initially released on 23 May, 1995 by MySQL AB. Now this is owned by Oracle
Corporation. TYPO3, MODx, Joomla, WordPress, phpBB, MyBB, Druphal are some of the famous
software which are using MySQL, Google, Facebook, Twitter, Flickr and YouTube are some of those
28
Xampp
XAMPP was introduced by Apache Friends on 22 May, 2002. This is an open source crossplatform
web-server solution stack package. This mainly comprises Apache HTTP server, MySQL database
and interpreters for the scripts written in PERL and PHP programming languages. This was designed
with intention to provide test environment on personal computers without access to internet so that
website designers and programmers can use it to test their websites on their own computers. XAMPP
is PHP development environment. This will help to run PHP, Apache tomcat server and MySQL.
Jquery
JQuery is advanced JavaScript library of pre-written JavaScript code that can be used in your own
coding projects. The Purpose of JQuery is to make it much easier to use JavaScript on your website.
JQuery takes a lot of common tasks that require many lines of JavaScript code to accomplish, and
wraps them into methods that you can call with a single line of code. The JQuery library contains the
following features:
▪ HTML/DOM manipulation
▪ CSS manipulation
▪ AJAX
▪ Utilities
29
3.5 Why Did You Choose That Specific Environment?
▪ PHP runs on various platforms (windows, Linux, UNIX, mac operating system x,
etc.).
▪ PHP is compatible with almost all servers used today (Apache, IIS, etc.).
▪ PHP can create, open, read, write, delete, and close files on the server.
▪ The main advantage of online application is that a person can report the crime at anytime and
anywhere.
▪ By the future technology user can view the case details and progress of the complaints on their
mobile phones.
30
▪ Face recognition technology can apply. User or witness of the crime can give the physical
Reusability is possible as and when require in this application. We can update it next version.
Reusable software reduces design, coding and testing cost by amortizing effort over several design.
Reducing the amount of code also simplifies understanding, which increases the likelihood that the
code is correct.
This proposed software runs effectively on a computer system which has the minimum requirements.
Hardware interfaces specifies the logical characteristics of each interface between the
Software product and the hardware components of the system. Many business type
Applications will not have hardware interfaces, since “Crime Reporting System” is an Application it
The minimum hardware requirement for developed system and its operations include the following:
Core2Duo.
31
3.9 Software Requirement
The minimum software requirements to run the program are listed below:
Editions)
ii. MySQL
iv. Browser e.g. Mozilla Firefox, Safari, chrome, Baidu Browser etc.
32
Chapter Summary
In this chapter we discussed the major point of requirement analyze and specification, the requirement
analyze describes the project information about current system, system description, overview of the
system and system features and development environment contains the specific environment,
development methodology requirement contains hardware requirement and software requirement, and
result reached is understanding the functionality and requirement of the system and easiest access and
conclusion.
33
Chapter IV System Analysis and Design
4.1 Introduction
According to (Bentley, 2007) system analysis as “the process of studding procedure or business in
order to identify its goals and purpose and create systems and procedures that will achieve them in an
efficient way”. System Analysis works with users to identify goals and build systems to achieve them.
System analysis is an important phase of any system development process. The system analyst plays
the role of an interrogator and dwells deep in to the working of the present system. Another view sees
system analysis as a problem-solving technique that breaks down a system into its components pieces
for the purpose of the studding how well those components parts work and interact to accomplish their
purpose, After analyzing the requirements of the task to be performed, the next step is to analyze the
The first activity in the phase is studying the existing system and other is to understand the
requirements and domain of the new system. Both the activities are equally important, but the first
activity serves as a basis of giving the functional specifications and then successful design of the
proposed system. Understanding the properties and requirements of a new system is more difficult and
requires creative thinking and understanding of existing running system is also difficult, improper
understanding of present system can lead diversion from solution. The system is viewed as a whole
and the inputs to the system are identified. The outputs from the system are traced through the various
processing that the input phases through in the organization. During analysis, data is collected on
34
4.2 Current System
The currently system that uses In Crime Investigation Department the most of the operations are done
manually like send complaints, taking actions against crimes, view status etc. So with the existing
system if anybody wants to complaint against crimes he must do it through the police. In general
people in Somalia are afraid to give a complaint in police station because they are filled with a false
fear about the police department. An online complaint registration system will solve the fear of the
public and which also helps police department catching criminals and taking appropriate actions.
▪ Even an efficient officer cannot/may not able to handle more than one case at a time.
▪ Police stations are at some places situated away from the police stations thus making some
35
4.3 System Requirements
Is a document or set of documentation that describes the features and behavior of system, it includes
variety of elements that attempts to define the intended functionality required by the system.
The following should be taken care of while designing the user interfaces
▪ The design or layout of every form will be very clear and very interactive to the
User.
▪ When the user open the software the welcome window will appear.
• In the login window the user can easily entered the desired password and loginname.
▪ From each and every window the user can easily go to any desired window that is there
▪ There will be a proper collection of GUI interface, which will provide better look And
feel.
▪ In the screen layout the background color is very light and the graphics and font
▪ In each and every window there will be alert, confirm etc message box for
Displaying message.
▪ The user will be able to search any data from the record by using proper guideline
▪ User can easily save its data in to the database and update as their need.
36
4.3.2 User Characteristics
▪ Working on a website
▪ User should know that how to search any police-station and criminal.
▪ The Admin makes every update in the system from this module.
▪ He can update the news and criminal record as per the updated record.
▪ Add user: This module help the users to report online complaints.
37
▪ View/Add/Delete Missing persons: this module help the user to report online
▪ View/Delete Users: This module helps the users to view and delete the detail of
users.
▪ Add/Edit/Delete/ Criminals: This module helps the users to view and delete the
detail of criminals.
▪ Search User/Criminal: This module helps the search user & criminal and details for
that.
▪ Generate Progress Report: This module helps to generate progress report for users.
The functional requirements highlight the specific functions the system should be able
▪ On form submission the data directly appears all police stations officer in case if it’s
38
▪ Store and retrieve information about crime and criminals.
i. Security Requirements
▪ The data security will be enhanced through restricting access to the data by the use
▪ The external security for those accessing the system over the internet will also be
▪ Validation of data during data entry will be achieved by using JavaScript language
validation at the client side to ensure data entered is the correct data for data
integrity purposes.
▪ The retrieval of needed data will be made efficient by the use of search forms to the
database hence getting the data within the shortest time possible.
39
4.7 System Design
The logical system design reviews the present system and prepares input and output specifications,
Complaints Reports
Database
diagram is one of the five diagrams in UML or modeling the dynamic aspects of the system.Usecase
diagram is central to modeling the behaviour of a system, a subsystem or a class.Usecase diagram are
more important for visualizing, specifying and make systems, subsystems and classes approachable
40
Figure 6 4.2 Use case diagram
Activity diagrams are graphical representations of workflows of stepwise activities and actions with
support for choice, iteration and concurrency. In the Unified Modeling Language, activity diagrams
are intended to model both computational and organizational processes (i.e. workflows).
41
4.7.3.1 Activity Diagram for Login Process
Not Valid
Verify? Error Message
Index Page
42
4.7.3.2 Activity Diagram Admin
View File
Login
Invailed
Vailed
Logout
43
4.7.3.3 Activity Diagram Users
View File
Login
Invailed
Vailed
Add Crime Add Missing View Cases View Wanted View District
Person
Logout
44
4.8 Database Design
System design is the most essential segment of software development. It requires a careful planning
Designing software means to plan how the various parts of software are going to achieve the
chosen Target. It should be done with highest care because if the phase contains any
Error then, that will influence the performance of the system, as a result it may take
More processing time more response times, extra coding workload, etc.
Once the software requirements have been analyzed and, specified, software design is the first of the
three technical activities designing, coding and testing that are required to build
and verify the software. Each activity transforms information in such manner the ultimately result in
The term database design can be used to describe many different parts of the design of an
45
Figure 4.6 Database Design
46
4.8.1 Entity Relationship Diagram
organization‟s data storage requirements. Entity relationship diagrams are abstractions of the real
world which simplify the problem to be solved while retaining its essential features. Entity
i. ENTITIES-These are the people, places, things, events and concepts of interest to an
ii. ATTRIBUTES-sometimes called data elements, they are the smallest units of data that can be
iii. RELATIONSHIPS- a verb or verb phrase that describes how the entities are related to each
other.
The diagram below shows the Entity Relationship Model for the online crime reporting system
comprising of Entities such as the Administrator, Citizen, Crime, Missing Person, Complain etc and
their attributes including Administrator ID, Name, Description etc as well as how the Entities are
47
4.8.1.1 Erd Symbols
ER diagram is used to represent database schema:
❖ Lines represent linking of attributes to entity sets & of entity sets to relationship sets.
Relationship is an association among one or more entities. This relationship can be broadly
classified into one-to-one relation, one-to-many relation, many-to-many relation and recursive
relation.
i. One-to-one relationship: Abbreviated 1:1, exists when exactly one of the second entity
occurs for each instance of the first entity.
48
ii. One-to-many relationship: Abbreviated 1:M, exists when one occurance of the first entity
can relate to many instances of the second entity, but each instances of second entity can
iii. Many-to-Many relationship: Abbreviated M:M, exists when one occurance of the first
entity can relate to many instances of the second entity, and one instances of the second entity
49
4.9 Database Tables
1. Admin Table
2. Users Table
3. Case Table
50
4. Crime _Registration Table
5.
Table 5 4.5Citizens
7. Complaints Table
51
8. Police Station Table
9. Missing Person
52
Table 9 4.9 district
11. Wanted Table
53
Chapter Summary
This chapter discusses about the design of the project. Software and database design were the following
steps of this chapter which was the conversion of the requirement analysis, to show the interior design
of the system. After that we discussed the database Design, Use Case Diagram, Activity Diagram,
Table Design and etc., although we have covered a majority of the project still we are going to the
54
Chapter V System Implementation
5.1 Introduction
This chapter we explained the framework of our project and how its work step by step and so on
we analysis how the project of web based crime reporting information system is completed
success during. Last months and we captured snapshots from the project to make more
comfortable to understand our audience what the project is and how it works we explain every
form and every page what is mean. Implementation is a critical situation we making data from
analyzing to converting or we are writing by code. Finally, we end programming and we caring
out of the performance thesis and beautiful application on web application, implementation we
made of three major activities, coding the program, testing the system and documenting the
system.
5.2 Coding
Coding as we mentioned before, is the process through which the physical design specification
created by the design team are turned into working computer code by the programming team
depending on the size and complicity of the system. Coding can be an involved, intensive
activity, according to our project when coding has begun the testing, process is beginning and
proceed in parallel. To produce each program models. The project code can be displayed in
appendix A.
55
5.3 Testing the System
Testing is the process of executing the program to find if there are any errors. It is the final
Verification and validation activity .In testing phase we have tried to affirm the quality of the
Testing the system for web based crime reporting information system is similarly process of
coding but instead of integrated modules into program for testing, we integrate programs into
online crime reporting information system follows the same incremental logic that integration
testing does. Under both integration and the system testing not only individual models of OCRIS
and programs get tested many times, so do they interfaces between models and programs. A test
case is a specific scenario of transactions, queries that represent a typical, critical, or atypical use
of the system, attest case should be repeatable so that can repeat as a new versions of the software
are tested. This is important for all codes weather written in-house developed by a constructer.
Test case need to determinate that new software works with other existing software with which is
must share data. Even though analysts often do not does the testing system analysts, because of
The people who create the test cases should not be the same people who coded on tested the
system. In addition to description of each test case, their most also be a summary of the test result,
with an emphasis on how the actual results differed from the expected result. The testing
summary indicated why the results where different and what, if anything, should done to change
the software further, this summary will than suggest the need for retesting, possibly introduced
new tests necessary to discover the source of the different. One important reason to keep such a
through description of test case and results is so that testing can be repeated for each revision of
and application although new versions of this system may require new test data to validate new
features of the application, previous test data usually can and should be reprocessed. Manual code
56
reviews can be time consuming and boring work and most important, are not always the best
solution.
In one sense, every systems development project whose unique and would be generate is own
unique documentation. In another sense, each project has specific operational framework, which
dictates that certain activity by under taking and that each of those activity. According to our
specific documentation will disagree depending on the real life of case study and format and
contents of the documentation. To start developing documentation elements first the information
we needed is captured. We can simplify the situation by dividing documentation into two basic
detailed information about web based crime information system design specifications. Its
The projectors developed this system using web technology such as PHP, JQUERY AND AJAX
as front end and the design whereas the MYSQL SERVER as a backend solution. The reason
why the developers choose these environment is that they are latest powerful for the web
technology suitable for such project like this the PHP is the robust web development tool
57
5.6 Snapshots of the Forms
In this section the developers discuss the design and the implementation of the major forms of
the project. The important codes for each form is also presented here for the clarity of the end
users of the system. There for the flowing snapshots demonstrate a full understands of entire
Login Page
This is the login page where administrator and all users will be allowed to make access to the
system and this will have login a username and password which will be retrieved from the
database every person use the system will have different username.
58
Main Page
This page is main page of the system that will be retrieved all forms information’s, All Reports
<?php
session_start();
if(empty($_SESSION['name'])){
header("Location:../logout.php");
}
?>
59
User Form
This page is registered by the new user’s information and saves in to the database system.
include("../db/db.php");
$path = "uploads/".$_FILES['image']['name'];
if(move_uploaded_file($_FILES['image']['tmp_name'], $path)){
$sql = "CALL Add_Users_Sp('$_POST[user_id]','$_POST[username]','$_POST[pasword]','$path',
'$_POST[date]')";
$res = $conn->query($sql);
60
Figure 16 5.4 User Table
61
Police Station Form
The police station form is one of the most important forms of the projects which deals with the crime
reporting system.
$query="CALL $sp(".rtrim($params,',').")";
$res = $conn->query($query);
$row = $res->fetch_array();
if($row[0]=='Aready Exists'){
?>
<div class="alert alert-danger" role="alert">
Already exist </div>
62
Figure 18 5.6 Police Station Table
63
Case Form
This page is used to register the cases for the criminals and wanted peoples.
$query="CALL $sp(".rtrim($params,',').")";
$res = $conn->query($query);
$row = $res->fetch_array();
if($row[0]=='Aready Exists'){
?>
<div class="alert alert-danger" role="alert">
Already exist </div>
64
Figure 20 5.8 Case Table
65
Crime Registration Form
This form shows the Crime registration part where all Columns of Crimes information included with clear
include("db/db.php");
$path = "uploads/".$_FILES['image']['name'];
if(move_uploaded_file($_FILES['image']['tmp_name'], $path)){
$sql = "CALL
Add_Crime_registration_Sp('$_POST[Cr_id]','$_POST[victim]','$_POST[cases]','$_POST[polstation]','$
_POST[name]','$_POST[Address]','$_POST[gender]','$_POST[phone]','$_POST[crime_location]','$_PO
ST[c_date]','$path','$_POST[description]')";
$res = $conn->query($sql);
66
Figure 22 5.10 Crime registration Table
67
Wanted Form
The below form shows the Wanted Person registration area where all fields of Wanted Person information
include("db/db.php");
$path = "uploads/".$_FILES['image']['name'];
if(move_uploaded_file($_FILES['image']['tmp_name'], $path)){
$sql = "CALL
Add_wanted_Sp('$_POST[wanted_id]','$_POST[station]','$_POST[wname]','$path','$_POST[wdate]')";
$res = $conn->query($sql);
68
Figure 24 5.12 wanted table
69
Missing Person Form
The below form shows the Missing Person registration area where all fields of Missing Person
include("db/db.php");
$path = "uploads/".$_FILES['image']['name'];
if(move_uploaded_file($_FILES['image']['tmp_name'], $path)){
$sql = "CALL
Add_missing_Sp('$_POST[m_id]','$_POST[polstation]','$_POST[name]','$_POST[Address]','$_POST[ge
nder]','$_POST[age]','$path','$_POST[miss_date]')";
$res = $conn->query($sql);
70
Figure 26 5.14 missing person table
71
Citizen Form
The below form shows the citizen registration matter where all fields of citizen information included with
$query="CALL $sp(".rtrim($params,',').")";
$res = $conn->query($query);
$row = $res->fetch_array();
if($row[0]=='Aready Exists'){
?>
<div class="alert alert-danger" role="alert">
Already exist </div>
72
Figure 28 5.16 citizen table
73
Chapter Summary
This project analysis the real implementation of the study where the researcher coded the system and
tested for their operations and the proposed task accordingly. The chapter also presented the snapshot of
the most important forms of the system with the same few of their reports since all report of the whole
project will be present in the appendices which will be put in the last pages of the research.
74
Chapter VI Conclusion and Recommendation
6.1 Introduction
This chapter present the conclusion of the research that has been conducted by group of researchers. The
ambulates the finding of the research, the accomplishments of the research objectives mentioned in chapter
one of the research by discussing the solution of achieved by the researchers and finally the chapter also
presents the Recommendation for those who may conduct a study such in topic.
6.2 Conclusion
After having put a lot of effort and hard work, finally the research completed successfully, although the
researchers can’t claim that this study is perfect since they are human being and lacks perfections. The
Online Crime Report Information System (OCRMS) is almost complete software package specially
developed for CID to automate the Crimes’ overall operation and everything related to its OCRMS the
offers high security, reliability, convenience and easy to operate. The system well-developed by considering
all the user requirements and any possible future shortcoming, there for this OCRMS will be soon fully
functioned at all CID campuses across Mogadishu and it has all the necessary Modules to manage the CID
The main goal for this project is to develop an Online Crime Reporting System for the police stations
and government agencies especially CID in Somalia. Moreover, here are the details of the project
75
• To allow the citizens report crimes online at any place.
All the objectives stated above have been achieved and the requirements of the users have been met
through the project. This system is very friendly system and it has a good interface that can be usable
by every person who is computer literate. Moreover, if the user make a mistake it generate an error
message that easily understandable by the user and it gives you the necessary utilities in your project,
another tools that you may need while you are working with the project. Our system has capability
to work 24hrs with addition and provides sufficiency and effective work and has equivalent storage.
Strengths
• You can search particular information for the each criminal easily.
• The system has dashboard where the admin can shortly what is done.
weaknesses
On the other hand, every system has its own weaknesses, so, In this project, only problems that
you might face is emergence alerting messages that appear whenever you misuse to the system,
and if you are not familiar with this system you might find it difficult to manage it, other
weakness is run time errors as soon as different version of Web browsers is used and these
errors are very simple limitation. Please don’t confuse, just read carefully what the message is
carrying out and then you will get the solution easily.
This section discusses how the researchers accomplished objectives of the exploration by restating the
76
Objective 1
To develop a system that can replace the separate management system in Online Crime Reporting
Information System. The researchers developed a full functional OCRMS for CID to replace the scattered
Objective 2
To add other features that are important in CID the explores noticed that the previous system locked
attendance module and the researchers added the new system with this important module and now it is
successfully integrated.
Objective 3
To shift from the desktop CRMS to online application the new OCRMS package is developing using PHP
which is the most powerful online tool in .NET technology.
In any study these is always a research gap that maybe bridged by future researchers and there for Societies
all over the world expand and develop continuously, as such human relationship and activities also expands.
The results of dynamism of the growing population give room for crime. These societies therefore strive to
establish and develop institutions that can ensure peace as well as security of lives and property of its
citizenry. So this project also has some future enhancements in the IT industry. Change is inevitable. The
project entitled “Online Crime Reporting” was successfully designed developed and tested. The system and
the architecture is a compatible one, so addition of new modules can be done without much difficulty. Since
this module has its unique properties it can extend further to make this system a complete one.
• Video conferencing: This method can be added to make the project livelier.
• Back up: is a method that the system will automatically generated every 24 hours.
• Security: It needs improvements and maintenance. First to improve the security of the
77
• Cyber Security: This System being web-based and an undertaking of Division, needs to
• Send Email: In future system will provide mail facility to every police station officer. And
78
Chapter Summary
The project titled as “Online Crime Reporting Information System” is a web based application. This
software provides facility for reporting online crimes, complaints, missing persons, show criminal details
and so on. This software is developed with scalability in mind. Additional modules can be easily added
when necessary. The software is developed with modular approach. All modules in the system have been
tested with valid data and invalid data and everything work successfully. Thus the system has fulfilled all
the objectives identified and is able to replace the existing system. The project has been completed
successfully with the maximum satisfaction of the organization. The constraints are met and overcome
successfully. The system is designed as like it was decided in the design phase. The project gives good
idea on developing a full-fledged application satisfying the user requirements. This software has a user-
friendly screen that enables the user to use without any inconvenience. Validation checks induced have
greatly reduced errors. Provisions have been made to upgrade the software. The application has been
tested with live data and has provided a successful result. Hence the software has proved to work
efficiently.
79
References
Awodele, O., Onuiri Ernest, E., Olaore Olufunmike, A., & Anita, S. O. O. U. E. (2015).
Awodele, O., Onuiri Ernest, E., Olaore Olufunmike, A., & Anita, S. O. O. U. E. (2015).
A Real-Time Crime Records Management System for National Security Agencies. European
Adderley, Richard & Musgrove, Peter. (2001). Police crime recording and investigation
Almanie, T., Mirza, R., & Lor, E. (2015). Crime prediction based on crime types and using
Awodele, O., Onuiri Ernest, E., Olaore Olufunmike, A., & Anita, S. O. O. U. E. (2015). A
Real- Time Crime Records Management System For National Security Agencies.
Bentley,L. D. (2007). System Analysis and Design for the Global Enterprise. New York
City:McGraw-Hill/Irwin.
Brahan, J. W., Lam, K. P., Chan, H., & Leung, W. (1998). AICAMS: artificial intelligence
80
crime analysis and management system. Knowledge-Based Systems, 11(5-6), 355-361.
Grover, V., Adderley, R., & Bramer, M. (2007). Review of current crime predictions
Springer, London.
Grover, V., Adderley, R., & Bramer, M. (2007). Review of current crime prediction Techniques. In
Applications and Innovations in Intelligent Systems XIV (pp. 233237). Springer, London.
Grover, V., Adderley, R., & Bramer, M. (2007). Review of current crime prediction techniques. In
Applications and Innovations in Intelligent Systems XIV (pp. 233237). Springer, London.
Iriberri, A., & Navarrete, C. J. (2010, January). Internet crime reporting: Evaluation of a
Crime reporting and investigative interview system by comparison with a non- Interactive
Jaiswal, A., Gunjal, N., Londhe, P., Singh, S., & Solanki, R. (2013, October) Crime
Automation & Reporting System. International Journal of Science and Modern Engineering
Jacobs, J., & Larrauri, E. (2015). European Criminal Records & Ex-Offender Employment.
Home Office.
81
Jain, N., Agarwal, S., Joshi, G., Gupta, R., & Kataria, A. (2017). Crime File System. Levitt,
S. D. (1998). The relationship between crime reporting and police: Implications for the Use of
Jakkhupan, W., & Klaypaksee, P. (2014, August). A web-based criminal record system
Using Mobile device: A case study of Hat Yai municipality. In Wireless and Mobile, 2014 IEEE
Kabia, V. S. (2016). The Relationship between Increased Police Patrols and Violent
Implications for the use of Uniform Crime Reports. Journal of Quantitative Criminology, 14(1),
61-81.
Moore, M. H., & Trojanowicz, R. C. (1988). Corporate strategies for policing (No. 6). US
Osawe, Cyril Onyepuemu. (2015). Increase Wave of Violent Crime and Insecurity: A
82
And Social Science (IOSR-JHSS) 20 Issue1, Ver. IV: 123-133.
Osawe, Cyril Onyepuemu. (2015). Increase Wave of Violent Crime and Insecurity: A
R. G. Jimoh, K.T. Ojulari, & O.A. Enikuomehin (2014). A Scalable Online Crime
Reporting System, African Journal of Computing & ICTs. Vol 7, No. 1. Pp11-20.
R. G. Jimoh, K.T. Ojulari, & O.A. Enikuomehin (2014). A Scalable Online Crime
Reporting System, African Journal of Computing & ICTs. Vol 7, No. 1. Pp11-20.
R. G. Jimoh, K.T. Ojulari, & O.A. Enikuomehin (2014). A Scalable Online Crime
Reporting System, African Journal of Computing & ICTs. Vol 7, No. 1. Pp11-20.
Raza, S. M., & Rajamanickam, L. (2015). A Proposed Solution for Crime Reporting and Crime Updates
Ugwuishiwu, C. H., Ugwu, K. C., & Inyiamah, H. C. (2013). Design and Implementation of Real-Time
Crime Information System for National Drug Law Enforcement Agency (NDLEA) in Nigeria.
Ugwuishiwu, C. H., Ugwu, K. C., & Inyiamah, H. C. (2013). Design and Implementation of
Real-Time Crime Information System for National Drug Law Enforcement Agency
83
Ugwuishiwu, C. H., Ugwu, K. C., & Inyiamah, H. C. (2013). Design and Implementation of Real-Time
84
Appendix A: Police_Station.php
<div class="x_content">
<br />
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">pol_station_name <span
class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="text" name="pol_station_name" required="required" class="form-control
85
col-md-7 col-xs-12">
</div>
</div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">phone</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="phone">
</div>
</div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Address</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="Address">
</div></div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Email</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="Email">
</div> </div>
<d`iv class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Area</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="Area">
</div> </div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Date</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="date" name="date">
</div></div>
<div class="ln_solid"></div>
<div class="form-group">
<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
<button class="btn btn-primary" type="button">Cancel</button>
86
<button type="submit" class="btn btn-success">Save</button>
</div> </div>
</form>
<p id="msg"></p>
</div>
</div>
</div>
<script src= "jquery-3.3.1.min.js"></script>
<!-- Waa Qaybta Ajax ka-->
<script type="text/javascript">
$(function(){
$("form").submit(function(e){
e.preventDefault();
var $form_date=$(this).serialize();
var $page_url=$(this).attr("action");
$.ajax({
data:$form_date,
url:$page_url,
method:"POST",
success:function(res){
$('#msg').html(res);
}}); });});
</script>
87
Appendix B: Insert.php
<?php
$params="";
$sp="";
$i=0;
foreach ($_POST as $val) {
$i++;
if ($i==1) {
$sp=$val;
continue;
}
88
Appendix C:UpdatePstation.php
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$sql="CALL update_police_station_Sp('$_POST[pol_station_id]','$_POST[pol_station_name]','$_POST[phone]',
'$_POST[Address]','$_POST[Email]','$_POST[Area]','$_POST[date]')";
$res=$conn->query($sql);
$row=$res->fetch_array();
echo $row[0];
header("Location:policestation_table.php");
?>
Appendix D: DeletePstation.php
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$sql="CALL delete_police_station_Sp('$_GET[pol_station_id]')";
$res=$conn->query($sql);
$row=$res->fetch_array();
echo $row[0];
header("Location:policestation_table.php?del=1");
?>
$result=$conn->query($query);
?>
<div class="clearfix"></div>
<div class="row">
89
<div class="col-md-12 col-sm-12 col-xs-12">
<!-- In lagu soo daabaco wixii kasoo laabta query procedure ka in lagu soo daabaco -->
<?php
if(isset($_POST["del"])){
if($_POST["del"]==1){
echo "Deleted Successfully";
}}
?>
<!-- End In lagu soo daabaco wixii kasoo laabta query procedure ka in lagu soo daabaco -->
<div class="x_content">
<a href="police _station.php" class="btn btn-success pull-right" style="margin-right:10px;margin-
top:3px;">Add Police Station</a>
<table id="datatable-buttons" class="table table-striped table-bordered">
<thead>
<tr>
<th>ID</th>
<th>Station Name</th>
<th>Phon</th>
<th>Address</th>
<th>Email</th>
<th>Area</th>
<th>Date</th>
<th>Action</th>
</tr></thead>
<tbody>
<?php
if(mysqli_num_rows($result) > 0)
{
while($row = mysqli_fetch_array($result))
{
?>
90
<tr>
<td><?php echo $row["pol_station_id"]; ?></td>
<td><?php echo $row["policatstaion_name"]; ?></td>
<td><?php echo $row["phone"]; ?></td>
<td><?php echo $row["address"]; ?></td>
<td><?php echo $row["email"]; ?></td>
<td><?php echo $row["area"]; ?></td>
<td><?php echo $row["dates"]; ?></td>
<td><button type="submit" class="btn btn-success btn-xs" onclick="selectPlice(<?php
echo $row['pol_station_id']; ?>)" data-whatever="@fat"><span class="glyphicon glyphicon-
edit"></span></button>
<a href="#" name="delete" onclick="DeletePolicestation(<?php echo
$row['pol_station_id']; ?>)" class="btn btn-danger btn-xs"><sapan class="glyphicon glyphicon-
trash"></span></a></td>
</tr>
<?php
}}
?>
<!-- Qaybta Delete ka -->
<?php
if(isset($_POST['pol_station_id'])) {
$id = $_POST['pol_station_id'];
$result = mysqli_query($conn, "DELETE from police_station WHERE pol_station_id='$id'");
if ($result) {
?>
<script>
alert("Success To Delete Data");
Windows.location.href='policestation_table.php';
</script>
<?php
}else{
?>
<script>
alert("Fail To Delete Data");
Windows.location.href='policestation_table.php';
91
</script>
<?php
}}
?>
<!-- End Qaybta Delete ka -->
</tbody>
</table>
<!-- Qaybta Model Form Update Cases -->
<div class="form-group">
<label class="control-label" for="first-name">Pol_station_ID : <span class="required">*</span>
</label>
<input type="text" id="pol_id" name="pol_station_id" required="required" class="form-control">
</div>
<div class="form-group">
<label class="control-label" for="last-name">pol_station_name <span class="required">*</span>
</label>
<input type="text" id="pname" name="pol_station_name" required="required" class="form-
control">
</div>
<div class="form-group">
92
<label for="middle-name" class="control-label">phone</label>
<input id="phone" class="form-control" type="text" name="phone">
</div>
<div class="form-group">
<label for="middle-name" class="control-label">Address</label>
<input id="addres" class="form-control" type="text" name="Address">
</div>
<div class="form-group">
<label for="middle-name" class="control-label">Email</label>
<input id="email" class="form-control" type="text" name="Email">
</div>
<div class="form-group">
<label for="middle-name" class="control-label">Area</label>
<input id="area" class="form-control" type="text" name="Area">
</div>
<div class="form-group">
<label for="middle-name" class="control-label">Date</label>
<input id="date" class="form-control" type="date" name="date">
</div>
<div class="modal-footer">
<button type="submit" id="register" class="btn btn-success"><span class="glyphicon glyphicon-plus"></span>
Update</button>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- waa qaybat model in lagu soo buuxiyo data -->
<script>
function selectPlice(pol_station_id){
var data= 'pol_station_id='+pol_station_id;
93
$.ajax({
data:data,
url:'selectPStation.php',
success:function(res){
// alert(res);
var index=res.split(';');
$('#pol_id').val(index[0]);
$('#pname').val(index[1]);
$('#phone').val(index[2]);
$('#addres').val(index[3]);
$('#email').val(index[4]);
$('#area').val(index[5]);
$('#date').val(index[6]);
$('#exampleModal').modal('show');
}});
}
</script>
<!-- End waa qaybat model in lagu soo buuxiyo data -->
94
$("form").submit(function(e){
e.preventDefault();
var $form_date=$(this).serialize();
var $page_url=$(this).attr("action");
$.ajax({
data:$form_date,
url:$page_url,
method:"POST",
success:function(res){
$('#msg').html(res);
}
});
});
});
</script>
Appendix F: cases.php
<div class="x_content">
<br />
<form method="post" action="insert.php" id="demo-form2" data-parsley-validate class="form-horizontal
form-label-left">
<!-- Input Type Hidden Connection -->
<div class="form-group">
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="hidden" name="proc" value="Add_Cases_Sp"required="required" class="form-
control col-md-7 col-xs-12">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">Case_id :<span
class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<!-- php query by selecting id and readonly -->
<?php
95
$conn=new mysqli("localhost","root","","online_crms_db");
$query="SELECT id FROM cases order by id DESC";
$res=$conn->query($query);
$row = $res->fetch_array(); ?>
<input type="text" name="case_id" value="<?php echo $row['id']+1; ?>" required="required" readOnly
class="form-control col-md-7 col-xs-12">
</div>
<!-- End php query by selecting id and readonly -->
</div>
<?php }?></select></div></div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Case Name :<span
class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="casename">
96
</div></div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Description : <span
class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="desc">
</div>
</div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Date : <span
class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="date" name="date" >
</div></div>
<div class="ln_solid"></div>
<div class="form-group">
<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
<button class="btn btn-primary" type="button">Cancel</button>
<button type="submit" class="btn btn-success">Save</button>
</div></div></form></div></div>
<script src= "jquery-3.3.1.min.js"></script>
<!-- Waa Qaybta Ajax ka-->
<script type="text/javascript">
$(function(){
$("form").submit(function(e){
e.preventDefault();
var $form_date=$(this).serialize();
var $page_url=$(this).attr("action");
$.ajax({
data:$form_date,
url:$page_url,
method:"POST",
success:function(res){
$('#msg').html(res);
97
}
});
});
});
</script>
Appendix G: insert.php
<?php
$params="";
$sp="";
$i=0;
foreach ($_POST as $val) {
$i++;
if ($i==1) {
$sp=$val;
continue;
}
98
</div> <?php } ?>
Apendex H: updateCases.php
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$sql="CALL update_case_Sp('$_POST[case_id]','$_POST[pollname]','$_POST[casename]',
'$_POST[desc]','$_POST[date]')";
$res=$conn->query($sql);
$row=$res->fetch_array();
echo $row[0];
header("Location:cases_table.php");
?>
Appedix I: deletecases.php
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$sql="CALL delete_Case_Sp('$_GET[c_id]')";
$res=$conn->query($sql);
$row=$res->fetch_array();
echo $row[0];
header("Location:cases_table.php?del=1");
?>
Appedix J: cases_table.php
<div class="x_content">
<br />
<form method="post" action="insert.php" id="demo-form2" data-parsley-validate class="form-horizontal
form-label-left">
99
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">Case_id :<span
class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
100
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Case Name :<span
class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="casename">
</div> </div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Description : <span
class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="desc">
</div>
</div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Date : <span
class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="date" name="date" >
</div>
</div>
<div class="ln_solid"></div>
<div class="form-group">
<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
<button class="btn btn-primary" type="button">Cancel</button>
<button type="submit" class="btn btn-success">Save</button>
</div>
</div>
</form>
101
</div>
</div>
Appendix K: crime_registration.php
<div class="x_content">
<br />
<form method="post" action="insert_crime.php" id="demo-form2" data-parsley-validate class="form-
horizontal form-label-left" enctype="multipart/form-data">
102
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="text" name="victim" required="required" class="form-control col-md-7 col-xs-12">
</div>
</div>
<?php
}
?>
</select>
</div>
</div>
<!-- Selection from Police Station name -->
<div class="form-group" >
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">Police Station : <span
class="required">*</span>
</label>
103
<div class="col-md-6 col-sm-6 col-xs-12">
<select class="form-control" name="polstation">
<option>Select Police Name</option>
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$query="SELECT pol_station_id,policatstaion_name FROM police_station";
$res=$conn->query($query);
while($row = $res->fetch_array())
{
?>
<option value="<?php echo $row[0]?>"> <?php echo $row[1]; ?> </option>
<?php }
?>
</select> </div> </div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Criminal
Name</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="name">
</div> </div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Victem
Address</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="Address">
</div> </div>
<div class="form-group" >
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">Gender : <span
class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<select class="form-control" name="gender">
<option>Select Gender</option>
104
<option>Male</option>
<option>Female</option> </select></div></div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Phone</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="phone">
</div> </div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-
12">Crime_location</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="text"
name="crime_location">
</div> </div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Crime_date</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="date" name="c_date">
</div> </div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-
12">Upload_evidance</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="file" name="image">
</div></div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Description</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="text"
name="description">
</div> </div>
<div class="ln_solid"></div>
<div class="form-group">
<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
<button class="btn btn-primary" type="button">Cancel</button>
105
<button type="submit" class="btn btn-success">Save</button>
</div></div></form></div> </div>
Appendix L: insert_crime.php
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$path = "uploads/".$_FILES['image']['name'];
if(move_uploaded_file($_FILES['image']['tmp_name'], $path)){
//$sql="insert into users(user_id,username,password,images,date)
values('$_POST[user_id]','$_POST[username]','$_POST[pasword]','$path',$_POST[date]')";
$sql = "CALL
Add_Crime_registration_Sp('$_POST[Cr_id]','$_POST[victim]','$_POST[cases]','$_POST[polstation]','$_POST[na
me]','$_POST[Address]','$_POST[gender]','$_POST[phone]','$_POST[crime_location]','$_POST[c_date]','$path','$_
POST[description]')";
$res = $conn->query($sql);
if(!$res){
echo $conn->error . $sql;
return false;
}else{
header("Location:crimeregistration_table.php");
}}?>
Appendix M: updateCrimes.php
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$path = "uploads/".$_FILES['image']['name'];
if(move_uploaded_file($_FILES['image']['tmp_name'], $path)){
$sql="CALL update_Crime_Reistration_Sp('$_POST[Cr_id]','$_POST[victim]',
'$_POST[cases]','$_POST[polstation]','$_POST[name]','$_POST[Address]','$_POST[gender]',
'$_POST[phone]','$_POST[c_date]','$path','$_POST[description]')";
$res = $conn->query($sql);
if(!$res){
echo $conn->error . $sql;
return false;
}
else{
header("Location:crimeregistration_table.php");
106
}}?>
Appendix N: deletecrimes.php
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$sql="CALL delete_crime_registration_Sp('$_GET[Cr_Id]')";
$res=$conn->query($sql);
$row=$res->fetch_array();
echo $row[0];
header("Location:crimeregistration_table.php?del=1");
?>
Apendix O: crimeregistration_table.php
<?php
session_start();
if(empty($_SESSION['name'])){
header("Location:../logout.php");
}?><?php
$conn=new mysqli("localhost","root","","online_crms_db");
$query="SELECT
cr.Cr_Id,cr.victim,cs.case_name,p.policatstaion_name,cr.name,cr.address,cr.c_date,cr.upload_evidance,cr.descriptio
n FROM crime_registration cr JOIN police_station p ON cr.pol_station_id=p.id JOIN cases cs ON
cr.case_id=cs.id";
$result=$conn->query($query);
?>
<div class="clearfix"></div>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-10">
<!-- In lagu soo daabaco wixii kasoo laabta query procedure ka in lagu soo daabaco -->
<?php
if(isset($_POST["del"])){
if($_POST["del"]==1){
echo "Deleted Successfully";
}}?>
<!-- End In lagu soo daabaco wixii kasoo laabta query procedure ka in lagu soo daabaco -->
<div class="x_content">
107
<a href="crime_registration.php" class="btn btn-success pull-right" style="margin-right:10px;margin-
top:3px;">Add Criminals</a>
<table id="datatable-buttons" class="table table-striped table-bordered">
<thead><tr>
<th>ID</th>
<th>Victem</th>
<th>Case</th>
<th>PStation</th>
<th>Crime Name</th>
<th>Adress</th>
<th>date</th>
<th>Evidance</th>
<th>Description</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
if(mysqli_num_rows($result) > 0)
{while($row = mysqli_fetch_array($result))
{?>
<tr>
<td><?php echo $row["Cr_Id"]; ?></td>
<td><?php echo $row["victim"]; ?></td>
<td><?php echo $row["case_name"]; ?></td>
<td><?php echo $row["policatstaion_name"]; ?></td>
<td><?php echo $row["name"]; ?></td>
<td><?php echo $row["address"]; ?></td>
<td><?php echo $row["c_date"]; ?></td>
<td><img src="<?php echo $row["upload_evidance"];
?>"style="width:45px;height:30px;margin-left: 10px;"></td>
<td><?php echo $row["description"]; ?></td>
<td><button type="submit" class="btn btn-success btn-xs" onclick="selectcrimes(<?php
echo $row['Cr_Id']; ?>)" data-whatever="@fat"><span class="glyphicon glyphicon-edit"></span></button>
108
<a href="#" name="delete" onclick="DeleteCrimeRegistred(<?php echo $row['Cr_Id'];
?>)" class="btn btn-danger btn-xs"><sapan class="glyphicon glyphicon-trash"></span></a></td>
</tr> <?php
}}?>
<!-- Qaybta Delete ka -->
<?php
if(isset($_POST['Cr_Id'])) {
$id = $_POST['Cr_Id'];
$result = mysqli_query($conn, "DELETE from crime_registration WHERE Cr_Id='$id'");
if ($result) {
?>
<script>
alert("Success To Delete Data");
Windows.location.href='crimeregistration_table.php';
</script>
<?php
}else{
?>
<script>
alert("Fail To Delete Data");
Windows.location.href='crimeregistration_table.php';
</script>
<?php
}
}
?>
<!-- End Qaybta Delete ka -->
</tbody>
</table>
<!-- Qaybta Model Form Update Cases -->
109
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 style="color:blue" class="modal-title" id="exampleModalLabel">Update Crime Registration Table</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" >
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="updateCrimes.php" method="post" enctype="multipart/form-data">
<div class="form-group">
<label class="control-label" for="first-name">Crime_id : <span class="required">*</span>
</label>
<!-- php query by selecting id and readonly -->
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$query="SELECT id FROM crime_registration order by id DESC";
$res=$conn->query($query);
$row = $res->fetch_array();
?>
<input type="text" id="id" name="Cr_id" required="required" class="form-control" value="<?php
echo $row['id']+1; ?>" readOnly>
</div>
<div class="form-group">
<label class="control-label" for="last-name">Victim <span class="required">*</span>
</label>
<input type="text" id="victim" name="victim" required="required" class="form-control">
</div>
<!-- Selection from Police Station name -->
<div class="form-group" >
<label class="control-label" for="last-name">Cases : <span class="required">*</span>
110
</label>
<select class="form-control" name="cases">
<option>Select Cases Name</option>
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$query="SELECT c.c_id,c.case_name FROM cases c";
$res=$conn->query($query);
while($row = $res->fetch_array())
{
?>
<option value="<?php echo $row[0]?>"> <?php echo $row[1]; ?> </option>
<?php}
?> </select></div>
<!-- Selection from Police Station name -->
<div class="form-group" >
<label class="control-label" for="last-name">Police Station : <span class="required">*</span>
</label>
<select class="form-control" name="polstation">
<option>Select Police Name</option>
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$query="SELECT pol_station_id,policatstaion_name FROM police_station";
$res=$conn->query($query);
while($row = $res->fetch_array())
{
?>
<option value="<?php echo $row[0]?>"> <?php echo $row[1]; ?> </option>
<?php
}?></select>
</div>
<div class="form-group">
<label for="middle-name" class="control-label">Name</label>
111
<input id="name" class="form-control" type="text" name="name">
</div>
<div class="form-group">
<label for="middle-name" class="control-label">Address</label>
<input id="add" class="form-control" type="text" name="Address">
</div>
<div class="form-group" >
<label class="control-label" for="last-name">Gender : <span class="required">*</span>
</label>
<select class="form-control" name="gender">
<option>Select Gender</option>
<option>Male</option>
<option>Female</option>
</select>
</div>
<div class="form-group">
<label for="middle-name" class="control-label">Phone</label>
<input id="tell" class="form-control" type="text" name="phone">
</div>
<div class="form-group">
<label for="middle-name" class="control-label">Crime_date</label>
<input id="date" class="form-control" type="date" name="c_date">
</div>
<div class="form-group">
<label for="middle-name" class="control-label">Upload_evidance</label>
<input id="evidance" class="form-control" type="file" name="image">
</div>
<div class="form-group">
<label for="middle-name" class="control-label">Description</label>
<input id="des" class="form-control" type="text" name="description">
</div>
<div class="modal-footer">
112
<button type="submit" id="register" class="btn btn-success"><span class="glyphicon glyphicon-
plus"></span> Update</button>
</div></form>
</div></div></div></div>
<!-- waa qaybat model in lagu soo buuxiyo data -->
<script>
function selectcrimes(Cr_id){
var data= 'Cr_Id='+Cr_id;
$.ajax({
data:data,
url:'selectCrimes.php',
success:function(res){
// alert(res);
var index=res.split(';');
$('#id').val(index[0]);
$('#victim').val(index[1]);
$('#name').val(index[4]);
$('#add').val(index[5]);
$('#tell').val(index[6]);
$('#location').val(index[8]);
$('#date').val(index[9]);
$('#des').val(index[11]);
$('#exampleModal').modal('show');
}});}
</script>
<!-- End waa qaybat model in lagu soo buuxiyo data -->
<!-- waa script lagu dhax samenayo function delete -->
<script>
function DeleteCrimeRegistred(Cr_id){
if(confirm('Are You Sure you want to Delete this Record?')){
//alert(CustID);
window.location="deletecrimes.php?Cr_Id="+Cr_id;
113
}
}</script>
<!-- End waa script lagu dhax samenayo function delete -->
Appendix P: users.php
<?php
session_start();
if(empty($_SESSION['name'])){
header("Location:../logout.php");
}
?>
<div class="x_content">
<br />
<form method="post" action="insert_wanted.php" id="demo-form2" data-parsley-validate class="form-
horizontal form-label-left" enctype="multipart/form-data">
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">Wanted_id <span
class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<!-- php query by selecting id and readonly -->
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$query="SELECT id FROM wanted order by id DESC";
$res=$conn->query($query);
$row = $res->fetch_array();
?>
<input type="text" name="W_id" required="required" class="form-control col-md-7 col-xs-12"
value="<?php echo $row['id']+1; ?>" readOnly>
</div>
<!-- End php query by selecting id and readonly -->
</div>
<!-- Selection from Police Station name -->
114
<div class="form-group" >
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">Police Station : <span
class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<select class="form-control" name="polstation">
<option>Select Police Name</option>
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$query="SELECT pol_station_id,policatstaion_name FROM police_station";
$res=$conn->query($query);
while($row = $res->fetch_array())
{
?>
<option value="<?php echo $row[0]?>"> <?php echo $row[1]; ?> </option>
<?php
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">name</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="name">
</div>
</div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">image</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="file" name="image">
</div>
</div>
115
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Date</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="date" name="date">
</div>
</div>
<div class="ln_solid"></div>
<div class="form-group">
<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
<button class="btn btn-primary" type="button">Cancel</button>
<button type="submit" class="btn btn-success">Save</button>
</div>
</div>
</form>
</div>
<!-- jQuery -->
<script src= "jquery-3.3.1.min.js"></script>
<!-- Waa Qaybta Ajax ka-->
<!-- <script type="text/javascript">
$(function(){
$("form").submit(function(e){
e.preventDefault();
var $form_date=$(this).serialize();
var $page_url=$(this).attr("action");
$.ajax({
data:$form_date,
url:$page_url,
method:"POST",
success:function(res){
$('#msg').html(res);
}
});
116
});
});
</script> -->
Appendix Q: insert_wanted.php
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$path = "uploads/".$_FILES['image']['name'];
if(move_uploaded_file($_FILES['image']['tmp_name'], $path)){
//$sql="insert into users(user_id,username,password,images,date)
values('$_POST[user_id]','$_POST[username]','$_POST[pasword]','$path',$_POST[date]')";
$sql = "CALL Add_wanted_Sp('$_POST[W_id]','$_POST[polstation]','$_POST[name]','$path', '$_POST[date]')";
$res = $conn->query($sql);
if(!$res){
echo $conn->error . $sql;
return false;
}
else{
header("Location:wanted_table.php");
}
}
?>
Appendix R: updatewanted.php
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$path = "uploads/".$_FILES['image']['name'];
if(move_uploaded_file($_FILES['image']['tmp_name'], $path)){
$sql="CALL update_wanted_Sp('$_POST[W_id]','$_POST[polstation]','$_POST[name]','$path','$_POST[date]')";
$res = $conn->query($sql);
if(!$res){
echo $conn->error . $sql;
return false;
117
}
else{
header("Location:wanted_table.php");
}}
?>
Appendix S: deletewanted.php
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$sql="CALL delete_crime_registration_Sp('$_GET[Cr_Id]')";
$res=$conn->query($sql);
$row=$res->fetch_array();
echo $row[0];
header("Location:crimeregistration_table.php?del=1");
?>
Appebdix T: wanted_table.php
<?php
session_start();
if(empty($_SESSION['name'])){
header("Location:../logout.php");
}
?>
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$query="SELECT w.W_id,p.policatstaion_name,w.name,w.image,w.date FROM wanted w JOIN police_station p
ON w.pol_station_id=p.id";
$result=$conn->query($query);
?>
118
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<!-- In lagu soo daabaco wixii kasoo laabta query procedure ka in lagu soo daabaco -->
<?php
if(isset($_POST["del"])){
if($_POST["del"]==1){
119
?>
<tr>
<td><?php echo $row["W_id"]; ?></td>
<td><?php echo $row["policatstaion_name"]; ?></td>
<td><?php echo $row["name"]; ?></td>
<td><img src="<?php echo $row["image"]; ?>" style="width:30px;height:30px;"></td>
<td><?php echo $row["date"]; ?></td>
<td><button type="submit" class="btn btn-success btn-xs"
onclick="selectWanted(<?php echo $row['W_id']; ?>)" data-whatever="@fat"><span class="glyphicon glyphicon-
edit"></span></button></td>
120
}
}
?>
<!-- End Qaybta Delete ka --></tbody></table>
<!-- Qaybta Model Form Update Cases -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 style="color:blue" class="modal-title" id="exampleModalLabel">Update Wanted Table</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" >
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="updatewanted.php" method="post" enctype="multipart/form-data">
<div class="form-group">
<label class="control-label " for="last-name">Wanted_id <span class="required">*</span>
</label>
<!-- php query by selecting id and readonly --><?php
$conn=new mysqli("localhost","root","","online_crms_db");
$query="SELECT id FROM wanted order by id DESC";
$res=$conn->query($query);
$row = $res->fetch_array();?>
<input type="text" id="id" name="W_id" required="required" class="form-control " value="<?php
echo $row['id']+1; ?>" readOnly>
</div>
<!-- Selection from Police Station name -->
<div class="form-group" >
<label class="control-label " for="last-name">Police Station : <span class="required">*</span>
</label>
121
<select class="form-control" name="polstation">
<option>Select Police Name</option>
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$query="SELECT pol_station_id,policatstaion_name FROM police_station";
$res=$conn->query($query);
while($row = $res->fetch_array())
{
?>
<option value="<?php echo $row[0]?>"> <?php echo $row[1]; ?> </option>
<?php } ?>
</select>
</div>
<div class="form-group">
<label for="middle-name" class="control-label ">name</label>
<input id="name" class="form-control " type="text" name="name"></div>
<div class="form-group">
<label for="middle-name" class="control-label ">image</label>
<input id="image" class="form-control " type="file" name="image"></div>
<div class="form-group">
<label for="middle-name" class="control-label ">Date</label>
<input id="date" class="form-control " type="date" name="date">
</div>
<div class="modal-footer">
122
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /page content -->
123
<script src="../vendors/datatables.net-buttons-bs/js/buttons.bootstrap.min.js"></script>
<!-- waa qaybat model in lagu soo buuxiyo data -->
<script>
function selectWanted(W_id){
var data= 'W_id='+W_id;
$.ajax({
data:data,
url:'selectWanted.php',
success:function(res){
// alert(res);
var index=res.split(';');
$('#id').val(index[0]);
$('#name').val(index[2]);
$('#date').val(index[4]);
$('#exampleModal').modal('show');
}
});
}
</script>
<!-- End waa qaybat model in lagu soo buuxiyo data -->
124
<script src="../vendors/datatables.net-buttons/js/buttons.flash.min.js"></script>
<script src="../vendors/datatables.net-buttons/js/buttons.html5.min.js"></script>
<script src="../vendors/datatables.net-buttons/js/buttons.print.min.js"></script>
<script src="../vendors/datatables.net-fixedheader/js/dataTables.fixedHeader.min.js"></script>
<script src="../vendors/datatables.net-keytable/js/dataTables.keyTable.min.js"></script>
<script src="../vendors/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
<script src="../vendors/datatables.net-responsive-bs/js/responsive.bootstrap.js"></script>
<script src="../vendors/datatables.net-scroller/js/dataTables.scroller.min.js"></script>
<script src="../vendors/jszip/dist/jszip.min.js"></script>
<script src="../vendors/pdfmake/build/pdfmake.min.js"></script>
<script src="../vendors/pdfmake/build/vfs_fonts.js"></script>
<!-- Custom Theme Scripts -->
<script src="../build/js/custom.min.js"></script>
</body>
</html>
Appendix U: missing_person.php
<div class="x_content">
<br />
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">m_id : <span
class="required">*</span>
</label>
125
<div class="col-md-6 col-sm-6 col-xs-12">
<!-- php query by selecting id and readonly -->
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$query="SELECT id FROM missing_person order by id DESC";
$res=$conn->query($query);
$row = $res->fetch_array();
?>
<input type="text" name="m_id" required="required" class="form-control col-md-7 col-xs-12"
value="<?php echo $row['id']+1; ?>" readOnly>
</div>
<!-- End php query by selecting id and readonly -->
</div>
<!-- Selection from Police Station name -->
<div class="form-group" >
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">Police Station : <span
class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<select class="form-control" name="polstation">
<option>Select Police Name</option>
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$query="SELECT pol_station_id,policatstaion_name FROM police_station";
$res=$conn->query($query);
while($row = $res->fetch_array())
{
?>
<option value="<?php echo $row[0]?>"> <?php echo $row[1]; ?> </option>
<?php
126
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Name</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="name">
</div>
</div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Address</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="Address">
</div>
</div>
127
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Image</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="file" name="image">
</div>div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Missing_date</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="date"
name="miss_date">
</div>
</div>
<div class="ln_solid"></div>
<div class="form-group">
<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
<button class="btn btn-primary" type="button">Cancel</button>
<button type="submit" class="btn btn-success">Save</button>
</div></div>
</form>
<p id="msg"></p>
</div></div>
Appendix V: insert_missing.php
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$path = "uploads/".$_FILES['image']['name'];
if(move_uploaded_file($_FILES['image']['tmp_name'], $path)){
//$sql="insert into users(user_id,username,password,images,date)
values('$_POST[user_id]','$_POST[username]','$_POST[pasword]','$path',$_POST[date]')";
$sql = "CALL
Add_missing_Sp('$_POST[m_id]','$_POST[polstation]','$_POST[name]','$_POST[Address]','$_POST[gender]','$_P
OST[age]','$path','$_POST[miss_date]')";
$res = $conn->query($sql);
if(!$res){
echo $conn->error . $sql;
128
return false;
}
else{
header("Location:missingperson_table.php");
}}?>
Appendix W: updateMperson.php
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$path = "uploads/".$_FILES['image']['name'];
if(move_uploaded_file($_FILES['image']['tmp_name'], $path)){
$sql="CALL update_missin_Persons_Sp('$_POST[m_id]','$_POST[polstation]','$_POST[name]',
'$_POST[Address]','$_POST[gender]','$_POST[age]','$path','$_POST[miss_date]')"; $res = $conn->query($sql);
if(!$res){
echo $conn->error . $sql;
return false;
}
else{
header("Location:missingperson_table.php");
}}
?>
Appendix X: deletemperson.php
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$sql="CALL delete_missing_person_Sp('$_GET[m_id]')";
$res=$conn->query($sql);
$row=$res->fetch_array();
echo $row[0];
header("Location:missingperson_table.php?del=1");?>
129
Appendix Y: missingperson_table.php
<?php
session_start();
if(empty($_SESSION['name'])){
header("Location:../logout.php");
}?>
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$query="SELECT m.m_id,pol.policatstaion_name,m.name,m.address,m.gender,m.age,m.image,m.miss_date FROM
missing_person m JOIN police_station pol on m.pol_station_id=pol.id";
$result=$conn->query($query);
?>
<div class="clearfix"></div>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<!-- In lagu soo daabaco wixii kasoo laabta query procedure ka in lagu soo daabaco -->
<?php
if(isset($_POST["del"])){
if($_POST["del"]==1){
130
<th>Address</th>
<th>Gender</th>
<th>Age</th>
<th>Image</th>
<th>Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
if(mysqli_num_rows($result) > 0)
{
while($row = mysqli_fetch_array($result))
{
?>
<tr>
<td><?php echo $row["m_id"]; ?></td>
<td><?php echo $row["policatstaion_name"]; ?></td>
<td><?php echo $row["name"]; ?></td>
<td><?php echo $row["address"]; ?></td>
<td><?php echo $row["gender"]; ?></td>
<td><?php echo $row["age"]; ?></td>
<td><img src="<?php echo $row["image"]; ?>"
style="width:45px;height:30px;margin-left: 10px;"></td>
<td><?php echo $row["miss_date"]; ?></td>
<td><button type="submit" class="btn btn-success btn-xs" onclick="selectMissing(<?php
echo $row['m_id']; ?>)" data-whatever="@fat"><span class="glyphicon glyphicon-edit"></span></button>
<a href="#" name="delete" onclick="DeleteMperon(<?php echo $row['m_id']; ?>)"
class="btn btn-danger btn-xs"><sapan class="glyphicon glyphicon-trash"></span></a></td>
</tr>
<?php
131
}}
?>
<?php
if(isset($_POST['m_id'])) {
$id = $_POST['m_id'];
$result = mysqli_query($conn, "DELETE from missing_person WHERE m_id='$id'");
if ($result) {
?>
<script>
alert("Success To Delete Data");
Windows.location.href='missingperson_table.php';
</script>
<?php
}else{
?>
<script>
alert("Fail To Delete Data");
Windows.location.href='missingperson_table.php';
</script>
<?php
}}?>
<!-- End Qaybta Delete ka -->
</tbody>
</table>
<!-- Qaybta Model Form Update Cases -->
132
<h4 style="color:blue" class="modal-title" id="exampleModalLabel">Update Missing Person Table</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" >
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="updateMperson.php" method="post" enctype="multipart/form-data">
<div class="form-group">
<label class="control-label " for="first-name">m_id : <span class="required">*</span>
</label>
<!-- php query by selecting id and readonly -->
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$query="SELECT id FROM missing_person order by id DESC";
$res=$conn->query($query);
$row = $res->fetch_array();
?>
<input type="text" id="id" name="m_id" required="required" class="form-control " value="<?php
</div>
133
?>
<option value="<?php echo $row[0]?>"> <?php echo $row[1]; ?> </option>
<?php
}
?>
</select>
</div>
<div class="form-group">
<label for="middle-name" class="control-label ">Name</label>
<input id="name" class="form-control" type="text" name="name">
</div>
<div class="form-group">
<label for="middle-name" class="control-label">Address</label>
<input id="add" class="form-control" type="text" name="Address">
</div>
<div class="form-group" >
<label for="middle-name" class="control-label">Gender</label>
<select id="gender" class="form-control" name="gender">
<option>Select Gender</option>
<option>Male</option>
<option>Female</option>
</select>
</div>
<div class="form-group">
<label for="middle-name" class="control-label">Age</label>
<input id="age" class="form-control" type="text" name="age">
</div>
<div class="form-group">
<label for="middle-name" class="control-label ">Image</label>
<input id="image" class="form-control" type="file" name="image">
</div>
134
<div class="form-group">
<label for="middle-name" class="control-label ">Missing_date</label>
<input id="date" class="form-control" type="date" name="miss_date">
</div>
<div class="modal-footer">
<button type="submit" id="register" class="btn btn-success"><span class="glyphicon glyphicon-plus"></span>
Update</button></div></form></div></div></div></div>
<!-- waa qaybat model in lagu soo buuxiyo data -->
<script>
function selectMissing(m_id){
var data= 'm_id='+m_id;
$.ajax({
data:data,
url:'selectMissing.php',
success:function(res){
// alert(res);
var index=res.split(';');
$('#id').val(index[0]);
$('#name').val(index[2]);
$('#add').val(index[3]);
$('#gender').val(index[4]);
$('#age').val(index[5]);
$('#date').val(index[7]);
$('#exampleModal').modal('show');
}});
}
</script>
<!-- End waa qaybat model in lagu soo buuxiyo data -->
<!-- waa script lagu dhax samenayo function delete -->
<script>
function DeleteMperon(m_id){
if(confirm('Are You Sure you want to Delete this Record?')){
//alert(CustID);
window.location="deletemperson.php?m_id="+m_id;
135
}
}
</script>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<div>
136
<a class="hiddenanchor" id="signup"></a>
<div class="login_wrapper">
<section class="login_content">
<h1>Login Form</h1>
<img src="images/Somali_Police_Force_Logo.png"
<div>
</div><div>
</div><div>
</div>
<option>Admin</option>
<option>User</option>
<option>Citizen</option>
137
</select>
</div><div>
</div>
<div class="clearfix"></div>
<div class="separator">
</p>
<div class="clearfix"></div>
</form>
</section>
</div></div></div>
</body>
</html>
session_start();
$conn=new mysqli("localhost","root","","online_crms_db");
if(isset($_POST['login'])){
$name=$_POST['name'];
$password=$_POST['pass'];
$type=$_POST['type'];
138
$result=mysqli_query($conn,$query);
if($result){
while($row=mysqli_fetch_array($result)){
echo '<script>alert("You are login successfully and you are loggined as ' .$row['type'].'")</script>';
if($row['type'] == 'admin'){
?>
<?php
$_SESSION['name']=$name;
$_SESSION['pass']=$password;
$_SESSION['type']=$type;
$_SESSION['images']=$row['images'];
?>
<script>
window.location.href="admin/index.php" </script>;
<?php
?>
<?php
$_SESSION['name']=$name;
$_SESSION['pass']=$password;
$_SESSION['type']=$type;
$_SESSION['images']=$row['images'];
?>
<script>
window.location.href="users/index.php" </script>;
139
<?php
?>
<?php
$_SESSION['name']=$name;
$_SESSION['pass']=$password;
$_SESSION['type']=$type;
$_SESSION['images']=$row['images'];
?>
<script>
window.location.href="citizens/index.php" </script>;
<?php
else{
}}
}}
?>
<?php
session_start();
session_destroy();
header("Location:login.php");
?>
140
Appendix AB: index.php
<?php
session_start();
if(empty($_SESSION['name'])){
header("Location:../logout.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
141
<link href="../vendors/bootstrap-progressbar/css/bootstrap-progressbar-3.3.4.min.css"
rel="stylesheet">
</head>
<body class="nav-md">
</div>
<div class="profile_pic">
style="width:70px;height:70px;margin-left:10px;" >
</div>
<div class="profile_info">
142
<h2 style="color:yellow;font-style: bold;font-size: 18px;padding-left: 20px;"><?php echo
$_SESSION['name'] ?></h2>
</div></div>
<br />
<div class="menu_section">
<h3>General</h3>
<li><a href="cases.php">Cases</a></li>
<li><a href="wanted.php">wanted</a></li>
<li><a href="district.php">District</a></li>
<li><a href="admin.php">Admin</a></li>
<li><a href="users.php">Uers</a></li>
</ul>
</li>
143
<ul class="nav child_menu">
</ul>
</li>
down"></span></a>
</li>
</ul>
</div> </div>
144
<a data-toggle="tooltip" data-placement="top" title="Settings">
</a>
</a>
</a>
</a>
<div class="top_nav">
<nav>
</div>
<li class="">
145
</ul>
</li>
</ul>
</nav>
<div class="count">150</div>
<h3>Total Users</h3>
</div></div>
<div class="count">800</div>
<h3>Total Complaints</h3>
</div></div>
<div class="count">150</div>
<h3>Total Criminals</h3>
146
</div></div>
</div></div></div>
<div class="panel-body">
<h3>80 </h3>
</div>
</div></div></div>
<div class="panel-body">
<h3>50 </h3>
</div>
147
</div></div> </div>
<div class="panel-body">
<h3>300 </h3>
</div>
Daily Services
</div></div></div>
<div class="panel-body">
<h3>1500 </h3>
</div>
No Complaints
</div></div></div>
<div class="row">
<div class="dashboard_graph">
<div class="col-md-6">
148
<h3>Police Activities <small>By Graph</small></h3>
</div>
<div class="col-md-6">
</div></div> </div>
</div>
<div class="x_title">
<div class="clearfix"></div>
</div>
<div>
<p>Regions Complaints</p>
<div class="">
</div>
</div>
</div>
<div>
149
<p>City Complaints</p>
<div class="">
</div></div></div></div>
<div><p>District Complaints</p>
<div class="">
</div></div></div><div>
<div class="">
</div></div></div></div></div>
<div class="clearfix"></div>
</div></div></div><br />
<div class="row">
</div></div></div></div>
<footer>
<div class="pull-right">
</div>
150
<div class="clearfix"></div>
</footer>
</div> </div>
<script src="../vendors/jquery/dist/jquery.min.js"></script>
<script src="../vendors/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="../vendors/fastclick/lib/fastclick.js"></script>
<script src="../vendors/nprogress/nprogress.js"></script>
<script src="../vendors/Chart.js/dist/Chart.min.js"></script>
<script src="../vendors/gauge.js/dist/gauge.min.js"></script>
<script src="../vendors/bootstrap-progressbar/bootstrap-progressbar.min.js"></script>
<script src="../vendors/iCheck/icheck.min.js"></script>
<script src="../vendors/skycons/skycons.js"></script>
<script src="../vendors/Flot/jquery.flot.js"></script>
<script src="../vendors/Flot/jquery.flot.pie.js"></script>
<script src="../vendors/Flot/jquery.flot.time.js"></script>
151
<script src="../vendors/Flot/jquery.flot.stack.js"></script>
<script src="../vendors/Flot/jquery.flot.resize.js"></script>
<script src="../vendors/flot.orderbars/js/jquery.flot.orderBars.js"></script>
<script src="../vendors/flot-spline/js/jquery.flot.spline.min.js"></script>
<script src="../vendors/flot.curvedlines/curvedLines.js"></script>
<script src="../vendors/DateJS/build/date.js"></script>
<script src="../vendors/jqvmap/dist/jquery.vmap.js"></script>
<script src="../vendors/jqvmap/dist/maps/jquery.vmap.world.js"></script>
<script src="../vendors/jqvmap/examples/js/jquery.vmap.sampledata.js"></script>
<script src="../vendors/moment/min/moment.min.js"></script>
<script src="../vendors/bootstrap-daterangepicker/daterangepicker.js"></script>
<script src="../build/js/custom.min.js"></script>
</body>
</html>
152
<!-- citizen form -->
<form method="post" action="insert.php" id="demo-form2" data-parsley-validate class="form-horizontal form-label-
left">
<!-- Input Type Hidden Connection -->
<div class="form-group">
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="hidden" name="proc" value="Add_Citizens_Sp" required="required" class="form-control col-
md-7 col-xs-12"></div></div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">Citizen_ID : <span
class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<!-- php query by selecting id and readonly -->
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$query="SELECT id FROM citizens order by id DESC";
$res=$conn->query($query);
$row = $res->fetch_array();
?>
<input type="text" readOnly name="CitizenID" value="<?php echo $row['id']+1; ?>"
required="required" class="form-control col-md-7 col-xs-12">
</div>
<!-- End php query by selecting id and readonly -->
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">Admin_ID <span
class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="text" name="AdminID" required="required" class="form-control col-md-7 col-xs-12">
</div>
</div>
153
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Name</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="name">
</div>
</div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Address</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="address">
</div>
</div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Tell</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="Tell">
</div>
</div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Place_birth</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="place birth">
</div>
</div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Date</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="date" name="date">
</div>
</div>
<div class="ln_solid"></div>
<div class="form-group">
<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
154
<button class="btn btn-primary" type="button">Cancel</button>
<button type="submit" class="btn btn-success">Submit</button>
</div>
</div>
</form>
</div>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<!-- In lagu soo daabaco wixii kasoo laabta query procedure ka in lagu soo daabaco -->
<?php
if(isset($_POST["del"])){
if($_POST["del"]==1){
}
}
?>
<div class="x_content">
155
<a href="citizen.php" class="btn btn-success pull-right" style="margin-right:10px;margin-top:3px;">Add Citizens</a>
<table id="datatable-buttons" class="table table-striped table-bordered">
<thead>
<tr>
<th>Citizen ID</th>
<th>Admin ID</th>
<th> Name</th>
<th>Address</th>
<th>Tell</th>
<th>PLace_Birth</th>
<th>Date</th>
<th>Action</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
if(mysqli_num_rows($result) > 0)
{
while($row = mysqli_fetch_array($result))
{
?>
<tr>
<td><?php echo $row["citizen_id"]; ?></td>
<td><?php echo $row["username"]; ?></td>
<td><?php echo $row["name"]; ?></td>
<td><?php echo $row["Address"]; ?></td>
<td><?php echo $row["Tell"]; ?></td>
<td><?php echo $row["place_birth"]; ?></td>
<td><?php echo $row["date"]; ?></td>
<td><button type="submit" class="btn btn-success btn-xs" onclick="selectCitizens(<?php
echo $row['citizen_id']; ?>)" data-whatever="@fat"><span class="glyphicon
glyphicon-edit"></span></button></td>
156
<td><a href="#" name="delete" onclick="DeleteCitizens(<?php echo $row['citizen_id'];
?>)" class="btn btn-danger btn-xs"><sapan class="glyphicon glyphicon-
trash"></span></a></td>
</tr>
<?php
}
}
?>
<!-- Qaybta Delete ka -->
<?php
if(isset($_POST['citizen_id'])) {
$id = $_POST['citizen_id'];
$result = mysqli_query($conn, "DELETE from citizens WHERE citizen_id='$id'");
if ($result) {
?>
<script>
alert("Success To Delete Data");
Windows.location.href='citizen_table.php';
</script>
<?php
}else{
?>
<script>
alert("Fail To Delete Data");
Windows.location.href='citizen_table.php';
</script>
<?php
}
}
?>
<!-- End Qaybta Delete ka -->
</tbody>
</table>
157
<!-- Qaybta Model Form Update Citizens -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-
hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 style="color:blue" class="modal-title" id="exampleModalLabel">Update Citizen Table</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" >
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="updateCitizen.php" method="post">
<div class="form-group">
<label class="control-label" for="first-name">Citizen_id : <span class="required">*</span>
</label>
<input type="text" id="id" name="citizenid" required="required" class="form-control ">
</div>
<!-- Selection from Admin name -->
<div class="form-group" >
<label class="control-label" for="last-name">Admin : <span class="required">*</span>
</label>
<select class="form-control" name="admin_id">
<option>Select Admin Name</option>
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$query="SELECT admin_id,username FROM admin";
$res=$conn->query($query);
while($row = $res->fetch_array())
{
?>
<option value="<?php echo $row[0]?>"> <?php echo $row[1]; ?> </option>
<?php
}
158
?>
</select>
</div>
<div class="form-group">
<label class="control-label" for="last-name">Name :<span class="required"> *</span>
</label>
<input type="text" id="name" name="username" required="required" class="form-control">
</div>
<div class="form-group">
<label for="middle-name" class="control-label">Address :<span class="required"> *</span></label>
<input id="add" class="form-control" type="text" name="address">
</div>
<div class="form-group">
<label for="middle-name" class="control-label">Tell :<span class="required"> *</span></label>
<input id="tell" class="form-control" type="text" name="phone">
</div>
<div class="form-group">
<label for="middle-name" class="control-label">Place_Birth :<span class="required">
*</span></label>
<input id="pacebirth" class="form-control" type="text" name="birth">
</div>
<div class="form-group">
<label for="middle-name" class="control-label">Date :<span class="required"> *</span></label>
<input id="date" class="form-control" type="date" name="date">
</div>
<div class="modal-footer">
<button type="submit" id="register" class="btn btn-success"><span class="glyphicon glyphicon-plus"></span>
Update</button>
</div>
</form>
</div>
</div>
</div>
159
</div></div></div>
<!-- END Model Form Update Cases -->
<!-- waa qaybat model in lagu soo buuxiyo data -->
<script>
function selectCitizens(CitizenID){
var data= 'citizen_id='+CitizenID;
$.ajax({
data:data,
url:'selectCitizens.php',
success:function(res){
// alert(res);
var index=res.split(';');
$('#id').val(index[0]);
$('#name').val(index[2]);
$('#add').val(index[3]);
$('#tell').val(index[4]);
$('#pacebirth').val(index[5]);
$('#date').val(index[6]);
$('#exampleModal').modal('show');
}
});
}
</script>
<!-- End waa qaybat model in lagu soo buuxiyo data -->
<!-- waa script lagu dhax samenayo function delete -->
<script>
function DeleteCitizens(CitizenID){
if(confirm('Are You Sure you want to Delete this Record?')){
//alert(CustID);
window.location="deletecitizens.php?citizen_id="+CitizenID;
}
}
</script>
160
<!-- End waa script lagu dhax samenayo function delete -->
<div class="row">
161
<div class="col-md-12 col-sm-12 col-xs-12">
<!-- In lagu soo daabaco wixii kasoo laabta query procedure ka in lagu soo daabaco -->
<?php
if(isset($_POST["del"])){
if($_POST["del"]==1){
}
}
?>
<div class="x_content">
<a href="citizen.php" class="btn btn-success pull-right" style="margin-right:10px;margin-top:3px;">Add Citizens</a>
<table id="datatable-buttons" class="table table-striped table-bordered">
<thead>
<tr>
<th>Citizen ID</th>
<th>Admin ID</th>
<th> Name</th>
<th>Address</th>
<th>Tell</th>
<th>PLace_Birth</th>
<th>Date</th>
<th>Action</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
if(mysqli_num_rows($result) > 0)
{
while($row = mysqli_fetch_array($result))
{
162
?>
<tr>
<td><?php echo $row["citizen_id"]; ?></td>
<td><?php echo $row["username"]; ?></td>
<td><?php echo $row["name"]; ?></td>
<td><?php echo $row["Address"]; ?></td>
<td><?php echo $row["Tell"]; ?></td>
<td><?php echo $row["place_birth"]; ?></td>
<td><?php echo $row["date"]; ?></td>
<td><button type="submit" class="btn btn-success btn-xs" onclick="selectCitizens(<?php
echo $row['citizen_id']; ?>)" data-whatever="@fat"><span class="glyphicon
glyphicon-edit"></span></button></td>
<td><a href="#" name="delete" onclick="DeleteCitizens(<?php echo $row['citizen_id'];
?>)" class="btn btn-danger btn-xs"><sapan class="glyphicon glyphicon-
trash"></span></a></td>
</tr>
<?php
}
}
?>
<!-- Qaybta Delete ka -->
<?php
if(isset($_POST['citizen_id'])) {
$id = $_POST['citizen_id'];
$result = mysqli_query($conn, "DELETE from citizens WHERE citizen_id='$id'");
if ($result) {
?>
<script>
alert("Success To Delete Data");
Windows.location.href='citizen_table.php';
</script>
<?php
}else{
163
?>
<script>
alert("Fail To Delete Data");
Windows.location.href='citizen_table.php';
</script>
<?php
}
}
?>
<!-- End Qaybta Delete ka -->
</tbody>
</table>
<!-- Qaybta Model Form Update Citizens -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-
hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 style="color:blue" class="modal-title" id="exampleModalLabel">Update Citizen Table</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" >
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="updateCitizen.php" method="post">
<div class="form-group">
<label class="control-label" for="first-name">Citizen_id : <span class="required">*</span>
</label>
<input type="text" id="id" name="citizenid" required="required" class="form-control ">
</div>
<!-- Selection from Admin name -->
<div class="form-group" >
<label class="control-label" for="last-name">Admin : <span class="required">*</span>
</label>
164
<select class="form-control" name="admin_id">
<option>Select Admin Name</option>
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$query="SELECT admin_id,username FROM admin";
$res=$conn->query($query);
while($row = $res->fetch_array())
{
?>
<option value="<?php echo $row[0]?>"> <?php echo $row[1]; ?> </option>
<?php
}
?>
</select>
</div>
<div class="form-group">
<label class="control-label" for="last-name">Name :<span class="required"> *</span>
</label>
<input type="text" id="name" name="username" required="required" class="form-control">
</div>
<div class="form-group">
<label for="middle-name" class="control-label">Address :<span class="required"> *</span></label>
<input id="add" class="form-control" type="text" name="address">
</div>
<div class="form-group">
<label for="middle-name" class="control-label">Tell :<span class="required"> *</span></label>
<input id="tell" class="form-control" type="text" name="phone">
</div>
<div class="form-group">
<div class="modal-footer">
<button type="submit" id="register" class="btn btn-success"><span class="glyphicon glyphicon-plus"></span>
Update</button>
165
</div>
</form>
</div>
</div>
</div>
</div></div></div>
<!-- END Model Form Update Cases -->
<!-- waa qaybat model in lagu soo buuxiyo data -->
<script>
function selectCitizens(CitizenID){
var data= 'citizen_id='+CitizenID;
$.ajax({
data:data,
url:'selectCitizens.php',
success:function(res){
// alert(res);
var index=res.split(';');
$('#id').val(index[0]);
$('#name').val(index[2]);
$('#add').val(index[3]);
$('#tell').val(index[4]);
$('#pacebirth').val(index[5]);
$('#date').val(index[6]);
$('#exampleModal').modal('show');
}
});
}
</script>
<!-- End waa qaybat model in lagu soo buuxiyo data -->
<!-- waa script lagu dhax samenayo function delete -->
<script>
function DeleteCitizens(CitizenID){
if(confirm('Are You Sure you want to Delete this Record?')){
166
//alert(CustID);
window.location="deletecitizens.php?citizen_id="+CitizenID;
}
}
</script>
<!-- End waa script lagu dhax samenayo function delete -->
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">Compliant ID : <span
class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<!-- php query by selecting id and readonly -->
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$query="SELECT id FROM complaints order by id DESC";
$res=$conn->query($query);
$row = $res->fetch_array();
167
?>
<input type="text" name="compID" required="required" class="form-control col-md-7 col-xs-12"
value="<?php echo $row['id']+1; ?>" readOnly>
</div>
<!-- End php query by selecting id and readonly -->
</div>
<?php
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Complaint Type</label>
168
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="comptype">
</div>
</div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Complaint Description</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="compdesc">
</div>
</div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Date</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="date" name="date">
</div>
</div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Phone</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="phone">
</div>
</div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Upload Evidance</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="image" class="form-control col-md-7 col-xs-12" type="file" name="image">
</div>
</div>
169
<div class="ln_solid"></div>
<div class="form-group">
<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
<button class="btn btn-primary" type="button">Cancel</button>
]
<div class="clearfix"></div>
</div>
<div class="x_content">
<a href="complaints.php" class="btn btn-success pull-right" style="margin-right:10px;margin-top:3px;">Add
Complaints</a>
<tbody>
<?php
if(mysqli_num_rows($result) > 0)
170
{
while($row = mysqli_fetch_array($result))
{
?>
<tr>
<td><?php echo $row["comp_id"]; ?></td>
<td><?php echo $row["citizensName"]; ?></td>
<td><?php echo $row["location"]; ?></td>
<td><?php echo $row["policatstaion_name"]; ?></td>
<td><?php echo $row["complaint_type"]; ?></td>
<td><?php echo $row["complaint_description"]; ?></td>
<td><?php echo $row["date_com"]; ?></td>
<td><?php echo $row["phone"]; ?></td>
<td><img src="<?php echo $row["upload_evidance"];?>"style="width:45px;height:30px;margin-
left: 10px;"></td>
</tr>
<?php
}
}
?>
<?php
if(isset($_POST['comp_id'])) {
$id = $_POST['comp_id'];
171
$result = mysqli_query($conn, "DELETE from complaints WHERE comp_id='$id'");
if ($result) {
?>
<script>
alert("Success To Delete Data");
Windows.location.href='complaints_table.php';
</script>
<?php
}else{
?>
<div class="form-group">
<label class="control-label" for="first-name">ID : <span class="required">*</span>
</label>
<input type="text" id="id" name="compID" required="required" class="form-control">
</div>
172
</label>
<select class="form-control" name="citizenID">
<option>Select Citizens Name</option>
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$query="SELECT citizen_id,name FROM citizens ";
$res=$conn->query($query);
while($row = $res->fetch_array())
{
?>
<option id="citzen" value="<?php echo $row[0]?>"> <?php echo $row[1]; ?> </option>
<?php
}
?>
</select>
</div>
<div class="form-group">
<label for="middle-name" class="control-label">Complaint Location</label>
<input id="loc" class="form-control" type="text" name="location">
</div>
173
while($row = $res->fetch_array())
{
?>
<div class="form-group">
<label for="middle-name" class="control-label">Description</label>
<input id="desc" class="form-control" type="text" name="compdesc">
</div>
<
<div class="form-group">
<label for="middle-name" class="control-label">Phone</label>
<input id="tell" class="form-control" type="text" name="phone">
</div>
<div class="form-group">
<label for="middle-name" class="control-label">Evidance</label>
<input id="evidance" class="form-control" type="file" name="image">
</div>
<div class="modal-footer">
</div> </form></div>></div>
<!-- waa qaybat model in lagu soo buuxiyo data -->
<script>
function selectcompaints(compID){
var data= 'comp_id='+compID;
174
$.ajax({
data:data,
url:'selectComplaints.php',
success:function(res){
// alert(res);
var index=res.split(';');
$('#id').val(index[0]);
$('#loc').val(index[3]);
$('#comptype').val(index[4]);
$('#desc').val(index[5]);
$('#date').val(index[6]);
$('#tell').val(index[7]);
$('#exampleModal').modal('show');
}
});
}
</script>
<!-- End waa script lagu dhax samenayo function delete -->
175
<form method="post" action="insert_users.php" id="demo-form2" data-parsley-validate class="form-horizontal
form-label-left" enctype="multipart/form-data">
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-
name">User_id : <span class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<!-- php query by selecting id and readonly -->
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$query="SELECT id FROM users order by id DESC";
$res=$conn->query($query);
$row = $res->fetch_array();
?>
<input type="text" name="user_id" required="required" class="form-control col-md-7 col-xs-12" value="<?php echo
$row['id']+1; ?>" readOnly>
</div>
<!-- End php query by selecting id and readonly -->
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-
name">UserName :<span class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="text" name="username" required="required" class="form-control
col-md-7 col-xs-12">
</div>
</div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-
var $form_date=$(this).serialize();
var $page_url=$(this).attr("action");
$.ajax({
176
data:$form_date,
url:$page_url,
method:"POST",
success:function(res){
$('#msg').html(res);
}
});
});
});
</script>
177
Appendix AK: Users Table.php
<?php
session_start();
if(empty($_SESSION['name'])){
header("Location:../logout.php");
}
?>
<!DOCTYPE html>
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$query="SELECT u.user_id,u.username,u.password,u.images,u.date,u.type FROM users u";
$result=$conn->query($query);
?>
<div class="clearfix"></div>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<!-- In lagu soo daabaco wixii kasoo laabta query procedure ka in lagu soo daabaco -->
<?php
if(isset($_POST["del"])){
if($_POST["del"]==1){
178
<th>UserID</th>
<th>UserName</th>
<th>Password</th>
<th>Images</th>
<th>Date</th>
<th>Type</th>
<th>Action</th>
<th>Action</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
if(mysqli_num_rows($result) > 0)
{
while($row = mysqli_fetch_array($result))
{
?>
<tr>
<td><?php echo $row["user_id"]; ?></td>
<td><?php echo $row["username"]; ?></td>
<td><?php echo $row["password"]; ?></td>
<td><img src="<?php echo $row["images"]; ?>"
style="width:45px;height:30px;margin-left: 10px;"></td>
<td><?php echo $row["date"]; ?></td>
<td><?php echo $row["type"]; ?></td>
<td><button type="submit" class="btn btn-success btn-xs" onclick="selectuser(<?php
echo $row['user_id']; ?>)" data-whatever="@fat"><span class="glyphicon
glyphicon-edit"></span></button></td>
<td><a href="#" name="delete" onclick="DeleteUser(<?php echo $row['user_id'];
?>)" class="btn btn-danger btn-xs"><sapan class="glyphicon glyphicon-
trash"></span></a></td>
<td></td>
179
</tr>
<?php
}
}
?>
<!-- Qaybta Delete ka Query -->
<?php
if(isset($_POST['user_id'])) {
$id = $_POST['user_id'];
$result = mysqli_query($conn, "DELETE from users WHERE user_id='$id'");
if ($result) {
?>
<script>
alert("Success To Delete Data");
Windows.location.href='user_table.php';
</script>
<?php
}else{
?>
<script>
alert("Fail To Delete Data");
Windows.location.href='user_table.php';
</script>
<?php
}
}
?>
<!-- End Qaybta Delete ka -->
</tbody>
</table>
180
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-
hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 style="color:blue" class="modal-title" id="exampleModalLabel">Update Users Table</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" >
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="updateUser.php" method="post" enctype="multipart/form-data">
<div class="form-group">
<label class="control-label " for="first-name">User_id : <span class="required">*</span>
</label>
<input type="text" id="id" name="ad_id" required="required" class="form-control">
</div>
<div class="form-group">
<label class="control-label " for="last-name">UserName :<span class="required">*</span>
</label>
<input type="text" id="name" name="username" required="required" class="form-control">
</div>
<div class="form-group">
<label for="middle-name" class="control-label ">Password :<span
class="required">*</span></label>
<input id="pass" class="form-control" type="password" name="pasword">
</div>
<div class="form-group">
<label for="middle-name" class="control-label ">Images :<span
class="required">*</span></label>
<input id="images" class="form-control" type="file" name="image">
</div>
<div class="form-group">
<label for="middle-name" class="control-label ">Date :<span class="required">*</span></label>
181
<input id="date" class="form-control" type="date" name="date">
</div>
<div class="modal-footer">
<button type="submit" id="register" class="btn btn-success"><span class="glyphicon glyphicon-
plus"></span> Update</button>
</div>
</form>
</div>
</div>
<!-- END Model Form Update Cases -->
</div>
</div>
</div>
182
</script>
<!-- End waa qaybat model in lagu soo buuxiyo data -->
<!-- waa script lagu dhax samenayo function delete -->
<script>
function DeleteUser(ad_id){
if(confirm('Are You Sure you want to Delete this Record?')){
//alert(CustID);
window.location="deleteuser.php?user_id="+ad_id;
}}</script>
<!-- End waa script lagu dhax samenayo function delete -->
183
AppendiM AO: Delete Users
<?php
$conn=new mysqli("localhost","root","","online_crms_db");
$sql="CALL delete_users_Sp('$_GET[user_id]')";
$res=$conn->query($sql);
$row=$res->fetch_array();
echo $row[0];
header("Location:user_table.php?del=1");
?>
184