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

53 рядки
2.6 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. if ($_SESSION['admin'] == 1){
  40. echo'(<a href="adminlanding.php" class="navlink">Administration</a>) ';
  41. }
  42. echo '(<select name="prefaccid" onchange="this.form.submit()">';
  43. echo '<option class="header" value="' . $_SESSION['prefaccid'] . '">' . $_SESSION['prefaccname'] . '</option>';
  44. echo '<option value="nopref">No default selected</option>';
  45. include_once ('header-list-accounts.php');
  46. echo '</select>)<noscript><input type="submit" value="Preferrence"></noscript> ';
  47. echo '(<select name="prefcharid" onchange="this.form.submit()">';
  48. echo '<option "class="header" value="' . $_SESSION['prefcharid'] . '">' . $_SESSION['prefcharname'] . '</option>';
  49. echo '<option value="nopref">No default selected</option>';
  50. include_once ('header-list-chars.php');
  51. echo '</select>)<noscript><input type="submit" value="Preferrence"></noscript> (<a href="logout.php?action=logout" class="navlink">Logout ' . $_SESSION['username'] . '</a>)</form><hr><br / >';
  52. }
  53. ?>