Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions .idea/CNA340_FinalProject.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

93 changes: 93 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

120 changes: 54 additions & 66 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added SOW_Final_Project Complete.pdf
Binary file not shown.
20 changes: 10 additions & 10 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ def root():
logged_in, first_name, no_of_items = get_login_details()
with sqlite3.connect('database.db') as conn:
cur = conn.cursor()
# Show last product added
#Show last product added
cur.execute('SELECT productId, name, price, description, image, stock FROM products ORDER BY productId DESC LIMIT 1 ')
# Show all items
#cur.execute('SELECT productId, name, price, description, image, stock FROM products LIMIT 1')
#Show all items
cur.execute('SELECT productId, name, price, description, image, stock FROM products LIMIT 3')
item_data = cur.fetchall()
# Show an error instead of the categories
category_data = [(-1,"Error")]
#Show an error instead of the categories
category_data = [(-1, "Error")]
# Show all categories
#cur.execute('SELECT categoryId, name FROM categories')
#category_data = cur.fetchall()
cur.execute('SELECT categoryId, name FROM categories')
category_data = cur.fetchall()
item_data = parse(item_data)
return render_template('home.html', itemData=item_data, loggedIn=logged_in, firstName=first_name, noOfItems=no_of_items, categoryData=category_data)

Expand Down Expand Up @@ -176,10 +176,10 @@ def update_profile():
@app.route("/loginForm")
def login_form():
# Uncomment to enable logging in and registration
#if 'email' in session:
if 'email' in session:
return redirect(url_for('root'))
#else:
# return render_template('login.html', error='')
else:
return render_template('login.html', error='')

@app.route("/login", methods = ['POST', 'GET'])
def login():
Expand Down