<?php include 'includes/header.php'; spl_autoload_register(function ($class_name) { include '/Users/montanawong/Sites/RecDawgs/src/' . str_replace('\\', '/', $class_name) . '.php'; }); use edu\uga\cs\recdawgs\presentation as Presentation; ?> <body> <div class="container"> <h1>All Leagues</h1> <?php $leagueUI = new Presentation\LeagueUI(); echo $leagueUI->listAll(); ?> <br/> <?php if ($_SESSION['userType'] == 1) { echo $leagueUI->listCreateButton(); } ?> <br/> <?php
<?php include 'includes/header.php'; spl_autoload_register(function ($class_name) { include '/Users/montanawong/Sites/RecDawgs/src/' . str_replace('\\', '/', $class_name) . '.php'; }); use edu\uga\cs\recdawgs\presentation as Presentation; if (!isset($_POST) || !isset($_POST['leagueId'])) { $errorMsg = urlencode("League not found."); header("Location: leagues.php?status={$errorMsg}"); } $leagueId = $_POST['leagueId']; $leagueUI = new Presentation\LeagueUI(); $leagueObj = $leagueUI->getLeague($leagueId); ?> <body><div class="container"> <h1><?php echo $leagueObj->getName(); ?> </h1><br/> <h2>League Info</h2> <?php echo $leagueUI->listInfo(null, $leagueId); ?> <?php if ($_SESSION['userType'] == 0) { echo "<h3>Select a team in this league to join</h3><form method='POST' action='php/doJoinTeam.php'>"; } else { if ($_SESSION['userType'] == 1) {