Boersenchecker UI
All checks were successful
Deploy / deploy-staging (push) Successful in 5s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-04-23 00:01:20 +02:00
parent 2e39acbf03
commit 327f40adec
3 changed files with 526 additions and 294 deletions

View File

@@ -1,29 +1,35 @@
<?php $ownerQuery = $isAdmin ? '?owner_sub=' . urlencode((string) $ownerSub) : ''; ?>
<div class="card">
<div class="bc-module-nav">
<a class="bc-module-tab" href="/module/boersenchecker">Ueberblick</a>
<a class="bc-module-tab is-active" href="/module/boersenchecker/depotverwaltung">Depotverwaltung</a>
<a class="bc-module-tab" href="/module/boersenchecker/aktienverwaltung">Aktienverwaltung</a>
</div>
<div class="pill">Boersenchecker</div>
<h1 style="margin-top:.75rem;">Depotverwaltung</h1>
<p class="muted">
Depots, Positionen und manuelle Kursverlaeufe. Die Waehrungsumrechnung nutzt, sofern verfuegbar,
die bestehende FX-Logik des Mining-Checkers weiter.
</p>
<div class="bc-app">
<div class="bc-grid-bg">
<div class="bc-shell bc-stack">
<header class="bc-hero">
<div class="bc-hero-top">
<div class="bc-hero-copy">
<div class="bc-eyebrow">Boersenchecker Modul</div>
<h1 class="bc-title">Depotverwaltung</h1>
<p class="bc-text">Depots, Positionen und Kurs-Historien verwalten. Die Waehrungsumrechnung nutzt weiterhin die bestehende FX-Logik des Mining-Checkers.</p>
</div>
<div class="bc-hero-controls">
<a class="bc-button bc-button--ghost" href="/">Zur Startseite</a>
<a class="bc-button bc-button--secondary" href="/modules/setup/boersenchecker">Setup</a>
</div>
</div>
<?php if ($error): ?>
<div class="card" style="margin-top:1rem; border-color:#ffb4a8; background:#fff5f3; color:#7a2114;">
<?= e($error) ?>
</div>
<?php elseif ($notice): ?>
<div class="card" style="margin-top:1rem; border-color:var(--accent-2);">
<?= e($notice) ?>
</div>
<?php endif; ?>
<div class="bc-tabs">
<a class="bc-button bc-button--tab" href="/module/boersenchecker">Ueberblick</a>
<a class="bc-button bc-button--tab-active" href="/module/boersenchecker/depotverwaltung">Depotverwaltung</a>
<a class="bc-button bc-button--tab" href="/module/boersenchecker/aktienverwaltung">Aktienverwaltung</a>
</div>
</header>
<?php if ($isAdmin): ?>
<div class="card" style="margin-top:1rem; background:var(--panel-2);">
<?php if ($error): ?>
<div class="bc-alert bc-alert--error"><?= e($error) ?></div>
<?php elseif ($notice): ?>
<div class="bc-alert bc-alert--success"><?= e($notice) ?></div>
<?php endif; ?>
<?php if ($isAdmin): ?>
<div class="bc-panel">
<strong>Benutzer-Scope</strong>
<form method="get" style="margin-top:.75rem; display:flex; gap:10px; flex-wrap:wrap; align-items:end;">
<label class="setup-field muted" style="margin:0; min-width:260px;">
@@ -36,13 +42,13 @@
<?php endforeach; ?>
</select>
</label>
<button class="cta-button" type="submit">Anzeigen</button>
<button class="bc-button bc-button--primary" type="submit">Anzeigen</button>
</form>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="grid" style="margin-top:1rem;">
<div class="card" style="background:var(--panel-2);">
<div class="grid" style="margin-top:1rem;">
<div class="bc-panel">
<strong><?= $editPortfolio ? 'Depot bearbeiten' : 'Neues Depot' ?></strong>
<form method="post" style="margin-top:.75rem; display:grid; gap:10px;">
<input type="hidden" name="action" value="save_portfolio">
@@ -61,15 +67,15 @@
<textarea name="portfolio_notes" rows="3"><?= e((string) ($editPortfolio['notes'] ?? '')) ?></textarea>
</label>
<div style="display:flex; gap:10px; flex-wrap:wrap;">
<button class="cta-button" type="submit">Depot speichern</button>
<button class="bc-button bc-button--primary" type="submit">Depot speichern</button>
<?php if ($editPortfolio): ?>
<a class="nav-link" href="/module/boersenchecker/depotverwaltung<?= e($ownerQuery) ?>">Abbrechen</a>
<a class="bc-button bc-button--secondary" href="/module/boersenchecker/depotverwaltung<?= e($ownerQuery) ?>">Abbrechen</a>
<?php endif; ?>
</div>
</form>
</div>
<div class="card" style="background:var(--panel-2);">
<div class="bc-panel">
<strong>API / FX</strong>
<p class="muted" style="margin-top:.75rem;">
Die Umrechnung liest gespeicherte FX-Daten aus dem Mining-Checker. Eine Aktualisierung wird nur manuell
@@ -82,12 +88,12 @@
<form method="post">
<input type="hidden" name="action" value="refresh_fx">
<input type="hidden" name="owner_sub" value="<?= e((string) $ownerSub) ?>">
<button class="cta-button" type="submit">FX-Daten aktualisieren</button>
<button class="bc-button bc-button--primary" type="submit">FX-Daten aktualisieren</button>
</form>
<form method="post">
<input type="hidden" name="action" value="refresh_alpha_vantage_all">
<input type="hidden" name="owner_sub" value="<?= e((string) $ownerSub) ?>">
<button class="nav-link" type="submit">Alle API-Kurse abrufen</button>
<button class="bc-button bc-button--secondary" type="submit">Alle API-Kurse abrufen</button>
</form>
</div>
<div class="muted" style="margin-top:.75rem;">
@@ -102,7 +108,7 @@
</div>
</div>
<div class="card" style="margin-top:1rem; background:var(--panel-2);">
<div class="bc-panel" style="margin-top:1rem;">
<strong><?= $editPosition ? 'Position bearbeiten' : 'Neue Position' ?></strong>
<?php if ($portfolios === []): ?>
<div class="muted" style="margin-top:.75rem;">Bitte zuerst ein Depot anlegen.</div>
@@ -176,16 +182,16 @@
<textarea name="position_notes" rows="3"><?= e((string) ($editPosition['notes'] ?? '')) ?></textarea>
</label>
<div style="display:flex; gap:10px; flex-wrap:wrap;">
<button class="cta-button" type="submit">Position speichern</button>
<button class="bc-button bc-button--primary" type="submit">Position speichern</button>
<?php if ($editPosition): ?>
<a class="nav-link" href="/module/boersenchecker/depotverwaltung<?= e($ownerQuery) ?>">Abbrechen</a>
<a class="bc-button bc-button--secondary" href="/module/boersenchecker/depotverwaltung<?= e($ownerQuery) ?>">Abbrechen</a>
<?php endif; ?>
</div>
</form>
<?php endif; ?>
</div>
<div class="card" style="margin-top:1rem; background:var(--panel-2);">
<div class="bc-panel" style="margin-top:1rem;">
<strong>API-Symbol suchen</strong>
<p class="muted" style="margin-top:.75rem;">
Suche nach Firma oder Ticker ueber den Alpha-Vantage-`SYMBOL_SEARCH`-Endpoint und uebernimm einen Treffer direkt ins Positionsformular.
@@ -197,12 +203,12 @@
<span>Suchbegriff</span>
<input type="text" name="search_keywords" value="<?= e($symbolSearchKeywords) ?>" placeholder="z.B. Mercedes, AAPL, Allianz" required>
</label>
<button class="cta-button" type="submit">Suchen</button>
<button class="bc-button bc-button--primary" type="submit">Suchen</button>
</form>
<?php if ($symbolSearchResults !== []): ?>
<div style="overflow:auto; margin-top:1rem;">
<table style="width:100%; border-collapse:collapse;">
<div class="bc-table-shell" style="margin-top:1rem;">
<table class="bc-table">
<thead>
<tr style="text-align:left; border-bottom:1px solid var(--border);">
<th style="padding:8px;">Symbol</th>
@@ -224,7 +230,7 @@
<td style="padding:8px;"><?= e((string) ($result['currency'] ?? '')) ?></td>
<td style="padding:8px;"><?= e((string) ($result['match_score'] ?? '')) ?></td>
<td style="padding:8px;">
<a class="nav-link" href="/module/boersenchecker/depotverwaltung?owner_sub=<?= urlencode((string) $ownerSub) ?>&symbol_candidate=<?= urlencode((string) ($result['symbol'] ?? '')) ?>&instrument_name_candidate=<?= urlencode((string) ($result['name'] ?? '')) ?>&market_candidate=<?= urlencode((string) ($result['region'] ?? '')) ?>&quote_currency_candidate=<?= urlencode((string) ($result['currency'] ?? '')) ?>">
<a class="bc-button bc-button--secondary" href="/module/boersenchecker/depotverwaltung?owner_sub=<?= urlencode((string) $ownerSub) ?>&symbol_candidate=<?= urlencode((string) ($result['symbol'] ?? '')) ?>&instrument_name_candidate=<?= urlencode((string) ($result['name'] ?? '')) ?>&market_candidate=<?= urlencode((string) ($result['region'] ?? '')) ?>&quote_currency_candidate=<?= urlencode((string) ($result['currency'] ?? '')) ?>">
In Formular uebernehmen
</a>
</td>
@@ -236,7 +242,7 @@
<?php endif; ?>
</div>
<div class="card" style="margin-top:1rem; background:var(--panel-2);">
<div class="bc-panel" style="margin-top:1rem;">
<strong>Manuellen Kurs erfassen</strong>
<?php if ($instrumentList === []): ?>
<div class="muted" style="margin-top:.75rem;">Sobald Positionen vorhanden sind, koennen hier Kurse mit Uhrzeit gespeichert werden.</div>
@@ -274,7 +280,7 @@
</label>
</div>
<div>
<button class="cta-button" type="submit">Kurs speichern</button>
<button class="bc-button bc-button--primary" type="submit">Kurs speichern</button>
</div>
</form>
<?php endif; ?>
@@ -416,14 +422,14 @@
<?php endif; ?>
</div>
<div class="card" style="margin-top:1rem;">
<div class="bc-panel" style="margin-top:1rem;">
<strong>Kursverlauf</strong>
<?php if ($instrumentList === []): ?>
<div class="muted" style="margin-top:.75rem;">Noch keine Kursdaten vorhanden.</div>
<?php else: ?>
<?php foreach ($instrumentList as $instrumentId => $instrument): ?>
<?php $history = array_slice($quoteHistory[$instrumentId] ?? [], 0, 10); ?>
<div class="card" style="margin-top:1rem; background:var(--panel-2);">
<div class="bc-panel" style="margin-top:1rem;">
<div style="display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap;">
<div>
<strong><?= e((string) $instrument['name']) ?></strong>
@@ -431,13 +437,13 @@
<?= e((string) ($instrument['symbol'] ?: '-')) ?> · <?= e((string) ($instrument['isin'] ?: '-')) ?>
</div>
</div>
<a class="nav-link" href="/module/boersenchecker/depotverwaltung?owner_sub=<?= urlencode((string) $ownerSub) ?>&instrument_id=<?= e((string) $instrumentId) ?>">Neuen Kurs erfassen</a>
<a class="bc-button bc-button--secondary" href="/module/boersenchecker/depotverwaltung?owner_sub=<?= urlencode((string) $ownerSub) ?>&instrument_id=<?= e((string) $instrumentId) ?>">Neuen Kurs erfassen</a>
</div>
<?php if ($history === []): ?>
<div class="muted" style="margin-top:.75rem;">Noch keine historischen Kurse vorhanden.</div>
<?php else: ?>
<div style="overflow:auto; margin-top:.75rem;">
<table style="width:100%; border-collapse:collapse;">
<div class="bc-table-shell" style="margin-top:.75rem;">
<table class="bc-table">
<thead>
<tr style="text-align:left; border-bottom:1px solid var(--border);">
<th style="padding:8px;">Zeitpunkt</th>
@@ -457,7 +463,7 @@
<input type="hidden" name="action" value="delete_quote">
<input type="hidden" name="owner_sub" value="<?= e((string) $ownerSub) ?>">
<input type="hidden" name="quote_id" value="<?= e((string) $quote['id']) ?>">
<button class="nav-link" type="submit">Loeschen</button>
<button class="bc-button bc-button--secondary" type="submit">Loeschen</button>
</form>
</td>
</tr>
@@ -470,4 +476,6 @@
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>