|
|
@@ -106,88 +106,88 @@
|
|
|
$this->filters = FILTER::RUNECRAFT;
|
|
|
// Monster
|
|
|
if (isset($_GET["monster_min_stars"]) && intval($_GET["monster_min_stars"]) > 0 && intval($_GET["monster_min_stars"]) < 7){
|
|
|
- $this->filters["monster_min_stars"] = $_GET["monster_min_stars"];
|
|
|
+ $this->filters["MONSTER_MIN_STARS"] = $_GET["monster_min_stars"];
|
|
|
}
|
|
|
if (isset($_GET["monster_max_stars"]) && intval($_GET["monster_max_stars"]) > 0 && intval($_GET["monster_max_stars"]) < 7){
|
|
|
- $this->filters["monster_max_stars"] = $_GET["monster_max_stars"];
|
|
|
+ $this->filters["MONSTER_MAX_STARS"] = $_GET["monster_max_stars"];
|
|
|
}
|
|
|
if (isset($_GET["monster_in_storage"]) && $_GET["monster_in_storage"] == "on"){
|
|
|
- $this->filters["monster_in_storage"] = true;
|
|
|
+ $this->filters["MONSTER_IN_STORAGE"] = true;
|
|
|
}
|
|
|
else{
|
|
|
- $this->filters["monster_in_storage"] = false;
|
|
|
+ $this->filters["MONSTER_IN_STORAGE"] = false;
|
|
|
}
|
|
|
if (isset($_GET["monster_name"]) && strlen($_GET["monster_name"]) > 0){
|
|
|
- $this->filters["monster_name"] = SQLite3::escapeString($_GET["monster_name"]);
|
|
|
+ $this->filters["MONSTER_NAME"] = SQLite3::escapeString($_GET["monster_name"]);
|
|
|
}
|
|
|
// Runes
|
|
|
if (isset($_GET["rune_min_stars"]) && intval($_GET["rune_min_stars"]) > 0 && intval($_GET["rune_min_stars"]) < 7){
|
|
|
- $this->filters["rune_min_stars"] = $_GET["rune_min_stars"];
|
|
|
+ $this->filters["RUNE_MIN_STARS"] = $_GET["rune_min_stars"];
|
|
|
}
|
|
|
if (isset($_GET["rune_max_stars"]) && intval($_GET["rune_max_stars"]) > 0 && intval($_GET["rune_max_stars"]) < 7){
|
|
|
- $this->filters["rune_max_stars"] = $_GET["rune_max_stars"];
|
|
|
+ $this->filters["RUNE_MAX_STARS"] = $_GET["rune_max_stars"];
|
|
|
}
|
|
|
if (isset($_GET["rune_min_level"]) && intval($_GET["rune_min_level"]) >= 0 && intval($_GET["rune_min_level"]) <= 15){
|
|
|
- $this->filters["rune_min_level"] = $_GET["rune_min_level"];
|
|
|
+ $this->filters["RUNE_MIN_LEVEL"] = $_GET["rune_min_level"];
|
|
|
}
|
|
|
if (isset($_GET["rune_max_level"]) && intval($_GET["rune_max_level"]) >= 0 && intval($_GET["rune_max_level"]) <= 15){
|
|
|
- $this->filters["rune_max_level"] = $_GET["rune_max_level"];
|
|
|
+ $this->filters["RUNE_MAX_LEVEL"] = $_GET["rune_max_level"];
|
|
|
}
|
|
|
if (isset($_GET["rune_min_quality"]) && intval($_GET["rune_min_quality"]) >= QUALITY_ID::NORMAL && intval($_GET["rune_min_quality"]) <= QUALITY_ID::LEGEND){
|
|
|
- $this->filters["rune_min_quality"] = $_GET["rune_min_quality"];
|
|
|
+ $this->filters["RUNE_MIN_QUALITY"] = $_GET["rune_min_quality"];
|
|
|
}
|
|
|
if (isset($_GET["rune_max_quality"]) && intval($_GET["rune_max_quality"]) >= QUALITY_ID::NORMAL && intval($_GET["rune_max_quality"]) <= QUALITY_ID::LEGEND){
|
|
|
- $this->filters["rune_max_quality"] = $_GET["rune_max_quality"];
|
|
|
+ $this->filters["RUNE_MAX_QUALITY"] = $_GET["rune_max_quality"];
|
|
|
}
|
|
|
if (isset($_GET["rune_min_original_quality"]) && intval($_GET["rune_min_original_quality"]) >= QUALITY_ID::NORMAL && intval($_GET["rune_min_original_quality"]) <= QUALITY_ID::LEGEND){
|
|
|
- $this->filters["rune_min_original_quality"] = $_GET["rune_min_original_quality"];
|
|
|
+ $this->filters["RUNE_MIN_ORIGINAL_QUALITY"] = $_GET["rune_min_original_quality"];
|
|
|
}
|
|
|
if (isset($_GET["rune_max_original_quality"]) && intval($_GET["rune_max_original_quality"]) >= QUALITY_ID::NORMAL && intval($_GET["rune_max_original_quality"]) <= QUALITY_ID::LEGEND){
|
|
|
- $this->filters["rune_max_original_quality"] = $_GET["rune_max_original_quality"];
|
|
|
+ $this->filters["RUNE_MAX_ORIGINAL_QUALITY"] = $_GET["rune_max_original_quality"];
|
|
|
}
|
|
|
if (isset($_GET["rune_min_efficiency"]) && intval($_GET["rune_min_efficiency"]) >= 0 && intval($_GET["rune_min_efficiency"]) <= 100){
|
|
|
- $this->filters["rune_min_efficiency"] = $_GET["rune_min_efficiency"];
|
|
|
+ $this->filters["RUNE_MIN_EFFICIENCY"] = $_GET["rune_min_efficiency"];
|
|
|
}
|
|
|
if (isset($_GET["rune_max_efficiency"]) && intval($_GET["rune_max_efficiency"]) >= 0 && intval($_GET["rune_max_efficiency"]) <= 100){
|
|
|
- $this->filters["rune_max_efficiency"] = $_GET["rune_max_efficiency"];
|
|
|
+ $this->filters["RUNE_MAX_EFFICIENCY"] = $_GET["rune_max_efficiency"];
|
|
|
}
|
|
|
if (isset($_GET["rune_min_max_efficiency"]) && intval($_GET["rune_min_max_efficiency"]) >= 0 && intval($_GET["rune_min_max_efficiency"]) <= 100){
|
|
|
- $this->filters["rune_min_max_efficiency"] = $_GET["rune_min_max_efficiency"];
|
|
|
+ $this->filters["RUNE_MIN_MAX_EFFICIENCY"] = $_GET["rune_min_max_efficiency"];
|
|
|
}
|
|
|
if (isset($_GET["rune_max_max_efficiency"]) && intval($_GET["rune_max_max_efficiency"]) >= 0 && intval($_GET["rune_max_max_efficiency"]) <= 100){
|
|
|
- $this->filters["rune_max_max_efficiency"] = $_GET["rune_max_max_efficiency"];
|
|
|
+ $this->filters["RUNE_MAX_MAX_EFFICIENCY"] = $_GET["rune_max_max_efficiency"];
|
|
|
}
|
|
|
if (isset($_GET["rune_slot"])){
|
|
|
$slots = $_GET["rune_slot"];
|
|
|
foreach ($slots as $slot){
|
|
|
if (intval($slot) >= 1 && intval($slot) < 7){
|
|
|
- array_push($this->filters["rune_slot"], intval($slot));
|
|
|
+ array_push($this->filters["RUNE_SLOT"], intval($slot));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
// Grindstones
|
|
|
if (isset($_GET["grind_min_quality"]) && intval($_GET["grind_min_quality"]) >= QUALITY_ID::NORMAL && intval($_GET["grind_min_quality"]) < QUALITY_ID::LEGEND){
|
|
|
- $this->filters["grind_min_quality"] = $_GET["grind_min_quality"];
|
|
|
+ $this->filters["GRIND_MIN_QUALITY"] = $_GET["grind_min_quality"];
|
|
|
}
|
|
|
if (isset($_GET["grind_stat"])){
|
|
|
$stats = $_GET["grind_stat"];
|
|
|
- $this->filters["grind_stat"] = [];
|
|
|
+ $this->filters["GRIND_STAT"] = [];
|
|
|
foreach ($stats as $stat){
|
|
|
- array_push($this->filters["grind_stat"], intval($stat));
|
|
|
+ array_push($this->filters["GRIND_STAT"], intval($stat));
|
|
|
}
|
|
|
}
|
|
|
if (isset($_GET["gem_stat_from"])){
|
|
|
$stats = $_GET["gem_stat_from"];
|
|
|
- $this->filters["gem_stat_from"] = [];
|
|
|
+ $this->filters["GEM_STAT_FROM"] = [];
|
|
|
foreach ($stats as $stat){
|
|
|
- array_push($this->filters["gem_stat_from"], intval($stat));
|
|
|
+ array_push($this->filters["GEM_STAT_FROM"], intval($stat));
|
|
|
}
|
|
|
}
|
|
|
if (isset($_GET["gem_stat_to"])){
|
|
|
$stats = $_GET["gem_stat_to"];
|
|
|
- $this->filters["gem_stat_to"] = [];
|
|
|
+ $this->filters["GEM_STAT_TO"] = [];
|
|
|
foreach ($stats as $stat){
|
|
|
- array_push($this->filters["gem_stat_to"], intval($stat));
|
|
|
+ array_push($this->filters["GEM_STAT_TO"], intval($stat));
|
|
|
}
|
|
|
}
|
|
|
return;
|
|
|
@@ -219,36 +219,36 @@
|
|
|
unit.id = rune.assigned_to AND
|
|
|
unit.unit = k_unit.id AND
|
|
|
rune_craft.type = k_rune_craft_type.id AND
|
|
|
- unit.stars >= " . $this->filters["rune_min_stars"] . " AND
|
|
|
- unit.stars <= " . $this->filters["rune_max_stars"] . " AND
|
|
|
+ unit.stars >= " . $this->filters["RUNE_MIN_STARS"] . " AND
|
|
|
+ unit.stars <= " . $this->filters["RUNE_MAX_STARS"] . " AND
|
|
|
-- RUNE FILTERS
|
|
|
- rune.quality >= " . $this->filters["rune_min_quality"] . " AND
|
|
|
- rune.quality <= " . $this->filters["rune_max_quality"] . " AND
|
|
|
- rune.level >= " . $this->filters["rune_min_level"] . " AND
|
|
|
- rune.level <= " . $this->filters["rune_max_level"] . " AND
|
|
|
- rune.stars >= " . $this->filters["rune_min_stars"] . " AND
|
|
|
- rune.stars <= " . $this->filters["rune_max_stars"] . " AND
|
|
|
- rune.original_quality >= " . $this->filters["rune_min_original_quality"] . " AND
|
|
|
- rune.original_quality <= " . $this->filters["rune_max_original_quality"] . " AND
|
|
|
- rune.efficiency >= " . $this->filters["rune_min_efficiency"] . " AND
|
|
|
- rune.efficiency <= " . $this->filters["rune_max_efficiency"] . " AND
|
|
|
- rune.max_efficiency >= " . $this->filters["rune_min_max_efficiency"] . " AND
|
|
|
- rune.max_efficiency <= " . $this->filters["rune_max_max_efficiency"] . " AND
|
|
|
+ rune.quality >= " . $this->filters["RUNE_MIN_QUALITY"] . " AND
|
|
|
+ rune.quality <= " . $this->filters["RUNE_MAX_QUALITY"] . " AND
|
|
|
+ rune.level >= " . $this->filters["RUNE_MIN_LEVEL"] . " AND
|
|
|
+ rune.level <= " . $this->filters["RUNE_MAX_LEVEL"] . " AND
|
|
|
+ rune.stars >= " . $this->filters["RUNE_MIN_STARS"] . " AND
|
|
|
+ rune.stars <= " . $this->filters["RUNE_MAX_STARS"] . " AND
|
|
|
+ rune.original_quality >= " . $this->filters["RUNE_MIN_ORIGINAL_QUALITY"] . " AND
|
|
|
+ rune.original_quality <= " . $this->filters["RUNE_MAX_ORIGINAL_QUALITY"] . " AND
|
|
|
+ rune.efficiency >= " . $this->filters["RUNE_MIN_EFFICIENCY"] . " AND
|
|
|
+ rune.efficiency <= " . $this->filters["RUNE_MAX_EFFICIENCY"] . " AND
|
|
|
+ rune.max_efficiency >= " . $this->filters["RUNE_MIN_MAX_EFFICIENCY"] . " AND
|
|
|
+ rune.max_efficiency <= " . $this->filters["RUNE_MAX_MAX_EFFICIENCY"] . " AND
|
|
|
(
|
|
|
rune.type = rune_craft.rune OR
|
|
|
k_rune_craft_type.inmemorial = 1
|
|
|
) AND
|
|
|
k_rune_craft_type.ancient = rune.ancient AND
|
|
|
";
|
|
|
- if (strlen($this->filters["monster_name"]) > 0){
|
|
|
- $s = $s . " AND upper(k_unit.name) LIKE = upper('%" . $this->filters["monster_name"] . "%') ";
|
|
|
+ if (strlen($this->filters["MONSTER_NAME"]) > 0){
|
|
|
+ $s = $s . " upper(k_unit.name) LIKE = upper('%" . $this->filters["MONSTER_NAME"] . "%') AND ";
|
|
|
}
|
|
|
- if (!$this->filters["monster_in_storage"]){
|
|
|
- //$s = $s . " AND unit.in_storage = 0 ";
|
|
|
+ if (!$this->filters["MONSTER_IN_STORAGE"]){
|
|
|
+ $s = $s . " unit.building <> " . BUILDING_ID::MONSTER_STORAGE . " AND ";
|
|
|
}
|
|
|
- if (count($this->filters["rune_slot"]) > 0){
|
|
|
+ if (count($this->filters["RUNE_SLOT"]) > 0){
|
|
|
$s = $s . " rune.slot IN ( ";
|
|
|
- foreach($this->filters["rune_slot"] as $t){
|
|
|
+ foreach($this->filters["RUNE_SLOT"] as $t){
|
|
|
$s = $s . "$t, ";
|
|
|
}
|
|
|
$s = $s . "-1) AND ";
|
|
|
@@ -260,19 +260,19 @@
|
|
|
k_rune_craft_type.gem = 1 AND
|
|
|
(
|
|
|
-- GEM FILTERS
|
|
|
- rune_craft.quality >= " . $this->filters["gem_min_quality"] . " AND
|
|
|
+ rune_craft.quality >= " . $this->filters["GEM_MIN_QUALITY"] . " AND
|
|
|
";
|
|
|
- if (count($this->filters["gem_stat_from"]) > 0){
|
|
|
+ if (count($this->filters["GEM_STAT_FROM"]) > 0){
|
|
|
$in = "(";
|
|
|
- foreach($this->filters["gem_stat_from"] as $t){
|
|
|
+ foreach($this->filters["GEM_STAT_FROM"] as $t){
|
|
|
$in = $in . "$t, ";
|
|
|
}
|
|
|
$in = $in . "-1)";
|
|
|
$s .= " (rune.substat_1 IN $in OR rune.substat_2 IN $in OR rune.substat_3 IN $in OR rune.substat_4 IN $in) AND ";
|
|
|
}
|
|
|
- if (count($this->filters["gem_stat_to"]) > 0){
|
|
|
+ if (count($this->filters["GEM_STAT_TO"]) > 0){
|
|
|
$in = "(";
|
|
|
- foreach($this->filters["gem_stat_to"] as $t){
|
|
|
+ foreach($this->filters["GEM_STAT_TO"] as $t){
|
|
|
$in = $in . "$t, ";
|
|
|
}
|
|
|
$in = $in . "-1)";
|
|
|
@@ -292,16 +292,16 @@
|
|
|
(
|
|
|
-- GRINDSTONE FILTERS
|
|
|
";
|
|
|
- if (count($this->filters["grind_stat"]) > 0){
|
|
|
+ if (count($this->filters["GRIND_STAT"]) > 0){
|
|
|
$in = "(";
|
|
|
- foreach($this->filters["grind_stat"] as $t){
|
|
|
+ foreach($this->filters["GRIND_STAT"] as $t){
|
|
|
$in = $in . "$t, ";
|
|
|
}
|
|
|
$in = $in . "-1)";
|
|
|
$s .= " rune_craft.stat IN $in AND ";
|
|
|
}
|
|
|
$s .= "
|
|
|
- rune_craft.quality >= " . $this->filters["grind_min_quality"] . " AND
|
|
|
+ rune_craft.quality >= " . $this->filters["GRIND_MIN_QUALITY"] . " AND
|
|
|
(
|
|
|
(
|
|
|
rune_craft.stat = rune.substat_1 AND
|