def forgot_Pin(): global User_Namedb, PIN_Confirm Narrator("if You Forgot Your PIN Code Press 1 : ") opt = input() print("*" + "---" * 15 + "*") if opt == "1": while True: Narrator("Please Enter Ur Username OR Email Address : ") username_rc = input() f = db.cursor() f.execute("SELECT * FROM `userinfo` WHERE username='******' or email='" + username_rc + "'") fd = f.fetchall() if f.rowcount > 0: for i in fd: User_Namedb = i[4] PIN_Confirm = i[5] print("*" + "---" * 15 + "*") Narrator("Your Username is : " + User_Namedb) Narrator("Your PIN Code is : " + str(PIN_Confirm)) Narrator( "Please Press (Shift+F10) To Login To Your Account Again") print("*" + "---" * 15 + "*") break else: Narrator("Sorry Your Enter UserName Not Found Try Again ") print("*" + "---" * 15 + "*") else: Narrator( "Invalid Key System is not Responding Please Press (Shift+F10) To Refresh" ) print("*" + "---" * 23 + "*")
def cash_deposit(self): Narrator("Enter Your Money Amount to Deposit in Your Account : ") Deposit_Cash = int(input()) Current_Amount = Deposit_Cash + Previous_Amount Narrator( f"\nPleasure To Inform You That {Deposit_Cash} Rupees has been Deposited Successfully in Your Account on " + x + " And Your Record will be Updated in 24 Hrs") f = db.cursor() f.execute("UPDATE `userinfo` SET current_amount='" + str(Current_Amount) + "' WHERE username='******'") f.execute("UPDATE `userinfo` SET deposit_amount='" + str(Deposit_Cash) + "' WHERE username='******'") db.commit()
def delete_account(self): print("\nDo You Really Want to Delete Your Account (Y / N) : ") while True: Key = input().upper() if Key == "Y": f = db.cursor() f.execute("DELETE FROM `userinfo` WHERE username='******'") db.commit() print("\nYour Account has been Deleted Sucessfully ") break elif Key == "N": print("\nYou Have Canceled While Deleting Your Account") break else: print("\nInvalid Key Press (Y or N) : ")
def change_pin(self): while True: old_PIN = input("Enter Your Old PIN Code : ") if old_PIN == PIN_Confirm: New_PIN = input("\nEnter Your New PIN Code : ") while True: New_PIN_Confirm = input("Enter Your New PIN Again : ") if New_PIN == New_PIN_Confirm: f = db.cursor() f.execute("UPDATE `userinfo` SET pin='" + New_PIN_Confirm + "' WHERE username='******'") db.commit() print("\nYour PIN Changed Successfully ") break else: print("\nPIN New PIN Match Enter Your PIN Again ") break else: print("\nPIN Not Match Enter Your PIN Again")
def cash_withdrawal(self): if Current_Amount < 100: Narrator( "Sorry You Cannot Withdrawal Money Because You Don't have Enough Money In Your Account " ) else: Narrator( "\nEnter Your Money Amount You Want To Withdrawal From Your Account You Have " + str(Current_Amount) + " Rupees In Your Account ") Withdrawal_Cash = int(input()) Current_Amount1 = Current_Amount - Withdrawal_Cash Narrator( f"You Have Successfully Withdrawal Amount Of {Withdrawal_Cash} Rupees From Your Account on " + x + " And Your Record will be Updated in 24 Hrs") f = db.cursor() f.execute("UPDATE `userinfo` SET current_amount='" + str(Current_Amount1) + "' WHERE username='******'") f.execute("UPDATE `userinfo` SET withdrawal_amount ='" + str(Withdrawal_Cash) + "' WHERE username='******'") db.commit()
msg = MIMEMultipart() msg["From"] = "Fawad ATM Management System" msg["To"] = Name msg["Subject"] = "Most Strongly Welcome To FATMS" msg["Bcc"] = Email msg.attach(MIMEText(message, 'html')) server = smtplib.SMTP_SSL("smtp.gmail.com", 465) server.login('*****@*****.**', 'pass') server.sendmail("*****@*****.**", Email, msg.as_string()) server.quit() print("\n" + "|" + "**" * 38 + "|") Narrator("|\t\t\t\tPlease Check Your Email Inbox For Account Details" + " " * 12 + "|") print("|" + "**" * 38 + "|") PIN_Confirm = "%546" + hashlib.md5(PIN_Confirm.encode('utf-8')).hexdigest() + "546%" f = db.cursor() f.execute("CREATE TABLE IF NOT EXISTS `userinfo` (id INT AUTO_INCREMENT PRIMARY KEY,name VARCHAR(255),father_name " "VARCHAR(255),dob VARCHAR(255),email VARCHAR(255),username VARCHAR(255),pin VARCHAR(11),previous_amount INT,deposit_amount INT,withdrawal_amount INT,current_amount INT)") f.execute("SELECT * FROM `userinfo` WHERE username= '******'") f.fetchall() if f.rowcount > 0: Narrator("\nThis User Name is Already Registered Please Login To Your Account") else: f.execute( "INSERT INTO `userinfo` (name,father_name,dob,email,username,pin,previous_amount) VALUES ('" + Name + "','" + F_Name + "','" + DOB + "','" + Email + "','" + User_Name + "','" + PIN_Confirm + "','" + str( Previous_Amount) + "')") db.commit() # welcome_message() Narrator("Congratulations!Registration has been Completed Successfully") try: send_email()