tippspiel2027/tippspiel/src/Views/home.php

80 lines
3.3 KiB
PHP
Raw Normal View History

2026-10-17 17:21:33 +02:00
<?php
use App\Models\Round;
2026-10-27 09:38:05 +01:00
$pageTitle = 'Hoschis Tippspiel - Startseite';
2026-10-27 10:05:06 +01:00
$bodyClass = 'home-page';
2026-10-17 17:21:33 +02:00
require __DIR__ . '/partials/header.php';
?>
2026-10-27 09:38:05 +01:00
<?php if (!empty($lockWarning)): ?>
<div class="lock-warning" role="status">
<?php if ($lockWarning['missing_tipps']): ?>
<p>Fehlende Tipps für <?php echo htmlspecialchars($lockWarning['name']); ?></p>
<?php endif; ?>
<?php if ($lockWarning['missing_joker']): ?>
<p>Fehlender Joker für <?php echo htmlspecialchars($lockWarning['name']); ?></p>
<?php endif; ?>
2026-10-27 12:59:45 +01:00
<?php if ($lockWarning['missing_payment']): ?>
<p>Fehlende Zahlungsmöglichkeit (IBAN oder PayPal)</p>
<?php endif; ?>
<?php if ($lockWarning['missing_email']): ?>
<p>Fehlende E-Mail-Adresse</p>
<?php endif; ?>
<?php if ($lockWarning['missing_mobile']): ?>
<p>Fehlende Handynummer</p>
<?php endif; ?>
2026-10-27 09:38:05 +01:00
<p>
<?php echo htmlspecialchars($lockWarning['name']); ?> sperrt sich:
<?php echo $lockWarning['lock_time']->format('Y-m-d H:i:s'); ?>
( noch <?php echo htmlspecialchars($lockWarning['remaining']); ?> )
</p>
2026-10-27 12:59:45 +01:00
<p>
<a class="lock-warning-link" href="/index.php?page=tipp_round&amp;id=<?php echo (int)$lockWarning['round_id']; ?>">Jetzt tippen</a>
</p>
2026-10-27 09:38:05 +01:00
</div>
<?php endif; ?>
<h1>Willkommen bei Hoschis Tippspiel</h1>
2026-10-17 17:21:33 +02:00
2026-10-21 20:22:20 +02:00
<?php if (!empty($message)): ?>
<div class="announcement"><?php echo nl2br(htmlspecialchars($message)); ?></div>
<?php endif; ?>
2026-10-18 21:40:43 +02:00
<h2>Abgeschlossene Runden:</h2>
2026-10-17 17:21:33 +02:00
<?php if ($currentSeason): ?>
<p>Saison: <strong><?php echo htmlspecialchars($currentSeason['name']); ?></strong></p>
<?php if ($rounds): ?>
<?php foreach ($rounds as $round): ?>
2026-10-27 08:47:08 +01:00
<?php
$summary = $roundSummaries[$round['id']] ?? ['winnings' => [], 'notes' => []];
$winnings = $summary['winnings'];
?>
2026-10-18 21:40:43 +02:00
<h3><a href="/index.php?page=ranking&round_id=<?php echo htmlspecialchars($round['id']); ?>"><?php echo htmlspecialchars($round['name']); ?></a></h3>
2026-10-27 08:47:08 +01:00
<?php if ($winnings): ?>
<p class="round-winnings-title"><strong>Gewinne:</strong></p>
<ul class="round-winnings">
<?php foreach ($winnings as $win): ?>
<li>
<strong><?php echo htmlspecialchars($win['name']); ?></strong>:
<?php echo number_format($win['amount'], 2, ',', '.'); ?> €
<span class="win-type">(<?php echo htmlspecialchars($win['label']); ?>)</span>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php foreach ($summary['notes'] as $note): ?>
<p class="round-note"><?php echo htmlspecialchars($note); ?></p>
<?php endforeach; ?>
2026-10-17 17:21:33 +02:00
<?php if (!empty($round['report'])): ?>
<p><?php echo nl2br(htmlspecialchars(Round::reportToText($round['report']))); ?></p>
<?php endif; ?>
<?php endforeach; ?>
<?php else: ?>
<p>Noch keine abgeschlossenen Runden in der aktuellen Saison.</p>
<?php endif; ?>
<?php else: ?>
<p>Keine Saison gefunden.</p>
<?php endif; ?>
<?php require __DIR__ . '/partials/footer.php'; ?>