<?php /** * Created by PhpStorm. * User: montanawong * Date: 4/28/16 * Time: 20:11 */ 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; $sportsVenueUI = new Presentation\SportsVenueUI(); ?> <body> <div class="container"> <h1>All Sports Venues</h1> <?php echo $sportsVenueUI->listAll(); ?> <br/> <?php if ($_SESSION['userType'] == 1) { echo $sportsVenueUI->listCreateButton(); }
}); use edu\uga\cs\recdawgs\presentation as Presentation; use edu\uga\cs\recdawgs\entity\impl as Entity; if (!isset($_POST) || !isset($_POST['sportsVenueId'])) { $errorMsg = urlencode("Sports Venue not found."); header("Location: sportsVenues.php?status={$errorMsg}"); } ?> <body> <div class="container"> <?php $sportsVenueId = $_POST['sportsVenueId']; $sportsVenueModel = new Entity\SportsVenueImpl(); $sportsVenueModel->setId($sportsVenueId); $sportsVenueUI = new Presentation\SportsVenueUI(); echo $sportsVenueUI->listSportsVenueInfo($sportsVenueModel); echo "<h2>Leagues used in</h2>"; echo $sportsVenueUI->listLeaguesUsedIn(null, $sportsVenueId); ?> <br/><br/> <?php //if admin allow update and deletion of sports venues and assignment to league if ($_SESSION['userType'] == 1) { echo $sportsVenueUI->listAddToLeagueButton($sportsVenueId); echo "<h3>Update Sports Venue</h3><br/><form action = 'updateSportsVenue.php' method = 'post' >\n <input type = 'hidden' name = 'sportsVenueId' value = '{$sportsVenueId}'>\n <input type ='submit' value ='Update the Sports Venue'>\n</form >"; } if ($_SESSION['userType'] == 1) { /* echo "<h3>Delete Sports Venue</h3><br/><form action = 'php/doDeleteSportsVenue.php' method = 'post'> <input type = 'hidden' name = 'userId' value = '{$_SESSION['userId']}'>