Skip to content

Commit

Permalink
with dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
miladbarooni committed Jan 21, 2020
1 parent e70cb84 commit 623456d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions Main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tkinter import Tk, Label, Button, Toplevel, StringVar, Entry, messagebox, Frame
from tkinter import Tk, Label, Button, Toplevel, StringVar, Entry, messagebox, Frame, END
from functools import partial
import tkinter as tk
from time import sleep
Expand Down Expand Up @@ -81,10 +81,10 @@ def loginVerify(self, username_login_entry, password_login_entry):
# self.db_cursor.execute("SELECT userid, password FROM USER WHERE userid=\'{}\'".format(username_login_entry.get()))

user_id = mydb.login(username_login_entry.get())

self.phone_number = username_login_entry.get()
#check whether user_id exists or not
if (len(user_id) != 0 and user_id[0][1] == password_login_entry.get()):
self.master.quit()

self.dashboardPage()
else:
messagebox.showinfo('Username/Password incorrect', 'your username of password is incorrect')
Expand Down Expand Up @@ -168,9 +168,12 @@ def profilePage(self):
self.profile = Tk()
self.profile.title("User Profile")
self.profile.geometry("700x500")
username = "Milad"
# First insert
Label(self.profile, text="Username:{}".format(username)).pack()
# Show yoru Username
Label(self.profile, text="You Username").pack()
username_entry = Entry(self.profile)
username_entry.pack()
username = "hello"
username_entry.insert(END, username)

def restaurantsPage(self):
print ("resturantsPage")
Expand Down
Binary file modified __pycache__/snapFood.cpython-37.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion snapFood.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def registerUser(self, phone_number, password, f_name = "", l_name = "", email =


def login(self, phone_number):
self._mycursor.execute("SELECT phone-number, password FROM USER WHERE phone-number=\'{}\'".format(phone_number))
self._mycursor.execute("SELECT `phone-number`, password FROM USER WHERE `phone-number`=\'{}\'".format(phone_number))
return self._mycursor.fetchall()

def updateUserProfile(self, phone_number, f_name = "", l_name = "", email = "", passwd = ""):
Expand Down

0 comments on commit 623456d

Please sign in to comment.