tournaments page added

This commit is contained in:
piapassecker 2023-11-03 12:37:44 +01:00
parent 99f44c9bb2
commit 151e06299d
2 changed files with 15 additions and 33 deletions

View File

@ -31,7 +31,7 @@ class Tournaments extends Page {
} }
function index() { function index() {
$this->set('template', 'tournaments.html');
} }
function manage() function manage()
@ -189,7 +189,7 @@ class Tournaments extends Page {
return; return;
} }
//var_dump($_SESSION['user']->data['dogs']); //var_dump($_SESSION['user']->data['tournaments']);
if(!is_array($_SESSION['user']->data['tournaments']) || !in_array($tid, $_SESSION['user']->data['tournaments'])) // new t! if(!is_array($_SESSION['user']->data['tournaments']) || !in_array($tid, $_SESSION['user']->data['tournaments'])) // new t!
{ {

View File

@ -1,35 +1,17 @@
<!-- FILEPATH: /home/chris/git/dogstats/web/pages/dogs/dog.html --> <!-- FILEPATH: /home/chris/git/dogstats/web/pages/dogs/dog.html -->
<h1>Turnier Veranstaltungen</h1>
<div class="container"> <p>Hier kannst du alle Veranstaltungen einsehen.</p>
<h1>Wettkämpfe</h1> <div class="tournaments-list">
<div class="row"> <?php foreach ($tournaments as $tournament) : ?>
<div class="col-3"> <div class="d-flex card">
<div class="card"> <img src="<?= $tournament['photo'] ?>/50x50/forcesize">
<img src="<?= $dogdata['photo']?:'https://pictshare.net/1ch3e5.png' ?>/300x170/forcesize" class="card-img-top" alt="<?= escape($dogdata['name']); ?>'s profile Picture"> <div class="card-body">
<div class="card-body"> <h3><?= escape($tournament['name']); ?></h3>
<h5 class="card-title"><?= escape($dogdata['name']); ?></h5> <p><?= escape($tournament['date']); ?></p>
<p class="card-text"> <button hx-get="/tournament/edit/<?= $tournament['id'] ?>" hx-push-url="/tournament/edit/<?= $tournament['id'] ?>" hx-target="#main" >Bearbeiten</button>
<button hx-get="/tournament/delete/<?= $tournament['id'] ?>" hx-target="#main" hx-confirm="Bist du sicher, dass du <?= escape($tournament['name']); ?> löschen willst">Löschen</button>
<ul>
<li>Rasse: <?= escape($dogdata['breed'])?:'Nicht eingetragen'; ?></li>
<li>Alter: <?= date_diff(date_create($dogdata['birthday']), date_create('now'))->y ?></li>
<?php if($dogdata['kennel_name']): ?><li>Zuchtname: <?= escape($dogdata['kennel_name']); ?></li> <?php endif; ?>
<?php if($dogdata['size']): ?><li>Größe: <?= escape($dogdata['size']); ?> cm</li> <?php endif; ?>
<?php if($dogdata['agility_size']): ?><li>Agility Größe: <?= escape($dogdata['agility_size']); ?></li> <?php endif; ?>
</ul>
<div class="d-flex justify-content-end">
<button type="button" class="btn btn-secondary" hx-get="/dogs/edit/<?= $dogid; ?>" hx-target="#main">
<i class="fas fa-edit"></i>
</button>
</div>
</div>
</div> </div>
</div> </div>
<div class="col-8"> <?php endforeach; ?>
Second Column
</div>
</div>
</div> </div>