erwre
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
<div class="card bc-hero" data-bc-home data-chart-endpoint="<?= e($chartEndpoint) ?>">
|
||||
<div class="bc-module-nav">
|
||||
<a class="bc-module-tab is-active" href="/module/boersenchecker">Startseite</a>
|
||||
<a class="bc-module-tab" href="/module/boersenchecker/depotverwaltung">Depotverwaltung</a>
|
||||
<a class="bc-module-tab" href="/module/boersenchecker/aktienverwaltung">Aktienverwaltung</a>
|
||||
</div>
|
||||
<script type="application/json" data-bc-instruments-json><?= json_encode(array_map(static function (array $position): array {
|
||||
return [
|
||||
'instrument_id' => (int) ($position['instrument_id'] ?? 0),
|
||||
@@ -18,23 +23,7 @@
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="bc-toolbar" style="margin-top:1rem;">
|
||||
<?php if ($isAdmin): ?>
|
||||
<form class="bc-surface" method="get">
|
||||
<strong>Benutzer</strong>
|
||||
<label class="setup-field muted" style="margin-top:.75rem;">
|
||||
<span>Scope</span>
|
||||
<select name="owner_sub">
|
||||
<?php foreach ($availableOwners as $owner): ?>
|
||||
<option value="<?= e((string) $owner['sub']) ?>" <?= (string) $ownerSub === (string) $owner['sub'] ? 'selected' : '' ?>><?= e((string) $owner['label']) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</label>
|
||||
<button class="cta-button" type="submit">Anzeigen</button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
|
||||
<form class="bc-surface" method="get">
|
||||
<?php if ($isAdmin): ?><input type="hidden" name="owner_sub" value="<?= e((string) $ownerSub) ?>"><?php endif; ?>
|
||||
<strong>Depot</strong>
|
||||
<?php if ($portfolios === []): ?>
|
||||
<div class="muted" style="margin-top:.75rem;">Keine Depots vorhanden.</div>
|
||||
@@ -53,7 +42,6 @@
|
||||
</form>
|
||||
|
||||
<form class="bc-surface" method="get">
|
||||
<?php if ($isAdmin): ?><input type="hidden" name="owner_sub" value="<?= e((string) $ownerSub) ?>"><?php endif; ?>
|
||||
<input type="hidden" name="portfolio_id" value="<?= e((string) $selectedPortfolioId) ?>">
|
||||
<strong>Aktie</strong>
|
||||
<?php if ($positions === []): ?>
|
||||
@@ -75,15 +63,55 @@
|
||||
<form class="bc-surface" method="post">
|
||||
<input type="hidden" name="action" value="refresh_current_quotes_home">
|
||||
<input type="hidden" name="portfolio_id" value="<?= e((string) $selectedPortfolioId) ?>">
|
||||
<input type="hidden" name="owner_sub" value="<?= e((string) $ownerSub) ?>">
|
||||
<strong>Aktuelle Kurse</strong>
|
||||
<p class="muted" style="margin:.75rem 0 1rem;">Abruf der aktuellen Kurse fuer das gewaehlte Depot.</p>
|
||||
<button class="cta-button" type="submit" <?= $selectedPortfolioId > 0 ? '' : 'disabled' ?>>Aktuelle Kurse abrufen</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="bc-overview-grid" style="margin-top:1rem;">
|
||||
<div class="bc-stat">
|
||||
<div class="muted">Positionen</div>
|
||||
<div class="bc-stat-value"><?= e((string) ($summary['positions'] ?? 0)) ?></div>
|
||||
<div class="muted" style="margin-top:6px;">Aktien im aktuell gewaehlten Depot</div>
|
||||
</div>
|
||||
<div class="bc-stat">
|
||||
<div class="muted">Investiert</div>
|
||||
<div class="bc-stat-value"><?= isset($summary['invested']) && $summary['invested'] !== null ? e(number_format((float) $summary['invested'], 2, ',', '.')) . ' ' . e($defaultReportCurrency) : 'n/a' ?></div>
|
||||
<div class="muted" style="margin-top:6px;">Auf Berichtswahrung umgerechnet</div>
|
||||
</div>
|
||||
<div class="bc-stat">
|
||||
<div class="muted">Aktueller Wert</div>
|
||||
<div class="bc-stat-value"><?= isset($summary['current']) && $summary['current'] !== null ? e(number_format((float) $summary['current'], 2, ',', '.')) . ' ' . e($defaultReportCurrency) : 'n/a' ?></div>
|
||||
<div class="muted" style="margin-top:6px;">Basierend auf letztem verfuegbarem Kurs</div>
|
||||
</div>
|
||||
<div class="bc-stat">
|
||||
<div class="muted">Performance</div>
|
||||
<div class="bc-stat-value"><?= isset($summary['gain']) && $summary['gain'] !== null ? e(number_format((float) $summary['gain'], 2, ',', '.')) . ' ' . e($defaultReportCurrency) : 'n/a' ?></div>
|
||||
<div class="muted" style="margin-top:6px;"><?= !empty($summary['best']['instrument_name']) ? 'Top: ' . e((string) $summary['best']['instrument_name']) : 'Noch keine Vergleichsdaten' ?></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bc-card-grid" style="margin-top:1rem;">
|
||||
<?php foreach (array_slice($positions, 0, 4) as $position): ?>
|
||||
<div class="bc-surface">
|
||||
<div class="muted">Bester Wert</div>
|
||||
<?php if (!empty($summary['best'])): ?>
|
||||
<div class="bc-stat-value"><?= e((string) $summary['best']['instrument_name']) ?></div>
|
||||
<div class="bc-pill-soft" style="margin-top:.75rem;"><?= e(number_format((float) ($summary['best']['gain_percent'] ?? 0), 2, ',', '.')) ?>%</div>
|
||||
<?php else: ?>
|
||||
<div class="muted" style="margin-top:.75rem;">Noch keine Performance verfuegbar.</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="bc-surface">
|
||||
<div class="muted">Schwaechster Wert</div>
|
||||
<?php if (!empty($summary['worst'])): ?>
|
||||
<div class="bc-stat-value"><?= e((string) $summary['worst']['instrument_name']) ?></div>
|
||||
<div class="bc-pill-soft" style="margin-top:.75rem;"><?= e(number_format((float) ($summary['worst']['gain_percent'] ?? 0), 2, ',', '.')) ?>%</div>
|
||||
<?php else: ?>
|
||||
<div class="muted" style="margin-top:.75rem;">Noch keine Performance verfuegbar.</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php foreach (array_slice($positions, 0, 2) as $position): ?>
|
||||
<div class="bc-stat">
|
||||
<div class="muted"><?= e((string) $position['instrument_name']) ?></div>
|
||||
<div class="bc-stat-value"><?= $position['latest_price'] !== null ? e(number_format((float) $position['latest_price'], 2, ',', '.')) . ' ' . e((string) $position['latest_currency']) : 'n/a' ?></div>
|
||||
@@ -122,10 +150,14 @@
|
||||
<?php else: ?>
|
||||
<div class="bc-position-list" style="margin-top:1rem;">
|
||||
<?php foreach ($positions as $position): ?>
|
||||
<?php $gainClass = (($position['gain_report'] ?? 0) >= 0) ? 'is-positive' : 'is-negative'; ?>
|
||||
<div class="bc-position-row">
|
||||
<div>
|
||||
<strong><?= e((string) $position['instrument_name']) ?></strong>
|
||||
<div class="muted"><?= e((string) ($position['symbol'] ?? '')) ?> · <?= e((string) ($position['isin'] ?? '-')) ?></div>
|
||||
<?php if (!empty($position['market'])): ?>
|
||||
<div class="bc-pill-soft" style="margin-top:.55rem;"><?= e((string) $position['market']) ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div>
|
||||
<div class="muted">Stueckzahl</div>
|
||||
@@ -139,6 +171,12 @@
|
||||
<div class="muted">Letzter Kurs</div>
|
||||
<div><?= $position['latest_price'] !== null ? e(number_format((float) $position['latest_price'], 2, ',', '.')) . ' ' . e((string) $position['latest_currency']) : 'n/a' ?></div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="muted">Performance</div>
|
||||
<div class="bc-performance <?= e($gainClass) ?>">
|
||||
<?= isset($position['gain_report']) && $position['gain_report'] !== null ? e(number_format((float) $position['gain_report'], 2, ',', '.')) . ' ' . e($defaultReportCurrency) : 'n/a' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user