forked from Vijay-Gunwant/BankManagement-Python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForgotPassword.py
More file actions
88 lines (65 loc) · 3.3 KB
/
Copy pathForgotPassword.py
File metadata and controls
88 lines (65 loc) · 3.3 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import tkinter
from tkinter import *
from tkinter import messagebox
import mysql.connector as mysql
def changePass(AccNo,Password,Confirm):
if AccNo == "" or Password == "" or Confirm == "":
messagebox.showwarning("Empty Values","Please Enter Some Valid Values")
return
con = mysql.connect(host="localhost", user="root", password="vijay@1234", database="bank")
cursor = con.cursor()
cursor.execute("SELECT Acc,Password FROM customer")
result = cursor.fetchall()
for Acount,Pass in result:
if AccNo == str(Acount):
if Password== Confirm:
cursor.execute(f"UPDATE customer SET Password = '{Password}' where Acc = '{AccNo}'")
con.commit()
messagebox.showinfo("Password Changed", "Your Password is Changed")
else:
messagebox.showerror("Values Not Match", "Confirm Password is not as same as Password")
else:
messagebox.showerror("Security Code Error", "Please Enter Correct Account Number")
def toLogin(Forgot_Password):
Forgot_Password.destroy()
from LoginPage import Login_Create
Login_Create()
def Reset_Creator():
BackgroundColor = "#c6cdcf"
ButtonColor = "#c8dbde"
Forgot_Password = tkinter.Tk()
# Window Setting
Forgot_Password.geometry("500x500")
Forgot_Password.resizable(False, False)
Forgot_Password.title("Realities Bank - Change Password")
Forgot_Password.iconbitmap("./Images/bank.ico")
Forgot_Password.config(bg=BackgroundColor)
# Logo Of Bank
logo = PhotoImage(file="./Images/BankLogo.png")
BankLogo = Label(Forgot_Password,image=logo, bg=BackgroundColor)
BankLogo.place(x=30, y=0)
# AccNo Label
AccNoLabel = Label(Forgot_Password,text="Account Number", font="Roboto 15 bold", bg=BackgroundColor)
AccNoLabel.place(x=100, y=150)
AccNoTextField = Entry(Forgot_Password, width=25, relief=SUNKEN, font="Roboto 15 italic", bd=3)
AccNoTextField.place(x=102, y=180)
# Password Label
PasswordLabel = Label(Forgot_Password,text="Password", font="Roboto 15 bold", bg=BackgroundColor)
PasswordLabel.place(x=100, y=220)
PasswordTextField = Entry(Forgot_Password, width=25, relief=SUNKEN, font="Roboto 15 italic", bd=3, show="*")
PasswordTextField.place(x=102, y=250)
# Confirm Password Label
Confirm_PasswordLabel = Label(Forgot_Password,text="Confirm Password", font="Roboto 15 bold", bg=BackgroundColor)
Confirm_PasswordLabel.place(x=100, y=290)
Confirm_PasswordTextField = Entry(Forgot_Password, width=25, relief=SUNKEN, font="Roboto 15 italic", bd=3,
show="*")
Confirm_PasswordTextField.place(x=102, y=320)
# Submit Button
Submit = Button(Forgot_Password,text="Reset Password", font="Roboto 15 bold", bg=ButtonColor, cursor="hand2",
relief=RAISED, width=15, activebackground=ButtonColor, command=lambda:changePass(AccNoTextField.get(),PasswordTextField.get(),Confirm_PasswordTextField.get()))
Submit.place(x=145, y=370)
# Back Button
Back = Button(Forgot_Password,text="Back", font="Roboto 15 bold", cursor="hand2", relief=RAISED,
activebackground=BackgroundColor, command=lambda:toLogin(Forgot_Password), bg=ButtonColor)
Back.place(x=5, y=450)
Forgot_Password.mainloop()