event list page events added
All checks were successful
Build and push / Pulling repo on server (push) Successful in 3s
All checks were successful
Build and push / Pulling repo on server (push) Successful in 3s
This commit is contained in:
parent
151e06299d
commit
bdaa417009
@ -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()
|
||||
|
Reference in New Issue
Block a user