echo '</strong></p>'; } } if ($tempo) { echo ' <ul class="links">'; if ($scuola == $result["scuola"]) { echo ' <li><a '; if (modo()) { echo 'id="iscriviti"'; } else { echo 'href="' . $dati['info']['root'] . 'corsi/' . $result["id"] . '"'; } echo ' class="btn btn-danger"><i class="fa fa-close"></i> Elimina iscrizione</a></li>'; $squadra = squadra($dati['database'], $dati['autogestione'], $dati["user"]); if ($squadra == null) { echo ' <li><a id="squad" href="' . $dati['info']['root'] . 'squadra" class="btn btn-primary">Crea squadra</a></li>'; } else { echo ' <li><a id="squad" href="' . $dati['info']['root'] . 'squadra/' . $squadra . '" class="btn btn-primary">Gestisci squadra</a></li>'; } } if (isAdminUserAutenticate()) { echo ' <li><a '; if (modo()) { echo 'id="stato"'; } else { echo 'href="' . $dati['info']['root'] . 'stato/' . $result["id"] . '"';
} })->via('GET', 'POST'); $app->get('/delete/:id', function ($id) use($dati, $app) { $app->render('squadra.php', array('dati' => $dati, 'id' => $id, 'delete' => '')); }); $app->get('/delete/yes/:id', function ($id) use($dati, $app) { $app->render('squadra.php', array('dati' => $dati, 'id' => $id, 'delete' => 'yes')); $app->redirect($app->urlFor('corsi')); }); $app->get('/aggiungi/:id/:add', function ($id, $add) use($dati, $app) { $app->render('squadra.php', array('dati' => $dati, 'gioca' => $id, 'add' => $add)); $app->redirect($app->urlFor('index') . 'giocatori/' . squadra($dati['database'], $dati['autogestione'], $dati['user'])); }); $app->get('/rimuovi/:id/:remove', function ($id, $remove) use($dati, $app) { $app->render('squadra.php', array('dati' => $dati, 'gioca' => $id, 'remove' => $remove)); $app->redirect($app->urlFor('index') . 'giocatori/' . squadra($dati['database'], $dati['autogestione'], $dati['user'])); }); /* Proposte */ $app->get('/proposte', function () use($dati, $app) { $app->render('proposte.php', array('dati' => $dati)); })->name('proposte'); $app->get('/:autogestione/proposte', function ($autogestione) use($dati, $app) { $app->render('proposte.php', array('dati' => $dati, 'autogestione' => $autogestione)); }); $app->get('/proposte/:id', function ($id) use($dati, $app) { $app->render('proposte.php', array('dati' => $dati, 'id' => $id)); if (!isset($_GET['ajax'])) { $app->redirect($app->urlFor('proposte')); } }); $app->map('/proposta', function () use($dati, $app) {
$response = $this->renderer->render($response, 'squadra.php', array('dati' => $dati, 'id' => $args['id'], 'delete' => '')); return $response; }); $app->get('/delete/yes/:id', function ($request, $response, $args) use($dati) { $response = $this->renderer->render($response, 'squadra.php', array('dati' => $dati, 'id' => $args['id'], 'delete' => 'yes')); $response = $response->withStatus(301)->withHeader('Location', $this->router->pathFor('corsi')); return $response; }); $app->get('/aggiungi/:id/:add', function ($request, $response, $args) use($dati) { $response = $this->renderer->render($response, 'squadra.php', array('dati' => $dati, 'gioca' => $args['id'], 'add' => $args['add'])); $response = $response->withStatus(301)->withHeader('Location', $this->router->pathFor('index') . 'giocatori/' . squadra($dati['database'], $dati['user'])); return $response; }); $app->get('/rimuovi/:id/:remove', function ($request, $response, $args) use($dati) { $response = $this->renderer->render($response, 'squadra.php', array('dati' => $dati, 'gioca' => $args['id'], 'remove' => $remove)); $response = $response->withStatus(301)->withHeader('Location', $this->router->pathFor('index') . 'giocatori/' . squadra($dati['database'], $dati['user'])); return $response; }); /* Proposte */ $app->get('/proposte', function ($request, $response, $args) use($dati) { $response = $this->renderer->render($response, 'proposte.php', array('dati' => $dati)); })->setName('proposte'); $app->get('/proposte/:id', function ($request, $response, $args) use($dati) { $response = $this->renderer->render($response, 'proposte.php', array('dati' => $dati, 'id' => $args['id'])); if (!isset($_GET['ajax'])) { $response = $response->withStatus(301)->withHeader('Location', $this->router->pathFor('proposte')); } return $response; }); $app->map(['GET', 'POST'], '/proposta', function ($request, $response, $args) use($dati) { $response = $this->renderer->render($response, 'proposte.php', array('dati' => $dati, 'new' => true));