public static function showAll() { // SHow a table of submission objects with links if (array_key_exists('headertitle', $_SESSION)) { MasterView::showHeader(); MasterView::showNavbar(); } $submissions = array_key_exists('submissions', $_SESSION) ? $_SESSION['submissions'] : array(); $base = array_key_exists('base', $_SESSION) ? $_SESSION['base'] : ""; echo "<h1>ClassBash submission list</h1>"; echo "<table>"; echo "<thead>"; echo "<tr><th>Submitter</th><th>Assignment number</th>\r\n\t <th>Download</th><th>Show summary</th><th>Update</th><th>Review link</th></tr>"; echo "</thead>"; echo "<tbody>"; foreach ($submissions as $submission) { echo '<tr><td>' . $submission->getSubmitterName() . '</td>'; echo '<td>' . $submission->getAssignmentNumber() . '</td>'; echo '<td><a href="/' . $base . '/submission/download/' . $submission->getSubmissionId() . '">Download</a></td>'; echo '<td><a href="/' . $base . '/submission/show/' . $submission->getSubmissionId() . '">Show</a></td>'; echo '<td><a href="/' . $base . '/submission/update/' . $submission->getSubmissionId() . '">Update</a></td>'; echo '<td><a href="/' . $base . '/review/new/' . $submission->getSubmissionId() . '">Submit review</a></td></tr>'; } echo "</tbody>"; echo "</table>"; if (array_key_exists('footertitle', $_SESSION)) { MasterView::showFooter(); } }
public static function showAll() { // SHow a table of submission objects with links if (array_key_exists('headertitle', $_SESSION)) { MasterView::showHeader(); MasterView::showNavbar(); } $reviews = array_key_exists('reviews', $_SESSION) ? $_SESSION['reviews'] : array(); $base = array_key_exists('base', $_SESSION) ? $_SESSION['base'] : ""; echo "<h1>ClassBash review list</h1>"; echo "<table>"; echo "<thead>"; echo "<tr><th>Review Id</th><th>Submission Id</th>\r\n\t\t\t <th>Reviewer name</th> <th>Review score</th>\r\n\t\t\t <th>Show review</td> <th> Update review</th></tr>"; echo "</thead>"; echo "<tbody>"; foreach ($reviews as $review) { echo '<tr>'; echo '<td>' . $review->getReviewId() . '</td>'; echo '<td><a href="/' . $base . '/submission/show/' . $review->getSubmissionId() . '">Submission ' . $review->getSubmissionId() . '</a></td>'; echo '<td>' . $review->getReviewerName() . '</td>'; echo '<td>' . $review->getScore() . '</td>'; echo '<td><a href="/' . $base . '/review/show/' . $review->getReviewId() . '">Show</a></td>'; echo '<td><a href="/' . $base . '/review/update/' . $review->getReviewId() . '">Update</a></td>'; echo '</tr>'; } echo "</tbody>"; echo "</table>"; if (array_key_exists('footertitle', $_SESSION)) { MasterView::showFooter(); } }
public static function showAll() { if (array_key_exists('headertitle', $_SESSION)) { MasterView::showHeader(); MasterView::showNavbar(); } $users = array_key_exists('users', $_SESSION) ? $_SESSION['users'] : array(); $base = array_key_exists('base', $_SESSION) ? $_SESSION['base'] : ""; echo "<h1>Fireside Heroes User List</h1>"; echo "<table>"; echo "<thead>"; echo "<tr><th>User Id</th><th>User name</th> <th>Show</th><th>Update</th></tr>"; echo "</thead>"; echo "<tbody>"; foreach ($users as $user) { echo '<tr>'; echo '<td>' . $user->getUserID() . '</td>'; echo '<td>' . $user->getUserName() . '</td>'; echo '<td><a href="/' . $base . '/user/show/' . $user->getUserID() . '">Show</a></td>'; echo '<td><a href="/' . $base . '/user/update/' . $user->getUserID() . '">Update</a></td>'; echo '</tr>'; } echo "</tbody>"; echo "</table>"; if (array_key_exists('footertitle', $_SESSION)) { MasterView::showFooter(); } }
public static function show() { $_SESSION['headertitle'] = "Fireside Login Form"; MasterView::showHeader(); MasterView::showNavbar(); LoginView::showDetails(); $_SESSION['footertitle'] = "<h3>The footer goes here</h3>"; MasterView::showFooter(); }
public static function show() { $_SESSION['headertitle'] = "ClassBash Home Page"; MasterView::showHeader(); MasterView::showNavbar(); HomeView::showDetails(); $_SESSION['footertitle'] = "<h3>The footer goes here</h3>"; MasterView::showFooter(); }
public static function show() { $_SESSION['headertitle'] = "Fireside Login Form"; MasterView::showHeader(); MasterView::showNavbar(); LoginView::showDetails(); $base = array_key_exists('base', $_SESSION) ? $_SESSION['base'] : ""; $_SESSION['footertitle'] = '<a href="/' . $base . '/index.php">FireSide</a></li>'; MasterView::showFooter(); }
public static function show() { $_SESSION['headertitle'] = "Fireside Heroes"; $_SESSION['styles'] = array('jumbotron.css'); MasterView::showHeader(); MasterView::showNavbar(); HomeView::showDetails(); $_SESSION['footertitle'] = "<h3>The footer goes here</h3>"; MasterView::showFooter(); MasterView::showPageEnd(); }
public static function show() { $_SESSION['headertitle'] = "h00dFliX Home Page"; $_SESSION['styles'] = array('jumbotron.css'); MasterView::showHeader(); MasterView::showNavbar(); HomeView::showDetails(); $_SESSION['footertitle'] = "<h3>Get your FliX on</h3>"; MasterView::showHomeFooter(); MasterView::showPageEnd(); }
public static function show($user) { MasterView::showHeader(); MasterView::showNavbar(); echo "<br>"; echo "<br>"; echo "<br>"; ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Login</title> </head> <body> <form action="login" method="post"> <section> <h1>Login</h1> Username <input type="text" name="userName" <?php if (!is_null($user)) { echo 'value = "' . $user->getUserName() . '"'; } ?> > <?php if (!is_null($user)) { echo $user->getError('userName'); } ?> <br><br> Password <input type="password" name="password" <?php if (!is_null($user)) { echo 'value = "' . $user->getPassword() . '"'; } ?> > <?php if (!is_null($user)) { echo $user->getError('password'); } ?> <br><br> </section> <input type="submit" name="submit"><br> </form> </body> </html> <?php }
public static function show() { $_SESSION['headertitle'] = "Fireside Heroes"; $_SESSION['styles'] = array('jumbotron.css'); MasterView::showHeader(); // echo '<script src="../ck_lab5/js/jquery.zrssfeed.min.js" type="text/javascript"></script>'; // echo '<script src="../ck_lab5/js/jquery.vticker.js" type="text/javascript"></script>'; // echo '<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">'; // echo '<link href="../ck_lab5/css/zss_ticker.css" rel="stylesheet" type="text/css" />'; MasterView::showNavbar(); HomeView::showDetails(); $_SESSION['footertitle'] = "<h3>username: box password: box</h3>"; MasterView::showFooter(); MasterView::showPageEnd(); }
public static function show($user, $userData) { MasterView::showHeader(); MasterView::showNavbar(); echo "<br>"; echo "<br>"; echo "<br>"; ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Sign-Up</title> </head> <body> <form action="signup" method="post"> <section> <h1>Account Information</h1> Username <input type="text" name="userName" <?php if (!is_null($user)) { echo 'value = "' . $user->getUserName() . '"'; } ?> tabindex="1"> <?php if (!is_null($user)) { echo $user->getError('userName'); } ?> <br><br> Password <input type="password" name="password" <?php if (!is_null($user)) { echo 'value = "' . $user->getPassword() . '"'; } ?> tabindex="2"> <?php if (!is_null($user)) { echo $user->getError('password'); } ?> <br><br> Picture <input type="file" name="picture" value="picture" <?php if (!is_null($userData)) { echo $userData->__toString(); } ?> tabindex="4"> <?php if (!is_null($user)) { echo $userData->getError('picture'); } ?> <br><br> <?php if (!is_null($user)) { echo $userData->getError('genres') . '<br>'; } ?> <fieldset> <legend>Genres of Interest</legend> Action <input type="checkbox" name="action" <?php if (!is_null($userData) && $userData->getAction()) { echo "checked"; } ?> tabindex="5"> Horror <input type="checkbox" name="horror" <?php if (!is_null($userData) && $userData->getHorror()) { echo "checked"; } ?> tabindex="6"> Comedy <input type="checkbox" name="comedy" <?php if (!is_null($userData) && $userData->getComedy()) { echo "checked"; } ?> tabindex="7"><br> Romance<input type="checkbox" name="romance" <?php if (!is_null($userData) && $userData->getRomance()) { echo "checked"; } ?> tabindex="8"> Family <input type="checkbox" name="family" <?php if (!is_null($userData) && $userData->getFamily()) { echo "checked"; } ?> tabindex="9"> Drama <input type="checkbox" name="drama" <?php if (!is_null($userData) && $userData->getDrama()) { echo "checked"; } ?> tabindex="10"> </fieldset><br> </section> <section> <h1>Personal Information</h1> First Name <input type="text" name="firstName" <?php if (!is_null($userData)) { echo 'value = "' . $userData->getFirstName() . '"'; } ?> tabindex="12"> <?php if (!is_null($user)) { echo $userData->getError('firstName'); } ?> <br><br> Last Name <input type="text" name="lastName" <?php if (!is_null($userData)) { echo 'value = "' . $userData->getLastName() . '"'; } ?> tabindex="13"> <?php if (!is_null($user)) { echo $userData->getError('lastName'); } ?> <br><br> Address <input type="text" name="address" <?php if (!is_null($userData)) { echo 'value = "' . $userData->getAddress() . '"'; } ?> tabindex="14"> <?php if (!is_null($user)) { echo $userData->getError('address'); } ?> <br><br> Neighborhood <input type="text" name="neighborhood" <?php if (!is_null($userData)) { echo 'value = "' . $userData->getNeighborhood() . '"'; } ?> tabindex="15"> <?php if (!is_null($user)) { echo $userData->getError('neighborhood'); } ?> <br><br> Date of Birth <input type="month" name="dateOfBirth" <?php if (!is_null($userData)) { echo 'value = "' . $userData->getDateOfBirth() . '"'; } ?> tabindex="16"> <?php if (!is_null($user)) { echo $userData->getError('dateOfBirth'); } ?> <br><br> <?php if (!is_null($user)) { echo $userData->getError('gender') . '<br>'; } ?> <fieldset> Male <input type="radio" name="gender" value="male" <?php if (!is_null($userData) && $userData->getGender() == "male") { echo "checked "; } ?> tabindex="19"> Female <input type="radio" name="gender" value="female" <?php if (!is_null($userData) && $userData->getGender() == "female") { echo "checked "; } ?> tabindex="20"> </fieldset><br> </section> <section> <h1>Contact Information</h1> Email <input type="text" name="email" <?php if (!is_null($userData)) { echo 'value = "' . $userData->getEmail() . '"'; } ?> tabindex="22"> <?php if (!is_null($user)) { echo $userData->getError('email'); } ?> <br><br> Phone <input type="text" name="phone" <?php if (!is_null($userData)) { echo 'value = "' . $userData->getPhone() . '"'; } ?> tabindex="23"> <?php if (!is_null($user)) { echo $userData->getError('phone'); } ?> <br><br> Facebook <input type="text" name="url" <?php if (!is_null($userData)) { echo 'value = "' . $userData->getURL() . '"'; } ?> tabindex="24"> <?php if (!is_null($user)) { echo $userData->getError('url'); } ?> <br><br> </section> <input type="submit" name="submit" tabindex="25"><br> </form> </body> </html> <?php }
public static function show($movieData) { MasterView::showHeader(); MasterView::showNavbar(); echo "<br>"; echo "<br>"; echo "<br>"; ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Add FliX</title> </head> <body> <form method="post"> <section> <h1>Add FliX</h1> Movie Title <input type="text" name="movieTitle" <?php if (!is_null($movieData)) { echo 'value = "' . $movieData->getMovieTitle() . '"'; } ?> > <?php if (!is_null($movieData)) { echo $movieData->getError('movieTitle'); } ?> <br><br> Release Date <input type="text" name="releaseDate"<?php if (!is_null($movieData)) { echo 'value = "' . $movieData->getReleaseDate() . '"'; } ?> > <?php if (!is_null($movieData)) { echo $movieData->getError('releaseDate'); } ?> <br><br> Return By <input type="text" name="returnBy" <?php if (!is_null($movieData)) { echo 'value = "' . $movieData->getReturnBy() . '"'; } ?> tabindex="16"> <?php if (!is_null($movieData)) { echo $movieData->getError('returnBy'); } ?> <br><br> </section> <input type="submit" name="submit"><br> </form> </body> </html> <?php }
public static function showUpdate() { $_SESSION['headertitle'] = "Update Tournament"; $_SESSION['styles'] = array('jumbotron.css'); MasterView::showHeader(); MasterView::showNavbar(); $tournament = array_key_exists('tournament', $_SESSION) ? $_SESSION['tournament'] : null; $base = array_key_exists('base', $_SESSION) ? $_SESSION['base'] : ""; echo '<div class="container-fluid">'; echo '<div class="row">'; echo '<div class="col-md-3 col-sm-2 col-xs-1"></div>'; echo '<div class="col-md-6 col-sm-8 col-xs-10">'; echo '<h1>' . $_SESSION['headertitle'] . '</h1>'; if (is_null($tournament)) { echo '<section>Tournament does not exist</section>'; return; } echo '<form role="form" method="post" action="/' . $base . '/tournament/update/' . $tournament->getTournamentID() . '">'; // Error at the top of the form if (!is_null($tournament) && !empty($tournament->getError('tournamentID'))) { echo '<div class="form-group">'; echo '<label><span class="label label-danger">'; echo $tournament->getError('tournamentID'); echo '</span></label></div>'; } echo '<div class="form-group">'; // Name echo '<label for="name">Tournament Name:'; echo '<span class="label label-danger">'; if (!is_null($tournament)) { echo $tournament->getError('name'); } echo '</span></label>'; echo '<input type="text" class="form-control" id = "name" name="name"'; if (!is_null($tournament)) { echo 'value = "' . $tournament->getName() . '"'; } echo 'required>'; echo '</div>'; echo '<div class="form-group">'; // Start Date echo '<label for="startDate">Start Date:'; echo '<span class="label label-danger">'; if (!is_null($tournament)) { echo $tournament->getError('startDate'); } echo '</span></label>'; echo '<input type="date" class="form-control" id = "startDate" name="startDate"'; if (!is_null($tournament)) { echo 'value = "' . $tournament->getDate() . '"'; } echo 'required>'; echo '</div>'; echo '<div class="form-group">'; // Start Time echo '<label for="startTime">Start Time:'; echo '<span class="label label-danger">'; if (!is_null($tournament)) { echo $tournament->getError('startTime'); } echo '</span></label>'; echo '<input type="time" class="form-control" id = "startTime" name="startTime"'; if (!is_null($tournament)) { echo 'value = "' . $tournament->getTime() . '"'; } echo 'required>'; echo '</div>'; echo '<div class="form-group">'; // Number Participants echo '<label for="numParticipants">Number of Participants:'; echo '<span class="label label-danger">'; if (!is_null($tournament)) { echo $tournament->getError('numParticipants'); } echo '</span></label>'; echo '<input type="number" class="form-control" id = "numParticipants" name="numParticipants"'; if (!is_null($tournament)) { echo 'value = "' . $tournament->getNumParticipants() . '"'; } echo 'required>'; echo '</div>'; echo '<button type="submit" class="btn btn-default">Submit</button>'; echo '</form>'; echo '</div>'; echo '<div class="col-md-3 col-sm-2 col-xs-1"></div>'; echo '</div>'; echo '</div>'; $_SESSION['footertitle'] = '<a href="/' . $base . '/index.php">FireSide</a></li>'; MasterView::showFooter(); }
MasterView::showHeader(); ?> <h2>It should call showFooter with an empty array</h2> <?php $_SESSION = array(); MasterView::showFooter(); ?> <h2>It should call showFooter with an actual footer</h2> <?php $_SESSION = array('footertitle' => "<h3>The footer goes here</h3>"); MasterView::showFooter(); ?> <h2>It should call showNavBar with an empty array</h2> <?php $_SESSION = array(); MasterView::showNavBar(); ?> <h2>It should call showNavbar with an actual user</h2> <?php $validTest = array("userName" => "krobbins"); $s1 = new User($validTest); $_SESSION = array('user' => $s1); MasterView::showNavbar(); ?> </body> </html>
public static function show($reviewData) { MasterView::showHeader(); MasterView::showNavbar(); echo "<br>"; echo "<br>"; echo "<br>"; ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Review</title> </head> <body> <form method="post"> <section> <h1>FliX Reviews</h1> Movie Title <input type="text" name="movieTitle" <?php if (!is_null($reviewData)) { echo 'value = "' . $reviewData->getMovieTitle() . '"'; } ?> > <?php if (!is_null($reviewData)) { echo $reviewData->getError('movieTitle'); } ?> <br><br> Reviewed By <input type="text" name="reviewedBy"<?php if (!is_null($reviewData)) { echo 'value = "' . $reviewData->getUserName() . '"'; } ?> > <?php if (!is_null($reviewData)) { echo $reviewData->getError('userName'); } ?> <br><br> Reviewed On <input type="text" name="reviewedOn" <?php if (!is_null($reviewData)) { echo 'value = "' . $reviewData->getReviewedOn() . '"'; } ?> tabindex="16"> <?php if (!is_null($reviewData)) { echo $reviewData->getError('reviewedOn'); } ?> <br><br> Review <br><br><textarea name="review" rows="10" cols="30" tabindex="21"><?php if (!is_null($reviewData)) { echo $reviewData->getReview(); } ?> </textarea><?php if (!is_null($reviewData)) { echo $reviewData->getError('review'); } ?> <br><br> </section> <input type="submit" name="submit"><br> </form> </body> </html> <?php }
public static function show() { $_SESSION['headertitle'] = "New user registration"; $_SESSION['styles'] = array('jumbotron.css'); MasterView::showHeader(); MasterView::showNavbar(); $user = array_key_exists('user', $_SESSION) ? $_SESSION['user'] : null; $base = array_key_exists('base', $_SESSION) ? $_SESSION['base'] : ""; echo '<div class="container-fluid">'; echo '<div class="row">'; echo '<div class="col-md-3 col-sm-2 hidden-xs"></div>'; echo '<div class="col-md-6 col-sm-8 col-xs-12">'; echo '<h1>' . $_SESSION['headertitle'] . '</h1>'; echo '<form role="form" action ="/' . $base . '/signup" method="Post">'; // Error at the top of the form if (!is_null($user) && !empty($user->getError('userID'))) { echo '<div class="form-group">'; echo '<label><span class="label label-danger">'; echo $user->getError('userID'); echo '</span></label></div>'; } echo '<div class="form-group">'; // First name echo '<label for="firstName">First name:'; echo '<span class="label label-danger">'; if (!is_null($user)) { echo $user->getError('firstName'); } echo '</span></label>'; echo '<input type="text" class="form-control" id = "firstName" name="firstName"'; if (!is_null($user)) { echo 'value = "' . $user->getFirstName() . '"'; } echo 'required>'; echo '</div>'; echo '<div class="form-group">'; // Last name echo '<label for="lastName">Last name:'; echo '<span class="label label-danger">'; if (!is_null($user)) { echo $user->getError('lastName'); } echo '</span></label>'; echo '<input type="text" class="form-control" id = "lastName" name="lastName"'; if (!is_null($user)) { echo 'value = "' . $user->getLastName() . '"'; } echo 'required>'; echo '</div>'; echo '<div class="form-group">'; // User name echo '<label for="userName">User name:'; echo '<span class="label label-danger">'; if (!is_null($user)) { echo $user->getError('userName'); } echo '</span></label>'; echo '<input type="text" class="form-control" id = "userName" name="userName"'; if (!is_null($user)) { echo 'value = "' . $user->getFirstName() . '"'; } echo 'required>'; echo '</div>'; echo '<div class="form-group">'; // Email echo '<label for="email">Email:'; echo '<span class="label label-danger">'; if (!is_null($user)) { echo $user->getError('email'); } echo '</span></label>'; echo '<input type="email" class="form-control" id = "email" name="email"'; if (!is_null($user)) { echo 'value = "' . $user->getEmail() . '"'; } echo 'required>'; echo '</div>'; echo '<div class="form-group">'; // PassWord echo '<label for="password">Password:'******'<span class="label label-danger">'; if (!is_null($user)) { echo $user->getError('passWord'); } echo '</span></label>'; echo '<input type="password" class="form-control" id = "passWord" name="passWord"'; echo 'required>'; echo '</div>'; // echo '<div class="form-group">'; // PassWord Retry // echo '<label for="passwordRetry">Retype password:'******'<span class="label label-danger">'; // if (!is_null($user)) // echo $user->getError('passWord'); // echo '</span></label>'; // echo '<input type="password" class="form-control" id = "passwordRetry" name="passwordRetry"'; // if (!is_null($user)) // echo 'value = "'. $user->getPasswordRetry() .'"'; // echo 'required>'; // echo '</div>'; //Gender echo 'Gender:'; echo '<div class="radio">'; echo '<label><input type="radio" name="gender" value="male">Male</label>'; echo '</div>'; echo '<div class="radio">'; echo '<label><input type="radio" name="gender" value="female">Female</label>'; echo '</div>'; if (!is_null($user)) { echo $user->getError('gender'); } echo '<div class="form-group">'; // BattleTag echo '<label for="battleTag">BattleTag:'; echo '<span class="label label-danger">'; if (!is_null($user)) { echo $user->getError('battleTag'); } echo '</span></label>'; echo '<input type="text" class="form-control" id = "battleTag" name="battleTag"'; if (!is_null($user)) { echo 'value = "' . $user->getBattleTag() . '"'; } echo 'required>'; echo '</div>'; //Highest rank echo '<div class="form-group">'; echo '<label for="rank">Highest Rank Achieved:</label>'; echo '<select class="form-control" id="rank" name="rank">'; echo '<option value="legend">Legend</option>'; echo '<option value="1">1</option>'; echo '<option value="2">2</option>'; echo '<option value="3">3</option>'; echo '<option value="4">4</option>'; echo '<option value="5">5</option>'; echo '<option value="6">6</option>'; echo '<option value="7">7</option>'; echo '<option value="8">8</option>'; echo '<option value="9">9</option>'; echo '<option value="10">10</option>'; echo '<option value="11">11</option>'; echo '<option value="12">12</option>'; echo '<option value="13">13</option>'; echo '<option value="14">14</option>'; echo '<option value="15">15</option>'; echo '<option value="16">16</option>'; echo '<option value="17">17</option>'; echo '<option value="18">18</option>'; echo '<option value="19">19</option>'; echo '<option value="20">20</option>'; echo '<option value="21">21</option>'; echo '<option value="22">22</option>'; echo '<option value="23">23</option>'; echo '<option value="24">24</option>'; echo '<option value="25">25</option>'; echo '</select>'; echo '</div>'; if (!is_null($user)) { echo $user->getError('rank'); } //FavHero echo 'Favorite Class:'; echo '<div class="checkbox">'; echo '<label><input type="checkbox" name="favHeros" value="druid" tabindex="13"> Druid</label>'; echo '</div>'; echo '<div class="checkbox">'; echo '<label><input type="checkbox" name="favHeros" value="hunter" tabindex="14"> Hunter</label>'; echo '</div>'; echo '<div class="checkbox">'; echo '<label><input type="checkbox" name="favHeros" value="mage" tabindex="15"> Mage</label>'; echo '</div>'; echo '<div class="checkbox">'; echo '<label><input type="checkbox" name="favHeros" value="paladin" tabindex="16"> Paladin</label>'; echo '</div>'; echo '<div class="checkbox">'; echo '<label><input type="checkbox" name="favHeros" value="priest" tabindex="17"> Priest</label>'; echo '</div>'; echo '<div class="checkbox">'; echo '<label><input type="checkbox" name="favHeros" value="rogue" tabindex="18"> Rogue</label>'; echo '</div>'; echo '<div class="checkbox">'; echo '<label><input type="checkbox" name="favHeros" value="shaman" tabindex="19"> Shaman</label>'; echo '</div>'; echo '<div class="checkbox">'; echo '<label><input type="checkbox" name="favHeros" value="warlock" tabindex="20"> Warlock</label>'; echo '</div>'; echo '<div class="checkbox">'; echo '<label><input type="checkbox" name="favHeros" value="warrior" tabindex="21"> Warrior</label>'; echo '</div>'; echo '<button type="submit" class="btn btn-default">Submit</button>'; echo '</form>'; echo '</div>'; echo '<div class="col-md-3 col-sm-2 hidden-xs"></div>'; echo '</div>'; echo '</div>'; if (!is_null($user)) { echo $user->getError('favHeros'); } // $base = (array_key_exists('base', $_SESSION))?$_SESSION['base']:""; $_SESSION['footertitle'] = '<a href="/' . $base . '/index.php">FireSide</a></li>'; MasterView::showFooter(); }
public static function show($tournament) { $_SESSION['headertitle'] = "Create Tournament"; $_SESSION['styles'] = array('jumbotron.css'); MasterView::showHeader(); MasterView::showNavbar(); $user = array_key_exists('user', $_SESSION) ? $_SESSION['user'] : null; $base = array_key_exists('base', $_SESSION) ? $_SESSION['base'] : ""; echo '<div class="container-fluid">'; echo '<div class="row">'; echo '<div class="col-md-3 col-sm-2 hidden-xs"></div>'; echo '<div class="col-md-6 col-sm-8 col-xs-12">'; echo '<h1>' . $_SESSION['headertitle'] . '</h1>'; echo '<form role="form" action ="/' . $base . '/tournamentCreate" method="Post">'; // Error at the top of the form if (!is_null($tournament) && !empty($tournament->getError('tournamentID'))) { echo '<div class="form-group">'; echo '<label><span class="label label-danger">'; echo $tournament->getError('tournamentID'); echo '</span></label></div>'; } echo '<div class="form-group">'; // Hosted By echo '<label for="hostedBy">Hosted By:'; echo '<span class="label label-danger">'; if (!is_null($tournament)) { echo $tournament->getError('hostedBy'); } echo '</span></label>'; echo '<input type="text" class="form-control" id = "hostedBy" name="hostedBy"'; if (!is_null($tournament)) { echo 'value = "' . $tournament->getHostedBy() . '"'; } echo 'required>'; echo '</div>'; echo '<div class="form-group">'; // Name echo '<label for="name">Tournament Name:'; echo '<span class="label label-danger">'; if (!is_null($tournament)) { echo $tournament->getError('name'); } echo '</span></label>'; echo '<input type="text" class="form-control" id = "name" name="name"'; if (!is_null($tournament)) { echo 'value = "' . $tournament->getName() . '"'; } echo 'required>'; echo '</div>'; echo '<div class="form-group">'; // Start Date echo '<label for="startDate">Start Date:'; echo '<span class="label label-danger">'; if (!is_null($tournament)) { echo $tournament->getError('startDate'); } echo '</span></label>'; echo '<input type="date" class="form-control" id = "startDate" name="startDate"'; if (!is_null($tournament)) { echo 'value = "' . $tournament->getDate() . '"'; } echo 'required>'; echo '</div>'; echo '<div class="form-group">'; // Start Time echo '<label for="startTime">Start Time:'; echo '<span class="label label-danger">'; if (!is_null($tournament)) { echo $tournament->getError('startTime'); } echo '</span></label>'; echo '<input type="time" class="form-control" id = "startTime" name="startTime"'; if (!is_null($tournament)) { echo 'value = "' . $tournament->getTime() . '"'; } echo 'required>'; echo '</div>'; echo '<div class="form-group">'; // Number Participants echo '<label for="numParticipants">Number of Participants:'; echo '<span class="label label-danger">'; if (!is_null($tournament)) { echo $tournament->getError('numParticipants'); } echo '</span></label>'; echo '<input type="number" class="form-control" id = "numParticipants" name="numParticipants"'; if (!is_null($tournament)) { echo 'value = "' . $tournament->getNumParticipants() . '"'; } echo 'required>'; echo '</div>'; echo '<button type="submit" class="btn btn-default">Submit</button>'; echo '</form>'; echo '</div>'; echo '<div class="col-md-3 col-sm-2 col-xs-1"></div>'; echo '</div>'; echo '</div>'; }
public static function show($user, $userData) { MasterView::showHeader(); MasterView::showNavbar(); echo "<br>"; echo "<br>"; echo "<br>"; ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Profile</title> </head> <body> <section> <h1>Welcome, <?php echo $user->getUserName(); ?> !</h1> <img alt="Profile Picture" src="images/<?php $userData->getPicture(); ?> " style=""> </section> <section> <h2>Personal Details</h2> Name: <?php echo $userData->getFirstName(); echo ' '; echo $userData->getLastName(); ?> <br> <span style=text-decoration:underline;>Genres of Interest</span><br> Action: <?php echo $userData->getGenres()[0]; ?> <br> Horror: <?php echo $userData->getGenres()[1]; ?> <br> Comedy: <?php echo $userData->getGenres()[2]; ?> <br> Romance: <?php echo $userData->getGenres()[3]; ?> <br> Family: <?php echo $userData->getGenres()[4]; ?> <br> Drama: <?php echo $userData->getGenres()[5]; ?> <br> Address: <?php echo $userData->getAddress(); ?> <br> Neighborhood: <?php echo $userData->getNeighborhood(); ?> <br> Date of Birth: <?php echo $userData->getDateOfBirth(); ?> <br> Gender: <?php echo $userData->getGender(); ?> <br> </section> <section> <h2>Contact Information</h2> Email: <?php echo $userData->getEmail(); ?> <br> Phone: <?php echo $userData->getPhone(); ?> <br> URL: <?php echo $userData->getURL(); ?> <br><br> </section> </body> </html> <?php }
public static function showUpdate() { $_SESSION['headertitle'] = "Fireside Heroes User Update"; $_SESSION['styles'] = array('jumbotron.css'); MasterView::showHeader(); MasterView::showNavbar(); $user = array_key_exists('user', $_SESSION) ? $_SESSION['user'] : null; $base = array_key_exists('base', $_SESSION) ? $_SESSION['base'] : ""; echo '<div class="container-fluid">'; echo '<div class="row">'; echo '<div class="col-md-3 col-sm-2 col-xs-1"></div>'; echo '<div class="col-md-6 col-sm-8 col-xs-10">'; echo '<h1>' . $_SESSION['headertitle'] . '</h1>'; if (is_null($user)) { echo '<section>User does not exist</section>'; return; } echo '<form role="form" method="Post" action ="/' . $base . '/user/update/' . $user->getUserID() . '">'; // Error at the top of the form if (!is_null($user) && !empty($user->getError('userID'))) { echo '<div class="form-group">'; echo '<label><span class="label label-danger">'; echo $user->getError('userID'); echo '</span></label></div>'; } echo '<div class="form-group">'; // User name echo '<label for="userName">User name:'; echo '<span class="label label-danger">'; if (!is_null($user)) { echo $user->getError('userName'); } echo '</span></label>'; echo '<input type="text" class="form-control" id = "userName" name="userName"'; if (!is_null($user)) { echo 'value = "' . $user->getFirstName() . '"'; } echo 'required>'; echo '</div>'; //Highest rank echo '<div class="form-group">'; echo '<label for="rank">Highest Rank Achieved:</label>'; echo '<select class="form-control" id="rank" name="rank">'; echo '<option value="legend">Legend</option>'; echo '<option value="1">1</option>'; echo '<option value="2">2</option>'; echo '<option value="3">3</option>'; echo '<option value="4">4</option>'; echo '<option value="5">5</option>'; echo '<option value="6">6</option>'; echo '<option value="7">7</option>'; echo '<option value="8">8</option>'; echo '<option value="9">9</option>'; echo '<option value="10">10</option>'; echo '<option value="11">11</option>'; echo '<option value="12">12</option>'; echo '<option value="13">13</option>'; echo '<option value="14">14</option>'; echo '<option value="15">15</option>'; echo '<option value="16">16</option>'; echo '<option value="17">17</option>'; echo '<option value="18">18</option>'; echo '<option value="19">19</option>'; echo '<option value="20">20</option>'; echo '<option value="21">21</option>'; echo '<option value="22">22</option>'; echo '<option value="23">23</option>'; echo '<option value="24">24</option>'; echo '<option value="25">25</option>'; echo '</select>'; echo '</div>'; echo '<button type="submit" class="btn btn-default">Submit</button>'; echo '</form>'; echo '</div>'; echo '<div class="col-md-3 col-sm-2 col-xs-1"></div>'; echo '</div>'; echo '</div>'; $_SESSION['footertitle'] = "The footer"; MasterView::showFooter(); }