Guild Wars stat tracking The idea behind this is to track multiple characters individual stats as well as account stats.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 

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