diff --git a/.gitignore b/.gitignore index 00a4441..4bf2d16 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ app.cpython-310.pyc energiemon.db +gtVi.py diff --git a/app.py b/app.py index 6f12638..f155204 100644 --- a/app.py +++ b/app.py @@ -1,8 +1,38 @@ -from flask import Flask +import sqlite3 +from flask import Flask, render_template, request, url_for, flash, redirect +from werkzeug.exceptions import abort + +def get_db_connection(): + conn = sqlite3.connect('energiemon.db') + conn.row_factory = sqlite3.Row + return conn app = Flask(__name__) +app.config['SECRET_KEY'] = 'Voobaiyae*h7kigj' + +@app.route('/', methods=('GET', 'POST')) +def index(): + + + if request.method == 'POST': + gaszaehler = request.form['gaszaehler'] + stromzaehler = request.form['stromzaehler'] + wasserzaehler = request.form['wasserzaehler'] + wetter = "weteter" + conn = get_db_connection() + conn.execute("INSERT INTO eintraege ( gaszaehler, stromzaehler, wasserzaehler, wetterinfo) VALUES ( ?, ?, ?, ?)", + (gaszaehler , stromzaehler, wasserzaehler, wetter ) + ) + conn.commit() + conn.close() + flash('Vielen Dank G' + gaszaehler + ' S' + stromzaehler + ' W' + wasserzaehler,'success') + return redirect(url_for('index')) -@app.route('/') -def hello(): - return 'Hello, World!' + conn = get_db_connection() + eintraege = conn.execute('SELECT * FROM eintraege').fetchall() + conn.close() + return render_template('index.html', eintraege=eintraege ) + +if __name__ == '__main__': + app.run() \ No newline at end of file diff --git a/registrierung.db b/registrierung.db new file mode 100644 index 0000000..e69de29 diff --git a/static/CCLOGO-vect.svg b/static/CCLOGO-vect.svg new file mode 100644 index 0000000..3cc997a --- /dev/null +++ b/static/CCLOGO-vect.svg @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000..39a2659 Binary files /dev/null and b/static/favicon.ico differ diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..fb5ff3f --- /dev/null +++ b/templates/base.html @@ -0,0 +1,51 @@ + + + + + + + + + + + {% block title %} {% endblock %} + + + +
+{% with errors = get_flashed_messages(category_filter=["error"]) %} +{% if errors %} +
+ +
+{% endif %} +{% endwith %} +{% with successmsgs = get_flashed_messages(category_filter=["success"]) %} +{% if successmsgs %} +
+ +
+{% endif %} +{% endwith %} + + {% block content %} {% endblock %} +
+ + + + + + + \ No newline at end of file diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..a43aa70 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,75 @@ +{% extends 'base.html' %} + +{% block content %} +

{% block title %} EnergieMonitor {% endblock %}

+

Erfassung

+ +
+
+ App statt Zettel! +
+ Hier gibt es etwas zu erfassen.... +
+
+ Chamäleon Logo +
+ +
+
+ + +
+ + + +
+ + + +
+
+ +
+ +
+
+

Infos / Datenschutz

+

+ Diese Erfassung läuft bei uns im Serverraum.
+ Die hier aufgenommenen Daten werden vertraulich und lediglich für die Auswertung von + Verbräuchen verwendet. + + Bei Fragen zur Datenhaltung und zum Datenschutz wenden Sie sich gern
+ an: kontakt @ ChamäleonCloud +

+ + + + + + + + + + + +{% endblock %} diff --git a/templates/register.html b/templates/register.html new file mode 100644 index 0000000..60a2966 --- /dev/null +++ b/templates/register.html @@ -0,0 +1,44 @@ +{% extends 'base.html' %} + +{% block content %} +

{% block title %} Registrierung {% endblock %}

+

Registrierung

+ + +

Infos / Datenschutz

+

+ Diese Registrierung läuft lokal bei uns im Haus.
+ Die hier aufgenommenen Daten werden vertraulich und lediglich für die ggf. nötige, + hilfreiche Nachverfolgung von Infektionsketten im Zusammenhang mit der Corona-Pandemie aufgenommen, + maximal vier Wochen gesichert im Hause aufbewahrt und nur auf Anfrage an das zuständige Gesundheitsamt weitergegeben. +
+ Verpflichtende Angaben sind: +

+ Bei Fragen zur Datenhaltung und zum Datenschutz wenden Sie sich gern
+ an: [E-Mail] moin @ Gut Moorbeck +

+ +{# +

Gäste bisher:

+

+ {% for gast in guests %} + +

{{ gast['nachname'] }}

+ +
{{ gast['nachname'] }}, {{ gast['vorname'] }}, {{ gast['anschrift'] }}, {{ gast['telefonnummer']}}, {{ gast['emailadresse'] }}, {{ gast['id'] }}
+ {{ gast['zeitpunkt'] }} +
+ {% endfor %} +

+#} + +{% endblock %} \ No newline at end of file
ChamäleonCloud Website Impressum Datenschutz