Guild Wars stat tracking The idea behind this is to track multiple characters individual stats as well as account stats.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 

39 rindas
1.8 KiB

  1. <?php
  2. $pagetitle = "Update character stats";
  3. include_once ('header.php');
  4. if (isset($_SESSION['userid'])) {
  5. if (!isset($_POST['chartitle'])) {
  6. $_POST['chartitle'] = "notselected";
  7. }
  8. if ($_SESSION['prefcharid'] == "0") {
  9. echo 'Please select a character from the menu above to add stats to before continuing';
  10. include_once ('footer.php');
  11. exit();
  12. }
  13. if (isset($_POST['titlepoints'])) {
  14. // include file just updates the database
  15. include_once ('includes/update-chartitleranks.php');
  16. }
  17. if ($_POST['chartitle'] == "notselected") {
  18. echo '<form action="updatecharstats.php" method="post">';
  19. echo 'Select character title to update: <select name="chartitle" onchange="this.form.submit()">';
  20. // $cts = Character Title Select
  21. $cts = $con->prepare("SELECT titlenameid, titlename FROM gwtitles WHERE titletype = 1 AND autofilled = 0 ORDER BY titlename");
  22. $cts->execute();
  23. $result = $cts->get_result();
  24. while ($row = $result->fetch_assoc()) {
  25. echo '<option value="' . $row['titlenameid'] . '">' . $row['titlename'] . '</option>';
  26. }
  27. echo '</select><input type="submit" value="Select title"></form><br />';
  28. $cts->close();
  29. } else {
  30. echo '<form action="updatecharstats.php" method="post"><input type="hidden" name="titlenameid" value="' . $_POST['chartitle'] .'">';
  31. echo '<input type="number" step="0.1" name="titlepoints" required autofocus><noscript><input type="submit" value="Update points"></noscript></form>';
  32. }
  33. echo 'Current character stats for: <b>' . $_SESSION['prefcharname'] . '</b><br />';
  34. include_once ('includes/getcharstats.php');
  35. echo 'Return to your <a href="index.php" class="navlink">user</a> page<br />';
  36. }
  37. include_once ('footer.php');
  38. ?>