Skip to content

Commit ec64778

Browse files
committed
Login Landing page Defined
1 parent fdf4595 commit ec64778

File tree

2 files changed

+33
-7
lines changed

2 files changed

+33
-7
lines changed

LoginPageGUI.py

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,52 @@
11
from tkinter import *
22
import pymongo
3+
import time
34
myclient = pymongo.MongoClient(
45
"mongodb+srv://CodingBlood:[email protected]/myFirstDatabase?retryWrites=true&w=majority")
56
mydb = myclient["Chatbox"]
67
mycol = mydb["UserDetails"]
78
def main():
89
def some():
9-
# global userid
10-
# global paswrd
1110
name = userid.get()
1211
pass_wrd = paswrd.get()
1312
myquery = {"UName": name}
1413
mydoc = mycol.find(myquery)
1514
for x in mydoc:
1615
if x["UPassword"] == pass_wrd:
1716
print("Login Successful")
18-
# Button(root1, text="Login Successful Click To Proceed", width=100, height=2, bd=5,)
17+
l1.destroy()
18+
l2.destroy()
19+
l3.destroy()
20+
l4.destroy()
21+
b1.destroy()
22+
sb1 = Button(root1, text=' Global Chat', bg=color["nero"], fg=color["orange"],
23+
font=('Malgun Gothic Semilight', 25, "bold"), width=500, height=100, bd=5, image=login,
24+
compound=LEFT,
25+
anchor="nw", command=some)
26+
# canvas1.create_text(100, 245, "Username", width=50, height=1, fg=color["orange"])
27+
sl1 = Button(root1, text=' Public Chat Groups', bg=color["nero"], fg=color["orange"],
28+
font=('Malgun Gothic Semilight', 25, "bold"), width=500, height=100, bd=5, image=login,
29+
compound=LEFT,
30+
anchor="nw", command=some)
31+
sl2 = Button(root1, text=' Private Chat Groups', bg=color["nero"], fg=color["orange"],
32+
font=('Malgun Gothic Semilight', 25, "bold"), width=500, height=100, bd=5, image=login,
33+
compound=LEFT,
34+
anchor="nw", command=some)
35+
sl3 = Button(root1, text=' New Public Group', bg=color["nero"], fg=color["orange"],
36+
font=('Malgun Gothic Semilight', 25, "bold"), width=500, height=100, bd=5, image=login,
37+
compound=LEFT,
38+
anchor="nw", command=some)
39+
sl4 = Button(root1, text=' New Private Group', bg=color["nero"], fg=color["orange"],
40+
font=('Malgun Gothic Semilight', 25, "bold"), width=500, height=100, bd=5, image=login,
41+
compound=LEFT,
42+
anchor="nw", command=some)
43+
canvas1.create_window(400, 495, anchor="nw", window=sb1)
44+
canvas1.create_window(700, 245, anchor="nw", window=sl1)
45+
canvas1.create_window(700, 370, anchor="nw", window=sl2)
46+
canvas1.create_window(100, 245, anchor="nw", window=sl3)
47+
canvas1.create_window(100, 370, anchor="nw", window=sl4)
1948
else:
2049
print("Login Failed")
21-
# Button(root1, text="Login Failed Retry...", width=100, height=2, bd=5)
2250
userid.set("")
2351
paswrd.set("")
2452
def switch():
@@ -88,16 +116,14 @@ def switch():
88116
paswrd = StringVar()
89117
brandLabel = Label(root1, text="", font="System 30", bg="gray17", fg="green")
90118
brandLabel.place(x=100, y=250)
91-
b1 = Button(root1, text=' Login', bg=color["nero"], fg=color["orange"],
119+
b1 = Button(root1, text=' Login', bg=color["nero"], fg=color["orange"],
92120
font=('Malgun Gothic Semilight', 25, "bold"), width=500, height=100, bd=5, image=login, compound=LEFT,
93121
anchor="nw", command=some)
94122
# canvas1.create_text(100, 245, "Username", width=50, height=1, fg=color["orange"])
95123
l1 = Entry(root1,font=('Malgun Gothic Semilight', 25, "bold"),bd=5, textvariable=userid)
96124
l2 = Entry(root1,font=('Malgun Gothic Semilight', 25, "bold"),bd=5, textvariable=paswrd, show='*')
97125
l3 = Label(root1, text='UserName', width=15, height=1, font=('Malgun Gothic Semilight', 25, "bold"),bd=5)
98126
l4 = Label(root1, text='Password', width=15, height=1, font=('Malgun Gothic Semilight', 25, "bold"),bd=5)
99-
# e1 = Entry(l1, bd=5)
100-
# e2 = Entry(l2, bd=5)
101127
canvas1.create_window(300, 495, anchor="nw", window=b1)
102128
canvas1.create_window(700, 245, anchor="nw", window=l1)
103129
canvas1.create_window(700, 370, anchor="nw", window=l2)
770 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)