diff --git a/routes.py b/routes.py index c8c3fec..1ab3671 100644 --- a/routes.py +++ b/routes.py @@ -19,6 +19,35 @@ logged_in_users = [] def dashboard(): return render_template("pages/dashboard.html") +@glob.app.route("/bills") +@flask_login.login_required +def bills(): + conn = glob.get_sql_connection() + cur = conn.cursor() + + cur.execute(""" + SELECT Betaletil, Regningfor, Regningsum, KID, Betalingsfrist, Betalt + FROM Regninger + WHERE BrukerID = %s + """, (flask_login.current_user.id,)) + + data = [] + for row in cur: + data.append(row) + + cur.close() + return render_template("pages/bills.html", data=data) + +@glob.app.route("/warranties") +@flask_login.login_required +def warranties(): + return "AAAA" + +@glob.app.route("/receipts") +@flask_login.login_required +def receipts(): + return "AAAA" + @glob.app.route("/login", methods = ["GET", "POST"]) def login(): if flask_login.current_user.is_authenticated: diff --git a/templates/layout/includes/side_nav.html b/templates/layout/includes/side_nav.html index 44da047..f6a3c14 100644 --- a/templates/layout/includes/side_nav.html +++ b/templates/layout/includes/side_nav.html @@ -104,52 +104,30 @@
lotsa bills
-many bills
- - - -{% endblock %} \ No newline at end of file diff --git a/templates/pages/bills.html b/templates/pages/bills.html new file mode 100644 index 0000000..5f43645 --- /dev/null +++ b/templates/pages/bills.html @@ -0,0 +1,36 @@ +{% set title = "Bills" %} + +{% extends "layout/dash.html" %} + +{% block content %} + +Payment to | +Description | +Sum | +KID | +Date Due | +Payment status | +
---|---|---|---|---|---|
{{ row[0] }} | +{{ row[1] }} | +{{ row[2] }} | +{{ row[3] }} | +{{ row[4] }} | +{{ row[5] }} | +
Tester siden!
-KVITTERINGER FOR FAEN!
- -{% endblock %} \ No newline at end of file diff --git a/templates/pages/receipts.html b/templates/pages/receipts.html new file mode 100644 index 0000000..85b6cd8 --- /dev/null +++ b/templates/pages/receipts.html @@ -0,0 +1,11 @@ +{% set title = "Dashboard" %} + +{% extends "layout/dash.html" %} + +{% block content %} + +Regninger :D
-test
-{% endblock %} \ No newline at end of file diff --git a/templates/pages/testing.html b/templates/pages/testing.html deleted file mode 100644 index 91a7ad0..0000000 --- a/templates/pages/testing.html +++ /dev/null @@ -1,8 +0,0 @@ -{% set title = "testing" %} - -{% extends "layout/bootstrap.html" %} - -{% block content %} -testing
-tester dette
-{% endblock %} \ No newline at end of file diff --git a/templates/pages/warranties.html b/templates/pages/warranties.html new file mode 100644 index 0000000..85b6cd8 --- /dev/null +++ b/templates/pages/warranties.html @@ -0,0 +1,11 @@ +{% set title = "Dashboard" %} + +{% extends "layout/dash.html" %} + +{% block content %} + +