if ($minskill > $maxskill) { $tempskill = $minskill; $minskill = $maxskill; $maxskill = $tempskill; } $query = "SELECT {$tbtradeskillrecipe}.id,{$tbtradeskillrecipe}.name,\n\t\t\t\t{$tbtradeskillrecipe}.tradeskill,{$tbtradeskillrecipe}.trivial\n\t\t\t\tFROM {$tbtradeskillrecipe}"; $s = "WHERE"; if ($iname != "") { $iname = str_replace(' ', '%', addslashes($iname)); $query .= " {$s} {$tbtradeskillrecipe}.name like '%" . $iname . "%'"; $s = "AND"; } if ($iskill > 0) { $query .= " {$s} {$tbtradeskillrecipe}.tradeskill={$iskill}"; $s = "AND"; } if ($minskill > 0) { $query .= " {$s} {$tbtradeskillrecipe}.trivial>={$minskill}"; $s = "AND"; } if ($maxskill > 0) { $query .= " {$s} {$tbtradeskillrecipe}.trivial<={$maxskill}"; $s = "AND"; } $query .= " ORDER BY {$tbtradeskillrecipe}.name"; $result = mysql_query($query) or message_die('recipes.php', 'MYSQL_QUERY', $query, mysql_error()); if (isset($result)) { PrintQueryResults($result, $MaxItemsReturned, "recipe.php", "recipe", "recipes", "id", "name", "trivial", "trivial at level", "tradeskill"); } } include $includes_dir . "footers.php";
$Query .= " AND {$tbnpctypes}.race != 127 AND {$tbnpctypes}.race != 240"; } $Query .= " ORDER BY {$tbnpctypes}.Name, {$tbnpctypes}.id LIMIT " . (LimitToUse($MaxNpcsReturned) + 1); $QueryResult = mysql_query($Query) or message_die('npcs.php', 'MYSQL_QUERY', $Query, mysql_error()); if (mysql_num_rows($QueryResult) == 1) { $row = mysql_fetch_array($QueryResult); header("Location: npc.php?id=" . $row["id"]); exit; } } /** Here the following holds : * $QueryResult : NPCs queried for if any query was issued, otherwise it is not defined * $iname : previously-typed query, or empty by default * $isearch is set if a query was issued */ $Title = "NPCs search"; $XhtmlCompliant = TRUE; include $includes_dir . 'headers.php'; echo "<center><table border='0' width='0%'><form method='GET' action='" . $PHP_SELF . "'>\n"; echo "<tr align='left'>\n"; echo "<td nowrap='1'><b>Name : </b></td>\n"; echo "<td><input type='text' value=\"{$iname}\" size='30' name='iname'></td>\n"; echo "</tr>\n"; echo "<tr tr align='left'>\n"; echo "<td nowrap='1' colspan='2'><input type='submit' value='Search' name='isearch'/></td>\n"; echo "</tr>\n"; echo "</form></table></center>\n"; if (isset($QueryResult)) { PrintQueryResults($QueryResult, $MaxNpcsReturned, "npc.php", "npc", "npcs", "id", "name"); } include $includes_dir . "footers.php";
} $Query = "SELECT {$tbfactionlist}.id,{$tbfactionlist}.name\n\t\t\t\tFROM {$tbfactionlist}\n\t\t\t\tWHERE {$tbfactionlist}.name like '%" . $name . "%'\n\t\t\t\tORDER BY {$tbfactionlist}.name\n\t\t\t\tLIMIT " . (LimitToUse($MaxFactionsReturned) + 1); $QueryResult = mysql_query($Query) or message_die('factions.php', 'MYSQL_QUERY', $Query, mysql_error()); if (mysql_num_rows($QueryResult) == 1) { $row = mysql_fetch_array($QueryResult); header("Location: faction.php?id=" . $row["id"]); exit; } } /** Here the following holds : * $QueryResult : factions queried for if any query was issued, otherwise it is not defined * $iname : previously-typed query, or empty by default * $isearch is set if a query was issued */ $Title = "Faction Search"; $XhtmlCompliant = TRUE; include $includes_dir . 'headers.php'; print "<center><table border='0' width='0%'><form method='GET' action='" . $PHP_SELF . "'>\n"; print "<tr>\n"; print "<td nowrap='1'><b>Search : </b></td>\n"; print "<td><input type='text' value=\"{$iname}\" size='30' name='iname'/></td>\n"; print "</tr>"; print "<tr align='center'>"; print "<td nowrap='1' colspan='2'><input type='submit' value='Search' name='isearch' class='form'/></td>\n"; print "</tr>\n"; print "</form></table></center>\n"; print "\n"; if (isset($QueryResult)) { PrintQueryResults($QueryResult, $MaxFactionsReturned, "faction.php", "faction", "factions", "id", "name"); } include $includes_dir . "footers.php";