Professional Documents
Culture Documents
Crime Management System Report(Shruti)
Crime Management System Report(Shruti)
Crime Management System Report(Shruti)
A
Report A
PROJECT REPORT ON
CRIME MANAGEMENT
SYSTEM
SUBMITTED TO
DR. A.P.J. ABDUL KALAM
TECHNICAL UNIVERSITY-
LUCKNOW,U.P.
IN
PARTIAL FULFILMENT OF REQUIREMENTS
FOR THE DEGREE OF
SUBMITTED BY
SHRUTI VISHWAKARMA
2001650140031
Page | 1
May
2022
PROJECT REPORT ON
SUBMITTED TO
DR.A.P.J. ABDUL KALAM TECHNICAL UNIVERSITY
LUCKNOW, U.P.
IN
PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE
DEGREE
OF
MASTER OF COMPUTER APPLICATON
IN
SUBMITTED BY
SHRUTI VISHWAKARMA
2001650140031
SESSION: 2021-2022
Page | 2
DECLARATION
I hereby declare that the work presented in this report entitled “CRIMINAL
MANAGEMENT SYTEM", was carried out by me. I have not submitted the matter
embodied in this project report for the award of any other degree or diploma of any other
University or Institute. I have given due credit to the original authors/sources for all the
words, ideas, diagrams, graphics, computer programs, experiments, results, that are not my
original contribution. I have used quotation marks to identify verbatim sentences and given
credit to the original authors/sources. I affirm that no portion of my work is plagiarized, and
the experiments and results reported in the project report are not manipulated. In the event of
a complaint of plagiarism and the manipulation of the experiments and results, I shall be
fully responsible and answerable.
Name: SHRUTI VISHWAKARMA
Roll No: 2001650140031
(SHRUTI VISHWAKARMA)
Page | 3
CERTIFICATE
Certified that SHRUTI VISHWAKARMA (2001650140031) has carried out the project work
presented in this report entitled “CRIME MANAGEMENT SYSTEM” for the award of Master of
Computer Application (Kanpur Institute of Technology) from Dr. APJ Abdul Kalam Technical
University, Lucknow under Mr. Ajeet Singh supervision. The project report embodies results of
original work, and studies are carried out by her and the content of the project report do not form the
basis for the award of any other degree to the candidate or to anybody else from this or any other
University/Institution.
Signature
Mr. Ajeet Singh
Assistant Professor
Kanpur Institute of Technology
Page | 4
ACKNOWLEDGEMENT
It gives us a great sense of pleasure to present the report of the MCA project undertaken during MCA
final year. We owe special debt of gratitude to Mr. Ajeet Singh (Assistant Professor) Kanpur
Institute of Technology, Kanpur for his constant support and guidance throughout the course of our
work. His sincerity, throughout and perseverance have been a constant source inspiration for us. It is
only his cognizant efforts that our endeavor have been light of the day.
We also take this opportunity to thank Mr. Vimal Kumar Awasthi (HOD) who helped in preparing
the guidelines.
We also do not like to miss the opportunity to acknowledge the contribution of all faculty members
of the department of their kind assistance and co-operation during the development of our project.
Last but not the least we acknowledge our friends for their contribution in the completion of the
project.
Page | 5
ABSTRACT
The “Criminal Management System” is a web based website for online complaining and
computerized management of crime records. Here in this website a person who wishes to file a
complaint or report an incident must register before log in and once the admin authenticates the user
he or she can login into the website and file a complaint .This complaint will be received by police
and police can send a message regarding status of the complaint to the user who filed the complaint.
Police can use this software to manage different crimes and some of the works which is done in
police station manually. Police gets their login password from admin directly. Some of the modules
like news, safety tips, missing persons and most wanted criminals can be viewed through the website
without logging in. So this website helps police to find out the problems in the society without them
actually coming to the police station.
Page | 6
TABLE OF CONTENT
Page
Contents No.
Declaration iii
Certificate iv
Acknowledgement v
Abstract vi
Table of Content vii
List of Figure x
List of Tables xi
Chapter 1: Introduction 12
1.1 Introduction 12
1.2 Motivation 12
1.3 Aims and Objective 12
1.4 Overview of the project 13
1.5 Summery 13
Chapter 2: Literature Review 14
2.1 Introduction 14
2.2 Background 14
2.3 Some Related Work 14
2.4 Summary 15
Chapter 3: Technology Used 16
3.1 Introduction of Python 16
3.2 Features of Python 16
3.3 Advantages 17
3.4 Applications 17
3.5 Summary 17
Chapter 4: Methodology 18
4.1 Introduction 18
4.2 Methodology 18
4.3 Software Development Life Cycle(SDLC) 18
4.3.1 Feasibility Study 19
4.3.2 Requirement Study 19
4.3.3 System Analysis 19
4.3.4 System Design 20
4.3.5 Coding 20
4.3.6 Testing 20
4.3.7 Acceptance 20
4.4 Waterfall Software Development Methodology 21
4.5 Waterfall Model Application 22
4.6 Summary 22
Chapter 5: Analysis 23
5.1 Introduction 23
5.2 Requirement Engineering 23
5.3 Requirement Engineering Process 23
5.3.1 Feasibility Study 24
5.3.2 Requirement Gathering 24
Page | 7
5.3.3 Software Requirement Specification 24
5.3.4 Software Requirement Validation 25
5.4 Software Requirement for Development 25
5.5 Hardware Requirement for Use 25
5.6 Software Requirement for Use 25
5.7 Use Case 25
5.7.1 Characteristics Associated with Use Case Are 26
5.7.2 The Steps in Designing Use Case Are 26
5.8 Use Case Diagram 26
5.9 Block Diagram 27
5.10 Flowchart 27
5.10.1 Definition 27
5.10.2 Necessity to Use Flowchart 27
5.11 Summary 28
Chapter 6: System Design 29
6.1 Introduction 29
6.2 System Design 29
6.3 System Context Diagram(SCD) 29
6.4 Data Flow Diagram 30
6.4.1 Definition 32
6.4.2 Types of DFD 32
6.4.3 DFD Components 33
6.5 Data Design 33
6.5.1 Entity Relationship diagram 33
6.6 Activity Diagram 34
6.7 Summary 35
Chapter 7: Implementation 36
7.1 Introduction 36
7.2 Existing System 36
7.3 Proposed System 36
7.4 Functional Requirement 36
7.5 Non-Functional Requirement 37
7.6 Summary 37
Chapter 8: Testing 38
8.1 Introduction 38
8.2 Verification 38
8.3 Validation 38
8.4 Black box Testing 38
8.5 White Box Testing 38
8.6 Types of Testing 39
8.7 Implementation and Software Specification Testing 39
8.7.1 Detailed Design of Implementation 39
8.7.2 Technical Design 39
8.7.3 Test Specifications and Planning 40
8.7.4 Programming and Testing 40
8.7.5 User Training 40
8.7.6 Acceptance Test 40
8.7.7 Installation Phase 40
Page | 8
8.7.8 System Installation 40
8.7.9 Review Phase 40
8.7.10 Development Recap 40
8.7.11 Post-Implementation Review 40
8.8 The Steps in the Software Testing 41
8.8.1 The Unit testing done include the testing item 41
8.8.2 The Steps involved during System Testing 41
8.8.3 The System testing done include the testing item 41
8.8.4 Six Test categories 41
8.9 Summary 42
Chapter 9: Application 43
9.1 Introduction 43
9.2 Modules 43
9.3 Database 43
9.4 Database Table 44
9.5 Summary 45
Chapter 10: Conclusion 46
10.1 Conclusion 46
10.2 Limitation 46
10.3 Future Scope 47
References 47
Appendix A (Screenshot) 48
Appendix B(Source Code) 51
Page | 9
LIST OF FIGURES
Page | 10
LIST OF TABLES
Page | 11
CHAPTER 1
1.1 INTRODUCTION
We see that when a group or society is formed the some rules and laws are made by the
people, for the people and to the people. The purpose of these rules and laws are to give a
peaceful life to all who are living in that society. Whenever any law is violated by any one we
say that crime is committed and who break that law is called criminal. To have peaceful life
we need a well- organized law enforcement system. In our Somalia, we have very good
facilities in law enforcement sector. But, due to less of facilities some works cannot be done
in a very good way.
1.2 MOTIVATION
In modern days crime is increasing day by day. To combat such crimes and to provide safety
to citizens, police department plays a vital role. It always is a vital responsibility arresting
criminal who is threat for the safety of society. After registering the FIR from any citizen,
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 peaceful environment of society. Along with
low salary scale, facilities of modern technology such as computerized system of keeping
records are not provided to police department which cause low efficiency. As it is the age of
computers, all the organization today use computers to maintain their records, so this facility
should be given to police department. In order to increase their efficiency and to save their
time, in our project we are going to implement a CRMS (criminal record management
system). This is an online web application with database system in which police will keep the
record of criminals who have been arrested. This will help the police department to manage
their records easily.
Page | 12
- Reduce manual and redundant records keeping
- Facilitate interaction and sharing of information among police departments, districts,
state/headquarters and other police agencies
- Building security and monitoring control to ensure only authorized personal have access to
the criminal information
Chapter 2: In this chapter we have discussed the web based application and history of web based
criminal record application as well as some previous works using reference.
Chapter 3: In this chapter we have discussed the steps of system development life cycle (SDLC) and
methodology used to develop the system using various figure.
Chapter 4: In this chapter we have described the requirement engineering process, software
requirement for development, and how to analyse the system through Use Case, Block Diagram and
Flowchart
Chapter 5: In this chapter we have described the design process of the system using System Context
Diagram (SCD), Data flow diagram (DFD), Entity Relationship Diagram (ERD) and Activity
Diagram
Chapter 6: This chapter we have described how implemented the system and explained interface
designing steps with various screen shots.
Chapter 7: In this chapter we have illustrated the software testing types, validation and testing
methods used this system along with a table showing different test results.
Chapter 8: In this chapter we have explained the application area of the system and where the
system can be used
Chapter 9: In this chapter we have presented the result and discussion of the system by showing all
necessary screen shots of the application.
Chapter 10: In this chapter we have discussed the conclusion, limitation, and future working
1.5 SUMMARY
In this chapter, we have discussed the aims and objectives of the project, situation of the
current system, necessity and brief overview of the proposed system.
CHAPTER 2
Page | 13
2.1 INTRODUCTION
We see that when a group or society is formed, some rules and laws are made by to follow.
The purpose of these rules and laws are to give a peaceful life to all who are living in that
society. Whenever any law is violated by anyone we say that crime is committed and who
break that law is called criminal. To have peaceful life we need a well-organized law
enforcement system. In our Somalia, we have very good facilities in law enforcement sector.
But, due to less of facilities some works cannot be done in a very good way.
2.2 BACKGROUND
The project is aimed to develop a crime file for maintain a computerized records of all the fir
against crime. The system is desktop application that can be access throughout the police
department. This system can be used as application for the crime file of the police department
to manage the records of different activity related to first information report. In suck desktop
crime file system we will manage all such activities (like registration of the criminal,
updating information, search of particular viewing of the respective reports of crimes) that
will save time, manpower. This system will provide better prospective for the enhancement
of organization regarding to quality and transparency.
In this research work, the web-based criminal management system (CMS) aims to use mobile
devices in place of traditional GPS devices in order to facilitate the police to record the
location of the committed crime. Despite from the location-based service, the CMS offers the
police to describe the detail and simultaneously attach the images or multimedia files. The
online crime reporting system has been developed to override the problems prevailing in the
practicing manual system. This software is supported to eliminate in some cases reducing the
hardships faced by the existing system.
Page | 14
Geographical Information System (GIS) is one of the aiding domains of technology where a
number of applications are being deployed to assist people in understanding and visualizing
data rather than having it in other complex forms. Implementing one of such kinds of
technology for crime analysis will help people in knowing the crime rate of their place in
comparison to other places and will also provide hand-in-hand support to the police for
providing additional focus on those regions. Crimes are the concerning factors of every
country for its political, Economical and social development. Yet, the number of technologies
available in detecting and reporting crimes are limited. A Geographical Information System
(GIS) based application can be implemented that can be used and accessed by everyone to
file the crimes happening in their locality and to know about other crimes.
2.4 SUMMARY
In this chapter, we have discussed some topic related with desktop application and the
preview related works of development.
Page | 15
CHAPTER 3
3.1Introduction of Python
3.2Features of Python
Page | 16
3.3Advantages of Python
3.4Applications of Python
3.5 Summary
In this chapter, we have discussed some topic related with Python programming language.
Page | 17
CHAPTER 4
4.1INTRODUCTION
Methodology is the theoretical and systematic analysis of strategies related to a field of study. It
includes the theoretical analysis of the collection of strategies and guidelines related to apart of
the knowledge A methodology does not set out to provide solutions—it is therefore, not the same
as a method. Instead, a methodology offers the theoretical underpinning for understanding which
method, set of methods, or best practices can be applied to a specific case, for example, to
calculate a specific result.
4.2 METHODOLOGY
There are many of methodology in my project it does not strictly follow a single methodology. It
has been development by considering waterfall methodology.
The cycle of the software development gives us an overview and guidelines for the development
of quality software. For our project, we follow SDLC to make reliable for the user.
Page | 18
4.3.1 FEASIBILITY STUDY
The feasibility study is an evaluation of the potential of a proposed project which is based on
extensive and research to support the process of decision making.
A requirement is a physical and functional need that a particular design, product or process
must be able to perform. It is commonly used in a formal sense in system engineering,
software engineering and enterprise engineering.
- Requirement Analysis
- Requirement Specification
- Requirement Validation
System analysis is the process of collecting a factual data, understand the process involved,
identifying problem and recommending feasible suggestion for improving the system
functioning, this involving studying the business process, gathering operational data,
understand the information flow, finding out bottlenecks and evolving solution for
overcoming the weakness of the system so as to achieve the organization goals. System
analysis also includes subdividing of complex process involving the entire system,
identification of data store and manual process.
This major objectives of system analysis are to find answers for each business process:
Page | 19
4.3.4 SYSTEM DESIGN
The design phase is the architectural phase of system design. The flow of data processing is
developed into charts, and the project team determines the most logical design and structure
for data flow and storage. For user interface, the project team designs mock-up screen layouts
that developers use to write the code for the actual interface.
4.3.5 CODING
In the SDLC model, the design and coding of the program involves only 10% of the project’s
commitment, here we compose the coding using a well-understood programming language
like Python, MYSQL.
4.3.6 TESTING
Testing involves executing and implementation of the software with test data and examining
the outputs of the software and its operational behavior to check that is performing as
required testing can be implementation in two ways.
4.3.7 IMPLEMENTATION
The installation and acceptance stage is the final stage of SDLC. In this stage, the software is
installed in the client place and the users are trained in using the new software.
- Inputs for installation and acceptance stage: the inputs of installation and acceptance
stages are:
- Outputs of installation and acceptance stage: the outputs of installation and acceptance
stages are:
- Production software – the software is installed in client machine with production data
loaded into it.
- Completed acceptance test – the software is tested by the users in the client side and the
acceptance test is completed.
- Customer acceptance memorandum – customer signs off the acceptance memorandum
which means the project completion is smooth and client has accepted it.
- Archived software artifacts – the source code of the entire software and other software
artifacts are archived for future use. Archived project plan the latest project plan is archived
for future use.
Page | 20
4.4 WATERFALL SOFTWARE DEVELOPMENT METHODOLOGY
Every software development is different and required a suitable SDLC approach to be followed
based on the internal and external factors. Some situations where the use of waterfall model is
most appropriate are:
Page | 21
4.5 WATERFALL MODEL APPLICATION
The waterfall model was first process model to be introduced, it also referred to as a linear
Sequential life cycle model. It is very simple to understand and use. In waterfall model, each
phase must be completed before the next phase can begin and there is no overlapping in the
phases Waterfall model is the earliest SDLC approach that was used for software development.
The waterfall model illustrates the software development process in a linear sequential flow,
Hence it is also referred to as a linear-sequential life cycle model.
4.6 SUMMARY
In this chapter, we have discussed about the background, methodology, and development process
and project plan of the project.
Page | 22
CHAPTER 5
5.1 INTRODUCTION
The software requirement are description of features and functionalities of the target system.
Requirement convey the exception of users from the software product. The requirement can be
obvious or hidden, know or unknown, expected or unexpected from client’s point of view.
5.2REQIREMENT ENGINEERING
The process to gather the software requirement form client, analyze and document them is
known as requirement engineering. The goal of requirement engineering is to develop and
maintain sophisticated and descriptive system requirement specification document.
The main objective of the process are to describe the principle requirement engineering activities
and the relationship, it depends on the application domain the people involved and the
organization developing the requirements.
- Feasibility Study
- Requirement Gathering
- Software Requirement Specification
- Software Requirement Validation
Page | 23
5.3.1 FEASIBILITY STUDY
A feasibility Study aims to reveal in an objective and rational way the strength and
weaknesses of a current or proposed company, the opportunities and threats present in the
environment, the necessary assets to be implemented and, ultimately, the prospective for
success. A feasibility study is a study that incorporates software analysis in case it is
economically advantageous, In case it can satisfy the technical requirement and if it is
adoptable in the required environment. It also condition the basic work and decides whether
to accept the project. Finally, the final result will be a hard plan to continue with the project.
A feasibility study assesses the potential for progress of the project, therefore, objectively
perceived is an imperative factor in the validity of the study for potential investors and
lenders.
If the feasibility report is positive towards undertaking the project, next phase starts with
gathering requirement from the user, analysis and engineering communicate with the client
and end-uses to know their ideas on that the software should provide and which features they
want the software to include.
SRS is a document created by system analyst after the requirement are collected various
stakeholders. SRS defines how the intended software will interact with hardware, external
interface, speed of operation, response time of system, portability of software across various
platforms, maintainability, speed of recovery after crashing, security, quality, limitations etc.
the requirements received from client are written in natural language, it is the responsibility
of system analyst to document the requirement in technical language. It is the responsibility
of system analyst to document the requirements in technical language so that they can be
comprehended and useful by the software development team.
Page | 24
5.3.4 SOFTWARE REQUIREMENT VALIDATION
After requirement specification are developed, the requirement mentioned in this document
are validated. User might ask for illegal, impractical solution or expected may interpret the
requirements correctly. This results in huge increase in cost if not nipped in the bud.
-Python 3
-MySQL
-Keyboard
-Mouse
- Screen solution of at least 1024*768 required for proper and complete viewing of screen
- RAM 1GB
- Hard Disk 250 GB
A use case is a software and system engineering term that describes how a user system to
accomplish a particular goal. A use case acts a software odelling technique that defines the
features to be implemented and the resolution of any errors that may be encountered.
Actors: actors are the type of users that interact with the system.
System: Use case capture functional requirement that specify the intended behaviour of the
system.
Page | 25
Goals: Use case is typically initiated by a user a full fill goals describing the activities and
variants involved in attaining the goal
Use case diagram are valuable for visualizing the functional requirements of system that will
translate into design choices and development priorities.
Use case diagrams are valuable UML diagram type and frequently used to odelli various system.
They enable you to visualize the different types of roles in a system and how those roles interact
with the system.
Page | 26
The above figure shows the use case diagram for Criminal record management system where the
admin and sub-admin can use the software for adding criminal, viewing criminal list, adding
crime report, viewing crime report and creating accounts, on the other part police can also add
criminals and crime reports, viewing criminals lists and crime reports, where the court can use
the software for giving punishments to the criminals.
A block diagram is a diagram of system in which the principle parts of functions are represented
by block connected by lines that show the relationships of the blocks. They are heavily used in
engineering in hardware design, electronic design, software design, and process flow diagrams.
Page | 27
5.10 FLOWCHART
5.10.2NECESSITY OF FLOWCHART
5.11 SUMMARY
In this chapter, we have discussed about the requirement analysis, requirement validation
software and hardware requirement, use case diagram, block diagram and flowchart diagram.
Page | 28
CHAPTER 6
6.1INTRODUCTION
System design is the process of defining the architecture, components, modules, interface, and
data for a system to satisfy specified requirement. System design could be seen as the application
of system theory to product development.
6.2SYSTEM DESIGN
- Architectural design: the design of system architecture which describes the structure behaviour.
- Logical design: it’s an abstract representation of the data flows, inputs and outputs of the
system, the requirements about the system are described.
- Input requirements
- Output requirements
- Storage requirements
- Processing requirements
- System control and backup or recovery
Another way the physical portion of system design can generally be broken down into three sub
tasks:
A system context diagram (SCD) in software engineering and systems engineering is a diagram
that defines the boundary between the system, or part of a system, and its environment, showing
the entities that interact with it, this diagram is a high level view of a system. It is similar to a
block diagram.
Page | 29
FIGURE 6.1 SYTEM CONTEXT DIAGRAM OF CRIMINAL MANAGEMENT SYSTEM
Page | 30
FIGURE 6.4.2 LEVEL 1 DFD ADMIN
Page | 31
FIGURE 6.4.4 LEVEL 1 DFD USER
6.4.1 DEFINITION
There is a prominent difference between DFD and flowchart, the flowchart depicts flow of
control in program modules. DFD’s depict flow of data in the system at various levels. DFD
does not contain any control or branch elements.
- Logical DFD – this type of DFD concentrates on the system process and flow of data in the
system.
- Physical DFD – this type of DFD shows how data flow is actually implemented in the system.
It is more specific and close to the implementation.
Page | 32
6.4.3 DFD COMPONENT
DFD can represent source, destination, storage and flow of data using the following set of
components-
- Entities – entities are source and destination of information data. Entities are represented by
rectangular with their respective names.
- Process – activities and action taken on the data are represented by circle or round edged
rectangles.
- Data storage – there are two variants of data storage- it can either be represented as a rectangle
with absence of both smaller sides or as an open-sided rectangle with only one side missing.
- Data flow – movement of data is shown by pointed arrows. Data movement is shown the base
of arrow as its source towards head of the arrow as destination.
6.5DATA DESIGN
Data designing illustrates the types of data that are stored in the system, the relationships
between them and the ways that data can be grouped or organised. A data model is that blueprint
or roadmap which facilitates a deeper understanding of the stored data.
The entity Relationship Diagram (ERD) depicts the relationship between the data objects.
The ERD is the notation that is used to conduct the date odelling activity the attributes of
each data object noted is the ERD can be described resign a data object descriptions.
· The set of primary components that are identified by the ERD are
· The primary purpose of the ERD is to represent data objects and their relationships.
Page | 33
FIGURE 6.5.1 ER DIAGRAM OF CRIMINAL MANAGEMENT SYSTEM
6.6ACTIVITY DIAGRAM
Page | 34
FIGURE 6.6.2 ACTIVITY DIAGRAM USER SIDE
6.7SUMMARY
In this chapter, we have discussed about the System design, data flow diagram and ER diagram,
activity diagram.
Page | 35
Chapter 7
7.1INTRODUCTION
The need for good record-keeping and information-sharing practices has taken on great
significance in today's global environment. Not only do well-organized records provide
important internal information (i.e., business operations and case management support—not to
forget the official memory of an agency's investigations), law enforcement agencies are now
required to communicate agency-to-agency and across continents to protect the Nation's
citizens. Nothing is more necessary to accomplishing that mission than having accessibility to
accurate and timely records. Calls for service records and investigative, arrest, criminal
identification, detention, and even civil records hold data that by themselves mean little;
however, once pieced together with information from other jurisdictions, the result can help
with all levels of investigations and aid in safeguarding the Nation.
7.2EXISTING SYSTEM
Almost all operations are done manually in the existing crime management system, such as
sing complaints, taking actions against crimes, viewing status, etc. So with the existing system,
if someone needs to register a complaint, he must do it through the police. If it is done
manually, numerous minor errors will occur. Error detection in the previous entries and data
cross verification is another essential operation. These are done manually, and it would take
time.
7.3PROPOSED SYSTEM
Now the proposed system is developed to solve all the problems that occurred in the earlier
systems by automating most of the operations. Keeping in mind that the type of users can range
from someone who knows how to work with computers to someone who knows nothing about
them, this application can be used by all by providing a user-friendly interface. In today's
world, where all people lack is time, this application lessens time consumption. It also provides
better communication and faster update of data.
7.4FUNCTIONAL REQUIREMENT
Page | 36
7.5NON- FUNCTIONAL REQUIREMENT
a) Performance.
b) Capacity.
c) Availability.
d) Security
7.6SUMMARY
In this chapter, we have discussed about the existing system, proposed system, functional
requirement and non-functional requirement.
Page | 37
CHAPTER 8
8.1INTRODUCTION
Testing is the process of executing a program with the aim of finding errors. To make our
software perform well it should be error-free. If testing is done successfully it will remove all
the errors from the software.
8.2VARIFICATION
Verification is the process of checking that a software achieves its goal without any bugs. It is
the process to ensure whether the product that is developed is right or not. It verifies whether
the developed product fulfills the requirements that we have.
Verification is Static Testing.
Activities involved in verification:
1. Inspections
2. Reviews
3. Walkthroughs
4. Desk-checking
8.3VALIDATION
Validation is the process of checking whether the software product is up to the mark or in other
words product has high level requirements. It is the process of checking the validation of
product i.e. it checks what we are developing is the right product. it is validation of actual and
expected product.
Validation is the Dynamic Testing.
Activities involved in validation:
1. Black box testing
2. White box testing
3. Unit testing
4. Integration testing
Black box testing is a technique of software testing which examines the functionality of software
without peering into its internal structure or coding. The primary source of black box testing is a
specification of requirements that is stated by the customer.
In this method, tester selects a function and gives input value to examine its functionality, and checks
whether the function is giving expected output or not. If the function produces correct output, then it
is passed in testing, otherwise failed. The test team reports the result to the development team and
then tests the next function. After completing testing of all functions if there are severe problems,
then it is given back to the development team for correction.
Page | 38
The term 'white box' is used because of the internal perspective of the system. The clear box or
white box or transparent box name denote the ability to see through the software's outer shell into
its inner workings.
Developers do white box testing. In this, the developer will test every line of the code of the
program. The developers perform the White-box testing and then send the application or the
software to the testing team, where they will perform the black box testing and verify the
application along with the requirements and identify the bugs and sends it to the developer.
8.6TYPES OF TESTING
ALPHA TESTING: Alpha Testing can be defined as a form of acceptance testing carried out to
identify various types of issues or bugs before publishing the build or executable of the software
public or market. This test type focuses on real users through black box and white box testing
techniques. The focus remains on the task which a general user might want or experience
BETA TESTING: Beta Testing can be defined as the second stage of testing any product before
release, where a sample of the released product with minimum features and characteristics is
being given to the intended audience for trying out or temporarily using the product. Unlike an
alpha test, the beta test is being carried out by real users in the real environment. This allows the
targeted customers to dive into the product's design, working, interface, functionality, etc.
UNIT TESTING: In this testing level, individual sections or parts of software or product are
tested. The idea of this is to confirm every part or unit of the product after the test.
INTEGRATION TESTING: In this software testing level, individual parts need to combine
and test as a single cluster. This testing level's main idea is for exposing the faults while
interacting between integrated units of the project.
SYSTEM TESTING: In this software testing level, the whole, integrated software or project is
tested. The principle for this testing is to assess the system's conformity with its intended
requirements.
VALIDATION TESTING: Validation testing was performed to ensure that all the functional
and performance requirement are met.
This phase of the systems development life cycle refines hardware and software
applications, stablishes programming plans, trains users and implement extensive testing
procedures, to evaluate design and operating specifications and provide the basis for further
modification.
Page | 39
This activity builds upon specification produces during new system design, adding detailed
technical specifications and documentation.
This activity prepares detailed test specifications for individual modules and programs, job
streams, subsystem and for the system as a whole.
This activity encompasses actual development, writing, and testing of program units or
modules.
This activity encompasses writing user procedure manuals, preparation of user training
materials, conducting training programs and testing procedures.
A final procedural review to demonstrate a system and secure user approval before a
system become operational.
In this phase new computerized system is installed, the conversion to new procedures is
fully implemented, and the potential of the new system is explored.
The process of starting the actual use of a system and training user personnel in its
operation.
This phase evaluates the successes and failure during a system development project, and to
measure the results of new Computerized Transystem in terms of benefits and savings
projected at the start of the project.
A review of a project immediately after completion to find the success and potential
problem in future work.
Page | 40
A review, conducted after a new system has been in operation for some time, to evaluate
actual system performance against expectations and projections for cost-benefit
improvements. Also identifies maintenance projects to enhance or improve the system.
Page | 41
data in the appropriate directories and it has sufficient space to prevent unexpected
termination due to insufficient disk space.
Performance Testing is a software testing process used for testing the speed, response
time, stability, reliability, scalability and resource usage of a software application
under particular workload. The main purpose of performance testing is to identify and
eliminate the performance bottlenecks in the software application. It is a subset of
performance engineering and also known as “Perf Testing”.
In software testing, recovery testing is the activity of testing how well an application
is able to recover from crashes, hardware failures and other similar problems.
Recovery testing is the forced failure of the software in a variety of ways to verify that
recovery is properly performed.
Procedure testing determine the clarity of documentation on operation and uses of the
system after failure.
Human Factor Testing determines how users will use the system when processing
data or preparing reports.
8.9 SUMMARY
Page | 42
CHAPTER 9
9.1INRODUCTION
The software to be produced is on “Crime Reporting System”. The main authority is given to
the Admin. He provides unique username and password for each employee through which
the user can login and perform the activities given by the Admin. As soon as a new
employee joins the company Admin assigns tasks to him/her. Next is the main module of the
system that is the Crime module. In this all the crime information will be stored in the
database. First complaint details will be added into the system, and then Station employee
checks, complaint is related to crime or law and order. If it is a crime, it goes to a criminal
record. As soon as this task is completed FIR charge sheet will submit to the court.
9.2MODULES
Login
This includes Administrator, Police and User login. There will be a username and password to
login into the system to use all the facilities.
9.3DATABASE
A database is an organized mechanism that has the capability of storing information through
which a user can retrieve stored information in an effective and efficient manner. The data is the
purpose of any database and must be protected. The database design is a two level process. In the
first step, user requirements are gathered together and a database is designed which will meet
these requirements as clearly as possible. This step is called Information Level Design and it is
taken independent of any individual DBMS. In the second step, this Information level design is
transferred into a design
for the specific DBMS that will be used to implement the system in question. This step is
called Physical Level Design, concerned with the characteristics of the specific DBMS that will
be used. A database design runs parallel with the system design.
Input design
The design of input focuses on controlling the amount of input required, controlling the errors,
avoiding delays, avoiding extra steps and keeping the process simple. The input is designed in
such a way so that it provides security and ease of use with retaining the privacy. The dialog to
guide the operating personnel in providing input.
Output Design
A quality output is one, which meets the requirements of the end user and presents the
information clearly. In output design it is determined how the information is to be displaced for
Page | 43
immediate need and also the hard copy output. It is the most important and direct source
information to the user. Efficient and intelligent output design improve the system's relationship
to help user decision-making. Designing computer output should proceed in an organized, well
thought out manner; the right output must be developed while ensuring that each output element
is designed so that people will find the system can use easily and effectively.
9.4DATABASE TABLES
Address varchar
Security Question Varchar
Security Answer Varchar
Page | 44
COLUMN DATATYPE COLUMN DATATYPE
Email email
Gender Varcahr
In this chapter we discuss about application modules and database of the software.
Page | 45
CHAPTER 10
10.1 COLCLUSSION
Our project is only a humble venture to satisfy the need to manage their project work. Several
user friendly coding have also adopted. Nowadays everything is getting computerized.
Manual work usually consumes a lot of time and is error-prone. To make complaining easy
and manage crime records, this application is beneficial. Thus, Crime Management System
overcomes most of the existing system's limitations and is a very user-friendly application.
10.2 LIMITATIONS
Excel export has not been developed for Crime, Users due to some criticality.
Off-line report of Crime, Complain, Crime-Report cannot be generated due to batch
mode execution.
Page | 46
REFERENCES
Lal, Divya, et al. "Advanced Immediate Crime Reporting to Police in India." Procedia
Computer Science 85 (2016): 543-549.
http://troindia.in/journal/ijcesr/vol5iss6/20-21.pdf
https://www.ijcsmc.com/docs/papers/March2015/V4I3201599a19.pdf
https://www.irjet.net/archives/V6/i4/IRJET-V6I4455.pdf [5] Chaudhari, Pritam
Vinay, et al. "Crime Reporting and Recording System." (2018). [6] Fabito, Bernie S.,
et al. "Leveraging crime reporting in Metro Manila using unsupervised crowd-sourced
data: A case for the iReport framework." 2017 International Conference on Control,
Electronics, Renewable Energy and Communications (ICRC). IEEE, 2017.
S. Maghu, S. Sehra and A. Bhardawaj, Inside of Cyber Crimes and
Information Security: Threats and Solutions”, International Journal of
Information & Computation Technology, Volume 4, Number 8 spl., pp. 835-
840, 2014.
P. Bhateja, P. Sehrawat and A. Bhardawaj, An Analysis of Data Mining, Web Image
Mining and their Applications, International Journal of
Information and Computation Technology, Vol. 3, No. 6, pp. 603-608, 2013.
C. Arora, C. Kaur, A. Gupta and A. Bhardawaj, A Review of Recent E-
learning Trends: Implementation & Cognitive Styles”, International Journal
of Information & Computation Technology, Volume 4, Number 3 spl., pp.
215-220, 2014.
S. Goel and A Bhardawaj, A Critical Analysis of Augmented Learning by
Applicability of IT Tools”, International Journal of Information &
Computation Technology, Volume 4, Number 4 spl. pp. 425-430,2014.
J. Govil, Ramifications of cyber crime and suggestive preventive measures.
In Electro/Information Technology, IEEE International Conference on (pp.
610-615). IEEE, 2007.
M. Gupta, B. Chandra, and M. P. Gupta, Crime data mining for Indian police
information system. Proceeding of the 2008 Computer Society of India.
C. H. Ku, and G. Leroy, A decision support system: Automated crime report analysis
and classification for e-government. Government Information
Quarterly, 31(4), 534-544, 2014.
N. Martin, and J. Rice, Cybercrime: Understanding and addressing the concerns of
stakeholders. Computers & Security, 30(8), 803-814, 2011.
J. S. Jadhav, and K. M. Nalawade, Research Aspect of Expert system of Indian
judiciary of crime against women. The International Journal of Engineering and
Science, 2(7), 2013.
A. B. Patki, S. Lakshminarayanan, S. Sivasubramanian, and S. S. Sarma, Cyber crime
information system for cybernetics awareness. In Cyberworlds, 2003. Proceedings.
2003 International Conference on (pp. 46-53). IEEE.
Page | 47
APPENDIX A
SCREENSHOTS
Page | 48
2. REGISTRATION SCREEN
Page | 49
3. CRIMINAL RECORD SCREEN
Page | 50
APPENDIX B
SOURCE CODE
1. REGISTER.PY
class Register():
def __init__(self,root):
self.root=root
self.root.title=('Register Page')
self.root.geometry('1600x790+0+0')
#text to speech
self.engine=pyttsx3.init()
self.voices=self.engine.getProperty('voices')
self.engine.setProperty('voice',self.voices[1].id)
#validation
self.First_var=StringVar()
self.Last_var=StringVar()
self.User_var=StringVar()
self.Father_var=StringVar()
self.Mother_var=StringVar()
self.Age_var=StringVar()
self.Email_var=StringVar()
self.contact_var=StringVar()
self.Gender_var=StringVar()
self.Country_var=StringVar()
self.State_var=StringVar()
self.Address_var=StringVar()
self.Blood_var=StringVar()
self.IDtype_var=StringVar()
self.IDnum_var=StringVar()
self.Department_var=StringVar()
self.Director_var=StringVar()
self.position_var=StringVar()
self.password=StringVar()
self.confirm_pass=StringVar()
self.check_var=IntVar()
Page | 51
#IMAGE
self.bg=ImageTk.PhotoImage(file='image/bg1.jpg')
bg_lbl=Label(self.root,image=self.bg, bd=2,relief=RAISED)
bg_lbl.place(x=0,y=0,relheight=1,relwidth=1)
logo_img=Image.open('image/logo2.png')
logo_img=logo_img.resize((60,60),Image.Resampling.LANCZOS)
self.logo=ImageTk.PhotoImage(logo_img)
#Title frame
title_frame=Frame(self.root,bd=1,relief=RIDGE,bg='bisque')
title_frame.place(x=260,y=28,width=1080,height=78)
title_lbl=Label(title_frame,image=self.logo,compound=LEFT,text=' USER
REGISTRATION FORM ',font=('times new roman',30,'bold'),fg='darkblue')
title_lbl.place(x=140,y=10)
#informatiion frame
main_frame=Frame(self.root,bd=1,relief=RIDGE,bg='bisque')
main_frame.place(x=260,y=110,width=1080,height=660,)
#first
First_name=Label(main_frame,text='First Name :',font=('times new roman',16,'bold'))
First_name.grid(row=0,column=0,padx=10,pady=10,sticky=W)
First_entry=ttk.Entry(main_frame,textvariable=self.First_var,font=('times new
roman',15),width=18)
First_entry.grid(row=0,column=1,padx=6,pady=10,sticky=W)
#last
Last_name=Label(main_frame,text='Last Name :',font=('times new roman',16,'bold'))
Last_name.grid(row=0,column=3,padx=8,pady=10,sticky=W)
Last_entry=ttk.Entry(main_frame,textvariable=self.Last_var,font=('times new
roman',15),width=18)
Last_entry.grid(row=0,column=4,padx=6,pady=10,sticky=W)
#User
User_name=Label(main_frame,text='User Name :',font=('times new roman',16,'bold'))
User_name.grid(row=0,column=6,padx=8,pady=10,sticky=W)
Page | 52
User_entry=ttk.Entry(main_frame,textvariable=self.User_var,font=('times new
roman',15),width=16)
User_entry.grid(row=0,column=7,padx=6,pady=10,sticky=W)
#father
Father_name=Label(main_frame,text='Father Name:',font=('times new
roman',16,'bold'))
Father_name.grid(row=1,column=0,padx=10,pady=10,sticky=W)
Father_entry=ttk.Entry(main_frame,textvariable=self.Father_var,font=('times new
roman',15),width=18)
Father_entry.grid(row=1,column=1,padx=6,pady=10,sticky=W)
#mother
Mother_name=Label(main_frame,text='Mother Name:',font=('times new
roman',16,'bold'))
Mother_name.grid(row=1,column=3,padx=10,pady=10,sticky=W)
Mother_entry=ttk.Entry(main_frame,textvariable=self.Mother_var,font=('times new
roman',15),width=18)
Mother_entry.grid(row=1,column=4,padx=6,pady=10,sticky=W)
#age
user_age=Label(main_frame,text='Age:',font=('times new roman',16,'bold'))
user_age.grid(row=1,column=6,padx=10,pady=10,sticky=W)
list=['21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','4
2','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60']
droplist=OptionMenu(main_frame,self.Age_var,*list)
#email
email_lbl=Label(main_frame,text='Email:',font=('times new roman',16,'bold'))
email_lbl.grid(row=2,column=0,padx=10,pady=10,sticky=W)
Page | 53
txt_email=ttk.Entry(main_frame,textvariable=self.Email_var,font=('times new
roman',15),width=18)
txt_email.grid(row=2,column=1,padx=6,pady=10,sticky=W)
#contact
contact_lbl=Label(main_frame,text='Contact:',font=('times new roman',16,'bold'))
contact_lbl.grid(row=2,column=3,padx=10,pady=10,sticky=W)
entry_contact=ttk.Entry(main_frame,textvariable=self.contact_var,font=('times new
roman',15),width=18)
entry_contact.grid(row=2,column=4,padx=6,pady=10,sticky=W)
#gender
gender_lbl=Label(main_frame,text='Gender:',font=('times new roman',16,'bold'))
gender_lbl.grid(row=2,column=6,padx=10,pady=10,sticky=W)
list1=['Male','Female','Other']
droplist=OptionMenu(main_frame,self.Gender_var,*list1)
#country
country_lbl=Label(main_frame,text='Country:',font=('times new roman',16,'bold'))
country_lbl.grid(row=3,column=0,padx=10,pady=10,sticky=W)
list2=['India','China','Germany','Australia','United
States','Japan','France','SwitzerLand','Italy','Swedan']
droplist=OptionMenu(main_frame,self.Country_var,*list2)
#state
state_lbl=Label(main_frame,text='State:',font=('times new roman',16,'bold'))
state_lbl.grid(row=3,column=3,padx=10,pady=10,sticky=W)
txt_state=ttk.Entry(main_frame,textvariable=self.State_var,font=('times new
Page | 54
roman',15),width=16)
txt_state.grid(row=3,column=4,padx=6,pady=10)
#address
address_lbl=Label(main_frame,text='Address:',font=('times new roman',16,'bold'))
address_lbl.grid(row=3,column=6,padx=10,pady=10,sticky=W)
txt_address=ttk.Entry(main_frame,textvariable=self.Address_var,font=('times new
roamn',15),width=14)
txt_address.grid(row=3,column=7,padx=6,pady=10)
#blood group
blood_lbl=Label(main_frame,text='Blood Group:',font=('times new roman',16,'bold'))
blood_lbl.grid(row=4,column=0,padx=10,pady=10,sticky=W)
list3=['A+','O+','B+','AB+','A-','O-','B-','AB-']
droplist=OptionMenu(main_frame,self.Blood_var,*list3)
#ID
id_type=Label(main_frame,text='Select ID Type:',font=('times new roman',16,'bold'))
id_type.grid(row=4,column=3,padx=6,pady=10,sticky=W)
self.combo_id_type=ttk.Combobox(main_frame,textvariable=self.IDtype_var,font=('times
new roman',15),justify='center',state='readonly',width=18)
self.combo_id_type["value"]=("Select Your Id",'Adhar Card','Driving
licence','Passport','PAN Card')
self.combo_id_type.grid(row=4,column=4,padx=6,pady=10)
self.combo_id_type.current(0)
#id type
id_no=Label(main_frame,text='ID Number:',font=('times new roman',16,'bold'))
id_no.grid(row=4,column=6,padx=6,pady=10,sticky=W)
entry_id_no=ttk.Entry(main_frame,textvariable=self.IDnum_var,font=('times new
roman',15),width=16)
entry_id_no.grid(row=4,column=7,padx=6,pady=10,sticky=W)
#department
department=Label(main_frame,text='Department:',font=('times new roman',16,'bold'))
department.grid(row=5,column=0,padx=6,pady=10,sticky=W)
entry_dep=ttk.Entry(main_frame,textvariable=self.Department_var,font=('times new
roman',15),width=17)
entry_dep.grid(row=5,column=1,padx=6,pady=10,sticky=W)
#director
Page | 55
director=Label(main_frame,text='Director Name:',font=('times new roman',16,'bold'))
director.grid(row=5,column=3,padx=6,pady=10,sticky=W)
entry_director=ttk.Entry(main_frame,textvariable=self.Director_var,font=('times new
roman',15),width=15)
entry_director.grid(row=5,column=4,padx=6,pady=10,sticky=W)
#position
position=Label(main_frame,text='Your Position:',font=('times new roman',16,'bold'))
position.grid(row=5,column=6,padx=6,pady=10,sticky=W)
entry_position=ttk.Entry(main_frame,textvariable=self.position_var,font=('times new
roman',15),width=15)
entry_position.grid(row=5,column=7,padx=6,pady=10,sticky=W)
#password
password=Label(main_frame,text="Password:",font=('times new roman',16,'bold'))
password.grid(row=6,column=0,padx=6,pady=10,sticky=W)
entry_pass=ttk.Entry(main_frame,textvariable=self.password,font=('times new
roman',15),width=17)
entry_pass.grid(row=6,column=1,padx=6,pady=10,sticky=W)
#password
C_password=Label(main_frame,text="Confirm Password:",font=('times new
roman',16,'bold'))
C_password.grid(row=6,column=3,padx=6,pady=10,sticky=W)
entry_pass_c=ttk.Entry(main_frame,textvariable=self.confirm_pass,font=('times new
roman',15),width=17)
entry_pass_c.grid(row=6,column=4,padx=6,pady=10,sticky=W)
#check button
check_frame=Frame(main_frame,bg='bisque')
check_frame.place(x=360,y=460,width=400,height=80)
#button frame
btn_frame=Frame(main_frame,bg='bisque')
btn_frame.place(x=220,y=560,width=680,height=45)
save_button=Button(btn_frame,text='Save',command=self.validation,font=('times new
roman',16,'bold'),width=12,cursor='hand2',bg='skyblue')
Page | 56
save_button.grid(row=0,column=0,padx=10,sticky=W)
Verify_button=Button(btn_frame,text='Verify
Data',command=self.verify_data,font=('times new
roman',16,'bold'),width=12,cursor='hand2',bg='skyblue')
Verify_button.grid(row=0,column=2,padx=10,sticky=W)
clear_button=Button(btn_frame,text='Clear
Data',command=self.clear_data,font=('times new
roman',16,'bold'),width=12,cursor='hand2',bg='skyblue')
clear_button.grid(row=0,column=4,padx=10,sticky=W)
login_button=Button(btn_frame,text='login
now',command=self.clear_data,font=('times new
roman',16,'bold'),width=12,cursor='hand2',bg='olive')
login_button.grid(row=0,column=6,padx=10,sticky=W)
#validation
def checkname(self,name):
if name.isalnum():
return True
if name==' ':
return True
else:
messagebox.showerror('Invalid','Not Allowed'+name[-1])
def checkfname(self,fname):
if fname.isalnum():
return True
if fname==' ':
return True
else:
messagebox.showerror('Invalid','Not Allowed'+fname[-1])
def checklname(self,lname):
if lname.isalnum():
return True
if lname==' ':
return True
else:
messagebox.showerror('Invalid','Not Allowed'+lname[-1])
def checkfathername(self,fathername):
if fathername.isalnum():
return True
if fathername==' ':
return True
else:
messagebox.showerror('Invalid','Not Allowed'+fathername[-1])
Page | 57
def checkMothername(self,mothername):
if mothername.isalnum():
return True
if mothername=='':
return True
else:
messagebox.showerror('Invalid','Not Allowed'+mothername[-1])
#checkcontact
def checkcontact(self,contact):
if contact.isdigit():
return True
if len(str(contact))==0:
return True
else:
messagebox.showerror("Invalid","Invalid Enrty")
return False
#password
def checkpassword(self,password):
if len(password)<=20:
if re.match("^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z](?=.*[^a-bA-B0-9]))",password):
return True
else:
messagebox.showinfo('Invalid','Enter vaild password(example:shruti123@)')
return False
else:
messagebox.showerror('Invaild',"Length try to exceed")
return False
#email
def checkemail(self,email):
if len(email)>7:
if re.match("^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$",email):
return True
else:
messagebox.showwarning('Alter','Invalid email enter vaild enter valid user email
(example:shrutivishwakarma868@gmail.com')
return False
else:
#mainValidation
def validation(self):
if self.First_var.get()=='':
self.engine.say('Please Enter Your first Name')
self.engine.runAndWait()
Page | 58
messagebox.showerror('Error','Please Enter Your First Name',parent=self.root)
elif self.Last_var.get()=='':
self.engine.say('Please Enter Your Last Name')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your Last Name',parent=self.root)
elif self.User_var.get()=='':
self.engine.say('Please Enter Your User Name')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your User Name',parent=self.root)
elif self.Father_var.get()=='':
self.engine.say('Please Enter Your Father Name')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your Father Name',parent=self.root)
elif self.Mother_var.get()=='':
self.engine.say('Please Enter Your Mother Name')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your Mother Name',parent=self.root)
elif self.Age_var.get()=='':
self.engine.say('Please Enter Your Age')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your Age',parent=self.root)
elif self.Email_var.get()=='':
self.engine.say('Please Enter Your Email')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your email',parent=self.root)
elif self.Gender_var.get()=='':
self.engine.say('Please Enter Your Gender')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your Gender',parent=self.root)
Page | 59
elif self.State_var.get()=='':
self.engine.say('Please Enter Your State')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your State',parent=self.root)
elif self.Address_var.get()=='':
self.engine.say('Please Enter Your Address')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your Address',parent=self.root)
elif self.Blood_var.get()=='':
self.engine.say('Please Enter Your BloodGroup')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your Blood Group',parent=self.root)
elif self.IDtype_var.get()=='':
self.engine.say('Please Enter Your IDTYPE')
self.engine.runAndWait()
messagebox.showerror('Error','Please Select your ID',parent=self.root)
elif self.Department_var.get()=='':
self.engine.say('Please Enter Your Department')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your Department',parent=self.root)
elif self.Director_var.get()=='':
self.engine.say('Please Enter Your Director Name')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your Director Name',parent=self.root)
elif self.position_var.get()=='':
self.engine.say('Please Enter Your Position')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your Postion',parent=self.root)
elif self.password.get()=='':
self.engine.say('Please Enter Your Password')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your Password',parent=self.root)
elif self.confirm_pass.get()=='':
self.engine.say('Please Enter Your Confirm Password')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your confirm
Password',parent=self.root)
Page | 60
elif self.password.get()!=self.confirm_pass.get():
messagebox.showerror('Error','Password & Comfirm Password Must Be
Same',parent=self.root)
elif self.Email_var.get()!=None:
global x
x=self.checkemail(self.Email_var.get())
if (x == True):
if self.check_var.get()==0:
self.check_lbl.config(text='Please Agree Our Terms And Condition',fg='red')
else:
self.check_lbl.config(text='Checked',fg='olive')
messagebox.showinfo('Successfully','Your registration successfully completed')
try:
con=mysql.connector.connect(host='localhost',username='root',password='Root',database='
Management')
my_cursur=con.cursor()
my_cursur.execute('Insert into register value(%s,%s,%s,%s,%s,%s,%s,%s,%s,
%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)',(
self.First_var.get(),
self.Last_var.get(),
self.User_var.get(),
self.Father_var.get(),
self.Mother_var.get(),
self.Age_var.get(),
self.Email_var.get(),
self.contact_var.get(),
self.Gender_var.get(),
self.Country_var.get(),
self.State_var.get(),
self.Address_var.get(),
self.Blood_var.get(),
self.IDtype_var.get(),
Page | 61
self.IDnum_var.get(),
self.Department_var.get(),
self.Director_var.get(),
self.position_var.get(),
self.password.get()
))
con.commit()
con.close()
messagebox.showinfo('Successfully',f'Your Registration Successfully
Completed Your UserName:{self.User_var.get()} and your password:
{self.password.get()}')
def verify_data(self):
data=f'First:{self.First_var.get()}\n Last:{self.Last_var.get()}\n User:
{self.User_var.get()}\n Father:{self.Father_var.get()}\n Mother:{self.Mother_var.get()}\n
Age:{self.Age_var.get()}\n Email:{self.Email_var.get()}\n Contact:
{self.contact_var.get()}\n Gender:{self.Gender_var.get()}\n Country:
{self.Country_var.get()}\n State:{self.State_var.get()}\n address:{self.Address_var.get()}\n
Blood:{self.Blood_var.get()}\n Id:{self.IDtype_var.get()}\n IDNUM:
{self.IDnum_var.get()}\n Department:{self.Department_var.get()}\n Director:
{self.Director_var.get()}\n Position:{self.position_var.get()}\n Password:
{self.password.get()}'
messagebox.showinfo('Details',data)
def clear_data(self):
self.First_var.set('')
self.Last_var.set('')
self.User_var.set('')
self.Father_var.set('')
self.Mother_var.set('')
self.Age_var.set('')
self.Email_var.set('')
self.contact_var.set('')
self.Gender_var.set('Gender')
self.Country_var.set('')
self.State_var.set('')
self.Address_var.set('')
self.Blood_var.set('')
self.IDtype_var.set('Select Your Id')
self.IDnum_var.set('')
Page | 62
self.Department_var.set('')
self.Director_var.set('')
self.position_var.set('')
self.password.set('')
self.confirm_pass.set('')
self.check_var.set(0)
if __name__=='__main__':
root=Tk()
obj=Register(root)
root.mainloop()
Page | 63
2. LOGIN.PY
def main():
win=Tk()
app=login_Window(win)
win.mainloop
class login_Window:
def __init__(self,root):
self.root=root
self.root.title('Login')
self.root.geometry("1550x800+0+0")
self.bg=ImageTk.PhotoImage(file=r'image/bg1.jpg')
lbl_bg=Label(self.root,image=self.bg)
lbl_bg.place(x=0,y=0,relwidth=1,relheight=1)
frame=Frame(self.root,bg="black")
frame.place(x=580,y=170,width=360,height=490)
img1=Image.open(r'image/logo2.png')
img1=img1.resize((90,100),Image.Resampling.LANCZOS)
self.photoimage1=ImageTk.PhotoImage(img1)
lblimg1=Label(image=self.photoimage1,bg="black",borderwidth=0)
lblimg1.place(x=720,y=175,width=100,height=80)
#username
username=lbl=Label(frame,text="User Name",font=("times new
roame",15,'bold'),fg='white',bg='black')
username.place(x=40,y=155)
Page | 64
#password
password=lbl=Label(frame,text="Password",font=("times new
roame",15,'bold'),fg='white',bg='black')
password.place(x=40,y=240)
#loginButton
loginbtn=Button(frame,command=self.login,text="Login",font=("times new
roame",15,'bold'),fg='white',bg='olive',activebackground="red")
loginbtn.place(x=110,y=330,width=120,height=35)
#registerButton
registerbtn=Button(frame,text="New User
Register",command=self.register_window,font=("times new
roame",10,'bold'),borderwidth=0,fg='white',bg='black',activeforeground="white",activeback
ground="red")
registerbtn.place(x=10,y=390,width=160)
#forgettenpassbtn
forgetbtn=Button(frame,text="Forget Password",font=("times new
roame",10,'bold'),borderwidth=0,fg='white',bg='black',activeforeground="white",activeback
ground="red")
forgetbtn.place(x=6,y=420,width=160)
def login(self):
if self.txtuser.get()=="" or self.txtpass.get()=="":
messagebox.showerror("Error","All Fields Required")
else:
messagebox.showerror("Invaild","Invalid UserName & Password")
def register_window(self):
self.new_window=Toplevel(self.root)
self.app=Register(self.new_window)
class Register():
def __init__(self,root):
self.root=root
Page | 65
self.root.title=('Register Page')
self.root.geometry('1600x790+0+0')
#text to speech
self.engine=pyttsx3.init()
self.voices=self.engine.getProperty('voices')
self.engine.setProperty('voice',self.voices[1].id)
#validation
self.First_var=StringVar()
self.Last_var=StringVar()
self.User_var=StringVar()
self.Father_var=StringVar()
self.Mother_var=StringVar()
self.Age_var=StringVar()
self.Email_var=StringVar()
self.contact_var=StringVar()
self.Gender_var=StringVar()
self.Country_var=StringVar()
self.State_var=StringVar()
self.Address_var=StringVar()
self.Blood_var=StringVar()
self.IDtype_var=StringVar()
self.IDnum_var=StringVar()
self.Department_var=StringVar()
self.Director_var=StringVar()
self.position_var=StringVar()
self.password=StringVar()
self.confirm_pass=StringVar()
self.check_var=IntVar()
#IMAGE
self.bg=ImageTk.PhotoImage(file='image/bg1.jpg')
bg_lbl=Label(self.root,image=self.bg, bd=2,relief=RAISED)
bg_lbl.place(x=0,y=0,relheight=1,relwidth=1)
logo_img=Image.open('image/logo2.png')
logo_img=logo_img.resize((60,60),Image.Resampling.LANCZOS)
self.logo=ImageTk.PhotoImage(logo_img)
#Title frame
title_frame=Frame(self.root,bd=1,relief=RIDGE,bg='bisque')
title_frame.place(x=260,y=28,width=1080,height=78)
title_lbl=Label(title_frame,image=self.logo,compound=LEFT,text=' USER
REGISTRATION FORM ',font=('times new roman',30,'bold'),fg='darkblue')
Page | 66
title_lbl.place(x=140,y=10)
#informatiion frame
main_frame=Frame(self.root,bd=1,relief=RIDGE,bg='bisque')
main_frame.place(x=260,y=110,width=1080,height=660,)
#first
First_name=Label(main_frame,text='First Name :',font=('times new roman',16,'bold'))
First_name.grid(row=0,column=0,padx=10,pady=10,sticky=W)
First_entry=ttk.Entry(main_frame,textvariable=self.First_var,font=('times new
roman',15),width=18)
First_entry.grid(row=0,column=1,padx=6,pady=10,sticky=W)
#last
Last_name=Label(main_frame,text='Last Name :',font=('times new roman',16,'bold'))
Last_name.grid(row=0,column=3,padx=8,pady=10,sticky=W)
Last_entry=ttk.Entry(main_frame,textvariable=self.Last_var,font=('times new
roman',15),width=18)
Last_entry.grid(row=0,column=4,padx=6,pady=10,sticky=W)
#User
User_name=Label(main_frame,text='User Name :',font=('times new roman',16,'bold'))
User_name.grid(row=0,column=6,padx=8,pady=10,sticky=W)
User_entry=ttk.Entry(main_frame,textvariable=self.User_var,font=('times new
roman',15),width=16)
User_entry.grid(row=0,column=7,padx=6,pady=10,sticky=W)
#father
Father_name=Label(main_frame,text='Father Name:',font=('times new
roman',16,'bold'))
Father_name.grid(row=1,column=0,padx=10,pady=10,sticky=W)
Father_entry=ttk.Entry(main_frame,textvariable=self.Father_var,font=('times new
roman',15),width=18)
Page | 67
Father_entry.grid(row=1,column=1,padx=6,pady=10,sticky=W)
#mother
Mother_name=Label(main_frame,text='Mother Name:',font=('times new
roman',16,'bold'))
Mother_name.grid(row=1,column=3,padx=10,pady=10,sticky=W)
Mother_entry=ttk.Entry(main_frame,textvariable=self.Mother_var,font=('times new
roman',15),width=18)
Mother_entry.grid(row=1,column=4,padx=6,pady=10,sticky=W)
#age
user_age=Label(main_frame,text='Age:',font=('times new roman',16,'bold'))
user_age.grid(row=1,column=6,padx=10,pady=10,sticky=W)
list=['21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','4
2','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60']
droplist=OptionMenu(main_frame,self.Age_var,*list)
#email
email_lbl=Label(main_frame,text='Email:',font=('times new roman',16,'bold'))
email_lbl.grid(row=2,column=0,padx=10,pady=10,sticky=W)
txt_email=ttk.Entry(main_frame,textvariable=self.Email_var,font=('times new
roman',15),width=18)
txt_email.grid(row=2,column=1,padx=6,pady=10,sticky=W)
#contact
contact_lbl=Label(main_frame,text='Contact:',font=('times new roman',16,'bold'))
contact_lbl.grid(row=2,column=3,padx=10,pady=10,sticky=W)
entry_contact=ttk.Entry(main_frame,textvariable=self.contact_var,font=('times new
roman',15),width=18)
entry_contact.grid(row=2,column=4,padx=6,pady=10,sticky=W)
Page | 68
#bind and validation register
validate_Contact=self.root.register(self.checkcontact)
entry_contact.config(validate='key',validatecommand=(validate_Contact,'%P'))
#gender
gender_lbl=Label(main_frame,text='Gender:',font=('times new roman',16,'bold'))
gender_lbl.grid(row=2,column=6,padx=10,pady=10,sticky=W)
list1=['Male','Female','Other']
droplist=OptionMenu(main_frame,self.Gender_var,*list1)
#country
country_lbl=Label(main_frame,text='Country:',font=('times new roman',16,'bold'))
country_lbl.grid(row=3,column=0,padx=10,pady=10,sticky=W)
list2=['India','China','Germany','Australia','United
States','Japan','France','SwitzerLand','Italy','Swedan']
droplist=OptionMenu(main_frame,self.Country_var,*list2)
#state
state_lbl=Label(main_frame,text='State:',font=('times new roman',16,'bold'))
state_lbl.grid(row=3,column=3,padx=10,pady=10,sticky=W)
txt_state=ttk.Entry(main_frame,textvariable=self.State_var,font=('times new
roman',15),width=16)
txt_state.grid(row=3,column=4,padx=6,pady=10)
#address
address_lbl=Label(main_frame,text='Address:',font=('times new roman',16,'bold'))
address_lbl.grid(row=3,column=6,padx=10,pady=10,sticky=W)
txt_address=ttk.Entry(main_frame,textvariable=self.Address_var,font=('times new
roamn',15),width=14)
txt_address.grid(row=3,column=7,padx=6,pady=10)
#blood group
blood_lbl=Label(main_frame,text='Blood Group:',font=('times new roman',16,'bold'))
blood_lbl.grid(row=4,column=0,padx=10,pady=10,sticky=W)
list3=['A+','O+','B+','AB+','A-','O-','B-','AB-']
Page | 69
droplist=OptionMenu(main_frame,self.Blood_var,*list3)
#ID
id_type=Label(main_frame,text='Select ID Type:',font=('times new roman',16,'bold'))
id_type.grid(row=4,column=3,padx=6,pady=10,sticky=W)
self.combo_id_type=ttk.Combobox(main_frame,textvariable=self.IDtype_var,font=('times
new roman',15),justify='center',state='readonly',width=18)
self.combo_id_type["value"]=("Select Your Id",'Adhar Card','Driving
licence','Passport','PAN Card')
self.combo_id_type.grid(row=4,column=4,padx=6,pady=10)
self.combo_id_type.current(0)
#id type
id_no=Label(main_frame,text='ID Number:',font=('times new roman',16,'bold'))
id_no.grid(row=4,column=6,padx=6,pady=10,sticky=W)
entry_id_no=ttk.Entry(main_frame,textvariable=self.IDnum_var,font=('times new
roman',15),width=16)
entry_id_no.grid(row=4,column=7,padx=6,pady=10,sticky=W)
#department
department=Label(main_frame,text='Department:',font=('times new roman',16,'bold'))
department.grid(row=5,column=0,padx=6,pady=10,sticky=W)
entry_dep=ttk.Entry(main_frame,textvariable=self.Department_var,font=('times new
roman',15),width=17)
entry_dep.grid(row=5,column=1,padx=6,pady=10,sticky=W)
#director
director=Label(main_frame,text='Director Name:',font=('times new roman',16,'bold'))
director.grid(row=5,column=3,padx=6,pady=10,sticky=W)
entry_director=ttk.Entry(main_frame,textvariable=self.Director_var,font=('times new
roman',15),width=15)
entry_director.grid(row=5,column=4,padx=6,pady=10,sticky=W)
#position
position=Label(main_frame,text='Your Position:',font=('times new roman',16,'bold'))
position.grid(row=5,column=6,padx=6,pady=10,sticky=W)
entry_position=ttk.Entry(main_frame,textvariable=self.position_var,font=('times new
roman',15),width=15)
entry_position.grid(row=5,column=7,padx=6,pady=10,sticky=W)
Page | 70
#password
password=Label(main_frame,text="Password:",font=('times new roman',16,'bold'))
password.grid(row=6,column=0,padx=6,pady=10,sticky=W)
entry_pass=ttk.Entry(main_frame,textvariable=self.password,font=('times new
roman',15),width=17)
entry_pass.grid(row=6,column=1,padx=6,pady=10,sticky=W)
#password
C_password=Label(main_frame,text="Confirm Password:",font=('times new
roman',16,'bold'))
C_password.grid(row=6,column=3,padx=6,pady=10,sticky=W)
entry_pass_c=ttk.Entry(main_frame,textvariable=self.confirm_pass,font=('times new
roman',15),width=17)
entry_pass_c.grid(row=6,column=4,padx=6,pady=10,sticky=W)
#check button
check_frame=Frame(main_frame,bg='bisque')
check_frame.place(x=360,y=460,width=400,height=80)
#button frame
btn_frame=Frame(main_frame,bg='bisque')
btn_frame.place(x=220,y=560,width=680,height=45)
save_button=Button(btn_frame,text='Save',command=self.validation,font=('times new
roman',16,'bold'),width=12,cursor='hand2',bg='skyblue')
save_button.grid(row=0,column=0,padx=10,sticky=W)
Verify_button=Button(btn_frame,text='Verify
Data',command=self.verify_data,font=('times new
roman',16,'bold'),width=12,cursor='hand2',bg='skyblue')
Verify_button.grid(row=0,column=2,padx=10,sticky=W)
clear_button=Button(btn_frame,text='Clear
Data',command=self.clear_data,font=('times new
roman',16,'bold'),width=12,cursor='hand2',bg='skyblue')
clear_button.grid(row=0,column=4,padx=10,sticky=W)
login_button=Button(btn_frame,text='login
now',command=self.clear_data,font=('times new
roman',16,'bold'),width=12,cursor='hand2',bg='olive')
login_button.grid(row=0,column=6,padx=10,sticky=W)
Page | 71
#validation
def checkname(self,name):
if name.isalnum():
return True
if name==' ':
return True
else:
messagebox.showerror('Invalid','Not Allowed'+name[-1])
def checkfname(self,fname):
if fname.isalnum():
return True
if fname==' ':
return True
else:
messagebox.showerror('Invalid','Not Allowed'+fname[-1])
def checklname(self,lname):
if lname.isalnum():
return True
if lname==' ':
return True
else:
messagebox.showerror('Invalid','Not Allowed'+lname[-1])
def checkfathername(self,fathername):
if fathername.isalnum():
return True
if fathername==' ':
return True
else:
messagebox.showerror('Invalid','Not Allowed'+fathername[-1])
def checkMothername(self,mothername):
if mothername.isalnum():
return True
if mothername=='':
return True
else:
messagebox.showerror('Invalid','Not Allowed'+mothername[-1])
#checkcontact
def checkcontact(self,contact):
if contact.isdigit():
return True
if len(str(contact))==0:
return True
else:
messagebox.showerror("Invalid","Invalid Enrty")
Page | 72
return False
#password
def checkpassword(self,password):
if len(password)<=20:
if re.match("^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z](?=.*[^a-bA-B0-9]))",password):
return True
else:
messagebox.showinfo('Invalid','Enter vaild password(example:shruti123@)')
return False
else:
messagebox.showerror('Invaild',"Length try to exceed")
return False
#email
def checkemail(self,email):
if len(email)>7:
if re.match("^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$",email):
return True
else:
messagebox.showwarning('Alter','Invalid email enter vaild enter valid user email
(example:shrutivishwakarma868@gmail.com')
return False
else:
#mainValidation
def validation(self):
if self.First_var.get()=='':
self.engine.say('Please Enter Your first Name')
self.engine.runAndWait()
messagebox.showerror('Error','Please Enter Your First Name',parent=self.root)
elif self.Last_var.get()=='':
self.engine.say('Please Enter Your Last Name')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your Last Name',parent=self.root)
elif self.User_var.get()=='':
self.engine.say('Please Enter Your User Name')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your User Name',parent=self.root)
elif self.Father_var.get()=='':
self.engine.say('Please Enter Your Father Name')
Page | 73
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your Father Name',parent=self.root)
elif self.Mother_var.get()=='':
self.engine.say('Please Enter Your Mother Name')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your Mother Name',parent=self.root)
elif self.Age_var.get()=='':
self.engine.say('Please Enter Your Age')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your Age',parent=self.root)
elif self.Email_var.get()=='':
self.engine.say('Please Enter Your Email')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your email',parent=self.root)
elif self.Gender_var.get()=='':
self.engine.say('Please Enter Your Gender')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your Gender',parent=self.root)
elif self.State_var.get()=='':
self.engine.say('Please Enter Your State')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your State',parent=self.root)
elif self.Address_var.get()=='':
self.engine.say('Please Enter Your Address')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your Address',parent=self.root)
elif self.Blood_var.get()=='':
self.engine.say('Please Enter Your BloodGroup')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your Blood Group',parent=self.root)
elif self.IDtype_var.get()=='':
Page | 74
self.engine.say('Please Enter Your IDTYPE')
self.engine.runAndWait()
messagebox.showerror('Error','Please Select your ID',parent=self.root)
elif self.Department_var.get()=='':
self.engine.say('Please Enter Your Department')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your Department',parent=self.root)
elif self.Director_var.get()=='':
self.engine.say('Please Enter Your Director Name')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your Director Name',parent=self.root)
elif self.position_var.get()=='':
self.engine.say('Please Enter Your Position')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your Postion',parent=self.root)
elif self.password.get()=='':
self.engine.say('Please Enter Your Password')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your Password',parent=self.root)
elif self.confirm_pass.get()=='':
self.engine.say('Please Enter Your Confirm Password')
self.engine.runAndWait()
messagebox.showerror('Error','Please enter your confirm
Password',parent=self.root)
elif self.password.get()!=self.confirm_pass.get():
messagebox.showerror('Error','Password & Comfirm Password Must Be
Same',parent=self.root)
elif self.Email_var.get()!=None:
global x
x=self.checkemail(self.Email_var.get())
if (x == True):
if self.check_var.get()==0:
self.check_lbl.config(text='Please Agree Our Terms And Condition',fg='red')
else:
self.check_lbl.config(text='Checked',fg='olive')
messagebox.showinfo('Successfully','Your registration successfully completed')
Page | 75
try:
con=mysql.connector.connect(host='localhost',username='root',password='Root',database='
Management')
my_cursur=con.cursor()
my_cursur.execute('Insert into register value(%s,%s,%s,%s,%s,%s,%s,%s,%s,
%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)',(
self.First_var.get(),
self.Last_var.get(),
self.User_var.get(),
self.Father_var.get(),
self.Mother_var.get(),
self.Age_var.get(),
self.Email_var.get(),
self.contact_var.get(),
self.Gender_var.get(),
self.Country_var.get(),
self.State_var.get(),
self.Address_var.get(),
self.Blood_var.get(),
self.IDtype_var.get(),
self.IDnum_var.get(),
self.Department_var.get(),
self.Director_var.get(),
self.position_var.get(),
self.password.get()
))
con.commit()
con.close()
messagebox.showinfo('Successfully',f'Your Registration Successfully
Completed Your UserName:{self.User_var.get()} and your password:
{self.password.get()}')
Page | 76
except Exception as es:
messagebox.showerror('Error',f'Due To:{str(es)}',parent=self.root)
def verify_data(self):
data=f'First:{self.First_var.get()}\n Last:{self.Last_var.get()}\n User:
{self.User_var.get()}\n Father:{self.Father_var.get()}\n Mother:{self.Mother_var.get()}\n
Age:{self.Age_var.get()}\n Email:{self.Email_var.get()}\n Contact:
{self.contact_var.get()}\n Gender:{self.Gender_var.get()}\n Country:
{self.Country_var.get()}\n State:{self.State_var.get()}\n address:{self.Address_var.get()}\n
Blood:{self.Blood_var.get()}\n Id:{self.IDtype_var.get()}\n IDNUM:
{self.IDnum_var.get()}\n Department:{self.Department_var.get()}\n Director:
{self.Director_var.get()}\n Position:{self.position_var.get()}\n Password:
{self.password.get()}'
messagebox.showinfo('Details',data)
def clear_data(self):
self.First_var.set('')
self.Last_var.set('')
self.User_var.set('')
self.Father_var.set('')
self.Mother_var.set('')
self.Age_var.set('')
self.Email_var.set('')
self.contact_var.set('')
self.Gender_var.set('Gender')
self.Country_var.set('')
self.State_var.set('')
self.Address_var.set('')
self.Blood_var.set('')
self.IDtype_var.set('Select Your Id')
self.IDnum_var.set('')
self.Department_var.set('')
self.Director_var.set('')
self.position_var.set('')
self.password.set('')
self.confirm_pass.set('')
self.check_var.set(0)
if __name__=='__main__':
main()
root=Tk()
app=login_Window(root)
root.mainloop()
Page | 77
Page | 78
3. CRIME.PY
class criminal:
def __init__(self,root):
self.root=root
self.root.geometry('1530x780+0+0')
self.root.title('CRIMINAL RECORD SYSTEM')
#variables
self.var_case_id=StringVar()
self.var_criminal_no=StringVar()
self.var_name=StringVar()
self.var_nickname=StringVar()
self.var_arrest_date=StringVar()
self.var_date_of_crime=StringVar()
self.var_address=StringVar()
self.var_age=StringVar()
self.var_occuption=StringVar()
self.var_birthmark=StringVar()
self.var_crime_type=StringVar()
self.var_father_name=StringVar()
self.var_gender=StringVar()
self.var_wanted=StringVar()
#ncr logo
img_logo=Image.open('image/logo.jpg')
img_logo=img_logo.resize((60,60),Image.Resampling.LANCZOS)
self.photo_logo=ImageTk.PhotoImage(img_logo)
self.logo=Label(self.root,image=self.photo_logo)
self.logo.place(x=80,y=5,width=60,height=60)
#Img_frame
img_frame=Frame(self.root,bd=2,relief=RIDGE,bg='white')
img_frame.place(x=0,y=70,width=1530,height=130)
#1st
img1=Image.open('image/police1.jpg')
Page | 79
img1=img1.resize((540,160),Image.Resampling.LANCZOS)
self.photo1=ImageTk.PhotoImage(img1)
self.img_1=Label(img_frame,image=self.photo1)
self.img_1.place(x=0,y=0,width=540,height=160)
#2nd
img2=Image.open('image/police2.jpg')
img2=img2.resize((540,160),Image.Resampling.LANCZOS)
self.photo2=ImageTk.PhotoImage(img2)
self.img_2=Label(img_frame,image=self.photo2)
self.img_2.place(x=540,y=0,width=540,height=160)
#3rd
img3=Image.open('image/police3.jpg')
img3=img3.resize((540,160),Image.Resampling.LANCZOS)
self.photo3=ImageTk.PhotoImage(img3)
self.img_3=Label(img_frame,image=self.photo3)
self.img_3.place(x=1080,y=0,width=540,height=160)
#MAIN_FRAME
Main_Frame=Frame(self.root,bd=2,relief=RIDGE,bg='white')
Main_Frame.place(x=10,y=200,width=1505,height=560)
#upper_frame
upper_Frame=LabelFrame(Main_Frame,bd=2,relief=RIDGE,text='CRIMINAL
INFORMATION',font=('times new roman',11,'bold'),fg='red',bg='white')
upper_Frame.place(x=10,y=10,width=1480,height=270)
#lables_Entry
#Case_id
caseid = Label(upper_Frame,text='Case ID:',font=('arial',11,'bold'),bg='white')
caseid.grid(row=0,column=0,padx=2,sticky=W)
caseentry=ttk.Entry(upper_Frame,textvariable=self.var_case_id,width=22,font=('arial',11,'b
old'))
caseentry.grid(row=0,column=1,padx=2,sticky=W)
#Criminal No
lbl_criminal_no = Label(upper_Frame,font=('arial',12,'bold'),text="Criminal NO:
",bg='white')
lbl_criminal_no.grid(row=0,column=2,sticky=W,padx=2,pady=7)
txt_criminal_no=ttk.Entry(upper_Frame,textvariable=self.var_criminal_no,width=22,font=(
'arial',11,'bold'))
txt_criminal_no.grid(row=0,column=3,padx=2,pady=7)
#Criminal Name
lbl_Name = Label(upper_Frame,font=('arial',12,'bold'),text="Criminal Name:
Page | 80
",bg='white')
lbl_Name.grid(row=1,column=0,sticky=W,padx=2,pady=7)
txt_Name=ttk.Entry(upper_Frame,textvariable=self.var_name,width=22,font=('arial',11,'bol
d'))
txt_Name.grid(row=1,column=1,padx=2,pady=7)
#NickName
lbl_nickname = Label(upper_Frame,font=('arial',12,'bold'),text="NickName:
",bg='white')
lbl_nickname.grid(row=1,column=2,sticky=W,padx=2,pady=7)
txt_nickname=ttk.Entry(upper_Frame,textvariable=self.var_nickname,width=22,font=('aria
l',11,'bold'))
txt_nickname.grid(row=1,column=3,padx=2,pady=7)
#Arrest Date
lbl_arrestDate = Label(upper_Frame,font=('arial',12,'bold'),text="Arrest Date:
",bg='white')
lbl_arrestDate.grid(row=2,column=0,sticky=W,padx=2,pady=7)
txt_arrestDate=ttk.Entry(upper_Frame,textvariable=self.var_arrest_date,width=22,font=('ar
ial',11,'bold'))
txt_arrestDate.grid(row=2,column=1,padx=2,pady=7)
#Date of Crime
lbl_dateofCrime = Label(upper_Frame,font=('arial',12,'bold'),text="Date of Crime:
",bg='white')
lbl_dateofCrime.grid(row=2,column=2,sticky=W,padx=2,pady=7)
txt_dateofCrime=ttk.Entry(upper_Frame,textvariable=self.var_date_of_crime,width=22,fon
t=('arial',11,'bold'))
txt_dateofCrime.grid(row=2,column=3,padx=2,pady=7)
#Address
lbl_address = Label(upper_Frame,font=('arial',12,'bold'),text="Address:",bg='white')
lbl_address.grid(row=3,column=0,sticky=W,padx=2,pady=7)
txt_address=ttk.Entry(upper_Frame,textvariable=self.var_address,width=22,font=('arial',11,
'bold'))
txt_address.grid(row=3,column=1,padx=2,pady=7)
#Age
lbl_age = Label(upper_Frame,font=('arial',12,'bold'),text="Age: ",bg='white')
lbl_age.grid(row=3,column=2,sticky=W,padx=2,pady=7)
Page | 81
txt_age=ttk.Entry(upper_Frame,textvariable=self.var_age,width=22,font=('arial',11,'bold'))
txt_age.grid(row=3,column=3,padx=2,pady=7)
#Occuption
lbl_occuption = Label(upper_Frame,font=('arial',12,'bold'),text="Occuption:
",bg='white')
lbl_occuption.grid(row=4,column=0,sticky=W,padx=2,pady=7)
txt_occuption=ttk.Entry(upper_Frame,textvariable=self.var_occuption,width=22,font=('aria
l',11,'bold'))
txt_occuption.grid(row=4,column=1,padx=2,pady=7)
#birthMark
lbl_birthMark = Label(upper_Frame,font=('arial',12,'bold'),text="Birth Mark:
",bg='white')
lbl_birthMark.grid(row=4,column=2,sticky=W,padx=2,pady=7)
txt_birthMark=ttk.Entry(upper_Frame,textvariable=self.var_birthmark,width=22,font=('aria
l',11,'bold'))
txt_birthMark.grid(row=4,column=3,padx=2,pady=7)
#Crime Type
lbl_crimeType = Label(upper_Frame,font=('arial',12,'bold'),text="Crime Type:
",bg='white')
lbl_crimeType.grid(row=0,column=4,sticky=W,padx=2,pady=7)
txt_crimeType=ttk.Entry(upper_Frame,textvariable=self.var_crime_type,width=22,font=('a
rial',11,'bold'))
txt_crimeType.grid(row=0,column=5,padx=2,pady=7)
#Father Name
lbl_fatherName = Label(upper_Frame,font=('arial',12,'bold'),text="Father Name:
",bg='white')
lbl_fatherName.grid(row=1,column=4,sticky=W,padx=2,pady=7)
txt_fatherName=ttk.Entry(upper_Frame,textvariable=self.var_father_name,width=22,font=(
'arial',11,'bold'))
txt_fatherName.grid(row=1,column=5,padx=2,pady=7)
#gender
lbl_gender = Label(upper_Frame,font=('arial',12,'bold'),text="Gender: ",bg='white')
lbl_gender.grid(row=2,column=4,sticky=W,padx=2,pady=7)
Page | 82
#radio Button gender
radio_frame_gender=Frame(upper_Frame,bd=2,relief=RIDGE,bg='white')
radio_frame_gender.place(x=740,y=90,width=220,height=30)
male=Radiobutton(radio_frame_gender,variable=self.var_gender,text='Male',value='male',f
ont=('arial',9,'bold'),bg='white')
male.grid(row=0,column=0,pady=2,padx=5,sticky=W)
self.var_gender.set('male')
female=Radiobutton(radio_frame_gender,variable=self.var_gender,text='Female',value='fe
male',font=('arial',9,'bold'),bg='white')
female.grid(row=0,column=1,pady=2,padx=5,sticky=W)
self.var_gender.set('female')
others=Radiobutton(radio_frame_gender,variable=self.var_gender,text='Others',value='Oth
ers',font=('arial',9,'bold'),bg='white')
others.grid(row=0,column=3,pady=2,padx=5,sticky=W)
self.var_gender.set('others')
#wanted
lbl_wanted = Label(upper_Frame,font=('arial',12,'bold'),text="Most Wanted:
",bg='white')
lbl_wanted.grid(row=3,column=4,sticky=W,padx=2,pady=7)
yes=Radiobutton(radio_frame_wanted,variable=self.var_wanted,text='Yes',value='yes',font
=('arial',9,'bold'),bg='white')
yes.grid(row=0,column=0,pady=2,padx=5,sticky=W)
self.var_wanted.set('yes')
no=Radiobutton(radio_frame_wanted,variable=self.var_wanted,text='No',value='no',font=('
arial',9,'bold'),bg='white')
no.grid(row=0,column=1,pady=2,padx=5,sticky=W)
self.var_wanted.set('no')
#Buttons
button_frame=Frame(upper_Frame,bd=2,relief=RIDGE,bg='white')
button_frame.place(x=5,y=200,width=630,height=45)
#add button
btn_add=Button(button_frame,command=self.add_data,text='Record
Save',font=('arial',13,'bold'),width=14,bg='grey',fg='white')
btn_add.grid(row=0,column=0,padx=3,pady=5)
Page | 83
#update button
btn_update=Button(button_frame,command=self.update_data,text='Update',font=('arial',13,'
bold'),width=14,bg='grey',fg='white')
btn_update.grid(row=0,column=1,padx=3,pady=5)
#delete button
btn_delete=Button(button_frame,command=self.delete_data,text='Delete',font=('arial',13,'b
old'),width=14,bg='grey',fg='white')
btn_delete.grid(row=0,column=2,padx=3,pady=5)
#clear button
btn_clear=Button(button_frame,command=self.clear_data,text='Clear',font=('arial',13,'bold'
),width=14,bg='grey',fg='white')
btn_clear.grid(row=0,column=3,padx=3,pady=5)
#background right-side-image
img_Crime=Image.open('image/background.jpg')
img_Crime=img_Crime.resize((450,240),Image.Resampling.LANCZOS)
self.photocrime=ImageTk.PhotoImage(img_Crime)
self.img_Crime=Label(upper_Frame,image=self.photocrime)
self.img_Crime.place(x=1020,y=0,width=450,height=240)
#down_frame
down_Frame=LabelFrame(Main_Frame,bd=2,relief=RIDGE,text='CRIMINAL
INFORMATION Table',font=('times new roman',11,'bold'),fg='red',bg='white')
down_Frame.place(x=10,y=280,width=1480,height=270)
#Search_frame
search_Frame=LabelFrame(down_Frame,bd=2,relief=RIDGE,text='
SEARCHCRIMINAL RECORD',font=('times new roman',11,'bold'),fg='red',bg='white')
search_Frame.place(x=0,y=0,width=1470,height=60)
#search_by
search_by= Label(search_Frame,font=('arial',10,'bold'),text="Search By:
",bg='silver',fg='white')
search_by.grid(row=0,column=0,sticky=W,padx=5)
self.var_com_search=StringVar()
combo_search_box=ttk.Combobox(search_Frame,textvariable=self.var_com_search,font=('
arial',10,'bold'),width=18,state='readonly')
combo_search_box['value']=('Select Option','Case_id','Criminal_no')
combo_search_box.current(0)
combo_search_box.grid(row=0,column=1,sticky=W,padx=5)
Page | 84
self.var_search=StringVar()
search_txt=ttk.Entry(search_Frame,textvariable=self.var_search,width=18,font=('arial',11,'
bold'))
search_txt.grid(row=0,column=2,padx=2,pady=5)
#search button
btn_search=Button(search_Frame,command=self.search_data,text='Search',font=('arial',13,'
bold'),width=14,bg='grey',fg='white')
btn_search.grid(row=0,column=3,padx=3,pady=5)
#all button
btn_all=Button(search_Frame,command=self.fetch_data,text='Show
All',font=('arial',13,'bold'),width=14,bg='grey',fg='white')
btn_all.grid(row=0,column=4,padx=3,pady=5)
#label
CrimeAgency = Label(search_Frame,font=('arial',25,'bold'),text="NATIONAL
CRIME AGENCY",bg='white',fg='crimson')
CrimeAgency.grid(row=0,column=5,sticky=W,padx=50,pady=0)
#table_frame
table_frame=Frame(down_Frame,bd=2,relief=RIDGE)
table_frame.place(x=0,y=60,width=1470,height=170)
#Scrollbar
Scroll_x=ttk.Scrollbar(table_frame,orient=HORIZONTAL)
Scroll_y=ttk.Scrollbar(table_frame,orient=VERTICAL)
self.criminal_table=ttk.Treeview(table_frame,column=("1","2","3","4","5","6","7","8","9",
"10","11","12","13","14"),xscrollcommand=Scroll_x.set,yscrollcommand=Scroll_y.set)
Scroll_x.pack(side=BOTTOM,fill=X)
Scroll_y.pack(side=RIGHT,fill=Y)
Scroll_x.config(command=self.criminal_table.xview)
Scroll_y.config(command=self.criminal_table.yview)
self.criminal_table.heading('1',text='CaseId')
self.criminal_table.heading('2',text='CrimeNo')
self.criminal_table.heading('3',text='Criminal Name')
self.criminal_table.heading('4',text='NiclName')
self.criminal_table.heading('5',text='ArrestDate')
self.criminal_table.heading('6',text='CrimeOfDaate')
self.criminal_table.heading('7',text='Address')
self.criminal_table.heading('8',text='Age')
Page | 85
self.criminal_table.heading('9',text='Occupation')
self.criminal_table.heading('10',text='Birth Mark')
self.criminal_table.heading('11',text='Crime Type')
self.criminal_table.heading('12',text='Father Name')
self.criminal_table.heading('13',text='Gender')
self.criminal_table.heading('14',text='Wanted')
self.criminal_table['show']='headings'
self.criminal_table.column('1',width=100)
self.criminal_table.column('2',width=100)
self.criminal_table.column('3',width=100)
self.criminal_table.column('4',width=100)
self.criminal_table.column('5',width=100)
self.criminal_table.column('6',width=100)
self.criminal_table.column('7',width=100)
self.criminal_table.column('8',width=100)
self.criminal_table.column('9',width=100)
self.criminal_table.column('10',width=100)
self.criminal_table.column('11',width=100)
self.criminal_table.column('12',width=100)
self.criminal_table.column('13',width=100)
self.criminal_table.column('14',width=100)
self.criminal_table.pack(fill=BOTH,expand=1)
self.criminal_table.bind('<ButtonRelease>',self.get_cursor)
self.fetch_data()
# Add function
def add_data(self):
if self.var_case_id.get()=="":
messagebox.showerror('Error','All Fields Are Required')
else:
try:
con=mysql.connector.connect(host='localhost',username='root',password='Root',database='
management')
my_cursor=con.cursor()
my_cursor.execute('insert into crimie values(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,
%s,%s,%s,%s)',(
self.var_case_id.get(),
self.var_criminal_no.get(),
self.var_name.get(),
self.var_nickname.get(),
self.var_arrest_date.get(),
Page | 86
self.var_date_of_crime.get(),
self.var_address.get(),
self.var_age.get(),
self.var_occuption.get(),
self.var_birthmark.get(),
self.var_crime_type.get(),
self.var_father_name.get(),
self.var_gender.get(),
self.var_wanted.get()
))
con.commit()
self.fetch_data()
self.clear_data()
con.close()
messagebox.showinfo('Success','Criminal record has been added')
#fetch data
def fetch_data(self):
con=mysql.connector.connect(host='localhost',username='root',password='Root',database='
management')
my_cursor=con.cursor()
my_cursor.execute('select * from crimie')
data=my_cursor.fetchall()
if len(data)!=0:
self.criminal_table.delete(*self.criminal_table.get_children())
for i in data:
self.criminal_table.insert('',END,values=i)
con.commit()
con.close()
#get Cursor
def get_cursor(self,event=""):
cursur_row=self.criminal_table.focus()
content=self.criminal_table.item(cursur_row)
data=content['values']
self.var_case_id.set(data[0])
self.var_criminal_no.set(data[1])
self.var_name.set(data[2])
self.var_nickname.set(data[3])
self.var_arrest_date.set(data[4])
self.var_date_of_crime.set(data[5])
self.var_address.set(data[6])
self.var_age.set(data[7])
Page | 87
self.var_occuption.set(data[8])
self.var_birthmark.set(data[9])
self.var_crime_type.set(data[10])
self.var_father_name.set(data[11])
self.var_gender.set(data[12])
self.var_wanted.set(data[13])
#updaate
def update_data(self):
if self.var_case_id.get()=="":
messagebox.showerror('Error','All Fields are required')
else:
try:
update = messagebox.askyesno('Update','Are you sure update this record')
if update>0:
con=mysql.connector.connect(host='localhost',username='root',password='Root',database='
management')
my_cursor=con.cursor()
my_cursor.execute('update crimie set Criminal_no=%s,Criminal_name=
%s,Nick_name=%s,arrested_date=%s,dateofCrime=%s,address=%s,age=%s,occuption=
%s,Birthmark=%s,crimeType=%s,fathername=%s,gender=%s,wanted=%s where Case_id=
%s',(
self.var_criminal_no.get(),
self.var_name.get(),
self.var_nickname.get(),
self.var_arrest_date.get(),
self.var_date_of_crime.get(),
self.var_address.get(),
self.var_age.get(),
self.var_occuption.get(),
self.var_birthmark.get(),
self.var_crime_type.get(),
self.var_father_name.get(),
self.var_gender.get(),
self.var_wanted.get(),
Page | 88
self.var_case_id.get(),
))
else:
if not update:
return
con.commit()
self.fetch_data()
self.clear_data()
con.close()
messagebox.showinfo('Success','Record successfully updated')
except Exception as es:
messagebox.showerror('Error',f'Due to{str(es)}')
#delete
def delete_data(self):
if self.var_case_id.get()=="":
messagebox.showerror('Error','All fields are required')
else:
try:
delete = messagebox.askyesno('Update','Are you sure update this record')
if delete>0:
con=mysql.connector.connect(host='localhost',username='root',password='Root',database='
management')
my_cursor=con.cursor()
sql='delete from crimie where Case_id=%s'
value=(self.var_case_id.get(),)
my_cursor.execute(sql,value)
else:
if not delete:
return
con.commit()
self.fetch_data()
self.clear_data()
con.close()
messagebox.showinfo('Success','Record successfully Deleted')
except Exception as es:
messagebox.showerror('Error',f'Due to{str(es)}')
#clear data
def clear_data(self):
self.var_case_id.set("")
self.var_criminal_no.set("")
self.var_name.set("")
self.var_nickname.set("")
self.var_arrest_date.set("")
self.var_date_of_crime.set("")
Page | 89
self.var_address.set("")
self.var_age.set("")
self.var_occuption.set("")
self.var_birthmark.set("")
self.var_crime_type.set("")
self.var_father_name.set("")
self.var_gender.set("")
self.var_wanted.set("")
#search
def search_data(self):
if self.var_com_search.get()=="":
messagebox.showerror('Error','All fields are required')
else:
try:
con=mysql.connector.connect(host='localhost',username='root',password='Root',database='
management')
my_cursor=con.cursor()
my_cursor.execute('select * from crimie where ' +str(self.var_com_search.get())+"
LIKE'%"+str(self.var_search.get()+"%'"))
rows=my_cursor.fetchall()
if len(rows)!=0:
self.criminal_table.delete(*self.criminal_table.get_children())
for i in rows:
self.criminal_table.insert("",END,values=i)
con.commit()
con.close()
except Exception as es:
messagebox.showerror('Error',f'Due to{str(es)}')
if __name__=="__main__":
root=Tk()
obj=criminal(root)
root.mainloop()
Page | 90