Guild Wars stat tracking The idea behind this is to track multiple characters individual stats as well as account stats.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

29 regels
1.1 KiB

  1. <?php
  2. if (isset($_SESSION['userid'])) {
  3. if ($_POST['prefcharid'] == "nopref") {
  4. // $ncp = No CharID Preferrence
  5. $ncp = $con->prepare("UPDATE userinfo SET prefcharid = 0, prefcharname = 'No default selected' WHERE userid = ?");
  6. $ncp->bind_param("i", $_SESSION['userid']);
  7. $ncp->execute();
  8. $ncp->close();
  9. $_SESSION['prefcharid'] = "0";
  10. $_SESSION['prefcharname'] = "No default selected";
  11. $_SESSION['charprofid'] = "0";
  12. } else {
  13. // $scp = Selected CharID Preferrence
  14. $scp = $con->prepare("SELECT charid, charname, profid FROM gwchars WHERE charid = ? AND accid = ? AND userid = ?");
  15. $scp->bind_param("iii", $_POST['prefcharid'], $_SESSION['prefaccid'], $_SESSION['userid']);
  16. $scp->execute();
  17. $result = $scp->get_result();
  18. while ($row = $result->fetch_assoc()) {
  19. $uap = $con->prepare("UPDATE userinfo SET prefcharid = ?, prefcharname = ? WHERE userid = ?");
  20. $uap->bind_param("isi", $_POST['prefcharid'], $row['charname'], $_SESSION['userid']);
  21. $uap->execute();
  22. $uap->close();
  23. $_SESSION['prefcharid'] = $row['charid'];
  24. $_SESSION['prefcharname'] = $row['charname'];
  25. $_SESSION['charprofid'] = $row['profid'];
  26. }
  27. }
  28. }
  29. ?>