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.
 
 
 

88 lines
3.5 KiB

  1. <!DOCTYPE html>
  2. <HTML>
  3. <HEAD>
  4. <link rel="stylesheet" type="text/css" href="gw-style.css">
  5. <TITLE>Treasure Data</TITLE>
  6. </HEAD>
  7. <BODY>
  8. <?php
  9. session_start();
  10. include_once 'gw-connect.php';
  11. $con = new mysqli(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME);
  12. //$cnameid = mysqli_real_escape_string($con, $_POST['cnameid']); //need to sanitize & validate this input somehow
  13. $cnameid = $_SESSION['playerid'];
  14. if ($con->connect_errno > 0){
  15. die ('Unable to connect to database [' . $db->connect_errno . ']');
  16. }
  17. $sql = "SELECT history.*, treasurelocation.*, playername.`playerid`, playername.`charname` FROM ((history INNER JOIN treasurelocation ON history.`locationid` = treasurelocation.`treasureid`) INNER JOIN playername ON history.`charnameid` = playername.`playerid`) WHERE history.`charnameid` = '$cnameid' ORDER BY `historydate`,`historyid` ASC";
  18. if (!$result = $con->query($sql)){
  19. die ('There was an error running the query [' . $con->error . ']');
  20. }
  21. if (mysqli_num_rows($result) > 0) {
  22. while ($row = $result->fetch_array()){
  23. echo 'On ' . $row['historydate'] . ', "' . $row['charname'] . '" got ' . $row['goldrec'] . 'GP and ';
  24. if ($row['itemtype'] == 16) { //this would be a rune
  25. $runeid = $row['runetype'];
  26. $sqlrune = "SELECT listrunes.`runeid`, listrunes.`runes` FROM listrunes WHERE listrunes.`runeid` = $runeid";
  27. if (!$result2 = $con->query($sqlrune)){
  28. die ('There was an error running the query [' . $con->error . ']');
  29. }
  30. while ($row2 = $result2->fetch_array()){
  31. echo 'a rune of ' . $row2['runes'];
  32. }
  33. } else if ($row['itemtype'] == 17) { //nothing dropped, but showing the recorded date
  34. echo 'nothing dropped at this location on this date';
  35. } else {
  36. if (is_null($row['material'])) {
  37. $itemrarity = $row['itemrarity'];
  38. $itemattr = $row['itemattribute'];
  39. $itemweap = $row['itemtype'];
  40. $sqlrare = "SELECT listrarity.* FROM listrarity WHERE listrarity.`rareid` = $itemrarity";
  41. $sqlattr = "SELECT listattribute.* FROM listattribute WHERE listattribute.`weapattrid` = $itemattr";
  42. $sqlweap = "SELECT listtype.* FROM listtype WHERE listtype.`weaponid` = $itemweap";
  43. if (!$resultrarity = $con->query($sqlrare)){
  44. die ('There was an error running the query [' . $con->error . ']');
  45. }
  46. while ($row3 = $resultrarity->fetch_array()){
  47. echo 'a ' . $row3['rarity'];
  48. }
  49. echo ' r' . $row['itemreq'];
  50. if (!$resultattr = $con->query($sqlattr)){
  51. die ('There was an error running the query [' . $con->error . ']');
  52. }
  53. while ($row4 = $resultattr->fetch_array()){
  54. echo ' ' . $row4['weaponattribute'];
  55. }
  56. if (!$resultweap = $con->query($sqlweap)){
  57. die ('There was an error running the query [' . $con->error . ']');
  58. }
  59. while ($row5 = $resultweap->fetch_array()){
  60. echo ' ' . $row5['weapontype'];
  61. }
  62. echo ' named ' . $row['itemname'];
  63. } else {
  64. $matid = $row['material'];
  65. $sqlmat = "SELECT material FROM materials WHERE materialid = $matid";
  66. if (!$resultmats = $con->query($sqlmat)){
  67. die ('There was an error running the query [' . $con->error . ']');
  68. }
  69. while ($row6 = $resultmats->fetch_array()){
  70. echo 'a ' . $row6['material'];
  71. }
  72. }
  73. }
  74. echo ' at <A HREF="' . $row['wikilink'] . '" CLASS="navlink">' . $row['location'] . '</A><BR />';
  75. }
  76. } else {
  77. echo '<CENTER>There is no data to display for that character yet</CENTER><BR />';
  78. }
  79. ?>
  80. <BR />
  81. <CENTER>
  82. <FORM METHOD="POST" ACTION="gw-toon.php">
  83. <INPUT TYPE="HIDDEN" NAME="cnameid" VALUE="0">
  84. <INPUT TYPE="SUBMIT" VALUE="Return to character selection">
  85. </FORM>
  86. </CENTER>
  87. </BODY>
  88. </HTML>