gw-pull is sort of broken right now. maybe a 3rd inner join will fix it?development
| @@ -5,9 +5,13 @@ $con = new mysqli(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME); | |||||
| $gold = mysqli_real_escape_string($con, $_POST['droppedgold']); //how much gold dropped | $gold = mysqli_real_escape_string($con, $_POST['droppedgold']); //how much gold dropped | ||||
| $droptype = mysqli_real_escape_string($con, $_POST['droptype']); //this dictates if the drop was a weapon/rune/material | $droptype = mysqli_real_escape_string($con, $_POST['droptype']); //this dictates if the drop was a weapon/rune/material | ||||
| $locid = mysqli_real_escape_string($con, $_POST['location']); //this is `treasurelocation`.`treasureid` in the database | $locid = mysqli_real_escape_string($con, $_POST['location']); //this is `treasurelocation`.`treasureid` in the database | ||||
| $toonid = mysqli_real_escape_string($con, $_POST['chartoon']; //this is the id of the character doing the hunting | |||||
| if ($droptype == 1){ | if ($droptype == 1){ | ||||
| $rarity = mysqli_real_escape_string($con, $_POST['rare']); | $rarity = mysqli_real_escape_string($con, $_POST['rare']); | ||||
| echo 'a '. $rarity . ' drop was a weapon!<BR />'; | |||||
| $req = mysqli_real_escape_string($con, $_POST['requirement']); | |||||
| $attrib = mysqli_real_escape_string($con, $_POST['attribute']; | |||||
| $weap = mysqli_real_escape_string($con, $_POST['weapon']); | |||||
| echo 'SQL code to run: "INSERT INTO `history` (historydate, charnameid, locationid, goldrec, itemreq, itemtype, itemattribute, itemrarity, itemname) VALUES (\'$variable-date-of-treasure\', ' . $toonid . ', ' . $locid . ', ' . $gold . ', ' . $req . ', ' . $weap . ', '$variable-attribute-of-weapon', '$variable-rarity-of-weapon', '$variable-name-of-weapon');"'; | |||||
| } else if ($droptype == 2){ | } else if ($droptype == 2){ | ||||
| echo 'drop was a rare material!<BR />'; | echo 'drop was a rare material!<BR />'; | ||||
| } else if ($droptype == 3){ | } else if ($droptype == 3){ | ||||
| @@ -20,7 +20,7 @@ if (mysqli_num_rows($result) > 0) { | |||||
| echo 'a ' . $row['itemtype'] . ' of ' . $row['runetype']; | echo 'a ' . $row['itemtype'] . ' of ' . $row['runetype']; | ||||
| } else { | } else { | ||||
| if (is_null($row['material'])) { | if (is_null($row['material'])) { | ||||
| echo 'a ' . $row['itemrarity'] . ' r' . $row['itemreq'] . ' ' . $row['itemattribute'] . ' ' . $row['itemtype'] . ' named something stupid'; | |||||
| echo 'a ' . $row['itemrarity'] . ' r' . $row['itemreq'] . ' ' . $row['itemattribute'] . ' ' . $row['itemtype'] . ' named ' . $row['itemname'] . ''; //itemtype changed, need to convert itemtype to something readable | |||||
| } else { | } else { | ||||
| echo 'a ' . $row['material']; | echo 'a ' . $row['material']; | ||||
| } | } | ||||
| @@ -71,9 +71,10 @@ if ($whatdropped == "1"){ | |||||
| $weapon = $row['weapontype']; | $weapon = $row['weapontype']; | ||||
| echo '<OPTION VALUE="' . $typeid . '">' . $weapon . '</OPTION>'; | echo '<OPTION VALUE="' . $typeid . '">' . $weapon . '</OPTION>'; | ||||
| } | } | ||||
| echo '</SELECT>'; | |||||
| echo '</SELECT> called the <INPUT TYPE="TEXT" NAME="itemname" MAXLENGTH="100" SIZE="40">'; | |||||
| echo ' and <INPUT TYPE="NUMBER" NAME="droppedgold" SIZE="4" MIN="1" MAX="9999"> gold pieces.'; | echo ' and <INPUT TYPE="NUMBER" NAME="droppedgold" SIZE="4" MIN="1" MAX="9999"> gold pieces.'; | ||||
| echo '<INPUT TYPE="HIDDEN" NAME="droptype" VALUE="1"><INPUT TYPE="HIDDEN" NAME="location" VALUE="' . $locid .'">'; | echo '<INPUT TYPE="HIDDEN" NAME="droptype" VALUE="1"><INPUT TYPE="HIDDEN" NAME="location" VALUE="' . $locid .'">'; | ||||
| echo '<INPUT TYPE="HIDDEN" NAME="chartoon" VALUE="' . $toonid .'">'; | |||||
| echo ' <BR /><CENTER><INPUT TYPE="SUBMIT" VALUE="Click me!"></FORM></CENTER><BR />'; | echo ' <BR /><CENTER><INPUT TYPE="SUBMIT" VALUE="Click me!"></FORM></CENTER><BR />'; | ||||
| } else if ($whatdropped == "2"){ | } else if ($whatdropped == "2"){ | ||||
| echo '<FORM METHOD="POST" ACTION="gw-insert.php">'; | echo '<FORM METHOD="POST" ACTION="gw-insert.php">'; | ||||