Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once("includes/session.php");
- require_once("includes/replay.php");
- $sUser = new SessionUser();
- if ($sUser->IsLoggedIn())
- {
- // Logged in
- echo "You are signed in, " . $sUser->GetUserLogin();
- ?>
- <a href="signout.php">Sign out.</a>
- <br/><br/><br/>
- <?php
- $groupID = $sUser->GetGroupID();
- echo sprintf("<b>Login</b>: %s <br/> <b>ID</b>: %s <br/> <b>Group</b>: %s <br/> <b>Email</b>: %s <br/>", $sUser->GetUserLogin(), $sUser->GetUserID(), $sUser->GetGroupName($groupID), $sUser->GetUserEmail());
- }
- else
- {
- // Need to log in
- ?>
- <b>Login:</b>
- <form name="login" action="signin.php" method="post">
- Login: <input type="text" name="login" />
- Password: <input type="password" name="password" />
- <input type="submit" value="Login" />
- </form>
- <br/>
- <b>Not registered?</b>
- <form name="register" action="register.php" method="post">
- <table border="0">
- <tr>
- <td>Login</td>
- <td><input type="text" name="login" autocomplete="off" /></td>
- </tr>
- <td>Password</td>
- <td><input type="password" name="password" autocomplete="off" /></td>
- </tr>
- <td>Email</td>
- <td><input type="text" name="email" autocomplete="off" /></td>
- </tr>
- </table><br/>
- <input type="submit" value="Register" />
- </form>
- <?php
- }
- ?>
- <hr />
- <br/>
- <b>Users</b><br/><br/>
- <?php
- $userList = $sUser->GetUsers();
- ?>
- <table border="1" width="90%" align="center">
- <tr>
- <th>ID</th><th>Username</th><th>Email</th><th>Group ID</th>
- </tr>
- <?php
- foreach ($userList as $val)
- {
- $id = $val->GetUserID();
- $login = $val->GetUserLogin();
- $email = $val->GetUserEmail();
- if ($email == null) $email = "none";
- $groupID = $val->GetGroupID();
- echo sprintf ("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>", $id, $login, $email, $groupID);
- }
- ?>
- </table>
- <br/>
- <hr />
- <br/>
- <form enctype="multipart/form-data" action="upload.php" method="post">
- <input type="hidden" name="MAX_FILE_SIZE" value="5000000" />
- Choose a file to upload: <input name="uploaded_file" type="file" />
- <input type="submit" value="Upload" />
- </form>
- <br/>
- <hr/>
- <?php
- /*$replay = new Replay();
- $replay->GetReplayFromFile ("Replays/09_sc2tv-ru_iiGames-ru-Open-01.SC2Replay");
- $players = $replay->GetPlayers();
- echo "Map: " . $replay->GetMap() . "<br/>";
- echo "Game type: " . $replay->GetGameType() . "<br/>";
- echo "Length: " . $replay->GetLength() . "<br/>";
- echo "Speed: " . $replay->GetSpeed() . "<br/>";
- echo "Replay build: " . $replay->GetBuild() . "<br/>";
- echo "<br/>";
- foreach ($players as $player)
- {
- echo sprintf("(%s) <font color=\"#%s\">%s</font> [Avg APM: %s] [Team: %s]<br/>", $player->GetRace(), $player->GetColor(), $player->GetName(), $player->GetAverageAPM(), $player->GetTeam());
- }
- */
- $rep = new Replay();
- $replays = $rep->GetReplays(30, 0);
- foreach ($replays as $replay)
- {
- ?>
- <table border="1" width="90%" align="center" cellpadding="0" cellspacing="0">
- <td width="500">
- <table border="1" width="100%">
- <tr><th>Map</th><td><?php echo $replay->GetMap(); ?></td></tr>
- <tr><th>Filename</th><td><?php echo "<a href=\"Replays/{$replay->GetFilename()}\">Get Replay</a>"; ?></td></tr>
- <tr><th>GameType</th><td><?php echo $replay->GetGameType(); ?></td></tr>
- <tr><th>Length</th><td><?php echo $replay->GetLength(); ?></td></tr>
- <tr><th>Speed</th><td><?php echo $replay->GetSpeed(); ?></td></tr>
- <tr><th>Build</th><td><?php echo $replay->GetBuild(); ?></td></tr>
- <tr><th>Date of addition</th><td><?php echo $replay->GetDate(); ?></td></tr>
- <tr><th>MD5</th><td><?php echo $replay->GetHash(); ?></td></tr>
- </table>
- </td>
- <td valign="top">
- <table border="1" width="100%">
- <tr>
- <th colspan="4">Players</th>
- </tr>
- <tr>
- <th>Name</th><th>Race</th><th width="140">Average APM</th><th>Team</th>
- </tr>
- <?php
- foreach ($replay->GetPlayers() as $player)
- {
- $color = $player->GetColor();
- echo "<tr><td><font color=\"#{$color}\">{$player->GetName()}</font></td><td>{$player->GetRace()}</td><td>{$player->GetAverageAPM()}</td><td>{$player->GetTeam()}</td></tr>";
- }
- ?>
- </table>
- </td>
- </table>
- <br/>
- <?php
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement