Bhargav Palav Project
Bhargav Palav Project
PROJECT REPORT
ON
SUBMITTED BY
Year: 2022-23
GUIDED BY
2
Table Of Contents
Chapter No – 1 Introduction
• Background
• Objective
• Purpose And Scope
• Organization And Report
• Existing System
• Proposed System
• Requirement Analysis
• Hardware Analysis
• Justification Of Selection Of Technology
• Requirments Specification
• Software And Hardware Requirments
• Conceptual Models
• Data Flow Diagrams
• ER Diagram
• Object Oriented Diagram
Chapter No – 4 Analysis
3
• Study Of Current System
• Advantage & Drawbacks Of Hotel Management System
Chapter No -5
• Conclusion
• Reference
ABSTRACT
4
The “Criminal Management System” is a software for online complaint and
computerized management of crime records.Here in this software a person who
wishes to file a complaint or report an incident must start the software and
report whatever he as seen on the crime site.This complaint will be received by
Police Cyber Employees and they can send a message regarding status of the
complaint to the user who files the complaint and Police will reach at the crime
scene to investigate it. 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
with logging in. So this website helps police to find out the problems in the society
without them actually coming to the police station.
Introduction
Background
The crime management system can help in storing the records related to the
criminals, cases, complaint record, case history and so on. This can allow a person
to enter or delete the records if necessary. All these records can be maintained in
a single database. Security is maintained so as to ensure that only the authorized
users will have access to the system. This application will be one of the useful
projects that the police can rely on. This website can help in getting the
information of the criminals of many years back. It can also help in minimizing
most of the work of the police. The features that can be included in this software
are as follows:
5
➢ Criminal record: This website can contain the details related to the
criminals in the particular case.
➢ Complaint registration: The details of the complaints that are registered
can also be stored through this website.
➢ Police database management: The details of the police in the particular
police station can be maintained through this software.
To run Criminal Management System in the background, I will show you the
easiest and the only way to run the software.First we have to setup Python on
“Microsoft Visual Code”.After doing the setup and setting admin username and
password , we have to install “My SQL” and “Workbench”. After that importing
the files in My SQL and Workbench the setup is finally completed.Now import the
files in database and the software will start after that without any flaws.
Objective
The main objective of the Criminal Management System is to manage the details
of criminal, crimes , the most wanted in police departments . It manages all the
information about criminals, what they have done , the crimes their whole
information.The project is totally built at administrative level so it is very
secure.The main objective of the project is to make an software to reduce the
works of physical data and the loads of file in the police department and it will be
easy to manage the crimes , criminals and information of the people and what
crimes they have done and search the records rather the searching the files by
using this software.
Purpose and Scope
The main purpose of the project is to file complaint of the crime happening in our
vision in day to day life as it will be easier to manage crime directly through the
software rather than visiting the police station. Our old belief that visiting police
station is very bad in the society will come to an end by this project and it will
become scope for more women’s to file the crime without any hesitation and the
police will directly reach the crime scene.The main Purpose of this project is to
6
report more number of crimes to the police so that they will work on it to make
the society crime free from the people who are making it dangerous to live.
Applicability
In many cases, the Crime Management System will have exposure for the
people who want to register or file FIR or case. It functions as a welcome sign
for the person using the app . A fully featured Crime Management System will
give them the power to file a case against the criminals in an easy to use and
intuitive format. Providing these gives you a great opportunity to the victims..
This is where having a complete Crime Management System comes in handy.
By leveraging all of the data across your entire system, you’ll be able to victims
to use the software with a more complete picture of the police Case filing.
From a victim perspective, your Crime Report Writing Solution is the brains
of the operation. Any question a victim has about any aspect of your
software, they are going to come to the Police station to get answered. It’s
immediately obvious how having a Crime Management system that ties in
with all of your other systems is crucial to an efficient workflow.
7
Rather than having to call different departments or switch between different
software programs to get answers for victims and help them achieve their
goals, your staff will be able to quickly access everything from one location.
Whether your victim wants to file a complaint of crime or any other problems
it can all be handled from one software package.
Methodology
The Project Criminal Management is excuted in the following way-
• Data Gathering
• Entering the details and reporting it in the. software.
• The admin receiving all the details reported crime.
• The Police Force working to solve the crime.
8
• Data Gathering
The victim coming to the police station or by other means to register or file
the complaint against the criminal ,what he has done and other
information.
The details are now entered in the software all the information of criminal,
the case id ,the officer in charge ,and other details of the criminal ,the
record is saved in the database.
The admin will now receive all the details of the reported crime and it will
be saved in the database till the crime is solved or the case will be closed
the members in the crime acts will come forward or the police will find
more criminals of the crime the database gets updated or added more.
The police department now will work to solve the case my getting clues of
the crime.
Organization Of Reports
• Admin panel
It is used for admins only
➢ Admin Login
Admin can login in login panel using username and password
9
• Add Police Officer
Admin can add or hire officers according to Case need
• Add Cases
Admin can add Cases.
Crime
Admin can view what crime the Criminal has done
All Criminals
Details of crime
Arrest Date
Update status
Most wanted
Admin can see the whether the Criminal is most wanted or not
10
Search
Logout
System Analysis:-
Requirment Analysis:-
Hardware Requirments:-
• Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz 3.20 GHz
• 2.00 GB RAM
System Requirments:-
11
• Data Science and Data
Visualization
• Desktop GUI
• Web Scraping Applications
• Business Applications
• Audio and Video Applications
• CAD Applications
• Embedded Applications
Introduction to Python
Python is free and simple to learn. Its primary features are that it is high-
level, dynamically typed and interpreted. This makes debugging of errors easy
and encourages the rapid development of application prototypes, marking itself
as the language to code with. Python was developed in 1989 by Guido Van
Rossum and emphasizes on the DRY (Don’t Repeat Yourself) principle
and readability.
With that out of the way, let’s jump straight into the Python Applications. :)
Python Applications
Python supports cross-platform operating systems which makes building
applications with it all the more convenient. Some of the globally known
12
applications such as YouTube, BitTorrent, DropBox, etc. use Python to achieve
their functionality.
1. Web Development
Python can be used to make web-applications at a rapid rate. Why is that? It is
because of the frameworks Python uses to create these applications. There
is common-backend logic that goes into making these frameworks and a number
of libraries that can help integrate protocols such as HTTPS, FTP, SSL etc. and even
help in the processing of JSON, XML, E-Mail and so much more.
Some of the most well-known frameworks are Django, Flask, Pyramid. Why use
a framework? The security, scalability, convenience that they provide is
commendable if we compare it to starting the development of a website from
scratch.
2. Game Development
Python is also used in the development of interactive games. There are libraries
such as PySoy which is a 3D game engine supporting Python 3, PyGame which
provides functionality and a library for game development. Games such as
Civilization-IV, Disney’s Toontown Online, Vega Strike etc. have been built using
Python.
13
3. Machine Learning and Artificial Intelligence
Machine Learning and Artificial Intelligence are the talks of the town as they yield
the most promising careers for the future. We make the computer learn based on
past experiences through the data stored or better yet, create algorithms which
makes the computer learn by itself. The programming language that mostly
everyone chooses? It’s Python. Why? Support for these domains with
the libraries that exist already such as Pandas, Scikit-Learn, NumPy and so many
more.
Learn the algorithm, use the library and you have your solution to the problem.
It is that simple. But if you want to go the hardcore way, you can design your own
code which yields a better solution, which still is much easier when we compare
it to other languages.
14
You can even visualize the data libraries such as Matplotlib, Seaborn, which are
helpful in plotting graphs and much more. This is what Python offers you to
become a Data Scientist.
5. Desktop GUI
We use Python to program desktop applications. It provides the Tkinter library
that can be used to develop user interfaces. There are some other useful toolkits
such as the wxWidgets, Kivy, PYQT that can be used to create applications on
several platforms.
You can start out with creating simple applications such as Calculators, To-Do
apps and go ahead and create much more complicated applications.
15
6. Web Scraping Applications
Python is a savior when it comes to pull a large amount of data from websites
which can then be helpful in various real-world processes such as price
comparison, job listings, research and development and much more Python
has BeautifulSoup which we use to pull such data. Here’s a full-fledged guide to
learn Web scraping with Python.
7. Business Applications
Business Applications are different than our normal applications covering
domains such as e-commerce, ERP and many more. They require applications
which are scalable, extensible and easily readable and Python provides us with
all these features. Platforms such as Tryton is available to develop such business
applications.
16
9. CAD Applications
Computer-Aided Designing is quite challenging to make as many things have to
be taken care of. Objects and their representation, functions are just the tip of
the iceberg when it comes to something like this. Python makes this simple too
and the most well-known application for CAD is Fandango.
17
• Python : The Crime Management System Project is developed in python
with some or more basic to advanced python extension. As Python is
widely used and easy to learn langauge with not some complex code it’s
easier to update the software or fix the bugs occuring in the software.
Uses of Mysql:-
System Design
18
Requriment Specification:
Python
Python is a high-level, general-purpose programming language. Its design
philosophy emphasizes code readability with the use of significant indentation.
Python is dynamically-typed and garbage-collected. It supports multiple ,
including structured (particularly procedural), objectoriented and functional
programming. It is often described as a "batteries included" language due to its
comprehensive standard library. Guido van Rossum began working on Python in
the late 1980s as a successor to the ABC programming language and first released
it in 1991 as Python 0.9.0. Python 2.0 was released in 2000 and introduced new
features such as list comprehensions, cycle-detecting garbage
collection, reference counting, and Unicode support. Python 3.0, released in
2008, was a major revision that is not completely backward-compatible with
earlier versions. Python 2 was discontinued with version 2.7.18 in 2020. Python
consistently ranks as one of the most popular programming languages.
MySQL
20
Conceptual Models:-
21
Data Flow Diagram For Admin.
22
ER Diagram For Crime Management System
What is a ER Diagram
An entity relationship diagram (ERD), also known as an entity relationship model,
is a graphical representation that depicts relationships among people, objects,
places, concepts or events within an information technology (IT) system. An ERD
uses data modeling techniques that can help define business processes and serve
as the foundation for a relational database.
ER Diagram for Crime Management System
23
ER Diagram For Admin Login
24
Flow Chart for Crime Management System
26
Analysis
Study Of Current System
Current System of Crime Management is fully based on paperwork.
Police Officers has to manage all records of criminals and on paper.
Problem and Weakness Of Current System-Paperwork is a tedious job.
There can be delay and the problem of human error in writing and
providing resources.
HISTORY
27
During the past several decades, the records are supposed to be manually
handled for all activities. Themanual handling of records is time consuming
andhighly prone to error. To improve the performance of
the Crime Management Software, the computerized system had to be
undertaken.
Efficiency
The basic need of this software is efficiency. The software should be efficient so
that whatever the usersubmits any detail the application is updated
immediately and automatically. These records will be usefulfor others instantly.
Control
The complete control of the electronic system is under the hands of authorized
persons who have thepassword to access the system and illegal access is not
permitted. Control is entirely in the hands of theadministrator and the other
members have the right to see the records not to change any transaction entry.
Security
Security is the main criteria for electronic hotel management systems. Since
illegal access may corrupt thedatabase and ensure protection of the stored data.
• User can keep the records of all things of the criminal his entire
biodata , kind of crime committed.
• It saves users time in searching the records of the criminal
• The system is useful as we can delete ,update or search records
with ease rather than searching it physically which takes time .
• It saves organization resources and expenses.
• This system is effective and saves time and of users.
• It is less time consuming and provides maximum accuracy.
28
• DRAWBACKS OF Crime MANAGEMENT SYSTEM
29
Display page of the software
30
Code for The project
import mysql.connector
class Criminal:
def __init__(self,root):
self.root=root
self.root.geometry("1530x790폭")
# Variables
31
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_occupation=StringVar()
self.var_birthMark=StringVar()
self.var_crime_type=StringVar()
self.var_father_name=StringVar()
self.var_gender=StringVar()
self.var_wanted=StringVar()
lbl_title.place(x=0,y=0,width=1530,height=70)
# logo
img_logo=Image.open('images/ncrlogo.png')
img_logo=img_logo.resize((60,60),Image.ANTIALIAS)
self.photo_logo=ImageTk.PhotoImage(img_logo)
self.logo=Label(self.root,image=self.photo_logo)
self.logo.place(x=100,y=5,width=60,height=60)
# Image Frame
32
img_frame=Frame(self.root,bd=2,relief=RIDGE,bg='white')
img_frame.place(x=0,y=65,width=1530,height=130)
# 1st
img1=Image.open('images/police3.jpg')
img1=img1.resize((540,160),Image.ANTIALIAS)
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)
# # 2st
img_2=Image.open('images/police2.jpg')
img_2=img_2.resize((540,160),Image.ANTIALIAS)
self.photo2=ImageTk.PhotoImage(img_2)
self.img_2=Label(img_frame,image=self.photo2)
self.img_2.place(x=540,y=0,width=540,height=160)
# # 3st
img_3=Image.open('images/police3.jpg')
img_3=img_3.resize((540,160),Image.ANTIALIAS)
self.photo3=ImageTk.PhotoImage(img_3)
self.img_3=Label(img_frame,image=self.photo3)
self.img_3.place(x=1000,y=0,width=540,height=160)
33
# Main Frame
Main_frame=Frame(self.root,bd=2,relief=RIDGE,bg='white')
Main_frame.place(x=10,y=200,width=1500,height=560)
# upper Frame
upper_frame.place(x=10,y=10,width=1480,height=270)
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,"bold"))
caseentry.grid(row=0,column=1,padx=2,pady=10, 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:",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,"bold"))
txt_Name.grid(row=1,column=1,sticky=W,padx=2,pady=7)
34
# 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=("arial",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=("arial",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,font=("arial",11,"bold"))
txt_dateOfCrime.grid(row=2,column=3,sticky=W,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)
35
# 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)
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)
# occupution
lbl_occupution=Label(upper_frame,font=("arial",12,"bold"),text="Occupation:",bg="white")
lbl_occupution.grid(row=4,column=0,sticky=W,padx=2,pady=7)
txt_occupution=ttk.Entry(upper_frame,textvariable=self.var_occupation,width=22,font=("arial",11,"bold"))
txt_occupution.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=("arial",11,"bold"))
txt_birthmark.grid(row=4,column=3,sticky=W,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=("arial",11,"bold"))
txt_crimeType.grid(row=0,column=5,padx=2,pady=7)
# # Father Name
36
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)
#Radio Frame
radio_frame_gender=Frame(upper_frame,bd=2,relief=RIDGE,bg='white')
radio_frame_gender.place(x=730,y=90,width=190,height=30)
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)
male=Radiobutton(radio_frame_gender,variable=self.var_gender,text='Male',value='male',font=('arial',9,'bold'),bg='white')
male.grid(row=2,column=5,pady=2,padx=5,sticky=W)
self.var_gender.set('male')
female=Radiobutton(radio_frame_gender,variable=self.var_gender,text='Female',value='female',font=('arial',9,'bold'),bg='white')
female.grid(row=2,column=6,pady=2,padx=5,sticky=W)
# Most wantes
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)
radio_frame_wanted=Frame(upper_frame,bd=2,relief=RIDGE,bg='white')
radio_frame_wanted.place(x=730,y=130,width=190,height=30)
yes=Radiobutton(radio_frame_wanted,variable=self.var_wanted,text='Yes',value='yes',font=('arial',9,'bold'),bg='white')
37
yes.grid(row=2,column=5,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=2,column=6,pady=2,padx=5,sticky=W)
# backgound image
img_crime=Image.open('images/backgound.jpg')
img_crime=img_crime.resize((470,245),Image.ANTIALIAS)
self.photocrime=ImageTk.PhotoImage(img_crime)
self.img_crime=Label(upper_frame,image=self.photocrime)
self.img_crime.place(x=1000,y=0,width=470,height=245)
# Button Frame
button_frame=Frame(upper_frame,bd=2,relief=RIDGE,bg='white')
button_frame.place(x=5,y=200,width=620,height=45)
btn_add=Button(button_frame,text="Record Save",command=self.add_data,font=("arial",13,"bold"),width=14,bg='blue',fg='white')
btn_add.grid(row=0,column=0,padx=3,pady=5)
btn_update=Button(button_frame,text="Update",command=self.update_data,font=("arial",13,"bold"),width=14,bg='blue',fg='white')
btn_update.grid(row=0,column=1,padx=1,pady=5)
btn_delete=Button(button_frame,text="Delete",command=self.delete_data,font=("arial",13,"bold"),width=14,bg='blue',fg='white')
btn_delete.grid(row=0,column=2,padx=1,pady=5)
btn_clear=Button(button_frame,text="Clear",command=self.reset_data,font=("arial",13,"bold"),width=14,bg='blue',fg='white')
btn_clear.grid(row=0,column=3,padx=1,pady=5)
38
# down Frame
down_frame.place(x=10,y=280,width=1480,height=270)
# Search Frame
search_frame.place(x=0,y=0,width=1470,height=60)
search_by=Label(search_frame,font=("arial",11,"bold"),text="Search By:",fg="white",bg="red")
search_by.grid(row=0,column=0,sticky=W,padx=5)
# search
self.var_com_search=StringVar()
com_txt_search=ttk.Combobox(search_frame,textvariable=self.var_com_search,state="readonly",
font=("arial",12,"bold"),width=18)
com_txt_search['value']=("Select Option","Case_id","Criminal_no")
com_txt_search.current(0)
com_txt_search.grid(row=0,column=1,sticky=W,padx=5)
self.var_search=StringVar()
txt_search=ttk.Entry(search_frame,textvariable=self.var_search,width=22,font=("arial",11,"bold"))
txt_search.grid(row=0,column=2,padx=5)
btn__search=Button(search_frame,text="Search",command=self.serach_data,font=("arial",11,"bold"),width=14,bg="blue",fg="white")
btn__search.grid(row=0,column=3,padx=5)
39
btn_ShowAll=Button(search_frame,text="Show All",command=self.fetch_data,font=("arial",11,"bold"),width=14,bg="blue",fg="white")
btn_ShowAll.grid(row=0,column=4,padx=5)
stayhome.place(x=780,y=0,width=600,height=30)
# img_logo_mask=Image.open(r"images�backgound.jpg")
# img_logo_mask=img_logo_mask.resize((50,50),Image.ANTIALIAS)
# self.photoimg_logo_mask=ImageTk.PhotoImage(img_logo_mask)
# self.logo=Label(search_frame,image=self.photoimg_logo_mask)
# self.logo.place(x=900,y=0,width=50,height=30)
# Table Frame
table_frame=Frame(down_frame,bd=3,relief=RIDGE)
table_frame.place(x=0,y=60,width=1470,height=170)
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.se
t,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)
40
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="NickName")
self.criminal_table.heading("5",text="ArrestDate")
self.criminal_table.heading("6",text="CrimeOfDate")
self.criminal_table.heading("7",text="Address")
self.criminal_table.heading("8",text="Age")
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)
41
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()
# *************Function Declarations*******************
def add_data(self):
if self.var_criminal_no.get()=="" or self.var_nickname.get()=="":
else:
try:
conn=mysql.connector.connect(host='localhost',username='root',password='Test@123',database='management')
my_cursor=conn.cursor()
self.var_case_id.get(),
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(),
42
self.var_occupation.get(),
self.var_birthMark.get(),
self.var_crime_type.get(),
self.var_father_name.get(),
self.var_gender.get(),
self.var_wanted.get()
))
conn.commit()
self.fetch_data()
conn.close()
messagebox.showerror('Error',f'Due To:{str(es)}',parent=self.root)
# fetch Data
def fetch_data(self):
conn=mysql.connector.connect(host='localhost',username='root',password='Test@123',database='management')
my_cursor=conn.cursor()
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)
conn.commit()
conn.close()
43
# Get Cursor
def get_cursor(self,event=""):
cursor_row=self.criminal_table.focus()
content=self.criminal_table.item(cursor_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])
self.var_occupation.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])
def update_data(self):
if self.var_criminal_no.get()=="" or self.var_nickname.get()=="":
else:
try:
44
if update>0:
conn=mysql.connector.connect(host='localhost',username='root',password='Test@123',database='management')
my_cursor=conn.cursor()
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_occupation.get(),
self.var_birthMark.get(),
self.var_crime_type.get(),
self.var_father_name.get(),
self.var_gender.get(),
self.var_wanted.get(),
self.var_case_id.get(),
))
45
else:
if not update:
return
conn.commit()
self.fetch_data()
conn.close()
messagebox.showerror('Error',f'Due To:{str(es)}',parent=self.root)
# Delete
def delete_data(self):
if self.var_case_id.get()=="":
else:
try:
if Delete>0:
conn=mysql.connector.connect(host='localhost',username='root',password='Test@123',database='management')
my_cursor=conn.cursor()
value=(self.var_case_id.get(),)
my_cursor.execute(sql,value)
else:
if not Delete:
return
conn.commit()
self.fetch_data()
conn.close()
46
messagebox.showinfo('Delete','Criminal record Successfully Deleted',parent=self.root)
messagebox.showerror('Error',f'Due To:{str(es)}',parent=self.root)
# reset
def reset_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("")
self.var_address.set("")
self.var_age.set("")
# self.var_occupationcomb.set("Select ID Proof")
self.var_occupation.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 serach_data(self):
if self.var_com_search.get()=='' or self.var_search.get()=='':
else:
try:
47
conn=mysql.connector.connect(host='localhost',username='root',password='Test@123',database='management')
my_cursor=conn.cursor()
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)
conn.commit
conn.close()
messagebox.showerror('Error',f'Due To:{str(es)}',parent=self.root)
if __name__=="__main__":
root=Tk()
obj=Criminal(root)
root.mainloop()
--
48
-- ------------------------------------------------------
--
--
49
`age` varchar(45) DEFAULT NULL,
--
--
UNLOCK TABLES;
50
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
Conclusion
Active campaigning of Crime Management System is the need of hour, the target
systems being important. Crime Management System is developed to make it
easily accessible and available anywhere at the user's convenience. The service
has to be expanded with more government institutions becoming issuing
members. Cyber security and privacy measures are of utmost importance; this
can be seen from its far reaching impact on all the other crucial elements involved
in acceptance and actual use of this technology. The Crime Management System
is still at a nascent stage, simply because of lack of awareness among the
population in regards to this service. Publicizing its advantages is key to creating
awareness and drawing subscribers or user. Although this may be considered
utopian when it comes to a developing country, unfettered internet access across
the country is a potent step towards expanding user base of a number of
government services, including India
Further Updates
We tend to deploy this project with several updates such as fingerprint of the
criminal, Also we will be rolling this app with the prison management feature so
we can know that in which cell criminal is being held , and which officer is
responsible for all his court dates. Last but not the least bugs fixing updates will
be rolling out in every quarter of the year
51
References
• Martin C. Brown-Python: The Complete Reference Forth Edition
• SQL: Learn SQL (using MySQL) in One Day and Learn It Well. SQL for
Beginners with Hands-on Project. (Learn Coding Fast with Hands-On
Project)
• Sharpe John Microsoft Visual C# Step by Step
52