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.
 
 
 

91 lines
3.6 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, $_GET['gwdrop']);
  10. if ($con->connect_errno > 0){
  11. die ('Unable to connect to database [' . $db->connect_errno . ']');
  12. }
  13. echo 'At ';
  14. $sqlmaplocation = "SELECT `location`, `wikilink` 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. echo '<A HREF="' . $loclink . '">' . $locname . '</A>';
  22. }
  23. echo ' a ';
  24. #experimental stuff
  25. echo '<FORM><SELECT NAME="gwdrop" onchange="this.form.submit()">';
  26. echo '<OPTION SELECTED DISABLED>choose one</OPTION>';
  27. echo '<OPTION VALUE="1">weapon</OPTION>';
  28. echo '<OPTION VALUE="2">material</OPTION>';
  29. echo '<OPTION VALUE="3">rune</OPTION></SELECT>';
  30. echo '<NOSCRIPT><INPUT TYPE="SUBMIT" VALUE="SUBMIT"></NOSCRIPT></FORM>';
  31. echo '<BR /><BR />Current drop value is: ' . $whatdropped . '</BR /><BR />'; //if this works then it's time to make a big as if else statement
  32. //code for white blue purple etc
  33. $sqlweaprare = "SELECT * FROM `listrarity` ORDER BY `rareid` ASC";
  34. if (!$result = $con->query($sqlweaprare)){
  35. die ('There was an error running the query [' . $con->error . ']');
  36. }
  37. echo '<SELECT NAME="rare">';
  38. while ($row = $result->fetch_array()){
  39. $rareid = $row['rareid'];
  40. $rarity = $row['rarity'];
  41. echo '<OPTION VALUE="' . $rareid . '">' . $rarity . '</OPTION>';
  42. }
  43. echo '</SELECT>, ';
  44. //code for weapon attribute requirment
  45. $sqlweapreq = "SELECT * FROM `listreq` ORDER BY `req` ASC";
  46. if (!$result = $con->query($sqlweapreq)){
  47. die ('There was an error running the query [' . $con->error . ']');
  48. }
  49. echo 'req<SELECT NAME="requirement">';
  50. while ($row = $result->fetch_array()){
  51. $reqid = $row['req'];
  52. echo '<OPTION VALUE="' . $reqid . '">' . $reqid . '</OPTION>';
  53. }
  54. echo '</SELECT>';
  55. //code for what attribute the weapon is (command, axe mastery, energy storage, etc
  56. $sqlweapattr = "SELECT * FROM `listattribute` ORDER BY `weapattrid` ASC";
  57. if (!$result = $con->query($sqlweapattr)){
  58. die ('There was an error running the query [' . $con->error . ']');
  59. }
  60. echo '<SELECT NAME="attribute">';
  61. while ($row = $result->fetch_array()){
  62. $attrid = $row['weapattrid'];
  63. $weapattr = $row['weaponattribute'];
  64. echo '<OPTION VALUE="' . $attrid . '">' . $weapattr . '</OPTION>';
  65. //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.
  66. }
  67. echo '</SELECT>';
  68. //code for what the weapon is - staff, dagger, scythe, wand, sword, etc
  69. $sqlweaptype = "SELECT * FROM `listtype` ORDER BY `weaponid` ASC";
  70. if (!$result = $con->query($sqlweaptype)){
  71. die ('There was an error running the query [' . $con->error . ']');
  72. }
  73. echo '<SELECT NAME="weapon">';
  74. while ($row = $result->fetch_array()){
  75. $typeid = $row['weaponid'];
  76. $weapon = $row['weapontype'];
  77. echo '<OPTION VALUE="' . $typeid . '">' . $weapon . '</OPTION>';
  78. //need to figure out how to display the options for weapon, material, or rune
  79. }
  80. echo '</SELECT>';
  81. echo ' and |code for gold dropped here| gold pieces';
  82. echo ' <BR /><BR />';
  83. echo 'End result: a Gold r9 Swordsmanship Sword'; //need to arrange code blocks around to achieve this
  84. ?>