event list page events added
All checks were successful
Build and push / Pulling repo on server (push) Successful in 3s

This commit is contained in:
piapassecker 2023-11-03 19:04:50 +01:00
parent 151e06299d
commit bdaa417009

View File

@ -31,7 +31,35 @@ class Tournaments extends Page {
}
function index() {
$this->set('template', 'tournaments.html');
$events = $_SESSION['user']->data['tournaments'];
$tournaments = [];
foreach($events as $key => $eventid)
{
//var_dump($dogid);
$event = new Tournament();
try{
$event->load($eventid);
}
catch(Exception $e)
{
error_log("Event $eventid not found. Deleting from user");
unset($_SESSION['user']->data['tournament'][$key]);
$_SESSION['user']->save();
continue;
}
if($event->data)
$tournaments[] = array_merge($event->data,['id'=>$eventid]);
}
if(count($_SESSION['user']->data['tournaments']) > 0)
{
$this->set('tournaments',$tournaments);
$this->set('template', 'tournaments.html');
}
}
function manage()