diff --git a/README.md b/README.md index 7c2f36e..7d2d610 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,12 @@ # FSCash -Dokumentiere Ausgaben on-the-go als Webapp \ No newline at end of file +Dokumentiere Ausgaben on-the-go als Webapp +Das erste Release soll enthalten: +- mariadb setup +- apache2 setup +- Auswahl des UI frameworks +- login +- Anzeige bestehender Ausgaben des aktuellen Monats +- "+" Button zum Aufruf der Eingabemaske +- Eingabemaske für Ausgaben +- Speichern der Ausgaben in mariadb diff --git a/html/assets/css/style.css b/html/assets/css/style.css new file mode 100644 index 0000000..0de48d5 --- /dev/null +++ b/html/assets/css/style.css @@ -0,0 +1,104 @@ +/* Basis-Stile */ +body { + font-family: Arial, sans-serif; + margin: 0; + padding: 0; + background-color: #f4f4f4; +} + +/* Cookie-Hinweis */ +.cookie-notice { + position: fixed; + bottom: 0; + left: 0; + right: 0; + background: #333; + color: #fff; + padding: 10px; + text-align: center; + z-index: 1000; +} + +/* Modal */ +.modal { + display: flex; + justify-content: center; + align-items: center; + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(0,0,0,0.5); + z-index: 1001; +} +.modal-content { + background: #fff; + padding: 20px; + border-radius: 5px; + width: 90%; + max-width: 400px; +} + +/* Navigation */ +.nav { + display: flex; + justify-content: space-between; + align-items: center; + padding: 10px; + background: #333; + color: #fff; +} +.nav-list { + display: none; + list-style: none; + padding: 0; + margin: 0; +} +.nav-list li { + padding: 5px 0; +} +.hamburger { + display: block; + background: none; + border: none; + color: #fff; + font-size: 24px; + cursor: pointer; +} +.logout { + color: #fff; + text-decoration: none; +} + +/* Tabelle */ +table { + width: 100%; + border-collapse: collapse; +} +th, td { + padding: 8px; + text-align: left; + border-bottom: 1px solid #ddd; +} + +/* Button */ +.btn-new { + display: block; + background: #4CAF50; + color: white; + padding: 10px; + text-align: center; + text-decoration: none; + margin: 20px 0; +} + +/* Responsive */ +@media (min-width: 768px) { + .nav-list { + display: flex; + } + .hamburger { + display: none; + } +} diff --git a/html/assets/js/script.js b/html/assets/js/script.js new file mode 100644 index 0000000..f9409b5 --- /dev/null +++ b/html/assets/js/script.js @@ -0,0 +1,9 @@ +// Cookie-Hinweis ausblenden +document.getElementById('accept-cookies').addEventListener('click', function() { + document.getElementById('cookie-notice').style.display = 'none'; +}); + +// Hamburger-Menü +document.querySelector('.hamburger').addEventListener('click', function() { + document.querySelector('.nav-list').classList.toggle('show'); +}); diff --git a/html/config.php b/html/config.php new file mode 100644 index 0000000..edbdd43 --- /dev/null +++ b/html/config.php @@ -0,0 +1,21 @@ + PDO::ERRMODE_EXCEPTION, + PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, + PDO::ATTR_EMULATE_PREPARES => false, +]; + +try { + $pdo = new PDO($dsn, $user, $pass, $options); +} catch (\PDOException $e) { + throw new \PDOException($e->getMessage(), (int)$e->getCode()); +} +?> diff --git a/html/dashboard.php b/html/dashboard.php new file mode 100644 index 0000000..6ed2c2c --- /dev/null +++ b/html/dashboard.php @@ -0,0 +1,83 @@ +prepare("SELECT * FROM users WHERE username = ?"); + $stmt->execute([$_POST['username']]); + $user = $stmt->fetch(); + if ($user && password_verify($_POST['password'], $user['password'])) { + $_SESSION['user_id'] = $user['id']; + } else { + header('Location: index.php'); + exit; + } +} + +// Daten abrufen +$stmt = $pdo->prepare("SELECT * FROM entries WHERE user_id = ?"); +$stmt->execute([$_SESSION['user_id']]); +$entries = $stmt->fetchAll(); +?> + + +
+ + +| Datum | + +Kategorie | +Zahlweise | + +Betreff | +Betrag | +
|---|---|---|---|---|
| = htmlspecialchars($entry['date']) ?> | + += htmlspecialchars($entry['category'] ?? '') ?> | += htmlspecialchars($entry['payment_method'] ?? '') ?> | + += htmlspecialchars($entry['subject']) ?> | += htmlspecialchars($entry['amount']) ?> | +
Hier kommt der Inhalt für Menüpunkt X.
+Hier kommt der Inhalt für Menüpunkt X.
+Hier kommt der Inhalt für Menüpunkt X.
+Hier kommt der Inhalt für Menüpunkt X.
+Hier kommt der Inhalt für Menüpunkt X.
+