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.
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

102 lines
4.2 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. //code for white blue purple etc
  27. $sqlweaprare = "SELECT * FROM `listrarity` ORDER BY `rareid` ASC";
  28. if (!$result = $con->query($sqlweaprare)){
  29. die ('There was an error running the query [' . $con->error . ']');
  30. }
  31. echo '<SELECT NAME="rare">';
  32. while ($row = $result->fetch_array()){
  33. $rareid = $row['rareid'];
  34. $rarity = $row['rarity'];
  35. echo '<OPTION VALUE="' . $rareid . '">' . $rarity . '</OPTION>';
  36. }
  37. echo '</SELECT>, ';
  38. //code for weapon attribute requirment
  39. $sqlweapreq = "SELECT * FROM `listreq` ORDER BY `req` ASC";
  40. if (!$result = $con->query($sqlweapreq)){
  41. die ('There was an error running the query [' . $con->error . ']');
  42. }
  43. echo 'req<SELECT NAME="requirement">';
  44. while ($row = $result->fetch_array()){
  45. $reqid = $row['req'];
  46. echo '<OPTION VALUE="' . $reqid . '">' . $reqid . '</OPTION>';
  47. }
  48. echo '</SELECT>';
  49. //code for what attribute the weapon is (command, axe mastery, energy storage, etc
  50. $sqlweapattr = "SELECT * FROM `listattribute` ORDER BY `weapattrid` ASC";
  51. if (!$result = $con->query($sqlweapattr)){
  52. die ('There was an error running the query [' . $con->error . ']');
  53. }
  54. echo '<SELECT NAME="attribute">';
  55. while ($row = $result->fetch_array()){
  56. $attrid = $row['weapattrid'];
  57. $weapattr = $row['weaponattribute'];
  58. echo '<OPTION VALUE="' . $attrid . '">' . $weapattr . '</OPTION>';
  59. //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.
  60. }
  61. echo '</SELECT>';
  62. //code for what the weapon is - staff, dagger, scythe, wand, sword, etc
  63. $sqlweaptype = "SELECT * FROM `listtype` ORDER BY `weaponid` ASC";
  64. if (!$result = $con->query($sqlweaptype)){
  65. die ('There was an error running the query [' . $con->error . ']');
  66. }
  67. echo '<SELECT NAME="weapon">';
  68. while ($row = $result->fetch_array()){
  69. $typeid = $row['weaponid'];
  70. $weapon = $row['weapontype'];
  71. echo '<OPTION VALUE="' . $typeid . '">' . $weapon . '</OPTION>';
  72. }
  73. echo '</SELECT>';
  74. } else if ($whatdropped == "2"){
  75. echo '<FORM METHOD="POST" ACTION="gw-insert.php">';
  76. //code for what rare material dropped
  77. $sqlraremat = "SELECT * FROM `materials` ORDER BY `materialid` ASC";
  78. if (!$result = $con->query($sqlraremat)){
  79. die ('There was an error running the query [' . $con->error . ']');
  80. }
  81. echo '<SELECT NAME="rarematerial">';
  82. while ($row = $result->fetch_array()){
  83. $matid = $row['materialid'];
  84. $raremat = $row['material'];
  85. echo '<OPTION VALUE="' . $matid . '">' . $raremat . '</OPTION>';
  86. }
  87. echo '</SELECT> ';
  88. echo ' and |code for gold dropped here| gold pieces. FYI, the loclink variable is set to '. $locid . ' ';
  89. echo '<INPUT TYPE="HIDDEN" NAME="droptype" VALUE="2">';
  90. echo ' <BR /><CENTER><INPUT TYPE="SUBMIT" VALUE="Click me!"></FORM></CENTER><BR />';
  91. } else if ($whatdropped == "3"){
  92. echo 'run rune code';
  93. } else {
  94. echo '<FORM METHOD="POST"><SELECT NAME="gwdrop" onchange="this.form.submit()">';
  95. echo '<OPTION SELECTED DISABLED>choose one</OPTION>';
  96. echo '<OPTION VALUE="1">weapon</OPTION>';
  97. echo '<OPTION VALUE="2">material</OPTION>';
  98. echo '<OPTION VALUE="3">rune</OPTION></SELECT>';
  99. echo '<NOSCRIPT><INPUT TYPE="SUBMIT" VALUE="SUBMIT"></NOSCRIPT></FORM>';
  100. }
  101. echo 'Reload the page with no GET data? <A HREF="gw-record.php">RELOAD</A>';
  102. ?>