#Tkinter Imports
from tkinter import *
import tkinter.messagebox
from tkinter import ttk
def action(event,name_text,id_text, dis_text, height_text, col_text,acc_text,gen_text,root):
    from . import DBMS_FinalP as DP
    id = id_text.get()
    name = name_text.get()
    dis = dis_text.get()
    height= height_text.get()
    color = col_text.get()
    acc = acc_text.get()
    dis = dis_text.get()
    gender=gen_text.get()
    DP.police_signin_enter_crim(name,id,gender,dis,acc,height,color)
    tkinter.messagebox.showinfo('Criminal Registered !!!',"Justice Will Be Served")
    root.destroy()
def missadd():
    root = tkinter.Tk()
    root.configure(background='grey')
    root.title("Criminals form")
    root.geometry("500x300")
    heading = ttk.Label(root, text="Form").grid(row=0, column=1)
    name_label = ttk.Label(root, text="Name").grid(row=1, column=0)
    id_label = ttk.Label(root, text="Citizen ID").grid(row=2, column=0)
    gender_label= ttk.Label(root, text="Gender").grid(row=3, column=0)
    district_label = ttk.Label(root, text="District").grid(row=4, column=0)
    acc_label = ttk.Label(root, text="Accused For").grid(row=5, column=0)
    height_label = ttk.Label(root, text="Height").grid(row=6, column=0)
    col_label = ttk.Label(root, text="Color").grid(row=7, column=0)


    id = tkinter.StringVar()
    name = tkinter.StringVar()
    color = tkinter.StringVar()
    height= tkinter.IntVar()
    acc= tkinter.StringVar()
    dis = tkinter.StringVar()
    gender=tkinter.StringVar()
    id_text = ttk.Entry(root, textvariable=id)
    name_text = ttk.Entry(root, textvariable=name)
    height_text = ttk.Entry(root, textvariable=height)
    col_text = ttk.Entry(root, textvariable=color)
    acc_text = ttk.Entry(root, textvariable=acc)
    dis_text = ttk.Entry(root, textvariable=dis)
    gen_text=ttk.Entry(root,textvariable=gender)
    name_text.grid(row=1, column=1, ipadx="100")
    id_text.grid(row=2, column=1, ipadx="100")
    gen_text.grid(row=3, column=1, ipadx="100")
    dis_text.grid(row=4, column=1, ipadx="100")
    acc_text.grid(row=5, column=1, ipadx="100")
    height_text.grid(row=6, column=1, ipadx="100")
    col_text.grid(row=7, column=1, ipadx="100")


    submit = tkinter.Button(root, text="Submit", fg="Black")
    submit.bind("<Button-1>",lambda event: action(event,name_text,id_text, dis_text, height_text, col_text,acc_text,gen_text,root))
    submit.grid(row=9, column=1)
    root.mainloop()
missadd()