Guild Wars stat tracking The idea behind this is to track multiple characters individual stats as well as account stats.
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 

80 líneas
3.6 KiB

  1. <?php
  2. $pagetitle = "Title Editor";
  3. include_once ('header.php');
  4. include_once ('connect.php');
  5. $con = mysqli_connect(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME);
  6. if ($con->connect_errno){
  7. die ('Unable to connect to database [' . $db->connect_errno . ']');
  8. }
  9. if (isset($_SESSION['title'])) {
  10. if ($_SESSION['title'] == "repeat") {
  11. $_POST['title'] = "addsubtitle";
  12. unset($_SESSION['title']);
  13. } else {
  14. unset($_SESSION['tr']);
  15. }
  16. }
  17. if ($_SESSION['admin'] == 1) {
  18. echo '<br />';
  19. if (isset($_POST['title'])) {
  20. if ($_POST['title'] == "addtitle") {
  21. // included file contains all the code to add a new title
  22. include_once ('includes/title-add.php');
  23. } else if ($_POST['title'] == "titlesubmit") {
  24. // included file contains all the code to submit a new title
  25. include_once ('includes/title-submit.php');
  26. } else if ($_POST['title'] == "modtitle") {
  27. // included file contains all the code to edit a title
  28. include_once ('includes/title-editor.php');
  29. } else if ($_POST['title'] == "updatetitle") {
  30. // this section doesn't require human interaction
  31. include_once ('includes/title-update.php');
  32. } else if ($_POST['title'] == "addsubtitle") {
  33. // included file contains all code to add the title ranks and points required
  34. include_once ('includes/titleranks-add.php');
  35. } else if ($_POST['title'] == "titleranksubmit") {
  36. // this section doesn't require human interaction
  37. include_once ('includes/titleranks-submit.php');
  38. } else if ($_POST['title'] == "modsubtitle") {
  39. // included file contains all code to edit a title rank
  40. include_once ('includes/titleranks-editor.php');
  41. }
  42. } else {
  43. unset($_SESSION['tid']);
  44. unset($_SESSION['tr']);
  45. echo 'Add titles <form action="titlemanager.php" method="post"><input type="hidden" name="title" value="addtitle"><input type="submit" value="Add title"></form><br />';
  46. 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>';
  47. include ('includes/title-select.php');
  48. echo '</select><noscript><input type="submit" value="Modify Title"></noscript></form><br /><br />';
  49. echo 'Add title ranks and points to <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>';
  50. include ('includes/title-select.php');
  51. echo '</select><noscript><input type="submit" value="Add title rank"></noscript></form><br /><br />';
  52. // now to view the last 5 title entries in the database
  53. echo 'Here is the last 5 titles entered into the database, newest entry is on top:<br />';
  54. echo '<table border="1"><tr><th>titleid</th><th>titlename</th><th>titletype</th><th>titletype</th></tr>';
  55. $stmtview = $con->prepare("SELECT * FROM gwtitles ORDER BY titlenameid DESC LIMIT 5");
  56. $stmtview->execute();
  57. $result = $stmtview->get_result();
  58. while ($row = $result->fetch_assoc()) {
  59. $tid = $row['titlenameid'];
  60. $tname = $row['titlename'];
  61. $ttype = $row['titletype'];
  62. $tmr = $row['titlemaxrank'];
  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></tr>';
  74. }
  75. $stmtview->close();
  76. echo '</table><br />If anything looks off, please fix it!<br /><br />';
  77. }
  78. }
  79. include_once ('footer.php');
  80. ?>