Guild Wars stat tracking The idea behind this is to track multiple characters individual stats as well as account stats.
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 

59 satır
2.8 KiB

  1. <?php
  2. if (isset($_SESSION['userid'])) {
  3. unset($_SESSION['title']);
  4. if (isset($_SESSION['tid'])) {
  5. $_POST['tid'] = $_SESSION['tid'];
  6. }
  7. if (isset($_SESSION['tr'])) {
  8. $tr = $_SESSION['tr'] + 1;
  9. } else {
  10. $trank = $con->prepare("SELECT MAX(strank) FROM gwsubtitles WHERE titlenameid = ?");
  11. $trank->bind_param("i", $_POST['tid']);
  12. $trank->execute();
  13. $trank->store_result();
  14. $trank->bind_result($gwstmr);
  15. while ($trank->fetch()) {
  16. if (is_null($gwstmr)) {
  17. $tr = 1;
  18. } else {
  19. $tr = $gwstmr + 1;
  20. }
  21. }
  22. }
  23. $stmtname = $con->prepare("SELECT titlename, titlemaxrank FROM gwtitles WHERE titlenameid = ?");
  24. $stmtname->bind_param("i", $_POST['tid']);
  25. $stmtname->execute();
  26. $stmtname->store_result();
  27. $stmtname->bind_result($gwtn, $gwtmr);
  28. while ($stmtname->fetch()) {
  29. echo 'Adding rank to title <b>' . $gwtn . '</b><br />The maximum rank achievable in game is ' . $gwtmr . '<br />';
  30. if ($tr > $gwtmr) {
  31. echo '<br />No more ranks can be added!<br /><br />';
  32. } else {
  33. echo '<form action="titlemanager.php" method="post"><table border="1"><tr><th>Title Rank Name</th><th>Title Points</th><th>Rank Level</th></tr>';
  34. echo '<tr><td><input type="text" name="titlerankname" required autofocus></td><td><input type="number" name="titlepoints" required></td><td><input type="number" readonly name="titlerank" min="1" max="15" value="' . $tr . '"></tr>';
  35. echo '</table><br /><input type="hidden" name="title" value="titleranksubmit"><input type="hidden" name="titlenameid" value="' . $_POST['tid'] . '"><input type="submit" value="Add title rank ..."></form><br />';
  36. }
  37. }
  38. $stmtname->free_result();
  39. $stmtname->close();
  40. echo 'Here are the currently associated title ranks, starting with rank 1:<br />';
  41. echo '<form action="titlemanager.php" method="post"><table border="1"><tr><th>stnameid</th><th>titlenameid</th><th>stname</th><th>stpoints</th><th>strank</th><th>Edit</th></tr>';
  42. $stmtview = $con->prepare("SELECT * FROM gwsubtitles WHERE titlenameid = ? ORDER BY strank ASC");
  43. $stmtview->bind_param("i", $_POST['tid']);
  44. $stmtview->execute();
  45. $result = $stmtview->get_result();
  46. while ($row = $result->fetch_assoc()) {
  47. $stnid = $row['stnameid'];
  48. $tnid = $row['titlenameid'];
  49. $stname = $row['stname'];
  50. $stpoints = $row['stpoints'];
  51. $strank = $row['strank'];
  52. echo '<tr><td>' . $stnid . '<td>' . $tnid . '</td><td>' . $stname . '</td><td>' . number_format($stpoints) . '</td><td>' . $strank . '</td><td><input type="checkbox" name="editstitle[]" value="' . $stnid . '"></td></tr>';
  53. }
  54. $stmtview->close();
  55. $_SESSION['tid'] = $_POST['tid'];
  56. echo '</table><br /><input type="hidden" name="title" value="modsubtitle"><input type="submit" value="Edit selected titles"></form><br />If anything looks off, please fix it!<br /><br />';
  57. echo 'Return to <a href="titlemanager.php" class="navlink">title manager</a>';
  58. }
  59. ?>