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.
 
 
 

81 lines
3.0 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. if ($con->connect_errno > 0){
  10. die ('Unable to connect to database [' . $db->connect_errno . ']');
  11. }
  12. echo 'At ';
  13. $sqlmaplocation = "SELECT `location`, `wikilink` FROM `treasurelocation` WHERE `treasureid` = $location";
  14. if (!$result = $con->query($sqlmaplocation)){
  15. die ('There was an error running the query [' . $con->error . ']');
  16. }
  17. while ($row = $result->fetch_array()){
  18. $locname = $row['location'];
  19. $loclink = $row['wikilink'];
  20. echo '<A HREF="' . $loclink . '">' . $locname . '</A>';
  21. }
  22. echo ' a ';
  23. //code for white blue purple etc
  24. $sqlweaprare = "SELECT * FROM `listrarity` ORDER BY `rareid` ASC";
  25. if (!$result = $con->query($sqlweaprare)){
  26. die ('There was an error running the query [' . $con->error . ']');
  27. }
  28. echo '<SELECT NAME="rare">';
  29. while ($row = $result->fetch_array()){
  30. $rareid = $row['rareid'];
  31. $rarity = $row['rarity'];
  32. echo '<OPTION VALUE="' . $rareid . '">' . $rarity . '</OPTION>';
  33. }
  34. echo '</SELECT>, ';
  35. //code for weapon attribute requirment
  36. $sqlweapreq = "SELECT * FROM `listreq` ORDER BY `req` ASC";
  37. if (!$result = $con->query($sqlweapreq)){
  38. die ('There was an error running the query [' . $con->error . ']');
  39. }
  40. echo 'req<SELECT NAME="requirement">';
  41. while ($row = $result->fetch_array()){
  42. $reqid = $row['req'];
  43. echo '<OPTION VALUE="' . $reqid . '">' . $reqid . '</OPTION>';
  44. }
  45. echo '</SELECT>';
  46. //code for what attribute the weapon is (command, axe mastery, energy storage, etc
  47. $sqlweapattr = "SELECT * FROM `listattribute` ORDER BY `weapattrid` ASC";
  48. if (!$result = $con->query($sqlweapattr)){
  49. die ('There was an error running the query [' . $con->error . ']');
  50. }
  51. echo '<SELECT NAME="attribute">';
  52. while ($row = $result->fetch_array()){
  53. $attrid = $row['weapattrid'];
  54. $weapattr = $row['weaponattribute'];
  55. echo '<OPTION VALUE="' . $attrid . '">' . $weapattr . '</OPTION>';
  56. //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.
  57. }
  58. echo '</SELECT>';
  59. //code for what the weapon is - staff, dagger, scythe, wand, sword, etc
  60. $sqlweaptype = "SELECT * FROM `listtype` ORDER BY `weaponid` ASC";
  61. if (!$result = $con->query($sqlweaptype)){
  62. die ('There was an error running the query [' . $con->error . ']');
  63. }
  64. echo '<SELECT NAME="weapon">';
  65. while ($row = $result->fetch_array()){
  66. $typeid = $row['weaponid'];
  67. $weapon = $row['weapontype'];
  68. echo '<OPTION VALUE="' . $typeid . '">' . $weapon . '</OPTION>';
  69. //need to figure out how to display the options for weapon, material, or rune
  70. }
  71. echo '</SELECT>';
  72. echo ' <BR /><BR />';
  73. echo 'End result: a Gold r9 Swordsmanship Sword'; //need to arrange code blocks around to achieve this
  74. ?>