Just a web script to help track when, where, and what you got from the free treasures scattered about Nightfall in the game Guild Wars.
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

121 linhas
5.4 KiB

  1. <TITLE>What Dropped?</TITLE>
  2. <?php
  3. include_once 'gw-connect.php';
  4. $con = new mysqli(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME);
  5. #$toonid = mysqli_real_escape_string($con, $_POST['playerid']); //enable this after character selection is working
  6. $toonid = 'Chrissi Chan';
  7. #$location = mysqli_real_escape_string($con, $_POST['locationid']); //enable this after location selection is working
  8. $location = 4;
  9. $whatdropped = mysqli_real_escape_string($con, $_POST['gwdrop']);
  10. if ($con->connect_errno > 0){
  11. die ('Unable to connect to database [' . $db->connect_errno . ']');
  12. }
  13. echo 'At ';
  14. $sqlmaplocation = "SELECT * FROM `treasurelocation` WHERE `treasureid` = $location";
  15. if (!$result = $con->query($sqlmaplocation)){
  16. die ('There was an error running the query [' . $con->error . ']');
  17. }
  18. while ($row = $result->fetch_array()){
  19. $locname = $row['location'];
  20. $loclink = $row['wikilink'];
  21. $locid = $row['treasureid'];
  22. echo '<A HREF="' . $loclink . '">' . $locname . '</A>';
  23. }
  24. echo ' a ';
  25. if ($whatdropped == "1"){
  26. echo '<FORM METHOD="POST" ACTION="gw-insert.php">';
  27. //code for white blue purple etc
  28. $sqlweaprare = "SELECT * FROM `listrarity` ORDER BY `rareid` ASC";
  29. if (!$result = $con->query($sqlweaprare)){
  30. die ('There was an error running the query [' . $con->error . ']');
  31. }
  32. echo '<SELECT NAME="rare">';
  33. while ($row = $result->fetch_array()){
  34. $rareid = $row['rareid'];
  35. $rarity = $row['rarity'];
  36. echo '<OPTION VALUE="' . $rareid . '">' . $rarity . '</OPTION>';
  37. }
  38. echo '</SELECT>, ';
  39. //code for weapon attribute requirment
  40. $sqlweapreq = "SELECT * FROM `listreq` ORDER BY `req` ASC";
  41. if (!$result = $con->query($sqlweapreq)){
  42. die ('There was an error running the query [' . $con->error . ']');
  43. }
  44. echo 'req<SELECT NAME="requirement">';
  45. while ($row = $result->fetch_array()){
  46. $reqid = $row['req'];
  47. echo '<OPTION VALUE="' . $reqid . '">' . $reqid . '</OPTION>';
  48. }
  49. echo '</SELECT>';
  50. //code for what attribute the weapon is (command, axe mastery, energy storage, etc
  51. $sqlweapattr = "SELECT * FROM `listattribute` ORDER BY `weapattrid` ASC";
  52. if (!$result = $con->query($sqlweapattr)){
  53. die ('There was an error running the query [' . $con->error . ']');
  54. }
  55. echo '<SELECT NAME="attribute">';
  56. while ($row = $result->fetch_array()){
  57. $attrid = $row['weapattrid'];
  58. $weapattr = $row['weaponattribute'];
  59. echo '<OPTION VALUE="' . $attrid . '">' . $weapattr . '</OPTION>';
  60. //need to add a nested while loop, to preselect the weapon with the attribute, or somehow java it? An r9 Axe of Energy Storage combo doesn't exist.
  61. }
  62. echo '</SELECT>';
  63. //code for what the weapon is - staff, dagger, scythe, wand, sword, etc
  64. $sqlweaptype = "SELECT * FROM `listtype` ORDER BY `weaponid` ASC";
  65. if (!$result = $con->query($sqlweaptype)){
  66. die ('There was an error running the query [' . $con->error . ']');
  67. }
  68. echo '<SELECT NAME="weapon">';
  69. while ($row = $result->fetch_array()){
  70. $typeid = $row['weaponid'];
  71. $weapon = $row['weapontype'];
  72. echo '<OPTION VALUE="' . $typeid . '">' . $weapon . '</OPTION>';
  73. }
  74. echo '</SELECT>';
  75. echo ' and |code for gold dropped here| gold pieces. FYI, the loclink variable is set to '. $locid . ' ';
  76. echo '<INPUT TYPE="HIDDEN" NAME="droptype" VALUE="2"><INPUT TYPE="HIDDEN" NAME="location" VALUE="' . $locid .'">';
  77. echo ' <BR /><CENTER><INPUT TYPE="SUBMIT" VALUE="Click me!"></FORM></CENTER><BR />';
  78. } else if ($whatdropped == "2"){
  79. echo '<FORM METHOD="POST" ACTION="gw-insert.php">';
  80. //code for what rare material dropped
  81. $sqlraremat = "SELECT * FROM `materials` ORDER BY `materialid` ASC";
  82. if (!$result = $con->query($sqlraremat)){
  83. die ('There was an error running the query [' . $con->error . ']');
  84. }
  85. echo '<SELECT NAME="rarematerial">';
  86. while ($row = $result->fetch_array()){
  87. $matid = $row['materialid'];
  88. $raremat = $row['material'];
  89. echo '<OPTION VALUE="' . $matid . '">' . $raremat . '</OPTION>';
  90. }
  91. echo '</SELECT> ';
  92. echo ' and |code for gold dropped here| gold pieces. FYI, the loclink variable is set to '. $locid . ' ';
  93. echo '<INPUT TYPE="HIDDEN" NAME="droptype" VALUE="2"><INPUT TYPE="HIDDEN" NAME="location" VALUE="' . $locid .'">';
  94. echo ' <BR /><CENTER><INPUT TYPE="SUBMIT" VALUE="Click me!"></FORM></CENTER><BR />';
  95. } else if ($whatdropped == "3"){
  96. echo '<FORM METHOD="POST" ACTION="gw-insert.php">';
  97. //code for what rune dropped
  98. $sqlrune = "SELECT * FROM `listrunes` ORDER BY `runeid` ASC";
  99. if (!$result = $con->query($sqlrunes)){
  100. die ('There was an error running the query [' . $con->error . ']');
  101. }
  102. echo 'rune of <SELECT NAME="rune">';
  103. while ($row = $result->fetch_array()){
  104. $runeid = $row['runeid'];
  105. $rune = $row['runes'];
  106. echo '<OPTION VALUE="' . $runeid . '">' . $rune . '</OPTION>';
  107. }
  108. echo '</SELECT> ';
  109. echo ' and |code for gold dropped here| gold pieces. FYI, the loclink variable is set to '. $locid . ' ';
  110. echo '<INPUT TYPE="HIDDEN" NAME="droptype" VALUE="2"><INPUT TYPE="HIDDEN" NAME="location" VALUE="' . $locid .'">';
  111. echo ' <BR /><CENTER><INPUT TYPE="SUBMIT" VALUE="Click me!"></FORM></CENTER><BR />';
  112. } else {
  113. echo '<FORM METHOD="POST"><SELECT NAME="gwdrop" onchange="this.form.submit()">';
  114. echo '<OPTION SELECTED DISABLED>choose one</OPTION>';
  115. echo '<OPTION VALUE="1">weapon</OPTION>';
  116. echo '<OPTION VALUE="2">material</OPTION>';
  117. echo '<OPTION VALUE="3">rune</OPTION></SELECT>';
  118. echo '<NOSCRIPT><INPUT TYPE="SUBMIT" VALUE="SUBMIT"></NOSCRIPT></FORM>';
  119. }
  120. echo 'Reload the page with no GET data? <A HREF="gw-record.php">RELOAD</A>';
  121. ?>