Guild Wars stat tracking The idea behind this is to track multiple characters individual stats as well as account stats.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 

47 řádky
2.2 KiB

  1. <?php
  2. if (isset($_SESSION['userid'])) {
  3. echo '<table border="1"><caption>Account wide stats</caption>';
  4. echo '<tr><th>Title</th><th>Title Rank</th><th>Title Points</th><th>Current Rank</th><th>Points Remaining</th><th>Max Title %</th><th>Next Rank</th></tr>';
  5. // $gas = GetAccountStats
  6. $gas = $con->prepare("SELECT * FROM gwaccstats WHERE userid = ? AND accid = ? ORDER BY currentstrank DESC, percent ASC");
  7. $gas->bind_param("ii", $_SESSION['userid'], $_SESSION['prefaccid']);
  8. $gas->execute();
  9. $result = $gas->get_result();
  10. while ($row = $result->fetch_assoc()) {
  11. // $gnr = Get Next Rank
  12. $gnr = $con->prepare("SELECT stpoints, stname FROM gwsubtitles WHERE titlenameid = ? AND stpoints >= ? ORDER BY stpoints ASC LIMIT 1");
  13. $gnr->bind_param("ii", $row['titlenameid'], $row['titlepoints']);
  14. $gnr->execute();
  15. $gnr->bind_result($stpoints, $stname);
  16. $gnr->fetch();
  17. $gnr->close();
  18. // $gt = Get Title
  19. $gt = $con->prepare("SELECT titlename FROM gwtitles WHERE titlenameid = ?");
  20. $gt->bind_param("i", $row['titlenameid']);
  21. $gt->execute();
  22. $gt->bind_result($titlename);
  23. $gt->fetch();
  24. $gt->close();
  25. $pr = number_format(($stpoints - $row['titlepoints']));
  26. if ($pr < 0) {
  27. $pr = "Highest rank achieved!";
  28. $stname = "Highest rank achieved!";
  29. }
  30. if ($row['currentstrankname'] === NULL) {
  31. $row['currentstrankname'] = "No title earned yet!";
  32. $row['currentstrank'] = "0";
  33. }
  34. if ($row['percent'] > 100) {
  35. $ohp = 100;
  36. } else {
  37. $ohp = $row['percent'];
  38. }
  39. echo '<tr><td style="width:150px;">' . $titlename . '</td><td style="width:200px;">' . $row['currentstrankname'] . '</td><td style="width:100px;">' . number_format($row['titlepoints']) . '</td><td style="width:70px;">' . $row['currentstrank'] . '</td>';
  40. echo '<td style="width:100px;">' . $pr . '</td><td><div class="percentbar" style="width:100px;"><div style="width:' . $ohp . 'px;"></div></div>';
  41. echo $ohp;
  42. echo '% completed</td><td>' . $stname . '</td></tr>';
  43. }
  44. $gas->close();
  45. echo '</table><br />';
  46. }
  47. ?>