diff --git a/shop.py b/shop.py index e646b7f..6e5ea13 100644 --- a/shop.py +++ b/shop.py @@ -37,7 +37,6 @@ def runQuery(query): mydb = dbConnect() c = mydb.cursor() c.execute(query) - print(f'Excuting {query}') if "select" in query.lower(): ret = c.fetchall() else: @@ -63,7 +62,6 @@ def deleteRow(rowID): def getItem(rowID): query = f"UPDATE SHOPLIST set gotten = 1 where id = {rowID}" - print(query) runQuery(query) def unGetItem(rowID): @@ -82,7 +80,6 @@ def index(): return render_template("auth.html", data=data) query = readFromDB() - pprint(query) data = {"title":"Shopping List", "results":query} for device in MOBILES: if device in request.user_agent.platform: @@ -93,24 +90,20 @@ def index(): def handle_data(): if "addValue" in request.form: for x in request.form: - # print(x) if request.form[x] == '': return redirect(url_for('index')) - print(request.form) insertToDB({"item": request.form["item"], "name": session["id"]}) if "rem" in request.form: - print(request.form["rem"]) deleteRow(request.form["rem"]) if "got" in request.form: - print(request.form["got"]) getItem(request.form["got"]) if "ungot" in request.form: unGetItem(request.form["ungot"]) if "loginform" in request.form: - query = "select id, username from USERS where username = '%s' and password = md5('%s')" % (request.form["username"], request.form["password"]) + query = "select id, username from USERS where username = '%s' and password = md5('%s')" % (request.form["username"].lower(), request.form["password"]) res = runQuery(query) if len(res) != 0: diff --git a/static/css/main.css b/static/css/main.css index 74275b3..2ba0dc2 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -30,6 +30,11 @@ aside { color: azure; } +#logbtn { + left: 10em; + padding-top: 10px; +} + body { background-color: #2a2a2a; } diff --git a/templates/auth.html b/templates/auth.html index 5d4622a..528da8d 100644 --- a/templates/auth.html +++ b/templates/auth.html @@ -1,14 +1,24 @@ {% include "header.html" %}

{{ data["title"] }}

-
-
- - - + +
+ +
+ +
+
+
+ +
+ +
+
+ +
+
-