#Tkinter Imports
from tkinter import *
import tkinter.messagebox
from tkinter import ttk
def action(event,id_text,name_text,gender_text,dob_text,dis_text,addr_text,des_text,sal_text,ms_text,root):
    from . import DBMS_FinalP as DP
    id = id_text.get()
    name = name_text.get()
    gender = gender_text.get()
    dob = dob_text.get()
    dis=dis_text.get()
    addr = addr_text.get()
    des = des_text.get()
    sal = sal_text.get()
    ms = ms_text.get()
    DP.police_signup(name,id,gender,dob,dis,addr,des,sal,ms)
    tkinter.messagebox.showinfo('Sign Up!!!', 'Welcome to the Force '+id)
    root.destroy()

def forms():

    root = tkinter.Tk()
    root.configure(background='grey')
    root.title("Complaints form")
    root.geometry("500x300")
    heading = ttk.Label(root, text="Form").grid(row=0, column=1)
    id_label= ttk.Label(root, text="Your ID").grid(row=1, column=0)
    name_label=ttk.Label(root,text="Name").grid(row=2, column=0)
    gender_label=ttk.Label(root,text="Gender").grid(row=3, column=0)
    dob_label=ttk.Label(root,text="DOB").grid(row=4, column=0)
    district_label=ttk.Label(root,text="District").grid(row=5, column=0)
    addr_label=ttk.Label(root,text="Address").grid(row=6, column=0)
    des_label = ttk.Label(root, text="Designation").grid(row=7, column=0)
    sal_label = ttk.Label(root, text="Salary").grid(row=8, column=0)
    ms_label = ttk.Label(root, text="Marital Status").grid(row=9, column=0)
    id=tkinter.StringVar()
    name=tkinter.StringVar()
    gender=tkinter.StringVar()
    dob=tkinter.StringVar()
    dis=tkinter.StringVar()
    addr=tkinter.StringVar()
    des=tkinter.StringVar()
    sal=tkinter.IntVar()
    ms=tkinter.StringVar()
    id_text= ttk.Entry(root,textvariable=id)
    name_text = ttk.Entry(root,textvariable=name)
    gender_text= ttk.Entry(root,textvariable=gender)
    dob_text = ttk.Entry(root,textvariable=dob)
    dis_text = ttk.Entry(root,textvariable=dis)
    addr_text=ttk.Entry(root,textvariable=addr)
    des_text = ttk.Entry(root,textvariable=des)
    sal_text = ttk.Entry(root, textvariable=sal)
    ms_text = ttk.Entry(root, textvariable=ms)
    id_text.grid(row=1, column=1, ipadx="100")
    name_text.grid(row=2, column=1, ipadx="100")
    gender_text.grid(row=3, column=1, ipadx="100")
    dob_text.grid(row=4, column=1, ipadx="100")
    dis_text.grid(row=5, column=1, ipadx="100")
    addr_text.grid(row=6, column=1, ipadx="100")
    des_text.grid(row=7, column=1, ipadx="100")
    sal_text.grid(row=8, column=1, ipadx="100")
    ms_text.grid(row=9, column=1, ipadx="100")
    submit = tkinter.Button(root, text="Submit", fg="Black")
    submit.bind("<Button-1>", lambda event: action(event,id_text,name_text,gender_text,dob_text,dis_text,addr_text,des_text,sal_text,ms_text,root))
    submit.grid(row=10, column=1)


    root.mainloop()
