-
Notifications
You must be signed in to change notification settings - Fork 0
/
open_caseedit.py
167 lines (158 loc) · 8.67 KB
/
open_caseedit.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
from tkinter import *
import tkinter as tk
import tkinter.messagebox
import tkinter.font as tkFont
from PIL import Image,ImageTk
import os
import sqlite3
def fest1(p,i,i1,i2,i3):
connection = sqlite3.connect('NCD.db')
cursor = connection.cursor()
t=tk.Tk()
t.title('CASE')
w, h = t.winfo_screenwidth(), t.winfo_screenheight()
t.geometry("%dx%d+0+0" % (w, h))
def back():
t.destroy()
from acp_home import acp_home
acp_home(p)
def update_case():
cursor.execute("Update CASE1 set CASENO=? where CASENO=?", (case_id1.get(), i[0][0],))
cursor.execute("Update CASE1 set PENALCODETYPE=? where CASENO=?", (pno1.get(), i[0][0],))
cursor.execute("Update CASE1 set SECTIONNUMBER =? where CASENO=?", (sn1.get(), i[0][0],))
cursor.execute("Update CASE1 set POLICESTATION=? where CASENO=?", (ps1.get(), i[0][0],))
cursor.execute("Update CASE1 set DESCRIPTION=? where CASENO=?", (desc1.get(), i[0][0],))
cursor.execute("Update CASE1 set OPENDATE=? where CASENO=?", (od1.get(), i[0][0],))
cursor.execute("Update CASE1 set CLOSEDATE=? where CASENO=?", (cd1.get(), i[0][0],))
cursor.execute("Update CASE2 set POLICEID=? where CASENO=?", (pi1.get(), i1[0][0],))
cursor.execute("Update CASE3 set VFNAME=? where CASENO=?", (victim1.get(), i2[0][0],))
cursor.execute("Update CASE3 set VMNAME=? where CASENO=?", (victim2.get(), i[0][0],))
cursor.execute("Update CASE3 set VLNAME=? where CASENO=?", (victim3.get(), i[0][0],))
cursor.execute("Update CASE3 set VAGE=? where CASENO=?", (age1.get(), i2[0][0],))
cursor.execute("Update CASE3 set VADDRESS=? where CASENO=?", (address1.get(), i2[0][0],))
cursor.execute("Update CASE4 set FIRNO=? where CASENO=?", (fr1.get(), i3[0][0],))
connection.commit()
tkinter.messagebox.showinfo('TITLE','CASE UPDATED')
ci = StringVar(t)
frn = StringVar(t)
pss = StringVar(t)
des = StringVar(t)
o = StringVar(t)
c = StringVar(t)
vn = StringVar(t)
vn1 = StringVar(t)
vn2 = StringVar(t)
ag = StringVar(t)
pii = StringVar(t)
pnoo = StringVar(t)
snn = StringVar(t)
addre= StringVar(t)
def delete():
cursor.execute('DELETE from CASE1 where CASENO=?', (i[0][0],))
connection.commit()
cursor.execute('DELETE from CASE2 where CASENO=?', (i1[0][0],))
connection.commit()
cursor.execute('DELETE from CASE2 where CASENO=?', (i2[0][0],))
connection.commit()
cursor.execute('DELETE from CASE4 where CASENO=?', (i3[0][0],))
connection.commit()
tkinter.messagebox.showinfo('TITLE','CASE DELETED')
return
victim=Label(t, text='Name of victim',font=tkFont.Font(family="Times New Roman", size=16), borderwidth=2, relief="solid",width=15,height=2)
od=Label(t, text='OPENING DATE',font=tkFont.Font(family="Times New Roman", size=16), borderwidth=2, relief="solid",width=15,height=2)
address=Label(t, text='ADDRESS',font=tkFont.Font(family="Times New Roman", size=16), borderwidth=2, relief="solid",width=15,height=2)
victim1=Entry(t,font=tkFont.Font(family="Times New Roman", size=30),textvariable=vn, borderwidth=2, relief="solid")
victim2 = Entry(t, font=tkFont.Font(family="Times New Roman", size=30), textvariable=vn1, borderwidth=2, relief="solid")
victim3 = Entry(t, font=tkFont.Font(family="Times New Roman", size=30), textvariable=vn2, borderwidth=2,relief="solid")
od1=Entry(t,font=tkFont.Font(family="Times New Roman", size=30),textvariable=o, borderwidth=2, relief="solid")
address1=Entry(t,font=tkFont.Font(family="Times New Roman", size=30), textvariable=addre, relief="solid")
#=Label(t, text='FIR', borderwidth=2, relief="solid")
case_id=Label(t, text='CASE ID',font=tkFont.Font(family="Times New Roman", size=16), borderwidth=2, relief="solid",width=15,height=2)
status=Label(t, text='COMPLAINT ID',font=tkFont.Font(family="Times New Roman", size=16), borderwidth=2, relief="solid",width=15,height=2)
case_id1=Entry(t,font=tkFont.Font(family="Times New Roman", size=30),textvariable=ci, borderwidth=2, relief="solid")
status1=Label(t, text=i[0][7], borderwidth=2, relief="solid", width=15,height=2)
#=Entry(t,font=tkFont.Font(family="Times New Roman", size=30), borderwidth=2, relief="solid")
desc=Label(t, text='DESCRIPTION',font=tkFont.Font(family="Times New Roman", size=16), borderwidth=2, relief="solid",width=15,height=2)
desc1=Entry(t,font=tkFont.Font(family="Times New Roman", size=30),textvariable=des, borderwidth=2, relief="solid")
cd=Label(t, text='CLOSING DATE',font=tkFont.Font(family="Times New Roman", size=16), borderwidth=2, relief="solid",width=15,height=2)
cd1=Entry(t,font=tkFont.Font(family="Times New Roman", size=30), textvariable=c,borderwidth=2, relief="solid")
fr = Label(t, text='FIR NUMBER',font=tkFont.Font(family="Times New Roman", size=16), borderwidth=2, relief="solid",width=15,height=2)
fr1 = Entry(t, font=tkFont.Font(family="Times New Roman", size=30), textvariable=frn, borderwidth=2, relief="solid")
pi = Label(t, text='POLICE ID',font=tkFont.Font(family="Times New Roman", size=16), borderwidth=2, relief="solid",width=15,height=2)
pi1 = Entry(t, font=tkFont.Font(family="Times New Roman", size=30), textvariable=pii, borderwidth=2, relief="solid")
pno = Label(t, text='PENAL NUMBER',font=tkFont.Font(family="Times New Roman", size=16), borderwidth=2, relief="solid",width=15,height=2)
pno1 = Entry(t, font=tkFont.Font(family="Times New Roman", size=30), textvariable=pnoo, borderwidth=2, relief="solid")
sn = Label(t, text='SECTION NUMBER',font=tkFont.Font(family="Times New Roman", size=16), borderwidth=2, relief="solid",width=15,height=2)
sn1 = Entry(t, font=tkFont.Font(family="Times New Roman", size=30), textvariable=snn, borderwidth=2,
relief="solid")
back_button = Button(t, text='Go Back', command=back, borderwidth=2, relief="solid", width=26, height=2).place(
x=950, y=700)
#OptionList=[i3[0][1]]
#v = tk.StringVar(t)
#v.set('FIR NUMBER ')
#fir= tk.OptionMenu(t, v, *OptionList)
#OptionList2=[i1[0][1]]
#OptionList3=[i[0][1]]
#v2 = tk.StringVar(t)
#v2.set('POLICE ID')
#police_id= tk.OptionMenu(t, v2, *OptionList2)
#v3 = tk.StringVar(t)
#v3.set('PENAL NUMBER')
#penal_no=tk.OptionMenu(t, v3, *OptionList3)
ps=Label(t, text='POLICE STATION',font=tkFont.Font(family="Times New Roman", size=16), borderwidth=2, relief="solid",width=15,height=2)
ps1=Entry(t,font=tkFont.Font(family="Times New Roman", size=30),textvariable=pss , borderwidth=2, relief="solid")
age=Label(t, text='AGE',font=tkFont.Font(family="Times New Roman", size=16), borderwidth=2, relief="solid",width=15,height=2)
age1=Entry(t,font=tkFont.Font(family="Times New Roman", size=30),textvariable=ag, borderwidth=2, relief="solid")
delete=Button(t, text='DELETE',font=tkFont.Font(family="Times New Roman", size=16),command=delete, borderwidth=2, relief="solid",width=15,height=2)
submit = Button(t, text='SUBMIT',font=tkFont.Font(family="Times New Roman", size=16), command=update_case, borderwidth=2, relief="solid",width=15,height=2)
victim.place(x=50, y=400)
age.place(x=50, y=75)
address.place(x=50, y=140)
victim1.place(x=300, y=400)
victim2.place(x=700, y=400)
victim3.place(x=1100, y=400)
age1.place(x=300, y=75)
address1.place(x=300, y=140)
case_id.place(x=50, y=10)
fr.place(x=50, y=335)
fr1.place(x=300, y=335)
case_id1.place(x=300, y=10)
pi.place(x=850, y=75)
pi1.place(x=1100, y=75)
status.place(x=850, y=205)
status1.place(x=1100, y=205)
pno.place(x=50, y=530)
pno1.place(x=300, y=530)
sn.place(x=50, y=595)
sn1.place(x=300, y=595)
# marks.place(x=50, y=350, width=300, height=70)
# address.place(x=400, y=350, width=300, height=70)
# penal_no.place(x=50, y=650, width=200, height=70)
desc.place(x=50, y=465)
desc1.place(x=300, y=465)
ps.place(x=850, y=140)
ps1.place(x=1100, y=140)
od.place(x=50, y=205)
od1.place(x=300, y=205)
cd.place(x=50, y=270)
cd1.place(x=300, y=270)
submit.place(x=950, y=600)
delete.place(x=750,y=600)
ci.set(i[0][0])
#v3.set(i3[0][1])
pss.set(i[0][3])
des.set(i[0][4])
o.set(i[0][5])
c.set(i[0][6])
vn.set(i2[0][1])
vn1.set(i2[0][2])
vn2.set(i2[0][3])
ag.set(i2[0][4])
#v.set(i[0][1])
#v2.set(i[0][1])
frn.set(i3[0][1])
pnoo.set(i[0][1])
pii.set(i1[0][1])
addre.set(i2[0][5])
snn.set(i[0][2])
mainloop()