Guild Wars stat tracking The idea behind this is to track multiple characters individual stats as well as account stats.
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 

49 Zeilen
2.5 KiB

  1. <?php
  2. # delete this block when shit finally works.
  3. ini_set('display_errors', 'on');
  4. error_reporting(E_ALL);
  5. mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
  6. # delete the above when shit finally works
  7. # use "$_POST['tid']" to show title ranks already associated with the selected title
  8. # and above that list put the input boxes for text and number_format
  9. # investigate if we can put multiple input boxes and loop through them to insert into the database
  10. # https://stackoverflow.com/questions/34469482/how-to-insert-multiple-inputs-into-the-database-using-the-power-of-php
  11. if (isset($_SESSION['tid'])) {
  12. $_POST['tid'] = $_SESSION['tid'];
  13. }
  14. $stmtname = $con->prepare("SELECT titlename FROM gwtitles WHERE titlenameid = ?");
  15. $stmtname->bind_param("i", $_POST['tid']);
  16. $stmtname->execute();
  17. $stmtname->store_result();
  18. $stmtname->bind_result($gwtn);
  19. while ($stmtname->fetch()) {
  20. echo 'Adding rank to title <b>' . $gwtn . '</b><br /><br />';
  21. }
  22. $stmtname->free_result();
  23. $stmtname->close();
  24. echo '<form action="titlemanager.php" method="post"><table border="1"><tr><th>Title Rank Name</th><th>Title Points</th><th>Rank Level</th></tr>';
  25. echo '<tr><td><input type="text" name="titlerankname" required autofocus></td><td><input type="number" name="titlepoints" required></td><td><input type="number" name="titlerank" min="1" max="15"</tr>';
  26. echo '</table><br /><input type="hidden" name="title" value="titleranksubmit"><input type="hidden" name="titlenameid" value="' . $_POST['tid'] . '"><input type="submit" value="Add title rank ..."></form>';
  27. echo 'Here are the currently associated title ranks, starting with rank 1:<br />';
  28. echo '<table border="1"><tr><th>stnameid</th><th>titlenameid</th><th>stname</th><th>stpoints</th><th>strank</th></tr>';
  29. $stmtview = $con->prepare("SELECT * FROM gwsubtitles WHERE titlenameid = ? ORDER BY strank ASC");
  30. $stmtview->bind_param("i", $_POST['tid']);
  31. $stmtview->execute();
  32. $result = $stmtview->get_result();
  33. while ($row = $result->fetch_assoc()) {
  34. $stnid = $row['stnameid'];
  35. $tnid = $row['titlenameid'];
  36. $stname = $row['stname'];
  37. $stpoints = $row['stpoints'];
  38. $strank = $row['strank'];
  39. echo '<tr><td>' . $stnid . '<td>' . $tnid . '</td><td>' . $stname . '</td><td>' . number_format($stpoints) . '</td><td>' . $strank . '</td></tr>';
  40. }
  41. $stmtview->close();
  42. echo '</table><br />If anything looks off, please fix it!<br /><br />';
  43. echo 'Return to <a href="titlemanager.php" class="navlink">title manager</a>'; //this line needs to go away soon. Maybe?
  44. ?>