Guild Wars stat tracking The idea behind this is to track multiple characters individual stats as well as account stats.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 

42 rindas
1.9 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. if (isset($_POST['delsubtitle'])) {
  8. if ($_POST['delsubtitle'] =="yes") {
  9. // this title makes you verify that you want to delete this title
  10. echo '<form action="titlemanager.php" method="post">Please check the box to verify you want to delete: <b>' . $_POST['titlename'] . '</b> <input type="checkbox" name="delsubtitle" value="iamsure">';
  11. echo '<input type="hidden" name="titlenameid" value="' . $_POST['titlenameid'] . '"><input type="hidden" name="title" value="updatesubtitle"><input type="submit" value="Delete title rank(s)"></form><br /><br />';
  12. } else if ($_POST['delsubtitle'] == "iamsure") {
  13. // this section actually deletes the title rank(s)
  14. # need to deal with array data eventually
  15. $stmtdel = $con->prepare("DELETE FROM gwsubtitles WHERE titlenameid = ?");
  16. $stmtdel->bind_param("i", $_POST['titlenameid']);
  17. $stmtdel->execute();
  18. $stmtdel->close();
  19. echo 'Title rank(s) have been deleted, redirecting!';
  20. header ("Refresh:1; url=titlemanager.php");
  21. }
  22. } else {
  23. // this section updates the title name
  24. if ($upd = $con->prepare("UPDATE gwsubtitles SET stname = ?, stpoints = ?, strank = ? WHERE titlenameid = ? AND stnameid = ?")) {
  25. $upd->bind_param("siiii", $stname, $stpoints, $strank, $titlenameid, $stnameid);
  26. for ($i = 0; $i < count($_POST['stname']); $i++) {
  27. $stname = $_POST['stname'][$i];
  28. $stpoints = $_POST['stpoints'][$i];
  29. $strank = $_POST['strank'][$i];
  30. $titlenameid = $_POST['titlenameid'][$i];
  31. $stnameid = $_POST['stnameid'][$i];
  32. $upd->execute();
  33. }
  34. $upd->close();
  35. }
  36. echo 'Title rank(s) updated, redirecting!';
  37. header ("Refresh:1; url=titlemanager.php");
  38. }
  39. echo 'Return to <a href="titlemanager.php" class="navlink">title manager</a>';
  40. ?>