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

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