updates
This commit is contained in:
parent
50cd802d33
commit
317f0bce1a
224 changed files with 1105 additions and 27 deletions
|
|
@ -1,10 +1,21 @@
|
|||
<?php
|
||||
use App\Models\Round;
|
||||
use App\Models\Team;
|
||||
|
||||
$pageTitle = 'Spiele & Ergebnisse eintragen';
|
||||
require __DIR__ . '/../partials/header.php';
|
||||
|
||||
$failedRoundId = $failedForm ? (int)($failedForm['round_id'] ?? 0) : null;
|
||||
|
||||
$teamLogo = function ($name) {
|
||||
static $cache = [];
|
||||
if (array_key_exists($name, $cache)) {
|
||||
return $cache[$name];
|
||||
}
|
||||
$team = Team::resolve($name);
|
||||
$cache[$name] = ($team && Team::logoExists($team)) ? Team::logoUrl($team) : null;
|
||||
return $cache[$name];
|
||||
};
|
||||
?>
|
||||
|
||||
<h1>Spiele & Ergebnisse eintragen</h1>
|
||||
|
|
@ -81,12 +92,16 @@ $failedRoundId = $failedForm ? (int)($failedForm['round_id'] ?? 0) : null;
|
|||
$gameId = (int)$game['id'];
|
||||
$in = $form['games'][$gameId] ?? null;
|
||||
$field = "games[$gameId]";
|
||||
$team1Name = $in['team1'] ?? $game['team1'];
|
||||
$team2Name = $in['team2'] ?? $game['team2'];
|
||||
$l1 = $teamLogo($team1Name);
|
||||
$l2 = $teamLogo($team2Name);
|
||||
?>
|
||||
<tr>
|
||||
<td><input type="text" name="<?php echo $field; ?>[team1]" maxlength="100" required
|
||||
value="<?php echo htmlspecialchars($in['team1'] ?? $game['team1']); ?>"></td>
|
||||
<td><input type="text" name="<?php echo $field; ?>[team2]" maxlength="100" required
|
||||
value="<?php echo htmlspecialchars($in['team2'] ?? $game['team2']); ?>"></td>
|
||||
<td><span class="team-cell"><?php if ($l1): ?><img src="<?php echo htmlspecialchars($l1); ?>" alt="" class="team-logo"><?php endif; ?><input type="text" name="<?php echo $field; ?>[team1]" maxlength="100" required
|
||||
value="<?php echo htmlspecialchars($team1Name); ?>"></span></td>
|
||||
<td><span class="team-cell"><?php if ($l2): ?><img src="<?php echo htmlspecialchars($l2); ?>" alt="" class="team-logo"><?php endif; ?><input type="text" name="<?php echo $field; ?>[team2]" maxlength="100" required
|
||||
value="<?php echo htmlspecialchars($team2Name); ?>"></span></td>
|
||||
<td><input type="datetime-local" name="<?php echo $field; ?>[kickoff]" required
|
||||
value="<?php echo htmlspecialchars($in['kickoff'] ?? date('Y-m-d\TH:i', strtotime($game['kickoff']))); ?>"></td>
|
||||
<td class="score">
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ $pageTitle = 'Saisons verwalten';
|
|||
require __DIR__ . '/../partials/header.php';
|
||||
?>
|
||||
|
||||
<div class="season-centered">
|
||||
<h1>Saisons verwalten</h1>
|
||||
|
||||
<?php if (!empty($message)): ?>
|
||||
|
|
@ -125,8 +126,13 @@ require __DIR__ . '/../partials/header.php';
|
|||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.season-centered { text-align: center; }
|
||||
.season-centered form { display: inline-block; text-align: left; }
|
||||
.season-centered form h2 { text-align: center; }
|
||||
.season-centered table { margin: 1em auto 0; text-align: left; }
|
||||
/* From users.php, for consistency */
|
||||
.form-group {
|
||||
margin-bottom: 1rem;
|
||||
|
|
|
|||
|
|
@ -14,23 +14,51 @@ if (!isset($currentSeason) || !isset($ranking) || !isset($games) || !isset($allR
|
|||
?>
|
||||
|
||||
<style>
|
||||
.game-header {
|
||||
width: 100px; /* Feste Breite für die Spiele-Spalten */
|
||||
th.rotated-header,
|
||||
th.game-header {
|
||||
padding: 4px 2px;
|
||||
text-align: center;
|
||||
vertical-align: bottom;
|
||||
white-space: normal;
|
||||
}
|
||||
th.game-header {
|
||||
width: 34px;
|
||||
min-width: 34px;
|
||||
}
|
||||
table.ranking-table {
|
||||
width: auto; /* Keine feste Breite, damit die Tabelle frei wachsen kann */
|
||||
min-width: 100%;
|
||||
max-width: none; /* Default-max-width (800px) aufheben */
|
||||
}
|
||||
th.rotated-header .rotated-label,
|
||||
th.game-header .rotated-label {
|
||||
display: inline-block;
|
||||
writing-mode: vertical-rl;
|
||||
transform: rotate(180deg);
|
||||
white-space: nowrap;
|
||||
max-height: 180px;
|
||||
overflow: hidden;
|
||||
}
|
||||
th.game-header .team-logo {
|
||||
display: block;
|
||||
margin: 0 auto 6px; /* Logo ganz oben, darunter der gedrehte Name */
|
||||
}
|
||||
.result-label {
|
||||
font-weight: 700;
|
||||
text-align: left;
|
||||
}
|
||||
.tipp-points {
|
||||
width: 55px; /* Breite für den Tipp (z.B. 2:1) */
|
||||
width: 34px; /* Schmale Spalte: Tor 1 bzw. Tor 2 */
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
padding-left: 2px;
|
||||
padding-right: 2px;
|
||||
}
|
||||
.tipp-joker {
|
||||
width: 70px; /* Breite für vergrößerten Joker */
|
||||
width: 44px; /* Breite für den Joker */
|
||||
box-sizing: border-box;
|
||||
padding-left: 5px;
|
||||
padding-left: 2px;
|
||||
padding-right: 2px;
|
||||
text-align: center;
|
||||
}
|
||||
.joker-icon {
|
||||
|
|
@ -140,6 +168,7 @@ if (!isset($currentSeason) || !isset($ranking) || !isset($games) || !isset($allR
|
|||
.bd-table .bd-num { text-align: right; }
|
||||
.bd-joker { font-size: 0.85em; color: var(--muted); }
|
||||
.bd-line { display: flex; justify-content: space-between; padding: 0.15em 0; }
|
||||
.bd-line strong { white-space: nowrap; }
|
||||
.bd-line.bd-total { border-top: 2px solid var(--pitch-dark); margin-top: 0.4em; padding-top: 0.4em; font-weight: 700; }
|
||||
|
||||
@media (max-width: 700px) {
|
||||
|
|
@ -171,16 +200,26 @@ if (!isset($currentSeason) || !isset($ranking) || !isset($games) || !isset($allR
|
|||
<table class="ranking-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">Platz</th>
|
||||
<th>Name</th>
|
||||
<th class="text-center"><span class="daily-winner-icon">🏆</span></th>
|
||||
<th class="text-center">Punkte<br>(Gesamt)</th>
|
||||
<th class="text-center">Punkte<br>(Runde)</th>
|
||||
<?php foreach ($games as $game): ?>
|
||||
<th class="game-header" colspan="2">
|
||||
<?php echo htmlspecialchars($game['team1']); ?><br>
|
||||
<?php echo htmlspecialchars($game['team2']); ?><br>
|
||||
<small>(<?php echo htmlspecialchars(App\Models\Game::getResultString($game['score1'], $game['score2'], $game['kickoff'])); ?>)</small>
|
||||
<th class="rotated-header"><span class="rotated-label">Platz</span></th>
|
||||
<th class="rotated-header"><span class="rotated-label">Name</span></th>
|
||||
<th class="rotated-header"><span class="rotated-label">Tagessieg</span></th>
|
||||
<th class="rotated-header"><span class="rotated-label">Punkte Gesamt</span></th>
|
||||
<th class="rotated-header"><span class="rotated-label">Punkte Runde</span></th>
|
||||
<?php foreach ($games as $game):
|
||||
$t1 = $teamLogos[$game['team1_id']] ?? null;
|
||||
$t2 = $teamLogos[$game['team2_id']] ?? null;
|
||||
$matchTitle = htmlspecialchars($game['team1'] . ' : ' . $game['team2']);
|
||||
?>
|
||||
<th class="game-header" title="<?php echo $matchTitle; ?>">
|
||||
<?php if ($t1 && $t1['logo']): ?><img src="<?php echo htmlspecialchars($t1['logo']); ?>" alt="" class="team-logo"><?php endif; ?>
|
||||
<span class="rotated-label"><?php echo htmlspecialchars($game['team1']); ?></span>
|
||||
</th>
|
||||
<th class="game-header" title="<?php echo $matchTitle; ?>">
|
||||
<?php if ($t2 && $t2['logo']): ?><img src="<?php echo htmlspecialchars($t2['logo']); ?>" alt="" class="team-logo"><?php endif; ?>
|
||||
<span class="rotated-label"><?php echo htmlspecialchars($game['team2']); ?></span>
|
||||
</th>
|
||||
<th class="game-header" title="Joker">
|
||||
<span class="rotated-label">Joker</span>
|
||||
</th>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
|
|
@ -229,7 +268,10 @@ if (!isset($currentSeason) || !isset($ranking) || !isset($games) || !isset($allR
|
|||
$title = "Punkte: " . $tipp['points'];
|
||||
?>
|
||||
<td class="tipp-cell tipp-points <?php echo htmlspecialchars($td_class); ?>" title="<?php echo $title; ?>">
|
||||
<?php echo htmlspecialchars($tipp['text']); ?>
|
||||
<?php echo htmlspecialchars($tipp['score1']); ?>
|
||||
</td>
|
||||
<td class="tipp-cell tipp-points <?php echo htmlspecialchars($td_class); ?>" title="<?php echo $title; ?>">
|
||||
<?php echo htmlspecialchars($tipp['score2']); ?>
|
||||
</td>
|
||||
<td class="tipp-cell tipp-joker" title="<?php echo $title; ?>">
|
||||
<?php if ($tipp['joker']): ?>
|
||||
|
|
@ -240,6 +282,20 @@ if (!isset($currentSeason) || !isset($ranking) || !isset($games) || !isset($allR
|
|||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="result-label">Spielergebnis</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<?php foreach ($games as $game): ?>
|
||||
<td class="text-center"><?php echo ((int)$game['score1'] > -1) ? (int)$game['score1'] : ''; ?></td>
|
||||
<td class="text-center"><?php echo ((int)$game['score2'] > -1) ? (int)$game['score2'] : ''; ?></td>
|
||||
<td></td>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<p>Für diese Saison gibt es noch keine Rangliste (möglicherweise haben noch keine Spieler bezahlt).</p>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
use App\Models\Game;
|
||||
use App\Models\Tipp;
|
||||
use App\Models\Team;
|
||||
|
||||
// Stellt sicher, dass die benötigten Variablen vorhanden sind
|
||||
if (!isset($selectedRound) || !isset($roundsToShow) || !isset($users) || !isset($tipps_map)) {
|
||||
|
|
@ -10,6 +11,16 @@ if (!isset($selectedRound) || !isset($roundsToShow) || !isset($users) || !isset(
|
|||
|
||||
$pageTitle = 'Tippübersicht - ' . htmlspecialchars($selectedRound['name']);
|
||||
require __DIR__ . '/partials/header.php';
|
||||
|
||||
$teamLogo = function ($name) {
|
||||
static $cache = [];
|
||||
if (array_key_exists($name, $cache)) {
|
||||
return $cache[$name];
|
||||
}
|
||||
$team = Team::resolve($name);
|
||||
$cache[$name] = ($team && Team::logoExists($team)) ? Team::logoUrl($team) : null;
|
||||
return $cache[$name];
|
||||
};
|
||||
?>
|
||||
|
||||
<h1>Tippübersicht bis: <?php echo htmlspecialchars($selectedRound['name']); ?></h1>
|
||||
|
|
@ -27,7 +38,9 @@ require __DIR__ . '/partials/header.php';
|
|||
<th>Spieler</th>
|
||||
<?php foreach ($round['games'] as $game): ?>
|
||||
<th class="game-header">
|
||||
<?php $l1 = $teamLogo($game['team1']); if ($l1): ?><img src="<?php echo htmlspecialchars($l1); ?>" alt="" class="team-logo"><?php endif; ?>
|
||||
<?php echo htmlspecialchars($game['team1']); ?><br>
|
||||
<?php $l2 = $teamLogo($game['team2']); if ($l2): ?><img src="<?php echo htmlspecialchars($l2); ?>" alt="" class="team-logo"><?php endif; ?>
|
||||
<?php echo htmlspecialchars($game['team2']); ?><br>
|
||||
<small>(<?php echo Game::getResultString($game['score1'], $game['score2'], $game['kickoff']); ?>)</small>
|
||||
</th>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,27 @@
|
|||
<?php
|
||||
use App\Models\Team;
|
||||
|
||||
$pageTitle = 'Spieltipp';
|
||||
require __DIR__ . '/../partials/header.php';
|
||||
|
||||
$teamLogo = function ($name) {
|
||||
static $cache = [];
|
||||
if (array_key_exists($name, $cache)) {
|
||||
return $cache[$name];
|
||||
}
|
||||
$team = Team::resolve($name);
|
||||
$cache[$name] = ($team && Team::logoExists($team)) ? Team::logoUrl($team) : null;
|
||||
return $cache[$name];
|
||||
};
|
||||
?>
|
||||
|
||||
<h1>Spieltipp:</h1>
|
||||
|
||||
<p><strong><?php echo htmlspecialchars($game['team1'] . ' : ' . $game['team2']); ?></strong></p>
|
||||
<p><strong>
|
||||
<span class="team-cell"><?php $l1 = $teamLogo($game['team1']); if ($l1): ?><img src="<?php echo htmlspecialchars($l1); ?>" alt="" class="team-logo"><?php endif; ?><?php echo htmlspecialchars($game['team1']); ?></span>
|
||||
:
|
||||
<span class="team-cell"><?php $l2 = $teamLogo($game['team2']); if ($l2): ?><img src="<?php echo htmlspecialchars($l2); ?>" alt="" class="team-logo"><?php endif; ?><?php echo htmlspecialchars($game['team2']); ?></span>
|
||||
</strong></p>
|
||||
|
||||
<?php if ($error): ?>
|
||||
<p style="color: red;"><?php echo htmlspecialchars($error); ?></p>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,19 @@
|
|||
<?php
|
||||
use App\Models\Tipp;
|
||||
use App\Models\Team;
|
||||
|
||||
$pageTitle = 'Tipps';
|
||||
require __DIR__ . '/../partials/header.php';
|
||||
|
||||
$teamLogo = function ($name) {
|
||||
static $cache = [];
|
||||
if (array_key_exists($name, $cache)) {
|
||||
return $cache[$name];
|
||||
}
|
||||
$team = Team::resolve($name);
|
||||
$cache[$name] = ($team && Team::logoExists($team)) ? Team::logoUrl($team) : null;
|
||||
return $cache[$name];
|
||||
};
|
||||
?>
|
||||
|
||||
<p>Aktive Saison: <?php echo htmlspecialchars($activeSeason['name']); ?></p>
|
||||
|
|
@ -37,7 +48,11 @@ require __DIR__ . '/../partials/header.php';
|
|||
$tippText = $tipp1 > -1 ? $tipp1 . ' : ' . $tipp2 : null;
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($game['team1'] . ' : ' . $game['team2']); ?></td>
|
||||
<td>
|
||||
<span class="team-cell"><?php $l1 = $teamLogo($game['team1']); if ($l1): ?><img src="<?php echo htmlspecialchars($l1); ?>" alt="" class="team-logo"><?php endif; ?><?php echo htmlspecialchars($game['team1']); ?></span>
|
||||
:
|
||||
<span class="team-cell"><?php $l2 = $teamLogo($game['team2']); if ($l2): ?><img src="<?php echo htmlspecialchars($l2); ?>" alt="" class="team-logo"><?php endif; ?><?php echo htmlspecialchars($game['team2']); ?></span>
|
||||
</td>
|
||||
<td><?php echo date('d.m.Y H:i', strtotime($game['kickoff'])); ?></td>
|
||||
<td><?php echo (int)$game['score1'] > -1 ? (int)$game['score1'] . ' : ' . (int)$game['score2'] : ''; ?></td>
|
||||
<td>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,18 @@
|
|||
<?php
|
||||
use App\Models\Team;
|
||||
|
||||
$pageTitle = 'Runde tippen';
|
||||
require __DIR__ . '/../partials/header.php';
|
||||
|
||||
$teamLogo = function ($name) {
|
||||
static $cache = [];
|
||||
if (array_key_exists($name, $cache)) {
|
||||
return $cache[$name];
|
||||
}
|
||||
$team = Team::resolve($name);
|
||||
$cache[$name] = ($team && Team::logoExists($team)) ? Team::logoUrl($team) : null;
|
||||
return $cache[$name];
|
||||
};
|
||||
?>
|
||||
|
||||
<h2><?php echo htmlspecialchars($round['name']); ?></h2>
|
||||
|
|
@ -19,9 +31,9 @@ require __DIR__ . '/../partials/header.php';
|
|||
$gameId = (int)$game['id'];
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($game['team1']); ?></td>
|
||||
<td><span class="team-cell"><?php $l1 = $teamLogo($game['team1']); if ($l1): ?><img src="<?php echo htmlspecialchars($l1); ?>" alt="" class="team-logo"><?php endif; ?><?php echo htmlspecialchars($game['team1']); ?></span></td>
|
||||
<td>:</td>
|
||||
<td><?php echo htmlspecialchars($game['team2']); ?></td>
|
||||
<td><span class="team-cell"><?php $l2 = $teamLogo($game['team2']); if ($l2): ?><img src="<?php echo htmlspecialchars($l2); ?>" alt="" class="team-logo"><?php endif; ?><?php echo htmlspecialchars($game['team2']); ?></span></td>
|
||||
<td class="score">
|
||||
<input type="number" min="0" max="99" name="scores[<?php echo $gameId; ?>][score1]" required
|
||||
value="<?php echo htmlspecialchars((string)($formScores[$gameId]['score1'] ?? '')); ?>">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue