Guild Wars stat tracking The idea behind this is to track multiple characters individual stats as well as account stats.
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 

56 рядки
2.9 KiB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <link rel="stylesheet" type="text/css" href="style.css">
  5. <?php
  6. if (session_status() == PHP_SESSION_NONE) {
  7. session_start();
  8. }
  9. $userid = (isset($_SESSION['userid']) ? $_SESSION['userid'] : null);
  10. include_once ('connect.php');
  11. $con = mysqli_connect(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME);
  12. if ($con->connect_errno){
  13. die ('Unable to connect to database [' . $db->connect_errno . ']');
  14. }
  15. if (!$userid){
  16. echo '<title>Please login first</title></head><body><center>Aloha, and welcome to my Guild Wars stats tracker. Please login below.<hr>';
  17. echo '<form action="login.php" method="post"><table border="0"><tr><td>Username:</td><td><input type="text" name="username" size="20" autofocus required></td></tr>';
  18. echo '<tr><td>Password:</td><td><input type="password" name="password" size="20" required></td></tr></table>';
  19. echo '<input type="submit" value="Login ..."></form><br /><br />';
  20. echo 'If you haven\'t registered an account yet,<br />please click <a href="register.php" class="navlink">here</a> to create one.<br />';
  21. } else {
  22. echo '<title>';
  23. if (isset($pagetitle)) {
  24. echo $pagetitle;
  25. } else {
  26. echo 'GWST';
  27. }
  28. echo '</title></head><body><center>';
  29. if (!empty($_POST['prefaccid'])) {
  30. //this section contains code to set the users preferred game account
  31. include_once ('includes/set-prefacc.php');
  32. }
  33. if (!empty($_POST['prefcharid'])) {
  34. //this section contains code to the users preferred character
  35. include_once ('includes/set-prefchar.php');
  36. }
  37. echo '<form action="' . $_SERVER['REQUEST_URI'] . '" method="post">';
  38. echo '(<a href="index.php" class="navlink">Home</a>) (<a href="preferences.php" class="navlink">Options</a>) ';
  39. echo '(<select name="prefaccid" onchange="this.form.submit()">';
  40. echo '<option class="header" value="' . $_SESSION['prefaccid'] . '">' . $_SESSION['prefaccname'] . '</option>';
  41. echo '<option value="nopref">No default selected</option>';
  42. include_once ('header-list-accounts.php');
  43. echo '</select>)<noscript><input type="submit" value="Preferrence"></noscript> ';
  44. echo '(<select name="prefcharid" onchange="this.form.submit()">';
  45. echo '<option "class="header" value="' . $_SESSION['prefcharid'] . '">' . $_SESSION['prefcharname'] . '</option>';
  46. echo '<option value="nopref">No default selected</option>';
  47. include_once ('header-list-chars.php');
  48. echo '</select>)<noscript><input type="submit" value="Preferrence"></noscript> ';
  49. if ($_SESSION['admin'] == 1){
  50. echo'(<a href="adminlanding.php" class="navlink">Administration</a>) ';
  51. }
  52. echo '(<a href="logout.php?action=logout" class="navlink">Logout ' . $_SESSION['username'] . '</a>)</form><hr>';
  53. echo '(<a href="updatecharstats.php" class="navlink">Update character titles</a>) (<a href="updateaccountstats.php" class="navlink">Update account titles</a>) ';
  54. echo '(<a href="addaccounts.php" class="navlink">Manage accounts & characters</a>)<br /><br />';
  55. }
  56. ?>