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

80 строки
3.7 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></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. echo '<tr><td>' . $tid . '</td><td>' . $tname . ' (' . $tmr . ')</td><td>' . $ttype . '</td><td>';
  63. if ($ttype == "0") {
  64. echo 'account';
  65. } else if ($ttype == "1") {
  66. echo 'character';
  67. } else {
  68. echo 'Anything other than a 0 or 1 means something broke!';
  69. include_once ('footer.php');
  70. exit();
  71. }
  72. echo '</td></tr>';
  73. }
  74. $stmtview->close();
  75. echo '</table><br />If anything looks off, please fix it!<br /><br />';
  76. }
  77. }
  78. }
  79. include_once ('footer.php');
  80. ?>