138 lines
5.1 KiB
PHP
138 lines
5.1 KiB
PHP
<?php
|
|
use App\Models\Round;
|
|
|
|
$pageTitle = 'Hoschis Tippspiel - Startseite';
|
|
$bodyClass = 'home-page';
|
|
require __DIR__ . '/partials/header.php';
|
|
?>
|
|
|
|
<?php if (!empty($profileWarnings)): ?>
|
|
<div class="lock-warning profile-warning" role="status">
|
|
<?php if (!empty($profileWarnings['missing_payment'])): ?>
|
|
<p>Fehlende Zahlungsmöglichkeit (IBAN oder PayPal)</p>
|
|
<?php endif; ?>
|
|
<?php if (!empty($profileWarnings['missing_mobile'])): ?>
|
|
<p>Fehlende Handynummer</p>
|
|
<?php endif; ?>
|
|
<p>
|
|
<a class="lock-warning-link" href="/index.php?page=settings">Daten ergänzen</a>
|
|
</p>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?php if (!empty($tippableRound) && empty($lockWarning)): ?>
|
|
<?php $tippableLock = Round::getLockTime($tippableRound['games']); ?>
|
|
<div class="home-tipp-cta">
|
|
<p><strong><?php echo htmlspecialchars($tippableRound['name']); ?></strong></p>
|
|
<?php if ($tippableLock): ?>
|
|
<p>Abgabe bis <?php echo $tippableLock->format('d.m.Y H:i'); ?> Uhr</p>
|
|
<?php endif; ?>
|
|
<p>
|
|
<a class="home-tipp-link" href="/index.php?page=tipp_round&id=<?php echo (int)$tippableRound['id']; ?>">Jetzt tippen</a>
|
|
</p>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?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; ?>
|
|
<?php if ($lockWarning['missing_email']): ?>
|
|
<p>Fehlende E-Mail-Adresse</p>
|
|
<?php endif; ?>
|
|
<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>
|
|
<p>
|
|
<a class="lock-warning-link" href="/index.php?page=tipp_round&id=<?php echo (int)$lockWarning['round_id']; ?>">Jetzt tippen</a>
|
|
</p>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<h1>Willkommen bei Hoschis Tippspiel</h1>
|
|
|
|
<?php if (!empty($message)): ?>
|
|
<div class="announcement"><?php echo nl2br(htmlspecialchars($message)); ?></div>
|
|
<?php endif; ?>
|
|
|
|
<h2>Abgeschlossene Runden:</h2>
|
|
<?php if ($currentSeason): ?>
|
|
<p>Saison: <strong><?php echo htmlspecialchars($currentSeason['name']); ?></strong></p>
|
|
<?php if ($rounds): ?>
|
|
<?php foreach ($rounds as $round): ?>
|
|
<?php
|
|
$summary = $roundSummaries[$round['id']] ?? ['winnings' => [], 'notes' => []];
|
|
$winnings = $summary['winnings'];
|
|
?>
|
|
<h3><a href="/index.php?page=ranking&round_id=<?php echo htmlspecialchars($round['id']); ?>"><?php echo htmlspecialchars($round['name']); ?></a></h3>
|
|
<?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; ?>
|
|
<?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; ?>
|
|
|
|
<style>
|
|
/* Dauerhafter Einstieg in die Tippabgabe. Bewusst im HTML statt im
|
|
stylesheet, damit die Aktion auch in einer PWA mit altem CSS-Cache
|
|
sofort sichtbar ist. */
|
|
.home-tipp-cta {
|
|
max-width: 56rem;
|
|
margin: 0.8em auto 1.6em;
|
|
padding: 0.9em 1.1em;
|
|
text-align: center;
|
|
background: #eef7f0;
|
|
border: 2px solid var(--pitch);
|
|
border-left: 8px solid var(--pitch);
|
|
border-radius: 8px;
|
|
}
|
|
.home-tipp-cta p {
|
|
margin: 0.25em 0;
|
|
}
|
|
.home-tipp-cta .home-tipp-link {
|
|
display: inline-block;
|
|
margin-top: 0.35em;
|
|
padding: 0.55em 1.4em;
|
|
font-family: var(--font-display);
|
|
font-size: 1rem;
|
|
font-weight: 700;
|
|
letter-spacing: 0.05em;
|
|
text-transform: uppercase;
|
|
text-decoration: none;
|
|
color: #fff;
|
|
background: var(--pitch-dark);
|
|
border-radius: 999px;
|
|
box-shadow: 0 2px 0 rgba(11, 61, 35, 0.9);
|
|
}
|
|
.home-tipp-cta .home-tipp-link:hover {
|
|
background: var(--pitch);
|
|
color: #fff;
|
|
}
|
|
</style>
|
|
|
|
<?php require __DIR__ . '/partials/footer.php'; ?>
|