From 895b5cef846fa1ab8e4dd14676b08351046e2ea2 Mon Sep 17 00:00:00 2001 From: Saketh Gajawada Date: Sat, 20 Mar 2021 14:54:40 +0000 Subject: [PATCH 01/26] added gui.py --- .replit | 2 ++ README.md | 1 - gui.py | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .replit create mode 100644 gui.py diff --git a/.replit b/.replit new file mode 100644 index 0000000..2aff877 --- /dev/null +++ b/.replit @@ -0,0 +1,2 @@ +language = "bash" +run = "" \ No newline at end of file diff --git a/README.md b/README.md index a469fa4..6a69bf2 100644 --- a/README.md +++ b/README.md @@ -24,4 +24,3 @@ And it's not just about the award, if you are interested after the hackathon to Regards, Vikas - diff --git a/gui.py b/gui.py new file mode 100644 index 0000000..2ee993b --- /dev/null +++ b/gui.py @@ -0,0 +1,36 @@ +import tkinter as tk +window = tk.Tk() +window.title("Contact Tracer") +window.geometry("1000x800") +name_var = tk.StringVar() +email_id_var = tk.StringVar() +vaccine_status_var = 0 +covid_status_var = 0 + +#function when submit button is clicked +def submit(): + name = name_var.get() + email_id = email_id_var.get() + vaccine_status = vaccine_status_var.get() + covid_status = covid_status_var.get() + print(name) + print(email_id) + +#name +name_lb = tk.Label(window,text = "Name", font=("Times New Roman", 12), bg="white").place(x=60,y=400) +name_entry = tk.Entry(window,textvariable = name_var, font=("Times New Roman", 12), bg="white").place(x=280,y=400) +#email +email_id_lb = tk.Label(window,text = "Email ID ", font=("Times New Roman", 12), bg="white").place(x=60,y=430) +email_id_entry = tk.Entry(window,textvariable = email_id_var, font=("Times New Roman", 12), bg="white").place(x=280,y=430) +#covid status +covid_lb = tk.Label(window,text = "Are you infected with Covid-19 ?", font=("Times New Roman", 12), bg="white").place(x=60,y=460) +covid_r1 = tk.Radiobutton(window, text="Yes", variable=covid_status_var, value= True).place(x=280,y=460) +covid_r2 = tk.Radiobutton(window, text="No", variable=covid_status_var, value= False).place(x=330,y=460) +#vaccine status +vaccine_lb = tk.Label(window,text = "Did you get vaccine ?", font=("Times New Roman", 12), bg="white").place(x=60,y=490) +vaccine_r1 = tk.Radiobutton(window, text="Yes1", variable=vaccine_status_var, value= True).place(x=280,y=490) +vaccine_r2 = tk.Radiobutton(window, text="No1", variable=vaccine_status_var, value= False).place(x=330,y=490) +#submit button +submit_bt = tk.Button(window,text = "SUBMIT",fg="white", bg="black",command = submit).place(x = 100,y = 600) + +window.mainloop() From a7a8142eef847daadc36b4dc9492571157453f0d Mon Sep 17 00:00:00 2001 From: Saketh Gajawada Date: Sat, 20 Mar 2021 14:59:08 +0000 Subject: [PATCH 02/26] updated gui.py --- gui.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gui.py b/gui.py index 2ee993b..44e3532 100644 --- a/gui.py +++ b/gui.py @@ -4,8 +4,8 @@ window.geometry("1000x800") name_var = tk.StringVar() email_id_var = tk.StringVar() -vaccine_status_var = 0 -covid_status_var = 0 +vaccine_status_var = tk.BooleanVar() +covid_status_var = tk.BooleanVar() #function when submit button is clicked def submit(): From df7dba23bcbe917838078149c7afbea403286e57 Mon Sep 17 00:00:00 2001 From: Saketh Gajawada Date: Sat, 20 Mar 2021 15:05:27 +0000 Subject: [PATCH 03/26] updated gui --- gui.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gui.py b/gui.py index 44e3532..5243c06 100644 --- a/gui.py +++ b/gui.py @@ -15,6 +15,8 @@ def submit(): covid_status = covid_status_var.get() print(name) print(email_id) + print(vaccine_status) + print(covid_status) #name name_lb = tk.Label(window,text = "Name", font=("Times New Roman", 12), bg="white").place(x=60,y=400) @@ -28,8 +30,8 @@ def submit(): covid_r2 = tk.Radiobutton(window, text="No", variable=covid_status_var, value= False).place(x=330,y=460) #vaccine status vaccine_lb = tk.Label(window,text = "Did you get vaccine ?", font=("Times New Roman", 12), bg="white").place(x=60,y=490) -vaccine_r1 = tk.Radiobutton(window, text="Yes1", variable=vaccine_status_var, value= True).place(x=280,y=490) -vaccine_r2 = tk.Radiobutton(window, text="No1", variable=vaccine_status_var, value= False).place(x=330,y=490) +vaccine_r1 = tk.Radiobutton(window, text="Yes", variable=vaccine_status_var, value= True).place(x=280,y=490) +vaccine_r2 = tk.Radiobutton(window, text="No", variable=vaccine_status_var, value= False).place(x=330,y=490) #submit button submit_bt = tk.Button(window,text = "SUBMIT",fg="white", bg="black",command = submit).place(x = 100,y = 600) From 57568f873aa930442e511e3b10ff355cd7ce3c9b Mon Sep 17 00:00:00 2001 From: Saketh Gajawada Date: Sat, 20 Mar 2021 15:12:12 +0000 Subject: [PATCH 04/26] updated --- .replit | 2 +- gui.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.replit b/.replit index 2aff877..5810a68 100644 --- a/.replit +++ b/.replit @@ -1,2 +1,2 @@ language = "bash" -run = "" \ No newline at end of file +run = "" diff --git a/gui.py b/gui.py index 5243c06..9fe283e 100644 --- a/gui.py +++ b/gui.py @@ -13,10 +13,8 @@ def submit(): email_id = email_id_var.get() vaccine_status = vaccine_status_var.get() covid_status = covid_status_var.get() - print(name) - print(email_id) - print(vaccine_status) - print(covid_status) + window.destroy() + #name name_lb = tk.Label(window,text = "Name", font=("Times New Roman", 12), bg="white").place(x=60,y=400) From 8d7209c0a5adc7b03f0eb48f81d3a04132f6d4be Mon Sep 17 00:00:00 2001 From: Saketh Gajawada Date: Sat, 20 Mar 2021 15:33:14 +0000 Subject: [PATCH 05/26] added three windows --- gui.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/gui.py b/gui.py index 9fe283e..01e397f 100644 --- a/gui.py +++ b/gui.py @@ -13,8 +13,20 @@ def submit(): email_id = email_id_var.get() vaccine_status = vaccine_status_var.get() covid_status = covid_status_var.get() + display = tk.Tk() + add_contacts_bt = tk.Button(display,text = "Add",command = add).pack() window.destroy() - +def add(): + add_contacts = tk.Tk() + add_name_var = tk.StringVar() + add_email_id_var = tk.StringVar() + #name + c_name_lb = tk.Label(add_contacts,text = "Name", font=("Times New Roman", 12), bg="white").place(x=60,y=400) + name_entry = tk.Entry(add_contacts,textvariable = add_name_var, font=("Times New Roman", 12), bg="white").place(x=280,y=400) + #email + c_email_id_lb = tk.Label(add_contacts,text = "Email ID ", font=("Times New Roman", 12), bg="white").place(x=60,y=430) + c_email_id_entry = tk.Entry(add_contacts,textvariable = add_email_id_var, font=("Times New Roman", 12), bg="white").place(x=280,y=430) + c_submit = tk.Button(text = "Add",command = "function to display name and email id in the list and add this line to it add_contacts.destroy() at last ").pack() #name name_lb = tk.Label(window,text = "Name", font=("Times New Roman", 12), bg="white").place(x=60,y=400) @@ -32,5 +44,4 @@ def submit(): vaccine_r2 = tk.Radiobutton(window, text="No", variable=vaccine_status_var, value= False).place(x=330,y=490) #submit button submit_bt = tk.Button(window,text = "SUBMIT",fg="white", bg="black",command = submit).place(x = 100,y = 600) - window.mainloop() From d3cc4c14d879eded1c3b6c8de8177d44051374d0 Mon Sep 17 00:00:00 2001 From: Saketh Gajawada Date: Sat, 20 Mar 2021 16:12:05 +0000 Subject: [PATCH 06/26] updated gui --- gui.py | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/gui.py b/gui.py index 01e397f..6bae7d8 100644 --- a/gui.py +++ b/gui.py @@ -6,7 +6,8 @@ email_id_var = tk.StringVar() vaccine_status_var = tk.BooleanVar() covid_status_var = tk.BooleanVar() - +contacts_name_lst = [] +contacts_email_id_lst = [] #function when submit button is clicked def submit(): name = name_var.get() @@ -14,20 +15,24 @@ def submit(): vaccine_status = vaccine_status_var.get() covid_status = covid_status_var.get() display = tk.Tk() - add_contacts_bt = tk.Button(display,text = "Add",command = add).pack() + def add(): + add_contacts = tk.Tk() + add_name_var = tk.StringVar() + add_email_id_var = tk.StringVar() + #name + c_name_lb = tk.Label(add_contacts,text = "Name", font=("Times New Roman", 12), bg="white").place(x=60,y=400) + name_entry = tk.Entry(add_contacts,textvariable = add_name_var, font=("Times New Roman", 12), bg="white").place(x=280,y=400) + #email + c_email_id_lb = tk.Label(add_contacts,text = "Email ID ", font=("Times New Roman", 12), bg="white").place(x=60,y=430) + c_email_id_entry = tk.Entry(add_contacts,textvariable = add_email_id_var, font=("Times New Roman", 12), bg="white").place(x=280,y=430) + def add_button(): + contacts_name_lst.append(add_name_var.get()) + contacts_email_id_lst.append(add_email_id_var.get()) + add_contacts.destroy() + c_submit = tk.Button(text = "Add",command = add_button).place(x = 100,y = 500) + add_contacts.mainloop() + add_contacts_bt = tk.Button(display, text="Add", command=add).pack() window.destroy() -def add(): - add_contacts = tk.Tk() - add_name_var = tk.StringVar() - add_email_id_var = tk.StringVar() - #name - c_name_lb = tk.Label(add_contacts,text = "Name", font=("Times New Roman", 12), bg="white").place(x=60,y=400) - name_entry = tk.Entry(add_contacts,textvariable = add_name_var, font=("Times New Roman", 12), bg="white").place(x=280,y=400) - #email - c_email_id_lb = tk.Label(add_contacts,text = "Email ID ", font=("Times New Roman", 12), bg="white").place(x=60,y=430) - c_email_id_entry = tk.Entry(add_contacts,textvariable = add_email_id_var, font=("Times New Roman", 12), bg="white").place(x=280,y=430) - c_submit = tk.Button(text = "Add",command = "function to display name and email id in the list and add this line to it add_contacts.destroy() at last ").pack() - #name name_lb = tk.Label(window,text = "Name", font=("Times New Roman", 12), bg="white").place(x=60,y=400) name_entry = tk.Entry(window,textvariable = name_var, font=("Times New Roman", 12), bg="white").place(x=280,y=400) @@ -45,3 +50,5 @@ def add(): #submit button submit_bt = tk.Button(window,text = "SUBMIT",fg="white", bg="black",command = submit).place(x = 100,y = 600) window.mainloop() +print(contacts_name_lst) +print(contacts_email_id_lst) \ No newline at end of file From db0f9eb18fe0171ac9c0c679007863f2d93baca5 Mon Sep 17 00:00:00 2001 From: Saketh Gajawada Date: Sat, 20 Mar 2021 16:55:13 +0000 Subject: [PATCH 07/26] update gui --- gui.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gui.py b/gui.py index 6bae7d8..7eb94d5 100644 --- a/gui.py +++ b/gui.py @@ -1,7 +1,10 @@ import tkinter as tk window = tk.Tk() window.title("Contact Tracer") -window.geometry("1000x800") +window.geometry("960x640") +img = tk.PhotoImage(file="window.png") +imglbl = tk.Label(window, image=img) +imglbl.place(x=0, y=0) name_var = tk.StringVar() email_id_var = tk.StringVar() vaccine_status_var = tk.BooleanVar() @@ -15,8 +18,10 @@ def submit(): vaccine_status = vaccine_status_var.get() covid_status = covid_status_var.get() display = tk.Tk() + display.title("Add Your Contacts") def add(): add_contacts = tk.Tk() + add_contacts.title("Contacts Information") add_name_var = tk.StringVar() add_email_id_var = tk.StringVar() #name From 22b95e75722feedd1ea1dd730b09e4fb2629d2d7 Mon Sep 17 00:00:00 2001 From: Darshak Jivrajani Date: Sat, 20 Mar 2021 20:57:05 +0000 Subject: [PATCH 08/26] Added Database connector --- gui.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gui.py b/gui.py index 7eb94d5..cb68e86 100644 --- a/gui.py +++ b/gui.py @@ -1,4 +1,6 @@ import tkinter as tk +import mysql.connector +sqid=1 window = tk.Tk() window.title("Contact Tracer") window.geometry("960x640") @@ -17,6 +19,9 @@ def submit(): email_id = email_id_var.get() vaccine_status = vaccine_status_var.get() covid_status = covid_status_var.get() + connection = mysql.connector.connect(host="192.168.43.78",database='trackerdb',user='DJ',password='Password') + cursor = connection.cursor() + Query = """ INSERT INTO Clients(id, name, email_id, covid_status, vaccine_status) VALUES (sqid,name,email_id,covid_status,vaccine_status)""" display = tk.Tk() display.title("Add Your Contacts") def add(): From bfeebad9ad76e617878f73834c09fd8b8569ed78 Mon Sep 17 00:00:00 2001 From: Darshak11 Date: Sun, 21 Mar 2021 03:21:40 +0530 Subject: [PATCH 09/26] temporary changes made --- gui.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/gui.py b/gui.py index cb68e86..6a99be5 100644 --- a/gui.py +++ b/gui.py @@ -1,12 +1,11 @@ import tkinter as tk import mysql.connector -sqid=1 window = tk.Tk() window.title("Contact Tracer") window.geometry("960x640") -img = tk.PhotoImage(file="window.png") -imglbl = tk.Label(window, image=img) -imglbl.place(x=0, y=0) +#img = tk.PhotoImage(file="window.png") +#imglbl = tk.Label(window, image=img) +#imglbl.place(x=0, y=0) name_var = tk.StringVar() email_id_var = tk.StringVar() vaccine_status_var = tk.BooleanVar() @@ -15,14 +14,19 @@ contacts_email_id_lst = [] #function when submit button is clicked def submit(): + sqid=1 name = name_var.get() email_id = email_id_var.get() vaccine_status = vaccine_status_var.get() covid_status = covid_status_var.get() - connection = mysql.connector.connect(host="192.168.43.78",database='trackerdb',user='DJ',password='Password') + connection = mysql.connector.connect(host="localhost",database='trackerdb',user='DJ',password='Password') cursor = connection.cursor() - Query = """ INSERT INTO Clients(id, name, email_id, covid_status, vaccine_status) VALUES (sqid,name,email_id,covid_status,vaccine_status)""" - display = tk.Tk() + Query = "INSERT INTO Clients VALUE (name,email_id,covid_status,vaccine_status);" + result = cursor.execute(Query) + connection.commit() + cursor.close() + connection.close() + display = tk.Tk() display.title("Add Your Contacts") def add(): add_contacts = tk.Tk() From 74ae09be610c38c423532704721b969117d9b45b Mon Sep 17 00:00:00 2001 From: Darshak11 Date: Sun, 21 Mar 2021 15:11:02 +0530 Subject: [PATCH 10/26] Completed --- gui.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/gui.py b/gui.py index 6a99be5..3e368ae 100644 --- a/gui.py +++ b/gui.py @@ -19,10 +19,17 @@ def submit(): email_id = email_id_var.get() vaccine_status = vaccine_status_var.get() covid_status = covid_status_var.get() - connection = mysql.connector.connect(host="localhost",database='trackerdb',user='DJ',password='Password') + connection = mysql.connector.connect(host="192.168.43.78",database='trackerdb',user='Remote',password='Password') cursor = connection.cursor() - Query = "INSERT INTO Clients VALUE (name,email_id,covid_status,vaccine_status);" - result = cursor.execute(Query) + sql = "INSERT INTO Clients (name,email_id,covid_status,vaccine_status) VALUES (%s,%s,%s,%s)" + cs=0 + if(covid_status): + cs=1 + vs=0 + if(vaccine_status): + vs=1 + val = (name,email_id,cs,vs) + cursor.execute(sql, val) connection.commit() cursor.close() connection.close() From cc33f94a6ae5d80113a37791a0e1fd5d732cdcde Mon Sep 17 00:00:00 2001 From: Saketh Gajawada Date: Sun, 21 Mar 2021 11:40:53 +0000 Subject: [PATCH 11/26] updated --- gui.py | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/gui.py b/gui.py index 3e368ae..eff2a20 100644 --- a/gui.py +++ b/gui.py @@ -12,6 +12,7 @@ covid_status_var = tk.BooleanVar() contacts_name_lst = [] contacts_email_id_lst = [] +i= 0 #function when submit button is clicked def submit(): sqid=1 @@ -22,13 +23,7 @@ def submit(): connection = mysql.connector.connect(host="192.168.43.78",database='trackerdb',user='Remote',password='Password') cursor = connection.cursor() sql = "INSERT INTO Clients (name,email_id,covid_status,vaccine_status) VALUES (%s,%s,%s,%s)" - cs=0 - if(covid_status): - cs=1 - vs=0 - if(vaccine_status): - vs=1 - val = (name,email_id,cs,vs) + val = (name,email_id,covid_status,vaccine_status) cursor.execute(sql, val) connection.commit() cursor.close() @@ -47,9 +42,27 @@ def add(): c_email_id_lb = tk.Label(add_contacts,text = "Email ID ", font=("Times New Roman", 12), bg="white").place(x=60,y=430) c_email_id_entry = tk.Entry(add_contacts,textvariable = add_email_id_var, font=("Times New Roman", 12), bg="white").place(x=280,y=430) def add_button(): - contacts_name_lst.append(add_name_var.get()) - contacts_email_id_lst.append(add_email_id_var.get()) - add_contacts.destroy() + # contacts_name_lst.append(add_name_var.get()) + # contacts_email_id_lst.append(add_email_id_var.get()) + for email in database: + if add_email_id_var.get() == email: + #printing name in table + e_name = Entry(display, width=20, fg='blue',font=('Arial',16,'bold')) + e_name.grid(row=i, column=0) + e_name.insert(tk.END,add_name_var.get()) + #printing email in tabel + e_name = Entry(display, width=20, fg='blue',font=('Arial',16,'bold')) + e_name.grid(row=i, column=1) + e_name.insert(tk.END,add_email_id_var.get()) + #printing covid status + e_name = Entry(display, width=20, fg='blue',font=('Arial',16,'bold')) + e_name.grid(row=i, column=2) + e_name.insert(tk.END,covid_status) + #printing vaccine satus + e_name = Entry(display, width=20, fg='blue',font=('Arial',16,'bold')) + e_name.grid(row=i, column=3) + e_name.insert(tk.END,vaccine_status) + i += 1 c_submit = tk.Button(text = "Add",command = add_button).place(x = 100,y = 500) add_contacts.mainloop() add_contacts_bt = tk.Button(display, text="Add", command=add).pack() @@ -62,12 +75,12 @@ def add_button(): email_id_entry = tk.Entry(window,textvariable = email_id_var, font=("Times New Roman", 12), bg="white").place(x=280,y=430) #covid status covid_lb = tk.Label(window,text = "Are you infected with Covid-19 ?", font=("Times New Roman", 12), bg="white").place(x=60,y=460) -covid_r1 = tk.Radiobutton(window, text="Yes", variable=covid_status_var, value= True).place(x=280,y=460) -covid_r2 = tk.Radiobutton(window, text="No", variable=covid_status_var, value= False).place(x=330,y=460) +covid_r1 = tk.Radiobutton(window, text="Yes", variable=covid_status_var, value= 1).place(x=280,y=460) +covid_r2 = tk.Radiobutton(window, text="No", variable=covid_status_var, value= 0).place(x=330,y=460) #vaccine status vaccine_lb = tk.Label(window,text = "Did you get vaccine ?", font=("Times New Roman", 12), bg="white").place(x=60,y=490) -vaccine_r1 = tk.Radiobutton(window, text="Yes", variable=vaccine_status_var, value= True).place(x=280,y=490) -vaccine_r2 = tk.Radiobutton(window, text="No", variable=vaccine_status_var, value= False).place(x=330,y=490) +vaccine_r1 = tk.Radiobutton(window, text="Yes", variable=vaccine_status_var, value= 1).place(x=280,y=490) +vaccine_r2 = tk.Radiobutton(window, text="No", variable=vaccine_status_var, value= 0).place(x=330,y=490) #submit button submit_bt = tk.Button(window,text = "SUBMIT",fg="white", bg="black",command = submit).place(x = 100,y = 600) window.mainloop() From 74cf5c399895db440cc6a9c5a646b3dfb1fdf0e7 Mon Sep 17 00:00:00 2001 From: Saketh Gajawada Date: Sun, 21 Mar 2021 12:19:02 +0000 Subject: [PATCH 12/26] updated --- gui.py | 61 +++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 20 deletions(-) diff --git a/gui.py b/gui.py index eff2a20..98214d7 100644 --- a/gui.py +++ b/gui.py @@ -12,7 +12,7 @@ covid_status_var = tk.BooleanVar() contacts_name_lst = [] contacts_email_id_lst = [] -i= 0 +i = 0 #function when submit button is clicked def submit(): sqid=1 @@ -28,7 +28,7 @@ def submit(): connection.commit() cursor.close() connection.close() - display = tk.Tk() + display = tk.Tk() display.title("Add Your Contacts") def add(): add_contacts = tk.Tk() @@ -41,31 +41,52 @@ def add(): #email c_email_id_lb = tk.Label(add_contacts,text = "Email ID ", font=("Times New Roman", 12), bg="white").place(x=60,y=430) c_email_id_entry = tk.Entry(add_contacts,textvariable = add_email_id_var, font=("Times New Roman", 12), bg="white").place(x=280,y=430) - def add_button(): - # contacts_name_lst.append(add_name_var.get()) - # contacts_email_id_lst.append(add_email_id_var.get()) + def add_function(i): for email in database: if add_email_id_var.get() == email: #printing name in table - e_name = Entry(display, width=20, fg='blue',font=('Arial',16,'bold')) - e_name.grid(row=i, column=0) + e_name = tk.Entry(display, width=20, fg='blue',font=('Arial',16,'bold')) + e_name.grid(row = i, column=0) e_name.insert(tk.END,add_name_var.get()) #printing email in tabel - e_name = Entry(display, width=20, fg='blue',font=('Arial',16,'bold')) - e_name.grid(row=i, column=1) - e_name.insert(tk.END,add_email_id_var.get()) + e_email = tk.Entry(display, width=20, fg='blue',font=('Arial',16,'bold')) + e_email.grid(row=i, column=1) + e_email.insert(tk.END,add_email_id_var.get()) #printing covid status - e_name = Entry(display, width=20, fg='blue',font=('Arial',16,'bold')) - e_name.grid(row=i, column=2) - e_name.insert(tk.END,covid_status) - #printing vaccine satus - e_name = Entry(display, width=20, fg='blue',font=('Arial',16,'bold')) - e_name.grid(row=i, column=3) - e_name.insert(tk.END,vaccine_status) + e_cs = tk.Entry(display, width=20, fg='blue',font=('Arial',16,'bold')) + e_cs.grid(row=i, column=2) + e_cs.insert(tk.END,covid_status) + #printing vaccine status + e_vs = tk.Entry(display, width=20, fg='blue',font=('Arial',16,'bold')) + e_vs.grid(row=i, column=3) + e_vs.insert(tk.END,vaccine_status) i += 1 - c_submit = tk.Button(text = "Add",command = add_button).place(x = 100,y = 500) - add_contacts.mainloop() - add_contacts_bt = tk.Button(display, text="Add", command=add).pack() + c_submit = tk.Button(text = "Add",command = add_function(i)).place(x = 100,y = 500) #button in third window + add_contacts.destroy() + def update_function(): + update = tk.Tk() + update.title("Update My Status") + # email + email_id_lb = tk.Label(update, text="Email ID ", font=("Times New Roman", 12), bg="white").place(x=60, y=430) + email_id_entry = tk.Entry(update, textvariable=email_id_var, font=("Times New Roman", 12), bg="white").place(x=280,y=430) + # covid status + covid_lb = tk.Label(update, text="Are you infected with Covid-19 ?", font=("Times New Roman", 12),bg="white").place(x=60, y=460) + covid_r1 = tk.Radiobutton(update, text="Yes", variable=covid_status_var, value=1).place(x=280, y=460) + covid_r2 = tk.Radiobutton(update, text="No", variable=covid_status_var, value=0).place(x=330, y=460) + # vaccine status + vaccine_lb = tk.Label(window, text="Did you get vaccine ?", font=("Times New Roman", 12), bg="white").place(x=60, + y=490) + vaccine_r1 = tk.Radiobutton(update, text="Yes", variable=vaccine_status_var, value=1).place(x=280, y=490) + vaccine_r2 = tk.Radiobutton(update, text="No", variable=vaccine_status_var, value=0).place(x=330, y=490) + '''def function for updating these to database : + code + code + code ''' + # submit button + submit_bt = tk.Button(update, text="Update", fg="white", bg="black", command='function for enetering values into database').place(x=100, y=600) + update.destroy() + add_contacts_bt = tk.Button(display, text="Add", command=add).pack() # button in second window + update_status = tk.Button(display,text = "Update my status",command = ).pack() # button in second window window.destroy() #name name_lb = tk.Label(window,text = "Name", font=("Times New Roman", 12), bg="white").place(x=60,y=400) From 437af7ff80a703f963c9606697760d730f7fb100 Mon Sep 17 00:00:00 2001 From: Saketh Gajawada Date: Sun, 21 Mar 2021 12:19:31 +0000 Subject: [PATCH 13/26] updated gui.py --- gui.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/gui.py b/gui.py index 98214d7..1dbaae2 100644 --- a/gui.py +++ b/gui.py @@ -3,9 +3,6 @@ window = tk.Tk() window.title("Contact Tracer") window.geometry("960x640") -#img = tk.PhotoImage(file="window.png") -#imglbl = tk.Label(window, image=img) -#imglbl.place(x=0, y=0) name_var = tk.StringVar() email_id_var = tk.StringVar() vaccine_status_var = tk.BooleanVar() From 9da88ba56749abaef89b844a7c0f7fb8a03b2638 Mon Sep 17 00:00:00 2001 From: Saketh Gajawada Date: Sun, 21 Mar 2021 12:20:32 +0000 Subject: [PATCH 14/26] updated --- gui.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gui.py b/gui.py index 1dbaae2..3722edf 100644 --- a/gui.py +++ b/gui.py @@ -71,8 +71,7 @@ def update_function(): covid_r1 = tk.Radiobutton(update, text="Yes", variable=covid_status_var, value=1).place(x=280, y=460) covid_r2 = tk.Radiobutton(update, text="No", variable=covid_status_var, value=0).place(x=330, y=460) # vaccine status - vaccine_lb = tk.Label(window, text="Did you get vaccine ?", font=("Times New Roman", 12), bg="white").place(x=60, - y=490) + vaccine_lb = tk.Label(window, text="Did you get vaccine ?", font=("Times New Roman", 12), bg="white").place(x=60, y=490) vaccine_r1 = tk.Radiobutton(update, text="Yes", variable=vaccine_status_var, value=1).place(x=280, y=490) vaccine_r2 = tk.Radiobutton(update, text="No", variable=vaccine_status_var, value=0).place(x=330, y=490) '''def function for updating these to database : From 3f4e8b89c188efc6294cc0f2413627223ce3c906 Mon Sep 17 00:00:00 2001 From: Saketh Gajawada Date: Sun, 21 Mar 2021 12:44:07 +0000 Subject: [PATCH 15/26] updated gui --- gui.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gui.py b/gui.py index 3722edf..98214d7 100644 --- a/gui.py +++ b/gui.py @@ -3,6 +3,9 @@ window = tk.Tk() window.title("Contact Tracer") window.geometry("960x640") +#img = tk.PhotoImage(file="window.png") +#imglbl = tk.Label(window, image=img) +#imglbl.place(x=0, y=0) name_var = tk.StringVar() email_id_var = tk.StringVar() vaccine_status_var = tk.BooleanVar() @@ -71,7 +74,8 @@ def update_function(): covid_r1 = tk.Radiobutton(update, text="Yes", variable=covid_status_var, value=1).place(x=280, y=460) covid_r2 = tk.Radiobutton(update, text="No", variable=covid_status_var, value=0).place(x=330, y=460) # vaccine status - vaccine_lb = tk.Label(window, text="Did you get vaccine ?", font=("Times New Roman", 12), bg="white").place(x=60, y=490) + vaccine_lb = tk.Label(window, text="Did you get vaccine ?", font=("Times New Roman", 12), bg="white").place(x=60, + y=490) vaccine_r1 = tk.Radiobutton(update, text="Yes", variable=vaccine_status_var, value=1).place(x=280, y=490) vaccine_r2 = tk.Radiobutton(update, text="No", variable=vaccine_status_var, value=0).place(x=330, y=490) '''def function for updating these to database : From ba3a9b974d7415ea38a82565a2026feeba126a90 Mon Sep 17 00:00:00 2001 From: SakethGajawada <77500278+SakethGajawada@users.noreply.github.com> Date: Sun, 21 Mar 2021 19:03:03 +0530 Subject: [PATCH 16/26] Rename gui.py to Ctrl Alt Elite --- gui.py => Ctrl Alt Elite | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename gui.py => Ctrl Alt Elite (99%) diff --git a/gui.py b/Ctrl Alt Elite similarity index 99% rename from gui.py rename to Ctrl Alt Elite index 98214d7..1b94cbe 100644 --- a/gui.py +++ b/Ctrl Alt Elite @@ -106,4 +106,4 @@ def update_function(): submit_bt = tk.Button(window,text = "SUBMIT",fg="white", bg="black",command = submit).place(x = 100,y = 600) window.mainloop() print(contacts_name_lst) -print(contacts_email_id_lst) \ No newline at end of file +print(contacts_email_id_lst) From a0092b791f91d3fe5b3af718130d87a466ca343a Mon Sep 17 00:00:00 2001 From: Darshak11 Date: Sun, 21 Mar 2021 20:13:42 +0530 Subject: [PATCH 17/26] Changes --- Ctrl Alt Elite | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Ctrl Alt Elite b/Ctrl Alt Elite index 1b94cbe..1d8c998 100644 --- a/Ctrl Alt Elite +++ b/Ctrl Alt Elite @@ -42,6 +42,14 @@ def submit(): c_email_id_lb = tk.Label(add_contacts,text = "Email ID ", font=("Times New Roman", 12), bg="white").place(x=60,y=430) c_email_id_entry = tk.Entry(add_contacts,textvariable = add_email_id_var, font=("Times New Roman", 12), bg="white").place(x=280,y=430) def add_function(i): + connection = mysql.connector.connect(host="192.168.43.78",database='trackerdb',user='Remote',password='Password') + cursor = connection.cursor() + + sql1 = "select email_id from Clients" + cursor.execute(sql1) + + database=cursor.fetchall() + for email in database: if add_email_id_var.get() == email: #printing name in table From c4c423314f159cf79be4260997f3bfd53ce551b2 Mon Sep 17 00:00:00 2001 From: Darshak11 Date: Sun, 21 Mar 2021 20:21:09 +0530 Subject: [PATCH 18/26] CHnages --- Ctrl Alt Elite | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Ctrl Alt Elite b/Ctrl Alt Elite index 1d8c998..ad62977 100644 --- a/Ctrl Alt Elite +++ b/Ctrl Alt Elite @@ -49,7 +49,9 @@ def submit(): cursor.execute(sql1) database=cursor.fetchall() - + connection.commit() + cursor.close() + connection.close() for email in database: if add_email_id_var.get() == email: #printing name in table @@ -86,11 +88,14 @@ def submit(): y=490) vaccine_r1 = tk.Radiobutton(update, text="Yes", variable=vaccine_status_var, value=1).place(x=280, y=490) vaccine_r2 = tk.Radiobutton(update, text="No", variable=vaccine_status_var, value=0).place(x=330, y=490) - '''def function for updating these to database : - code - code - code ''' - # submit button + def update_button(): + connection = mysql.connector.connect(host="192.168.43.78",database='trackerdb',user='Remote',password='Password') + cursor = connection.cursor() + sql3= "Update Clients set covid_status=%s,vaccine_status=%s where email_id=%s" + cursor.execute(sql3,(.get(),.get(),.get())) + connection.commit() + cursor.close() + connection.close() submit_bt = tk.Button(update, text="Update", fg="white", bg="black", command='function for enetering values into database').place(x=100, y=600) update.destroy() add_contacts_bt = tk.Button(display, text="Add", command=add).pack() # button in second window From 0d93b4cccf372434342c01a87ab2dd2f55d10e90 Mon Sep 17 00:00:00 2001 From: Saketh Gajawada Date: Sun, 21 Mar 2021 15:37:58 +0000 Subject: [PATCH 19/26] final changes ig --- Ctrl Alt Elite | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Ctrl Alt Elite b/Ctrl Alt Elite index ad62977..c0ce6ad 100644 --- a/Ctrl Alt Elite +++ b/Ctrl Alt Elite @@ -92,11 +92,11 @@ def submit(): connection = mysql.connector.connect(host="192.168.43.78",database='trackerdb',user='Remote',password='Password') cursor = connection.cursor() sql3= "Update Clients set covid_status=%s,vaccine_status=%s where email_id=%s" - cursor.execute(sql3,(.get(),.get(),.get())) + cursor.execute(sql3,(covid_status_var.get(),vaccine_status_var.get(),email_id_var.get())) connection.commit() cursor.close() connection.close() - submit_bt = tk.Button(update, text="Update", fg="white", bg="black", command='function for enetering values into database').place(x=100, y=600) + submit_bt = tk.Button(update, text="Update", fg="white", bg="black", command=update_button).place(x=100, y=600) update.destroy() add_contacts_bt = tk.Button(display, text="Add", command=add).pack() # button in second window update_status = tk.Button(display,text = "Update my status",command = ).pack() # button in second window From 8510b8bc3a08ae144dc1fa012214dd83944a84cf Mon Sep 17 00:00:00 2001 From: Saketh Gajawada Date: Sun, 21 Mar 2021 15:41:04 +0000 Subject: [PATCH 20/26] final updates --- Ctrl Alt Elite | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ctrl Alt Elite b/Ctrl Alt Elite index c0ce6ad..de941e0 100644 --- a/Ctrl Alt Elite +++ b/Ctrl Alt Elite @@ -99,7 +99,7 @@ def submit(): submit_bt = tk.Button(update, text="Update", fg="white", bg="black", command=update_button).place(x=100, y=600) update.destroy() add_contacts_bt = tk.Button(display, text="Add", command=add).pack() # button in second window - update_status = tk.Button(display,text = "Update my status",command = ).pack() # button in second window + update_status = tk.Button(display,text = "Update my status",command = update_function ).pack() # button in second window window.destroy() #name name_lb = tk.Label(window,text = "Name", font=("Times New Roman", 12), bg="white").place(x=60,y=400) From 5ab0560a89308a50c0e5f630959a552fac9b9a4b Mon Sep 17 00:00:00 2001 From: SakethGajawada <77500278+SakethGajawada@users.noreply.github.com> Date: Sun, 21 Mar 2021 21:12:58 +0530 Subject: [PATCH 21/26] Update Ctrl Alt Elite --- Ctrl Alt Elite | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Ctrl Alt Elite b/Ctrl Alt Elite index de941e0..c07ad3c 100644 --- a/Ctrl Alt Elite +++ b/Ctrl Alt Elite @@ -3,9 +3,6 @@ import mysql.connector window = tk.Tk() window.title("Contact Tracer") window.geometry("960x640") -#img = tk.PhotoImage(file="window.png") -#imglbl = tk.Label(window, image=img) -#imglbl.place(x=0, y=0) name_var = tk.StringVar() email_id_var = tk.StringVar() vaccine_status_var = tk.BooleanVar() @@ -13,7 +10,6 @@ covid_status_var = tk.BooleanVar() contacts_name_lst = [] contacts_email_id_lst = [] i = 0 -#function when submit button is clicked def submit(): sqid=1 name = name_var.get() @@ -44,10 +40,8 @@ def submit(): def add_function(i): connection = mysql.connector.connect(host="192.168.43.78",database='trackerdb',user='Remote',password='Password') cursor = connection.cursor() - sql1 = "select email_id from Clients" cursor.execute(sql1) - database=cursor.fetchall() connection.commit() cursor.close() From a9d9a21e2da1c110e7ca81d504816a53d8797e94 Mon Sep 17 00:00:00 2001 From: SakethGajawada <77500278+SakethGajawada@users.noreply.github.com> Date: Sun, 21 Mar 2021 21:13:33 +0530 Subject: [PATCH 22/26] Rename Ctrl Alt Elite to Ctrl_Alt_Elite.py --- Ctrl Alt Elite => Ctrl_Alt_Elite.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Ctrl Alt Elite => Ctrl_Alt_Elite.py (100%) diff --git a/Ctrl Alt Elite b/Ctrl_Alt_Elite.py similarity index 100% rename from Ctrl Alt Elite rename to Ctrl_Alt_Elite.py From 40e43333f36b0958b28ca318711382cea8cd24fa Mon Sep 17 00:00:00 2001 From: Saketh Gajawada Date: Sun, 21 Mar 2021 16:33:46 +0000 Subject: [PATCH 23/26] final submission --- README.md | 81 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 63 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 6a69bf2..399b1fd 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,71 @@ -# Hackathon-Python -Repository for python submissions for Zense Hackathon 2021 -You have to make your python submission pull request to this repository. + From team #<<<<>>>>># + Saketh Gajawada and Darshak Jivrajani + +A small poem for u(Zense) + +This hackathon held by ZENSE; +At first, made us tense. + +But........ + +With ur kindness u got our attention; +Every time v asked something u planted a seed Of motivation. + +Thankyou Zense for being there; +Thankyou for showing concern and care. + +Thankyou for keeping us in the track; +Thankyou for helping with what we lack. + +For being what u r; +U have always been our college superstars. + +It may look like We r bluffing; +But its actually a thankful opening. + + + COVID-19 CONTACT TRACER + +IDEA OF THE PROJECT : + Our main idea is to stop the spreading of Covid-19.We made a contact tracer application which warns us through an email when any previously contacted person gets infected. This may help us to take precautions or by being self quarantine may reduce the spreading of corona virus. + +IMPLEMENTATION: +We tried to implement it using Tkinter and database connectivity.We used Tkinter to develop the UI for the application. For maintaining the data of all the users we needed a database and also the database which can be used by all the people all over the world we needed a database server, so for that we used MySql. We had also planned to make the mailing system but could not implement it in the code. At present the takes input from the user and adds the user to the Database and we can add our contacts and update our current status. + +DIFFICULTIES FACED: +The issues which came up during implementation were : + Making the Mysql database remotely accessable was a issue as we were unaware of the steps to do it. We tried to solve this issue by looking throught stackoverflow pages and trying to implement and undestand the solution given there. + Python implementation of connecting the database was also a tough part.We used youtube videos and some tutorials to overcome it. + It was really difficult to manage the control flow of gui,for example checking the order of windows,We actually have 4 windows to display.To overcome this all I did is to check with >>>>>>>>>patience<<<<<<<. + Labelling variables was also one of the biggest task,dealt it with naming variables as clear as possible however long it may be. + +WHAT WE LEARNED: +We learnt how to give database connectivity to a python file and also how to give remote access and how to use that access of a database using a python file. Also we learnt to make a complicated GUI using Tkinter and explored the Tkinter module as much as possible. We could have implemented more but than could not have learned more details. We also wanted to learn how to make a automatic mailing system to send notifications, but could not do it but will surely research and learn about it. We also wanted to make the app with location optimized and learn how to get location access and use it. We both basically found our interests and both had similar. + + + + + + + + + + + + + + + + + + + + -Message from Vikas Yadav: Founder of Zense -Hi folks, -Very happy to see this hackathon happening again. While on campus I loved being part of events like these. A lot of my interests developed as side effects of these events. With that in mind and to encourage the spirit of innovation - I would like to announce a bonus prize of Rs 5000 from my side for the idea which I find the best. In case it's difficult to decide a single winner - please don't mind if I split the prize into two. -Parameters I am going to judge you on: -- Feasibility of the idea -- Completeness of the implementation -- Effort you put in -- Impact of the idea -Some potential ideas you can think of: -- Automate a mundane task which you might have to everyday using python -- Explore the python ecosystem to find some amazing libraries - use it to solve a real-world problem around you -- Or just make something cool -And it's not just about the award, if you are interested after the hackathon to pursue your idea further I would be happy to mentor. -Regards, -Vikas From 5d503c0720d4ec5880262e5c7e3565a15dd6f938 Mon Sep 17 00:00:00 2001 From: SakethGajawada <77500278+SakethGajawada@users.noreply.github.com> Date: Sun, 21 Mar 2021 22:05:06 +0530 Subject: [PATCH 24/26] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 399b1fd..01f0a2c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ A small poem for u(Zense) -This hackathon held by ZENSE; +This hackathon held by ZENSE. At first, made us tense. But........ @@ -11,16 +11,16 @@ But........ With ur kindness u got our attention; Every time v asked something u planted a seed Of motivation. -Thankyou Zense for being there; +Thankyou Zense for being there. Thankyou for showing concern and care. -Thankyou for keeping us in the track; +Thankyou for keeping us in the track. Thankyou for helping with what we lack. -For being what u r; +For being what u r. U have always been our college superstars. -It may look like We r bluffing; +It may look like We r bluffing. But its actually a thankful opening. From 7e811a2385f39e1b698b3cf54e453c9c6f9ecc98 Mon Sep 17 00:00:00 2001 From: SakethGajawada <77500278+SakethGajawada@users.noreply.github.com> Date: Sun, 21 Mar 2021 22:06:17 +0530 Subject: [PATCH 25/26] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 01f0a2c..9172727 100644 --- a/README.md +++ b/README.md @@ -11,16 +11,16 @@ But........ With ur kindness u got our attention; Every time v asked something u planted a seed Of motivation. -Thankyou Zense for being there. +Thankyou Zense for being there; Thankyou for showing concern and care. -Thankyou for keeping us in the track. +Thankyou for keeping us in the track; Thankyou for helping with what we lack. -For being what u r. +For being what u r; U have always been our college superstars. -It may look like We r bluffing. +It may look like We r bluffing; But its actually a thankful opening. From 3e14ec52ed29c6a1bea7e74abe3322b1bafdb907 Mon Sep 17 00:00:00 2001 From: Darshak11 <77498057+Darshak11@users.noreply.github.com> Date: Sun, 21 Mar 2021 22:14:32 +0530 Subject: [PATCH 26/26] Delete .replit --- .replit | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .replit diff --git a/.replit b/.replit deleted file mode 100644 index 5810a68..0000000 --- a/.replit +++ /dev/null @@ -1,2 +0,0 @@ -language = "bash" -run = ""