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.
 
 
 
 
 

49 líneas
2.2 KiB

  1. <?php
  2. if (isset($_SESSION['userid'])) {
  3. // get all the character id's related to the selected account id's
  4. // $gci = Get Character ID's
  5. $gaccid = implode(", ", $_POST['delaccid']);
  6. $gci = $con->prepare("SELECT charid, accid FROM gwchars WHERE accid IN ($gaccid) AND userid = ?");
  7. $gci->bind_param("i", $_SESSION['userid']);
  8. $gci->execute();
  9. $gciresults = $gci->get_result();
  10. while ($gcirow = $gciresults->fetch_assoc()) {
  11. $delchar = $con->prepare("DELETE FROM gwchars WHERE charid = ? AND accid = ? AND userid = ?");
  12. $delchar->bind_param("iii", $gcirow['charid'], $gcirow['accid'], $_SESSION['userid']);
  13. $delchar->execute();
  14. $delchar->close();
  15. // $dac = Delete Account Stats
  16. $dac = $con->prepare("DELETE FROM gwaccstats WHERE accid = ? AND userid = ?");
  17. $dac->bind_param("ii", $gcirow['accid'], $_SESSION['userid']);
  18. $dac->execute();
  19. $dac->close();
  20. // $dcs = Delete Character Stats
  21. $dcs = $con->prepare("DELETE FROM gwcharstats WHERE charid = ? AND accid = ? AND userid = ?");
  22. $dcs->bind_param("iii", $gcirow['charid'], $gcirow['accid'], $_SESSION['userid']);
  23. $dcs->execute();
  24. $dcs->close();
  25. }
  26. $gci->close();
  27. //this should be the last SQL query to run!
  28. $delacc = $con->prepare("DELETE FROM gwaccounts WHERE accid IN ($gaccid) AND userid = ?");
  29. $delacc->bind_param("i", $_SESSION['userid']);
  30. $delacc->execute();
  31. $delacc->close();
  32. // $nap = No Account Preference
  33. $nap = $con->prepare("UPDATE userinfo SET prefaccid = 0, prefaccname = 'No default selected' WHERE userid = ?");
  34. $nap->bind_param("i", $_SESSION['userid']);
  35. $nap->execute();
  36. $nap->close();
  37. $_SESSION['prefaccid'] = "0";
  38. $_SESSION['preaccname'] = "No default selected";
  39. echo 'Account(s) deleted - no preferred account selected.<br /><br />';
  40. // $ncp = No Character Preference
  41. $ncp = $con->prepare("UPDATE userinfo SET prefcharid = 0, prefcharname = 'No default selected' WHERE userid = ?");
  42. $ncp->bind_param("i", $_SESSION['userid']);
  43. $ncp->execute();
  44. $ncp->close();
  45. $_SESSION['prefcharid'] = "0";
  46. $_SESSION['prefcharname'] = "No default selected";
  47. echo 'All characters related to the account have been deleted - no preferred character selected.<br /><br />';
  48. }
  49. ?>