Guild Wars stat tracking The idea behind this is to track multiple characters individual stats as well as account stats.
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 

37 satır
1.5 KiB

  1. <?php
  2. if (isset($_SESSION['userid'])) {
  3. if ($_POST['prefaccid'] == "nopref") {
  4. // $nap = No AccountID Preferrence
  5. $nap = $con->prepare("UPDATE userinfo SET prefaccid = 0, prefaccname = 'No default selected' WHERE userid = ?");
  6. $nap->bind_param("i", $_SESSION['userid']);
  7. $nap->execute();
  8. $nap->close();
  9. $_SESSION['prefaccid'] = "0";
  10. $_SESSION['prefaccname'] = "No default selected";
  11. echo 'Account preference update - no preferred account selected.<br />';
  12. } else {
  13. // $sap = Select AccountID Preferrence
  14. $sap = $con->prepare("SELECT accid, accemail FROM gwaccounts WHERE accid = ? AND userid = ?");
  15. $sap->bind_param("ii", $_POST['prefaccid'], $_SESSION['userid']);
  16. $sap->execute();
  17. $result = $sap->get_result();
  18. while ($row = $result->fetch_assoc()) {
  19. $uap = $con->prepare("UPDATE userinfo SET prefaccid = ?, prefaccname = ? WHERE userid = ?");
  20. $uap->bind_param("isi", $_POST['prefaccid'], $row['accemail'], $_SESSION['userid']);
  21. $uap->execute();
  22. $uap->close();
  23. $_SESSION['prefaccid'] = $row['accid'];
  24. $_SESSION['prefaccname'] = $row['accemail'];
  25. }
  26. $sap->close();
  27. }
  28. $ncp = $con->prepare("UPDATE userinfo SET prefcharid = 0, prefcharname = 'No default selected' WHERE userid = ?");
  29. $ncp->bind_param("i", $_SESSION['userid']);
  30. $ncp->execute();
  31. $ncp->close();
  32. $_SESSION['prefcharid'] = "0";
  33. $_SESSION['prefcharname'] = "No default selected";
  34. $_SESSION['charprofid'] = "0";
  35. echo 'Guild Wars preferred account updated! <br />';
  36. }
  37. ?>