|
@@ -100,7 +100,7 @@
|
|
|
}
|
|
}
|
|
|
$rune_alt = new Rune($this->db, $r["alternative"]);
|
|
$rune_alt = new Rune($this->db, $r["alternative"]);
|
|
|
// If the alternative rune isassigned
|
|
// If the alternative rune isassigned
|
|
|
- if ($this->filters["alternative_source"] > 0 && strlen($rune_alt->assigned_to) > 0){
|
|
|
|
|
|
|
+ if ($this->filters["ALTERNATIVE_SOURCE"] > 0 && strlen($rune_alt->assigned_to) > 0){
|
|
|
$rune_alt->assigned_to = new Unit($this->db, $rune_alt->assigned_to);
|
|
$rune_alt->assigned_to = new Unit($this->db, $rune_alt->assigned_to);
|
|
|
}
|
|
}
|
|
|
array_push($rupgrade["alternative"], $rune_alt);
|
|
array_push($rupgrade["alternative"], $rune_alt);
|
|
@@ -132,82 +132,83 @@
|
|
|
* min_stars (1-6) and in_storage (on/off).
|
|
* min_stars (1-6) and in_storage (on/off).
|
|
|
*/
|
|
*/
|
|
|
private function parse_filters(){
|
|
private function parse_filters(){
|
|
|
|
|
+ $this->filters = FILTER::RUNEUPGRADE;
|
|
|
// Monster
|
|
// Monster
|
|
|
if (isset($_GET["monster_min_stars"]) && intval($_GET["monster_min_stars"]) > 0 && intval($_GET["monster_min_stars"]) < 7){
|
|
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){
|
|
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"){
|
|
if (isset($_GET["monster_in_storage"]) && $_GET["monster_in_storage"] == "on"){
|
|
|
- $this->filters["monster_in_storage"] = true;
|
|
|
|
|
|
|
+ $this->filters["MONSTER_IN_STORAGE"] = true;
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
|
- $this->filters["monster_in_storage"] = false;
|
|
|
|
|
|
|
+ $this->filters["MONSTER_IN_STORAGE"] = false;
|
|
|
}
|
|
}
|
|
|
if (isset($_GET["monster_name"]) && strlen($_GET["monster_name"]) > 0){
|
|
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
|
|
// Runes
|
|
|
if (isset($_GET["rune_min_stars"]) && intval($_GET["rune_min_stars"]) > 0 && intval($_GET["rune_min_stars"]) < 7){
|
|
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){
|
|
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){
|
|
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){
|
|
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){
|
|
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){
|
|
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){
|
|
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){
|
|
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){
|
|
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){
|
|
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){
|
|
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){
|
|
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"])){
|
|
if (isset($_GET["rune_slot"])){
|
|
|
$slots = $_GET["rune_slot"];
|
|
$slots = $_GET["rune_slot"];
|
|
|
foreach ($slots as $slot){
|
|
foreach ($slots as $slot){
|
|
|
if (intval($slot) >= 1 && intval($slot) < 7){
|
|
if (intval($slot) >= 1 && intval($slot) < 7){
|
|
|
- array_push($this->filters["rune_slot"], intval($slot));
|
|
|
|
|
|
|
+ array_push($this->filters["RUNE_SLOT"], intval($slot));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
// Alternatives
|
|
// Alternatives
|
|
|
if (isset($_GET["alternative_min_stars"]) && intval($_GET["alternative_min_stars"]) > 0 && intval($_GET["alternative_min_stars"]) < 7){
|
|
if (isset($_GET["alternative_min_stars"]) && intval($_GET["alternative_min_stars"]) > 0 && intval($_GET["alternative_min_stars"]) < 7){
|
|
|
- $this->filters["alternative_min_stars"] = $_GET["alternative_min_stars"];
|
|
|
|
|
|
|
+ $this->filters["ALTERNATIVE_MIN_STARS"] = $_GET["alternative_min_stars"];
|
|
|
}
|
|
}
|
|
|
if (isset($_GET["alternative_min_level"]) && intval($_GET["alternative_min_level"]) >= 0 && intval($_GET["alternative_min_level"]) <= 15){
|
|
if (isset($_GET["alternative_min_level"]) && intval($_GET["alternative_min_level"]) >= 0 && intval($_GET["alternative_min_level"]) <= 15){
|
|
|
- $this->filters["alternative_min_level"] = $_GET["alternative_min_level"];
|
|
|
|
|
|
|
+ $this->filters["ALTERNATIVE_MIN_LEVEL"] = $_GET["alternative_min_level"];
|
|
|
}
|
|
}
|
|
|
if (isset($_GET["alternative_min_original_quality"]) && intval($_GET["alternative_min_original_quality"]) >= QUALITY_ID::NORMAL && intval($_GET["alternative_min_original_quality"]) <= QUALITY_ID::LEGEND){
|
|
if (isset($_GET["alternative_min_original_quality"]) && intval($_GET["alternative_min_original_quality"]) >= QUALITY_ID::NORMAL && intval($_GET["alternative_min_original_quality"]) <= QUALITY_ID::LEGEND){
|
|
|
- $this->filters["alternative_min_original_quality"] = $_GET["alternative_min_original_quality"];
|
|
|
|
|
|
|
+ $this->filters["ALTERNATIVE_MIN_ORIGINAL_QUALITY"] = $_GET["alternative_min_original_quality"];
|
|
|
}
|
|
}
|
|
|
if (isset($_GET["alternative_condition"]) && intval($_GET["alternative_condition"]) >= 0 && intval($_GET["alternative_condition"]) <= QUALITY_ID::LEGEND){
|
|
if (isset($_GET["alternative_condition"]) && intval($_GET["alternative_condition"]) >= 0 && intval($_GET["alternative_condition"]) <= QUALITY_ID::LEGEND){
|
|
|
- $this->filters["alternative_condition"] = $_GET["alternative_condition"];
|
|
|
|
|
|
|
+ $this->filters["ALTERNATIVE_CONDITION"] = $_GET["alternative_condition"];
|
|
|
}
|
|
}
|
|
|
if (isset($_GET["alternative_source"]) && intval($_GET["alternative_source"]) >= 0 && intval($_GET["alternative_source"]) <= 2){
|
|
if (isset($_GET["alternative_source"]) && intval($_GET["alternative_source"]) >= 0 && intval($_GET["alternative_source"]) <= 2){
|
|
|
- $this->filters["alternative_source"] = $_GET["alternative_source"];
|
|
|
|
|
|
|
+ $this->filters["ALTERNATIVE_SOURCE"] = $_GET["alternative_source"];
|
|
|
}
|
|
}
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -291,29 +292,29 @@
|
|
|
rune_alt.uid = '$UID' AND
|
|
rune_alt.uid = '$UID' AND
|
|
|
unit.id = rune.assigned_to AND
|
|
unit.id = rune.assigned_to AND
|
|
|
unit.unit = k_unit.id AND
|
|
unit.unit = k_unit.id AND
|
|
|
- unit.stars >= " . $this->filters["monster_min_stars"] . " AND
|
|
|
|
|
- unit.stars <= " . $this->filters["monster_max_stars"] . " AND
|
|
|
|
|
- rune.stars >= " . $this->filters["rune_min_stars"] . " AND
|
|
|
|
|
- rune.stars <= " . $this->filters["rune_max_stars"] . " AND
|
|
|
|
|
- rune.level >= " . $this->filters["rune_min_level"] . " AND
|
|
|
|
|
- rune.level <= " . $this->filters["rune_max_level"] . " AND
|
|
|
|
|
- rune.quality >= " . $this->filters["rune_min_quality"] . " AND
|
|
|
|
|
- rune.quality <= " . $this->filters["rune_max_quality"] . " 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
|
|
|
|
|
|
|
+ unit.stars >= " . $this->filters["MONSTER_MIN_STARS"] . " AND
|
|
|
|
|
+ unit.stars <= " . $this->filters["MONSTER_MAX_STARS"] . " AND
|
|
|
|
|
+ rune.stars >= " . $this->filters["RUNE_MIN_STARS"] . " AND
|
|
|
|
|
+ rune.stars <= " . $this->filters["RUNE_MAX_STARS"] . " AND
|
|
|
|
|
+ rune.level >= " . $this->filters["RUNE_MIN_LEVEL"] . " AND
|
|
|
|
|
+ rune.level <= " . $this->filters["RUNE_MAX_LEVEL"] . " AND
|
|
|
|
|
+ rune.quality >= " . $this->filters["RUNE_MIN_QUALITY"] . " AND
|
|
|
|
|
+ rune.quality <= " . $this->filters["RUNE_MAX_QUALITY"] . " 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_alt.type AND
|
|
rune.type = rune_alt.type AND
|
|
|
rune.slot = rune_alt.slot AND
|
|
rune.slot = rune_alt.slot AND
|
|
|
rune.main_stat = rune_alt.main_stat AND
|
|
rune.main_stat = rune_alt.main_stat AND
|
|
|
rune.id <> rune_alt.id AND
|
|
rune.id <> rune_alt.id AND
|
|
|
- rune_alt.stars >= " . $this->filters["alternative_min_stars"] . " AND
|
|
|
|
|
- rune_alt.level >= " . $this->filters["alternative_min_level"] . " AND
|
|
|
|
|
- rune_alt.original_quality >= " . $this->filters["alternative_min_original_quality"] . " AND
|
|
|
|
|
|
|
+ rune_alt.stars >= " . $this->filters["ALTERNATIVE_MIN_STARS"] . " AND
|
|
|
|
|
+ rune_alt.level >= " . $this->filters["ALTERNATIVE_MIN_LEVEL"] . " AND
|
|
|
|
|
+ rune_alt.original_quality >= " . $this->filters["ALTERNATIVE_MIN_ORIGINAL_QUALITY"] . " AND
|
|
|
";
|
|
";
|
|
|
- switch ($this->filters["alternative_source"]){
|
|
|
|
|
|
|
+ switch ($this->filters["ALTERNATIVE_SOURCE"]){
|
|
|
case 0: // Unassigned
|
|
case 0: // Unassigned
|
|
|
$s = $s . " rune_alt.assigned_to IS NULL AND ";
|
|
$s = $s . " rune_alt.assigned_to IS NULL AND ";
|
|
|
break;
|
|
break;
|
|
@@ -327,7 +328,7 @@
|
|
|
break;
|
|
break;
|
|
|
// Case 2: Assigned or unassigned.
|
|
// Case 2: Assigned or unassigned.
|
|
|
}
|
|
}
|
|
|
- switch ($this->filters["alternative_condition"]){
|
|
|
|
|
|
|
+ switch ($this->filters["ALTERNATIVE_CONDITION"]){
|
|
|
case 0: // Higher grade, any quality
|
|
case 0: // Higher grade, any quality
|
|
|
$s = $s .
|
|
$s = $s .
|
|
|
" rune_alt.stars >= rune.stars ";
|
|
" rune_alt.stars >= rune.stars ";
|
|
@@ -360,15 +361,15 @@
|
|
|
" rune_alt.original_quality > rune.original_quality ";
|
|
" rune_alt.original_quality > rune.original_quality ";
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
- 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 . " AND upper(k_unit.name) LIKE = upper('%" . $this->filters["MONSTER_NAME"] . "%') ";
|
|
|
}
|
|
}
|
|
|
- if (!$this->filters["monster_in_storage"]){
|
|
|
|
|
- //$s = $s . " AND unit.in_storage = 0 ";
|
|
|
|
|
|
|
+ if (!$this->filters["MONSTER_IN_STORAGE"]){
|
|
|
|
|
+ $s = $s . " AND unit.building <> " . BUILDING_ID::MONSTER_STORAGE;
|
|
|
}
|
|
}
|
|
|
- if (count($this->filters["rune_slot"]) > 0){
|
|
|
|
|
|
|
+ if (count($this->filters["RUNE_SLOT"]) > 0){
|
|
|
$s = $s . " AND rune.slot IN ( ";
|
|
$s = $s . " AND rune.slot IN ( ";
|
|
|
- foreach($this->filters["rune_slot"] as $t){
|
|
|
|
|
|
|
+ foreach($this->filters["RUNE_SLOT"] as $t){
|
|
|
$s = $s . "$t, ";
|
|
$s = $s . "$t, ";
|
|
|
}
|
|
}
|
|
|
$s = $s . "-1) ";
|
|
$s = $s . "-1) ";
|