-
Notifications
You must be signed in to change notification settings - Fork 0
/
DonorDetails.py
59 lines (38 loc) · 1.67 KB
/
DonorDetails.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
from tkinter import *
import csv
from tkinter import messagebox
#CREATING TKINTER FILE
root = Tk()
root.title("DONOR DETAILS")
#CREATING CANVAS
canvas1 = Canvas(root,width=1500,height = 1500,background="gray")
canvas1.pack()
# input here
NICno = Label(text="NIC NUMBER",width="20",bg="blue",fg="white").place(x=400,y=300)
NIC = Entry(textvariable=NICno,width=50)
NIC.place(x=570,y=300)
## ORDERING TABLE
NICno=Label(text="NIC NO",font=("caliber",8),bg="yellow",fg="blue").place(x=385,y=350)
name=Label(text="NAME",font=("caliber",8),bg="yellow",fg="blue").place(x=500,y=350)
age=Label(text="AGE",font=("caliber",8),bg="yellow",fg="blue").place(x=560,y=350)
dob=Label(text="D-O-B",font=("caliber",8),bg="yellow",fg="blue").place(x=600,y=350)
bgroup=Label(text="GROUP",font=("caliber",8),bg="yellow",fg="blue").place(x=650,y=350)
phone=Label(text="PHONE",font=("caliber",8),bg="yellow",fg="blue").place(x=700,y=350)
city=Label(text="CITY",font=("caliber",8),bg="yellow",fg="blue").place(x=750,y=350)
state=Label(text="STATE",font=("caliber",8),bg="yellow",fg="blue").place(x=800,y=350)
def close():
exit()
def search():
nno = NIC.get()
csv_file = csv.reader(open('DonorRegistration.csv'))
for row in csv_file:
if nno == row[0]:
label1 = Label(text=row)
canvas1.create_window(620, 400, window=label1)
#SUBMIT BUTTON HERE
submitbutton = Button(root,text="SUBMIT",width="20",font=("Arial Black",12,"bold"),fg="red",bg="black",command=search)
submitbutton.place(x=550,y=500)
#CLOSE BUTTON HERE
closebutton = Button(root,text="EXIT",width="20",font=("Arial Black",12,"bold"),fg="red",bg="black",command=close)
closebutton.place(x=550,y=550)
mainloop()