diff --git a/exportCSV.sql b/exportCSV.sql new file mode 100644 index 0000000..dff52f9 --- /dev/null +++ b/exportCSV.sql @@ -0,0 +1,9 @@ +/*.open registrierung.db*/ +.mode csv +.separator ';' +.header on +select id, datetime(zeitpunkt,"localtime") as zeitpunkt, gaszaehler,stromzaehler,wasserzaehler,wetterinfo + from eintraege; + +# zeitpunkt,gaszaehler,stromzaehler,wasserzaehler,wetterinfo + diff --git a/init_db.py b/init_db.py new file mode 100755 index 0000000..e15e731 --- /dev/null +++ b/init_db.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 +import sqlite3 + +connection = sqlite3.connect('vokabeln.db') + + +with open('schema.sql') as f: + connection.executescript(f.read()) + +cur = connection.cursor() + +cur.execute("INSERT INTO eintraege ( gaszaehler, stromzaehler, wasserzaehler, wetterinfo) VALUES ( ?, ?, ?, ?)", + ('', '', '127', 'kalt aber oho') + ) + +connection.commit() +connection.close() diff --git a/runServer.sh b/runServer.sh new file mode 100755 index 0000000..171d2ee --- /dev/null +++ b/runServer.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +# +# startet den Flask Server in Python +# +FLASK_APP=gastCheckIn.py FLASK_ENV=production flask run -p 5001 + diff --git a/schema.sql b/schema.sql new file mode 100644 index 0000000..060bc16 --- /dev/null +++ b/schema.sql @@ -0,0 +1,10 @@ +DROP TABLE IF EXISTS eintraege; + +CREATE TABLE eintraege ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + zeitpunkt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + gaszaehler TEXT DEFAULT "", + stromzaehler TEXT DEFAULT "", + wasserzaehler TEXT DEFAULT "", + wetterinfo TEXT DEFAULT "" +); 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..7899463 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,48 @@ + + +
+ + + + + + +