Compare commits

...

2 Commits

Author SHA1 Message Date
p3t3rp1Lz
7f2f35b7de Testsystem kenntlich gemacht 2025-11-22 09:31:50 +01:00
p3t3rp1Lz
6a1d2e888a Config jetzt Environmentabhängig 2025-11-22 09:18:18 +01:00
3 changed files with 15 additions and 3 deletions

View File

@ -1,9 +1,9 @@
<?php <?php
$host = 'server'; $host = getenv('POSTGRES_HOST');
$db = 'haushaltsbuch'; $db = getenv('POSTGRES_DB');
$user = getenv('POSTGRES_APPUSER'); $user = getenv('POSTGRES_APPUSER');
$pass = getenv('POSTGRES_APPPASSWORD'); $pass = getenv('POSTGRES_APPPASSWORD');
$port = "5432"; $port = getenv('POSTGRES_PORT');
try { try {
$dsn = "pgsql:host=$host;port=$port;dbname=$db;"; $dsn = "pgsql:host=$host;port=$port;dbname=$db;";

View File

@ -1,5 +1,6 @@
<?php <?php
require_once __DIR__ . '/includes/db_connect.php'; require_once __DIR__ . '/includes/db_connect.php';
$system = getenv('POSTGRES_SYSTEM') ?? 'test';
$stmt = $pdo->query("SELECT k.id, $stmt = $pdo->query("SELECT k.id,
k.bezeichnung, k.bezeichnung,
@ -38,6 +39,11 @@
<body> <body>
<div class="header"> <div class="header">
<?php
if($system == 'test') {
echo '<h2 class="restguthaben">Testsystem</h2>';
}
?>
<h2 class="restguthaben"> <h2 class="restguthaben">
Restguthaben <?= htmlspecialchars($monat)?>: <?= htmlspecialchars($restguthaben ?? '0') ?> € Restguthaben <?= htmlspecialchars($monat)?>: <?= htmlspecialchars($restguthaben ?? '0') ?> €
</h2> </h2>

View File

@ -1,5 +1,6 @@
<?php <?php
require_once __DIR__ . '/includes/db_connect.php'; require_once __DIR__ . '/includes/db_connect.php';
$system = getenv('POSTGRES_SYSTEM') ?? 'test';
$konto_id = $_GET['id']; $konto_id = $_GET['id'];
@ -61,6 +62,11 @@
id="konto_navigationLinks"> id="konto_navigationLinks">
Neue Kontobewegung Neue Kontobewegung
</a> </a>
<?php
if($system == 'test') {
echo '<h2 class="restguthaben">Testsystem</h2>';
}
?>
<h2 class="kontoübersicht" id="h2_kontoübersicht"> <h2 class="kontoübersicht" id="h2_kontoübersicht">
<?= htmlspecialchars($konto_bezeichnung) ?>: <?= htmlspecialchars(number_format($konto_kontostand, 2, ",", ".")) ?> € <?= htmlspecialchars($konto_bezeichnung) ?>: <?= htmlspecialchars(number_format($konto_kontostand, 2, ",", ".")) ?> €
</h2> </h2>