Advertisement
bueddl

Untitled

Sep 29th, 2013
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.79 KB | None | 0 0
  1.  
  2. /**
  3.  *
  4.  */
  5. function admin_game($gameId)
  6. {
  7.     $tpl = new Template('admin/game', 'admin/index');
  8.  
  9.     $game = Game::get2($gameId);
  10.     $tpl->assign('game', $game);
  11.  
  12.     $players = Game::getPlayers($gameId);
  13.     $tpl->assign('players', $players);
  14.  
  15.     $scores = Game::getScores($gameId);
  16.     $tpl->assign('scores', $scores);
  17.  
  18.     $tracks = Place::getTracks();
  19.     $tpl->assign('tracks', $tracks);
  20.  
  21.     $tpl->display();
  22. }
  23.  
  24. /**
  25.  *
  26.  */
  27. function admin_game_do($gameId)
  28. {
  29.     $game = Game::get($gameId);
  30.  
  31.     $game['player_count'] = (int)$_POST['player_max'];
  32.  
  33.     $game['valid_from'] = $_POST['valid_from'];
  34.  
  35.     $game['valid_to'] = $_POST['valid_to'];
  36.  
  37.     Game::save($game);
  38.  
  39.     $message = 'Spiel mit der Id ' . (int)$gameId . ' erfolgreich bearbeitet.';
  40.     Redirect::to('admin/start', array('flash_notice' => $message));
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement