-
Notifications
You must be signed in to change notification settings - Fork 0
/
Adminlogin.py
61 lines (46 loc) · 1.86 KB
/
Adminlogin.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
from tkinter import *
import os
import csv
from tkinter import messagebox
# DECLARING TKINTER
root = Tk()
root.title("Admin Login")
#CREATING CANVSAS
canvas1 = Canvas(root,width=1500,height = 1500,background="orange")
canvas1.pack()
#EXITING FUNCTION
def exitprgrm():
exit()
#CALLING FILES
def callingdonorpage():
os.system("python DonorDetails.py")
def callingrequstorpage():
os.system("python RequestorDetails.py")
### user login criteria
def login():
user_name = unameinput.get()
pwd_name = pwdinput.get()
if (user_name == "Muhammad Ghufran"):
if (pwd_name == "Ep1749065"):
donordeatils = Button(root, text="DONOR\nDETAILS", width="20", font=("Arial Black", 12, "bold"), fg="red", bg="yellow", command=callingdonorpage)
donordeatils.place(x=400, y=400)
requestordetails = Button(root, text="REQST\nDETAILS", width="20", font=("Arial Black", 12, "bold"), fg="red", bg="yellow", command=callingrequstorpage)
requestordetails.place(x=650, y=400)
else:
messagebox.showerror("Error", "Invalid Password")
else:
messagebox.showerror("Error","Invalid Username")
#USER NAME DECLARATION
uname = Label(text= "User Name",font=("Arial Black",8),width="21",bg="blue",fg="white").place(x=400,y=180)
unameinput = Entry(textvariable=uname,width=35)
unameinput.place(x=600,y=180)
#PASSWORD DECLARATION
pwd = Label(text= "Password",font=("Arial Black",8),width="21",bg="blue",fg="white").place(x=400,y=220)
pwdinput= Entry(textvariable=pwd,width=35)
pwdinput.place(x=600,y=220)
#CREATING SUBMIT BUTTON
button1= Button(text="OK",width="16",font=("Arial Black",12,"bold"),fg="red",bg="white",command=login)
button1.place(x=550,y=280)
#CREATING EXITING BUTTON
button2 =Button(text="Cancel",width="16",font=("Arial Black",12,"bold"),fg="white",bg="red",command=exitprgrm).place(x=550,y=330)
mainloop()