Guild Wars stat tracking The idea behind this is to track multiple characters individual stats as well as account stats.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

91 lines
4.0 KiB

  1. <?php
  2. $pagetitle = "Title Editor";
  3. include_once ('header.php');
  4. if (isset($_SESSION['userid'])){
  5. if (isset($_SESSION['title'])) {
  6. if ($_SESSION['title'] == "repeat") {
  7. $_POST['title'] = "addsubtitle";
  8. unset($_SESSION['title']);
  9. } else {
  10. unset($_SESSION['tr']);
  11. }
  12. }
  13. if ($_SESSION['admin'] == 1) {
  14. echo '<br />';
  15. if (isset($_POST['title'])) {
  16. if ($_POST['title'] == "addtitle") {
  17. // included file contains all the code to add a new title
  18. include_once ('includes/title-add.php');
  19. } else if ($_POST['title'] == "titlesubmit") {
  20. // included file contains all the code to submit a new title
  21. include_once ('includes/title-submit.php');
  22. } else if ($_POST['title'] == "modtitle") {
  23. // included file contains all the code to edit a title
  24. include_once ('includes/title-editor.php');
  25. } else if ($_POST['title'] == "updatetitle") {
  26. // this section doesn't require human interaction
  27. include_once ('includes/title-update.php');
  28. } else if ($_POST['title'] == "addsubtitle") {
  29. // included file contains all code to add the title ranks and points required
  30. include_once ('includes/titleranks-add.php');
  31. } else if ($_POST['title'] == "titleranksubmit") {
  32. // this section doesn't require human interaction
  33. include_once ('includes/titleranks-submit.php');
  34. } else if ($_POST['title'] == "modsubtitle") {
  35. // included file contains all code to edit a title rank
  36. include_once ('includes/titleranks-editor.php');
  37. } else if ($_POST['title'] == "updatesubtitle") {
  38. // this sectionupdates modified title ranks in the database, or deletes them
  39. include_once ('includes/titleranks-update.php');
  40. }
  41. } else {
  42. unset($_SESSION['tid']);
  43. unset($_SESSION['tr']);
  44. echo 'Add titles <form action="titlemanager.php" method="post"><input type="hidden" name="title" value="addtitle"><input type="submit" value="Add title"></form><br />';
  45. echo 'Modify titles <form action="titlemanager.php" method="post"><input type="hidden" name="title" value="modtitle"><select name="tid" onchange="this.form.submit()"><option selected disabled>Select title</option>';
  46. include ('includes/title-select.php');
  47. echo '</select><noscript><input type="submit" value="Modify Title"></noscript></form><br /><br />';
  48. echo 'Add or modify title ranks and points <form action="titlemanager.php" method="post"><input type="hidden" name="title" value="addsubtitle"><select name="tid" onchange="this.form.submit()"><option selected disabled>Add title rank(s)</option>';
  49. include ('includes/title-select.php');
  50. echo '</select><noscript><input type="submit" value="Add title rank"></noscript></form><br /><br />';
  51. // now to view the last 5 title entries in the database
  52. echo 'Here is the last 15 titles entered into the database, newest entry is on top:<br />';
  53. echo '<table border="1"><tr><th>titleid</th><th>titlename</th><th>titletype</th><th>titletype</th><th>autofilled</th><th>autofilled</th></tr>';
  54. $stmtview = $con->prepare("SELECT * FROM gwtitles ORDER BY titlenameid DESC LIMIT 15");
  55. $stmtview->execute();
  56. $result = $stmtview->get_result();
  57. while ($row = $result->fetch_assoc()) {
  58. $tid = $row['titlenameid'];
  59. $tname = $row['titlename'];
  60. $ttype = $row['titletype'];
  61. $tmr = $row['titlemaxrank'];
  62. $taf = $row['autofilled'];
  63. echo '<tr><td>' . $tid . '</td><td>' . $tname . ' (' . $tmr . ')</td><td>' . $ttype . '</td><td>';
  64. if ($ttype == "0") {
  65. echo 'account';
  66. } else if ($ttype == "1") {
  67. echo 'character';
  68. } else {
  69. echo 'Anything other than a 0 or 1 means something broke!';
  70. include_once ('footer.php');
  71. exit();
  72. }
  73. echo '</td><td>' . $taf . '</td><td>';
  74. if ($taf == "0") {
  75. echo 'no';
  76. } else if ($taf == "1") {
  77. echo 'yes';
  78. } else {
  79. echo 'Anything other than a 0 or 1 means something broke!';
  80. include_once ('footer.php');
  81. exit();
  82. }
  83. echo '</td></tr>';
  84. }
  85. $stmtview->close();
  86. echo '</table><br />If anything looks off, please fix it!<br /><br />';
  87. }
  88. }
  89. }
  90. include_once ('footer.php');
  91. ?>