├── crime.db ├── logo.gif ├── information.db ├── police_logo.png ├── back.cpython-36.pyc ├── back.cpython-38.pyc ├── db.cpython-36.pyc ├── db.cpython-38.pyc ├── listComp.cpython-36.pyc ├── listComp.cpython-38.pyc ├── B3_final_ppt[1]harsh[12}[1][1].pptx ├── DBMS MINI PROJECT B3 (CRIMINAL DBMS).pdf ├── LICENSE ├── listComp.py ├── back.py ├── README.md ├── front.py └── main_application_file.py /crime.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarhaKousar1601/Criminal-DBMS/main/crime.db -------------------------------------------------------------------------------- /logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarhaKousar1601/Criminal-DBMS/main/logo.gif -------------------------------------------------------------------------------- /information.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarhaKousar1601/Criminal-DBMS/main/information.db -------------------------------------------------------------------------------- /police_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarhaKousar1601/Criminal-DBMS/main/police_logo.png -------------------------------------------------------------------------------- /back.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarhaKousar1601/Criminal-DBMS/main/back.cpython-36.pyc -------------------------------------------------------------------------------- /back.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarhaKousar1601/Criminal-DBMS/main/back.cpython-38.pyc -------------------------------------------------------------------------------- /db.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarhaKousar1601/Criminal-DBMS/main/db.cpython-36.pyc -------------------------------------------------------------------------------- /db.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarhaKousar1601/Criminal-DBMS/main/db.cpython-38.pyc -------------------------------------------------------------------------------- /listComp.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarhaKousar1601/Criminal-DBMS/main/listComp.cpython-36.pyc -------------------------------------------------------------------------------- /listComp.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarhaKousar1601/Criminal-DBMS/main/listComp.cpython-38.pyc -------------------------------------------------------------------------------- /B3_final_ppt[1]harsh[12}[1][1].pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarhaKousar1601/Criminal-DBMS/main/B3_final_ppt[1]harsh[12}[1][1].pptx -------------------------------------------------------------------------------- /DBMS MINI PROJECT B3 (CRIMINAL DBMS).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarhaKousar1601/Criminal-DBMS/main/DBMS MINI PROJECT B3 (CRIMINAL DBMS).pdf -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Farha Kousar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /listComp.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | from tkinter.ttk import * 3 | from db import DBConnect 4 | import sqlite3 5 | 6 | class ListComp: 7 | def __init__(self): 8 | self._dbconnect = DBConnect() 9 | self._dbconnect.row_factory = sqlite3.Row 10 | self._root = Tk() 11 | self._root.title('List of Complaints') 12 | tv = Treeview(self._root) 13 | tv.pack() 14 | tv.heading('#0', text='ID') 15 | tv.configure(column=('#Name', '#Gender','#Phone No.','#Adhar No.', '#Comment')) 16 | tv.heading('#Name', text='Name') 17 | tv.heading('#Gender', text='Gender') 18 | tv.heading('#Phone No.', text='Phone No.') 19 | tv.heading('#Adhar No.', text='Adhar No.') 20 | tv.heading('#Comment', text='Comment') 21 | cursor = self._dbconnect.ListRequest() 22 | for row in cursor: 23 | tv.insert('', 'end', '#{}'.format(row['ID']),text=row['ID']) 24 | tv.set('#{}'.format(row['ID']),'#Name',row['Name']) 25 | tv.set('#{}'.format(row['ID']),'#Gender',row['Gender']) 26 | tv.set('#{}'.format(row['ID']),'#Phone No.',row['Phone_No']) 27 | tv.set('#{}'.format(row['ID']),'#Adhar No.',row['Adhar_No']) 28 | tv.set('#{}'.format(row['ID']),'#Comment',row['Comment']) 29 | 30 | -------------------------------------------------------------------------------- /back.py: -------------------------------------------------------------------------------- 1 | import sqlite3 2 | 3 | def connect(): 4 | connection=sqlite3.connect("crime.db") 5 | cur=connection.cursor() 6 | cur.execute("CREATE TABLE IF NOT EXISTS crime_record( Criminal_id PRIMARY KEY,Name text,Gender text,Nationality text,Age integer,Height float,Weight float,Crime_Committed text)") 7 | connection.commit() 8 | # connection.close() 9 | 10 | def insert(Criminal_id,Name,Gender,Nationality,Age,Height,Weight,Crime_Committed): 11 | connection=sqlite3.connect("crime.db") 12 | cur=connection.cursor() 13 | cur.execute("INSERT INTO crime_record VALUES (?, ?, ?, ?, ?, ?, ?, ?)",(Criminal_id , Name , Gender , Nationality , Age , Height , Weight , Crime_Committed)) 14 | connection.commit() 15 | # connection.close() 16 | 17 | def view(): 18 | connection=sqlite3.connect("crime.db") 19 | cur=connection.cursor() 20 | cur.execute("SELECT * FROM crime_record ") 21 | rows=cur.fetchall() 22 | # connection.close() 23 | return rows 24 | 25 | def search(Criminal_id="",Name="",Gender="",Nationality="",Age="",Height="",Weight="",Crime_Committed=""): 26 | connection=sqlite3.connect("crime.db") 27 | cur=connection.cursor() 28 | cur.execute("SELECT * FROM crime_record WHERE Criminal_id=? OR Name=? OR Gender=? OR Nationality=? OR Age=? OR Height=? OR Weight=? OR Crime_Committed=? ",(Criminal_id,Name,Gender,Nationality,Age,Height,Weight,Crime_Committed)) 29 | rows=cur.fetchall() 30 | # connection.close() 31 | return rows 32 | 33 | def delete(Criminal_id): 34 | connection=sqlite3.connect("crime.db") 35 | cur=connection.cursor() 36 | cur.execute("DELETE FROM crime_record WHERE Criminal_id=?",(Criminal_id,)) 37 | connection.commit() 38 | # connection.close() 39 | 40 | def update(Criminal_id,Name,Gender,Nationality,Age,Height,Weight,Crime_Committed): 41 | connection=sqlite3.connect("crime.db") 42 | cur=connection.cursor() 43 | cur.execute("UPDATE crime_record SET Criminal_id=?,Name=?,Gender=?,Nationality=?,Age=?,Height=?,Weight=?,Crime_Committed=? WHERE Criminal_id=?",(Criminal_id,Name,Gender,Nationality,Age,Height,Weight,Crime_Committed,Criminal_id)) 44 | connection.commit() 45 | # connection.close() 46 | 47 | connect() 48 | 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Criminal Database Management System 2 | 3 | [![Python Version](https://img.shields.io/badge/Python-3.8%2B-blue?style=plastic)](https://www.python.org/downloads/) 4 | [![SQLite Version](https://img.shields.io/badge/SQLite-3.35.5-green?style=plastic)](https://www.sqlite.org/download.html) 5 | [![Tkinter Version](https://img.shields.io/badge/Tkinter-8.6-red?style=plastic)](https://docs.python.org/3/library/tkinter.html) 6 | [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=plastic)](https://opensource.org/licenses/MIT) 7 | 8 | 9 | 10 | The Criminal Database Management System is a Python application designed to manage criminal records efficiently. It provides functionalities to add, view, search, update, and delete criminal records stored in a SQLite database. The application utilizes the Tkinter library for the graphical user interface and SQLite3 for database management. 11 | 12 | ## Features 13 | 14 | - **User Authentication:** The system provides a login interface to authenticate users before accessing the database functionalities. 15 | - **CRUD Operations:** Users can perform CRUD (Create, Read, Update, Delete) operations on criminal records stored in the database. 16 | - **Search Functionality:** Users can search for specific criminal records based on various criteria such as Criminal ID, Name, Gender, Nationality, Age, Height, Weight, and Crime Committed. 17 | - **Graphical User Interface:** The application offers an intuitive GUI built using the Tkinter library, making it user-friendly and accessible. 18 | - **Data Persistence:** Criminal records are stored persistently in a SQLite database, ensuring data integrity and availability across sessions. 19 | 20 | ## Installation 21 | 22 | 1. Clone the repository: 23 | 24 | ```bash 25 | git clone https://github.com/yourusername/criminal-database.git 26 | ``` 27 | 28 | 2. Navigate to the project directory: 29 | 30 | ```bash 31 | cd criminal-database 32 | ``` 33 | 34 | 3. Install the required dependencies: 35 | 36 | ```bash 37 | pip install -r requirements.txt 38 | ``` 39 | 40 | 4. Run the application: 41 | 42 | ```bash 43 | python main.py 44 | ``` 45 | 46 | ## Usage 47 | 48 | 1. Launch the application by executing the `main.py` file. 49 | 2. Log in using valid credentials to access the database functionalities. 50 | 3. Use the navigation buttons to perform CRUD operations on criminal records. 51 | 4. Utilize the search functionality to find specific criminal records based on desired criteria. 52 | 53 | 54 | ## License 55 | 56 | This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. 57 | -------------------------------------------------------------------------------- /front.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | import back 3 | window=Tk() 4 | pic=PhotoImage(file="logo.gif") 5 | label2=Label(window,image=pic).grid(row=0,column=4,rowspan=7,columnspan=5) 6 | #pic1=PhotoImage(file="NYPD.gif") 7 | #label2=Label(window,image=pic1).grid(row=7,column=4,rowspan=5,columnspan=5) 8 | def viewcommand(): 9 | list1.delete(0,END) 10 | for crime_record in back.view(): 11 | list1.insert(END,crime_record) 12 | 13 | def searchcommand(): 14 | list1.delete(0,END) 15 | for crime_record in back.search(Criminal_id_text.get(),Name_text.get(),Gender_text.get(),Nationality_text.get(),Age_text.get(),Height_text.get(),Weight_text.get(),Crime_Committed_text.get()): 16 | list1.insert(END,crime_record) 17 | 18 | def insertcommand(): 19 | back.insert(Criminal_id_text.get(),Name_text.get(),Gender_text.get(),Nationality_text.get(),Age_text.get(),Height_text.get(),Weight_text.get(),Crime_Committed_text.get()) 20 | list1.delete(0,END) 21 | list1.insert(END,(Criminal_id_text.get(),Name_text.get(),Gender_text.get(),Nationality_text.get(),Age_text.get(),Height_text.get(),Weight_text.get(),Crime_Committed_text.get())) 22 | 23 | def get_selected_row(event): 24 | try: 25 | global selected_tuple 26 | index=list1.curselection()[0] 27 | selected_tuple=list1.get(index) 28 | e1.delete(0,END) 29 | e1.insert(END,selected_tuple[0]) 30 | e2.delete(0,END) 31 | e2.insert(END,selected_tuple[1]) 32 | e3.delete(0,END) 33 | e3.insert(END,selected_tuple[2]) 34 | e4.delete(0,END) 35 | e4.insert(END,selected_tuple[3]) 36 | e5.delete(0, END) 37 | e5.insert(END, selected_tuple[4]) 38 | e6.delete(0, END) 39 | e6.insert(END, selected_tuple[5]) 40 | e7.delete(0, END) 41 | e7.insert(END, selected_tuple[6]) 42 | e8.delete(0, END) 43 | e8.insert(END, selected_tuple[7]) 44 | except IndexError: 45 | pass 46 | 47 | def deletecommand(): 48 | back.delete(selected_tuple[0]) 49 | viewcommand() 50 | 51 | def updatecommand(): 52 | back.update( Criminal_id_text.get(), Name_text.get(), Gender_text.get(), Nationality_text.get(),Age_text.get(),Height_text.get(),Weight_text.get(),Crime_Committed_text.get() ) 53 | searchcommand() 54 | 55 | window.wm_title("CRIMINAL RECORD DATABASE") 56 | 57 | l1=Label(window,text="Criminal_ID") 58 | l1.grid(row=0,column=0) 59 | 60 | l2=Label(window,text="Name") 61 | l2.grid(row=0,column=2) 62 | 63 | l3=Label(window,text="Gender") 64 | l3.grid(row=1,column=0) 65 | 66 | l4=Label(window,text="Nationality") 67 | l4.grid(row=1,column=2) 68 | 69 | l5=Label(window,text="Age") 70 | l5.grid(row=2,column=0) 71 | 72 | l6=Label(window,text="Height(foot)") 73 | l6.grid(row=2,column=2) 74 | 75 | l7=Label(window,text="Weight(kg)") 76 | l7.grid(row=3,column=0) 77 | 78 | l8=Label(window,text="Crime_Committed") 79 | l8.grid(row=3,column=2) 80 | 81 | Criminal_id_text=StringVar() 82 | e1=Entry(window,textvariable=Criminal_id_text) 83 | e1.grid(row=0,column=1) 84 | 85 | Name_text=StringVar() 86 | e2=Entry(window,textvariable=Name_text) 87 | e2.grid(row=0,column=3) 88 | 89 | Gender_text=StringVar() 90 | e3=Entry(window,textvariable=Gender_text) 91 | e3.grid(row=1,column=1) 92 | 93 | Nationality_text=StringVar() 94 | e4=Entry(window,textvariable=Nationality_text) 95 | e4.grid(row=1,column=3) 96 | 97 | Age_text=StringVar() 98 | e5=Entry(window,textvariable=Age_text) 99 | e5.grid(row=2,column=1) 100 | 101 | Height_text=StringVar() 102 | e6=Entry(window,textvariable=Height_text) 103 | e6.grid(row=2,column=3) 104 | 105 | Weight_text=StringVar() 106 | e7=Entry(window,textvariable=Weight_text) 107 | e7.grid(row=3,column=1) 108 | 109 | Crime_Committed_text=StringVar() 110 | e8=Entry(window,textvariable=Crime_Committed_text) 111 | e8.grid(row=3,column=3) 112 | 113 | list1=Listbox(window,height=10,width=35) 114 | list1.grid(row=4,column=0,rowspan=10,columnspan=2,pady=4) 115 | list1.bind('<>',get_selected_row) 116 | 117 | scr=Scrollbar(window) 118 | scr.grid(row=4,column=2,rowspan=6) 119 | 120 | list1.configure(yscrollcommand=scr.set) 121 | scr.configure(command=list1.yview) 122 | 123 | b1=Button(window,text="View all",width=12,command=viewcommand) 124 | b1.grid(row=4,column=3) 125 | 126 | b2=Button(window,text="Search entry",width=12,command=searchcommand) 127 | b2.grid(row=5,column=3) 128 | 129 | b3=Button(window,text="Add entry",width=12,command=insertcommand) 130 | b3.grid(row=6,column=3) 131 | 132 | b4=Button(window,text="Update",width=12,command=updatecommand) 133 | b4.grid(row=7,column=3) 134 | 135 | b5=Button(window,text="Delete",width=12,command=deletecommand) 136 | b5.grid(row=8,column=3) 137 | 138 | b6=Button(window,text="Close",width=12,command=window.destroy) 139 | b6.grid(row=9,column=3) 140 | 141 | window.mainloop() 142 | -------------------------------------------------------------------------------- /main_application_file.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | from tkinter.ttk import Style 3 | from tkinter.messagebox import * 4 | import random 5 | from db import DBConnect 6 | from listComp import ListComp 7 | import back 8 | 9 | #Public log in 10 | def complaint_management(): 11 | # root.destroy() 12 | conn = DBConnect() 13 | root1 = Tk() 14 | root1.geometry('600x325') 15 | root1.title('Complaint Management System') 16 | root1.configure(background='light blue') 17 | 18 | #Style 19 | style = Style() 20 | style.theme_use('classic') 21 | for elem in ['TLabel', 'TButton', 'TRadioutton']: 22 | style.configure(elem, background='lightblue') 23 | 24 | #Gridx1353 25 | labels = ['Full Name:','Gender:','Phone No.:','Adhar No.:', 'Complaint:'] 26 | for i in range(5): 27 | Label(root1, text=labels[i]).grid(row=i, column=0, padx=10, pady=10) 28 | 29 | BuList = Button(root1, text='List Complaints') 30 | BuList.grid(row=6, column=1) 31 | BuSubmit = Button(root1, text='Submit Now') 32 | BuSubmit.grid(row=6, column=2) 33 | 34 | 35 | #Entries 36 | fullname = Entry(root1, width=40, font=('Arial', 14)) 37 | fullname.grid(row=0, column=1, columnspan=2) 38 | SpanGender = StringVar() 39 | Radiobutton(root1, text='Male', value='male', variable=SpanGender).grid(row=1, column=1) 40 | Radiobutton(root1, text='Female', value='female', variable=SpanGender).grid(row=1, column=2) 41 | 42 | #Phone and Adhar Addition...jump in sequence with tab key 43 | phone_entry = Entry(root1, width=20, font=('Arial', 14)) 44 | phone_entry.grid(row=2, column=1) 45 | # phone_button = Button(root1, text='Verify') 46 | # phone_button.grid(row=2, column=2) 47 | adhar_entry = Entry(root1, width=20, font=('Arial', 14)) 48 | adhar_entry.grid(row=3, column=1) 49 | # adhar_button = Button(root1, text='Verify') 50 | # adhar_button.grid(row=3, column=2) 51 | 52 | # comment = Text(root1, width=35, height=3, font=('Arial', 14)) 53 | # comment.grid(row=4, column=1, columnspan=2, padx=10, pady=10) 54 | 55 | Complaint = Text(root1, width=35,height=3,font=('Arial', 14)) 56 | Complaint.grid(row=4, column=1, columnspan=2, padx=10, pady=10) 57 | #Unable to add placeholder in text area of complaint 58 | # Complaint.insert(0,"Enter your complete information including occupation and addreess followed by complaint.") 59 | # Complaint.configure(state=DISABLED) 60 | def SaveData(): 61 | msg = conn.Add(fullname.get(), SpanGender.get(),phone_entry.get(),adhar_entry.get(),Complaint.get(1.0, 'end')) 62 | fullname.delete(0, 'end') 63 | phone_entry.delete(0,'end') #Delete text after submission 64 | adhar_entry.delete(0,'end') 65 | Complaint.delete(1.0, 'end') 66 | showinfo(title='Add Info', message=msg) 67 | 68 | def ShowList(): 69 | listrequest = ListComp() 70 | 71 | 72 | BuSubmit.config(command=SaveData) 73 | BuList.config(command=ShowList) 74 | 75 | root1.mainloop() 76 | 77 | #official log in 78 | def click(): 79 | text_entry=textentry.get() 80 | if text_entry == "123" : 81 | print("Login Approved") 82 | root.destroy() 83 | # import os 84 | # os.system('front.py') 85 | window=Tk() 86 | pic=PhotoImage(file="logo.gif") 87 | label2=Label(window,image=pic).grid(row=0,column=4,rowspan=7,columnspan=5) 88 | def viewcommand(): 89 | list1.delete(0,END) 90 | for crime_record in back.view(): 91 | list1.insert(END,crime_record) 92 | 93 | def searchcommand(): 94 | list1.delete(0,END) 95 | for crime_record in back.search(Criminal_id_text.get(),Name_text.get(),Gender_text.get(),Nationality_text.get(),Age_text.get(),Height_text.get(),Weight_text.get(),Crime_Committed_text.get()): 96 | list1.insert(END,crime_record) 97 | 98 | def insertcommand(): 99 | back.insert(Criminal_id_text.get(),Name_text.get(),Gender_text.get(),Nationality_text.get(),Age_text.get(),Height_text.get(),Weight_text.get(),Crime_Committed_text.get()) 100 | list1.delete(0,END) 101 | list1.insert(END,(Criminal_id_text.get(),Name_text.get(),Gender_text.get(),Nationality_text.get(),Age_text.get(),Height_text.get(),Weight_text.get(),Crime_Committed_text.get())) 102 | 103 | def get_selected_row(event): 104 | try: 105 | global selected_tuple 106 | index=list1.curselection()[0] 107 | selected_tuple=list1.get(index) 108 | e1.delete(0,END) 109 | e1.insert(END,selected_tuple[0]) 110 | e2.delete(0,END) 111 | e2.insert(END,selected_tuple[1]) 112 | e3.delete(0,END) 113 | e3.insert(END,selected_tuple[2]) 114 | e4.delete(0,END) 115 | e4.insert(END,selected_tuple[3]) 116 | e5.delete(0, END) 117 | e5.insert(END, selected_tuple[4]) 118 | e6.delete(0, END) 119 | e6.insert(END, selected_tuple[5]) 120 | e7.delete(0, END) 121 | e7.insert(END, selected_tuple[6]) 122 | e8.delete(0, END) 123 | e8.insert(END, selected_tuple[7]) 124 | except IndexError: 125 | pass 126 | 127 | def deletecommand(): 128 | back.delete(selected_tuple[0]) 129 | viewcommand() 130 | 131 | def updatecommand(): 132 | back.update( Criminal_id_text.get(), Name_text.get(), Gender_text.get(), Nationality_text.get(),Age_text.get(),Height_text.get(),Weight_text.get(),Crime_Committed_text.get() ) 133 | searchcommand() 134 | 135 | window.wm_title("CRIMINAL RECORD DATABASE") 136 | 137 | l1=Label(window,text="Criminal_ID") 138 | l1.grid(row=0,column=0) 139 | 140 | l2=Label(window,text="Name") 141 | l2.grid(row=0,column=2) 142 | 143 | l3=Label(window,text="Gender") 144 | l3.grid(row=1,column=0) 145 | 146 | l4=Label(window,text="Nationality") 147 | l4.grid(row=1,column=2) 148 | 149 | l5=Label(window,text="Age") 150 | l5.grid(row=2,column=0) 151 | 152 | l6=Label(window,text="Height(foot)") 153 | l6.grid(row=2,column=2) 154 | 155 | l7=Label(window,text="Weight(kg)") 156 | l7.grid(row=3,column=0) 157 | 158 | l8=Label(window,text="Crime_Committed") 159 | l8.grid(row=3,column=2) 160 | 161 | Criminal_id_text=StringVar() 162 | e1=Entry(window,textvariable=Criminal_id_text) 163 | e1.grid(row=0,column=1) 164 | 165 | Name_text=StringVar() 166 | e2=Entry(window,textvariable=Name_text) 167 | e2.grid(row=0,column=3) 168 | 169 | Gender_text=StringVar() 170 | e3=Entry(window,textvariable=Gender_text) 171 | e3.grid(row=1,column=1) 172 | 173 | Nationality_text=StringVar() 174 | e4=Entry(window,textvariable=Nationality_text) 175 | e4.grid(row=1,column=3) 176 | 177 | Age_text=StringVar() 178 | e5=Entry(window,textvariable=Age_text) 179 | e5.grid(row=2,column=1) 180 | 181 | Height_text=StringVar() 182 | e6=Entry(window,textvariable=Height_text) 183 | e6.grid(row=2,column=3) 184 | 185 | Weight_text=StringVar() 186 | e7=Entry(window,textvariable=Weight_text) 187 | e7.grid(row=3,column=1) 188 | 189 | Crime_Committed_text=StringVar() 190 | e8=Entry(window,textvariable=Crime_Committed_text) 191 | e8.grid(row=3,column=3) 192 | 193 | list1=Listbox(window,height=10,width=35) 194 | list1.grid(row=4,column=0,rowspan=10,columnspan=2,pady=4) 195 | list1.bind('<>',get_selected_row) 196 | 197 | scr=Scrollbar(window) 198 | scr.grid(row=4,column=2,rowspan=6) 199 | 200 | list1.configure(yscrollcommand=scr.set) 201 | scr.configure(command=list1.yview) 202 | 203 | b1=Button(window,text="View all",width=12,command=viewcommand) 204 | b1.grid(row=4,column=3) 205 | 206 | b2=Button(window,text="Search entry",width=12,command=searchcommand) 207 | b2.grid(row=5,column=3) 208 | 209 | b3=Button(window,text="Add entry",width=12,command=insertcommand) 210 | b3.grid(row=6,column=3) 211 | 212 | b4=Button(window,text="Update",width=12,command=updatecommand) 213 | b4.grid(row=7,column=3) 214 | 215 | b5=Button(window,text="Delete",width=12,command=deletecommand) 216 | b5.grid(row=8,column=3) 217 | 218 | b6=Button(window,text="Close",width=12,command=window.destroy) 219 | b6.grid(row=9,column=3) 220 | def ShowList(): #For listing complaints of public in official log in 221 | listrequest = ListComp() 222 | 223 | b6=Button(window,text="List Complaints",width=12,command=ShowList) 224 | b6.grid(row=9,column=4) 225 | 226 | window.mainloop() 227 | 228 | else : 229 | print("Access Denied") 230 | label1=Label(bottomFrame,text="Wrong Password. Try again",fg="black",bg="red") 231 | label1.grid(row=1,column=1) 232 | colors = ['green','black','purple'] 233 | # colors = ['dark red','green','black','red2','gold2','indianred1','sienna1','orange2','darkorchid1','cornflower blue','saddle brown','cornsilk3','steelblue4'] 234 | def IntroLabelColorTick(): 235 | fg = random.choice(colors) 236 | SliderLabel.config(fg=fg) 237 | SliderLabel.after(1000,IntroLabelColorTick) 238 | 239 | def IntroLabelTick(): 240 | global count,text 241 | if(count>=len(ss)): 242 | count = 0 243 | text = '' 244 | SliderLabel.config(text=text) 245 | else: 246 | text = text+ss[count] 247 | SliderLabel.config(text=text) 248 | count += 1 249 | SliderLabel.after(300,IntroLabelTick) 250 | 251 | 252 | 253 | 254 | root = Tk() 255 | root.title("Login Window") 256 | root.geometry("560x530+00+00") 257 | root.configure(background = "dark blue") 258 | 259 | topFrame = Frame(root,bg="light blue") 260 | topFrame.pack() 261 | ss = 'Criminal \nFinder\n Application' 262 | count = 0 263 | text = '' 264 | SliderLabel = Label(root,text=ss,font=('Times new roman',17,'italic bold'),relief=RIDGE,borderwidth=0,width=17,bg='light blue') 265 | # SliderLabel = Label(root,text=ss,font=('Times new roman',20,'italic bold'),relief=RIDGE,borderwidth=4,width=18,bg='linen') 266 | SliderLabel.place(x=272,y=20) 267 | IntroLabelTick() 268 | IntroLabelColorTick() 269 | 270 | bottomFrame = Frame(root) 271 | bottomFrame.pack(side =BOTTOM) 272 | photo = PhotoImage(file = "police_logo.png") 273 | Label(topFrame ,image = photo).grid(row=1 ,column = 1 ,sticky = W) 274 | # label = Label(topFrame, text="CRIMINAL \n RECORD \n DATABASE ",fg="black",bg="light blue",font=(None, 25)).grid(row=1,column = 3,sticky= E) 275 | 276 | 277 | # Label(topFrame, text="Enter Password",fg="black",bg="light blue",font=(None, 15)).grid(row=4,column=3) 278 | # textentry = Entry(topFrame , width =30 ,fg="black" ,bg="white",show = "*") 279 | # textentry.grid(row=5, column = 3,sticky=W) 280 | # Button(topFrame ,text="Submit",width=10 ,command = click).grid(row=6,column=3,sticky=W) 281 | 282 | # pass_label=Label(root,text="Enter Password",font=('Times new roman',15,'italic bold'),relief=RIDGE,borderwidth=0,width=30,bg='light blue') 283 | # pass_label.place(x=100,y=230) 284 | 285 | #Official log in 286 | # SliderLabel = Label(root,text=ss,font=('Times new roman',20,'italic bold'),relief=RIDGE,borderwidth=0,width=17,bg='light blue') 287 | 288 | Label(topFrame, text="OFFICIAL LOG IN",bg="light blue",font=('Times new roman',15,'bold')).grid(row=4,column=1,sticky=NW) 289 | # Label(topFrame, text="OFFICIAL LOG IN",fg="black",bg="light blue",font=(,font=('Times new roman',15,'italic bold')).grid(row=4,column=1,sticky=NW) 290 | Label(topFrame, text="Enter Password",bg="light blue",font=('Times new roman',11,'italic')).grid(row=5,column=1,sticky=SW) 291 | textentry = Entry(topFrame , width =15 ,fg="black" ,bg="white",show = "*") 292 | textentry.grid(row=6, column = 1,sticky=W) 293 | Button(topFrame ,text="Log In",width=10 ,command = click).grid(row=7,column=1,sticky=W) 294 | 295 | #Public log in 296 | Label(topFrame, text=" PUBLIC LOG IN",bg="light blue",font=('Times new roman',15,'bold')).grid(row=4,column=2,sticky=NE) 297 | Label(topFrame, text=" Enter Name",bg="light blue",font=('Times new roman',11,'italic')).grid(row=5,column=2,sticky=S) 298 | # Label(topFrame, text=" Click below to log in publicly",bg="light blue",font=('Times new roman',11,'italic')).grid(row=5,column=2,sticky=SE) 299 | textentry_public = Entry(topFrame , width =18 ,fg="black" ,bg="white") 300 | textentry_public.grid(row=6, column = 2,sticky=E) 301 | 302 | Button(topFrame ,text="Log In",width=10,command = complaint_management).grid(row=7,column=2,sticky=E) 303 | 304 | 305 | def close(): 306 | exit() 307 | Label(bottomFrame,text="Caution: Information entered incorrectly by a agency \n representaion in Database will be reflected on the ultimate \n report. UK Police will make corrections requested by the person \nat any point before the ultimate report is issued.",fg="red",bg="white").grid(row=6 ,column=1,sticky=W) 308 | Button(bottomFrame,text="Click to Exit",width=10,command=close).grid(row = 7,column =1,sticky = S) 309 | 310 | 311 | 312 | root.mainloop() 313 | --------------------------------------------------------------------------------