Просмотр исходного кода

Fixed some bugs arisen with the latest changes:

 - Correct building instantiation.
 - Unit entity now reflect DB structure changes.
 - Fix in the HTML helper that restores rune panels.
 - Fixed a problem with several filter not being applied in all sections.
 - Rune stat filters are now populated.
 - Some typos and minor UI fixes
Iñigo Valentin 6 лет назад
Родитель
Сommit
1794e0ab49
100 измененных файлов с 265 добавлено и 330 удалено
  1. 1 1
      application/entity/Building.php
  2. 1 1
      application/entity/Decoration.php
  3. 1 1
      application/entity/Inventory.php
  4. 1 1
      application/entity/K_Building.php
  5. 2 4
      application/entity/Unit.php
  6. 1 1
      application/helper/HTML_Helper.php
  7. 0 1
      application/page/Catalog_Page.php
  8. 4 4
      application/page/Home_Page.php
  9. 24 26
      application/page/Monsters_Page.php
  10. 53 53
      application/page/Report_Runecraft_Page.php
  11. 50 49
      application/page/Report_Runeupgrade_Page.php
  12. 29 28
      application/page/Report_Skillup_Page.php
  13. 40 39
      application/page/Runes_Page.php
  14. 24 24
      application/page/Runs_Page.php
  15. 0 2
      application/view/catalog.php
  16. 0 2
      application/view/fusion.php
  17. 0 2
      application/view/guild.php
  18. 0 2
      application/view/help.php
  19. 0 2
      application/view/home.php
  20. 0 2
      application/view/inc/filter_catalog.php
  21. 0 2
      application/view/inc/filter_fusion.php
  22. 0 2
      application/view/inc/filter_monsters.php
  23. 30 38
      application/view/inc/filter_report_runecraft.php
  24. 0 2
      application/view/inc/filter_report_runeupgrade.php
  25. 0 2
      application/view/inc/filter_report_skillup.php
  26. 0 2
      application/view/inc/filter_runes.php
  27. 0 2
      application/view/inc/filter_runs.php
  28. 2 4
      application/view/inc/filter_teams.php
  29. 0 2
      application/view/inc/footer.php
  30. 0 2
      application/view/inc/header.php
  31. 0 2
      application/view/landing.php
  32. 0 2
      application/view/monster.php
  33. 0 2
      application/view/monster_info.php
  34. 0 2
      application/view/monsters.php
  35. 0 2
      application/view/profile.php
  36. 0 2
      application/view/report.php
  37. 2 5
      application/view/report_runecraft.php
  38. 0 2
      application/view/report_runeupgrade.php
  39. 0 2
      application/view/report_skillup.php
  40. 0 2
      application/view/runes.php
  41. 0 2
      application/view/runs.php
  42. 0 2
      application/view/teams.php
  43. 0 0
      doc/classes/APP.html
  44. 0 0
      doc/classes/ARCHETYPE_ID.html
  45. 0 0
      doc/classes/AREA_TYPE_ID.html
  46. 0 0
      doc/classes/ARENA_RANKING_POINTS.html
  47. 0 0
      doc/classes/ARENA_RANKING_RANK.html
  48. 0 0
      doc/classes/BUILDING_ID.html
  49. 0 0
      doc/classes/Building.html
  50. 0 0
      doc/classes/CRAFT_ID.html
  51. 0 0
      doc/classes/Catalog_Page.html
  52. 0 0
      doc/classes/Controller.html
  53. 0 0
      doc/classes/Custom_Filter.html
  54. 0 0
      doc/classes/DB.html
  55. 0 0
      doc/classes/DECORATION_ID.html
  56. 0 0
      doc/classes/DIFFICULTY_ID.html
  57. 0 0
      doc/classes/DUNGEON_ID.html
  58. 0 0
      doc/classes/Decoration.html
  59. 0 0
      doc/classes/EFFECT_AREA_ID.html
  60. 0 0
      doc/classes/ELEMENTAL_RIFT_DUNGEON_ID.html
  61. 0 0
      doc/classes/ELEMENT_ID.html
  62. 0 0
      doc/classes/ENHANCE_MONSTER_ID.html
  63. 0 0
      doc/classes/Entity.html
  64. 0 0
      doc/classes/FILTER.html
  65. 0 0
      doc/classes/Fusion.html
  66. 0 0
      doc/classes/Fusion_Page.html
  67. 0 0
      doc/classes/GUILD_MEMBER_GRADE_ID.html
  68. 0 0
      doc/classes/Guild.html
  69. 0 0
      doc/classes/Guild_Member.html
  70. 0 0
      doc/classes/Guild_Page.html
  71. 0 0
      doc/classes/HTML.html
  72. 0 0
      doc/classes/Helper.html
  73. 0 0
      doc/classes/Home_Page.html
  74. 0 0
      doc/classes/INVENTORY_ID.html
  75. 0 0
      doc/classes/INVENTORY_TYPE_ID.html
  76. 0 0
      doc/classes/Inventory.html
  77. 0 0
      doc/classes/K_Area.html
  78. 0 0
      doc/classes/K_Building.html
  79. 0 0
      doc/classes/K_Decoration.html
  80. 0 0
      doc/classes/K_Effect.html
  81. 0 0
      doc/classes/K_Guild_Skill.html
  82. 0 0
      doc/classes/K_Guild_Skill_Group.html
  83. 0 0
      doc/classes/K_Leader_Skill.html
  84. 0 0
      doc/classes/K_Rune_Set.html
  85. 0 0
      doc/classes/K_Skill.html
  86. 0 0
      doc/classes/K_Skill_Level.html
  87. 0 0
      doc/classes/K_Source.html
  88. 0 0
      doc/classes/K_Unit.html
  89. 0 0
      doc/classes/K_Unit_Transformation.html
  90. 0 0
      doc/classes/LABYRINTH_STAGES_ID.html
  91. 0 0
      doc/classes/Landing_Page.html
  92. 0 0
      doc/classes/Monster_Fusion.html
  93. 0 0
      doc/classes/Monster_Info_Page.html
  94. 0 0
      doc/classes/Monster_Page.html
  95. 0 0
      doc/classes/Monsters_Page.html
  96. 0 0
      doc/classes/NET.html
  97. 0 0
      doc/classes/PATH.html
  98. 0 0
      doc/classes/Page.html
  99. 0 0
      doc/classes/Profile_Page.html
  100. 0 0
      doc/classes/QUALITY_ID.html

+ 1 - 1
application/entity/Building.php

@@ -55,7 +55,7 @@
                   building,
                   gain
                 FROM building
-                WHERE building = $id;
+                WHERE id = $id;
             ";
             $q = $this->db->query($s);
             $r = $q->fetchArray(SQLITE3_ASSOC);

+ 1 - 1
application/entity/Decoration.php

@@ -54,7 +54,7 @@
                   decoration,
                   level
                 FROM decoration
-                WHERE decoration = $id;
+                WHERE id = $id;
             ";
             $q = $this->db->query($s);
             $r = $q->fetchArray(SQLITE3_ASSOC);

+ 1 - 1
application/entity/Inventory.php

@@ -115,7 +115,7 @@
                 return URL::IMG["INVENTORY"] . str_pad($this->id, 9, '0', STR_PAD_LEFT) . ".png";
             }
             else{
-                return PATH::IMG["UNKNOWN"];
+                return URL::IMG["UNKNOWN"];
             }
         }
     }

+ 1 - 1
application/entity/K_Building.php

@@ -54,7 +54,7 @@
               "  name, " .
               "  description " .
               "FROM k_building " .
-              "WHERE id = $id; ";
+              "WHERE id = '$id'; ";
             $q = $this->db->query($s);
             $r = $q->fetchArray(SQLITE3_ASSOC);
             if ($r){

+ 2 - 4
application/entity/Unit.php

@@ -253,10 +253,8 @@
               "  exp_gained, " .
               "  exp_gain_rate, " .
               "  costume, " .
-              "  attribute, " .
               "  source, " .
               "  create_time, " .
-              "  homunculus, " .
               "  homunculus_name, " .
               "  lock " .
               "FROM unit " .
@@ -267,7 +265,7 @@
             $r = $q->fetchArray(SQLITE3_ASSOC);
             $this->uid = $r["uid"];
             $this->id = $r["id"];
-            if (strlen($r["building"]) > 0){
+            if ($r["building"] != null && $r["building"] > 0){
                 $this->building = new Building($this->db, $r["building"]);
             }
             if (strlen($r["unit"]) > 0){
@@ -319,7 +317,7 @@
                 $this->experience_level = $r["exp"];
                 $this->experience_level_up = $r["exp"] - $this->exp_gained;
             }
-            if ($this->homunculus){
+            if ($this->unit->homunculus){
                 $this->title = $this->homunculus_name;
             }
             else{

+ 1 - 1
application/helper/HTML_Helper.php

@@ -198,7 +198,7 @@
             $html .= "<table class='rune'>\n";
             $html .= "<tr>\n";
             $html .= "<td class='icon'>\n";
-            $html .= html_rune_panel($rune, $unit) . "\n";
+            $html .= HTML::rune_panel($rune, $unit) . "\n";
             $html .= "</td>\n";
             $html .= "<td class='stats'>\n";
             $html .= "<table>\n";

+ 0 - 1
application/page/Catalog_Page.php

@@ -42,7 +42,6 @@
             while ($r_mon = $q_mon->fetchArray(SQLITE3_ASSOC)){
                 array_push($this->units, new K_Unit($db, $r_mon["id"], false));
             }
-            error_log($s_mon);
             $this->title = "Catalog - SWDB";
             $this->description = "Catalog of all monsters";
             $this->canonical = URL::BASE . "catalog/";

+ 4 - 4
application/page/Home_Page.php

@@ -194,22 +194,22 @@
                 array_push($this->defense, new Unit($db, $r["unit"], false));
             }
             $s = "
-                SELECT DISTINCT building
+                SELECT DISTINCT id
                 FROM building
                 WHERE uid = '$UID';
             ";
             $q = $this->db->query($s);
             while ($r = $q->fetchArray(SQLITE3_ASSOC)){
-                array_push($this->building, new Building($db, $r["building"]));
+                array_push($this->building, new Building($db, $r["id"]));
             }
             $s = "
-                SELECT decoration
+                SELECT id
                 FROM decoration
                 WHERE uid = '$UID';
             ";
             $q = $this->db->query($s);
             while ($r = $q->fetchArray(SQLITE3_ASSOC)){
-                array_push($this->decoration, new Decoration($db, $r["decoration"]));
+                array_push($this->decoration, new Decoration($db, $r["id"]));
             }
             $s = "
                 SELECT

+ 24 - 26
application/page/Monsters_Page.php

@@ -35,11 +35,11 @@
             "spd" => 0,
             "crd" => 0,
             "elm" => [
-                0 => 0,
                 1 => 0,
                 2 => 0,
                 3 => 0,
-                4 => 0
+                4 => 0,
+                5 => 0,
             ]
         ];
 
@@ -72,22 +72,22 @@
         private function parse_filters(){
             $this->filters = FILTER::MONSTER;
             if (isset($_GET["element"]) && property_exists(ELEMENT_ID, strtoupper($_GET["element"]))){
-                $this->filters["element"] = $_GET["element"];
+                $this->filters["ELEMENT"] = $_GET["element"];
             }
             if (isset($_GET["name"]) && strlen($_GET["name"]) > 0){
-                $this->filters["name"] = SQLite3::escapeString($_GET["name"]);
+                $this->filters["NAME"] = SQLite3::escapeString($_GET["name"]);
             }
             if (isset($_GET["min_stars"]) && intval($_GET["min_stars"]) > 0 && intval($_GET["min_stars"]) <= 6){
-                $this->filters["min_stars"] = $_GET["min_stars"];
+                $this->filters["MIN_STARS"] = $_GET["min_stars"];
             }
             if (isset($_GET["max_stars"]) && intval($_GET["max_stars"]) > 0 && intval($_GET["max_stars"]) <= 6){
-                $this->filters["max_stars"] = $_GET["max_stars"];
+                $this->filters["MAX_STARS"] = $_GET["max_stars"];
             }
             if (isset($_GET["in_storage"]) && $_GET["in_storage"] == "on"){
-                $this->filters["in_storage"] = true;
+                $this->filters["IN_STORAGE"] = true;
             }
             if (isset($_GET["without_runes"]) && $_GET["without_runes"] == "on"){
-                $this->filters["without_runes"] = true;
+                $this->filters["WITHOUT_RUNES"] = true;
             }
             return;
         }
@@ -109,18 +109,18 @@
                 WHERE
                   unit.uid = '$UID' AND
                   unit.unit = k_unit.id AND 
-                  stars >= " . $this->filters["min_stars"] . " AND 
-                  stars <= " . $this->filters["max_stars"];
-            if (property_exists(ELEMENT_ID, $this->filters["element"])){
-                $s = $s . " AND unit IN (SELECT id FROM k_unit WHERE element = " . $this->filters["element"] . ") ";
+                  stars >= " . $this->filters["MIN_STARS"] . " AND 
+                  stars <= " . $this->filters["MAX_STARS"];
+            if (property_exists(ELEMENT_ID, $this->filters["ELEMENT"])){
+                $s = $s . " AND unit IN (SELECT id FROM k_unit WHERE element = " . $this->filters["ELEMENT"] . ") ";
             }
-            if ($this->filters["name"] != ""){
-                $s = $s . " AND unit IN (SELECT id FROM k_unit WHERE upper(name) LIKE '%" . strtoupper($this->filters["name"]) . "%') ";
+            if ($this->filters["NAME"] != ""){
+                $s = $s . " AND unit IN (SELECT id FROM k_unit WHERE upper(name) LIKE '%" . strtoupper($this->filters["NAME"]) . "%') ";
             }
-            if ($this->filters["in_storage"]){
-                $s = $s . " AND in_storage = 0 ";
+            if ($this->filters["IN_STORAGE"]){
+                $s = $s . " AND building = " . BUILDING_ID::MONSTER_STORAGE;
             }
-            if (!$this->filters["without_runes"]){
+            if (!$this->filters["WITHOUT_RUNES"]){
                 $s = $s . " AND unit.id IN (SELECT DISTINCT assigned_to FROM rune) ";
             }
             $s = $s . "
@@ -141,8 +141,6 @@
          * $building_stats array.
          */
         private function calculate_buildings(){
-            global $STAT;
-            global $EFFECT_AREA;
             global $UID;
             $s = "
               SELECT
@@ -158,25 +156,25 @@
                 k_decoration.id = decoration.decoration AND
                 decoration.decoration = k_decoration_level.decoration AND
                 decoration.level = k_decoration_level.level AND
-                area = " . EFFECT_AREA::GENERAL . " AND
-                affected_stat IN (" . STAT::ATK . ", " . STAT::DEF . ", " . STAT::HP . ", " . STAT::SPD . ", " . STAT::CRIT_DMG . ");
+                area = " . EFFECT_AREA_ID::GENERAL . " AND
+                affected_stat IN (" . STAT_ID::ATK . ", " . STAT_ID::DEF . ", " . STAT_ID::HP . ", " . STAT_ID::SPD . ", " . STAT_ID::CRIT_DMG . ");
             ";
             $q = $this->db->query($s);
             while ($r = $q->fetchArray(SQLITE3_ASSOC)){
                 switch($r["affected_stat"]){
-                    case STAT::DEF:
+                    case STAT_ID::DEF:
                         $this->building_stats["def"] += $r["bonus"];
                         break;
-                    case STAT::HP:
+                    case STAT_ID::HP:
                         $this->building_stats["hp"] += $r["bonus"];
                         break;
-                    case STAT::SPD:
+                    case STAT_ID::SPD:
                         $this->building_stats["spd"] += $r["bonus"];
                         break;
-                    case STAT::CRIT_DMG:
+                    case STAT_ID::CRIT_DMG:
                         $this->building_stats["crd"] += $r["bonus"];
                         break;
-                    case STAT::ATK:
+                    case STAT_ID::ATK:
                         if(strlen($r["element"]) > 0){
                             $this->building_stats["elm"][$r["element"]] += $r["bonus"];
                         }

+ 53 - 53
application/page/Report_Runecraft_Page.php

@@ -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

+ 50 - 49
application/page/Report_Runeupgrade_Page.php

@@ -100,7 +100,7 @@
                 }
                 $rune_alt = new Rune($this->db, $r["alternative"]);
                 // 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);
                 }
                 array_push($rupgrade["alternative"], $rune_alt);
@@ -132,82 +132,83 @@
          * min_stars (1-6) and in_storage (on/off).
          */
         private function parse_filters(){
+            $this->filters = FILTER::RUNEUPGRADE;
             // 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));
                     }
                 }
             }
             // Alternatives
             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){
-                $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){
-                $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){
-                $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){
-                $this->filters["alternative_source"] = $_GET["alternative_source"];
+                $this->filters["ALTERNATIVE_SOURCE"] = $_GET["alternative_source"];
             }
             return;
         }
@@ -291,29 +292,29 @@
                 rune_alt.uid = '$UID' AND
                 unit.id = rune.assigned_to 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.slot = rune_alt.slot AND 
                 rune.main_stat = rune_alt.main_stat 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
                     $s = $s . " rune_alt.assigned_to IS NULL AND ";
                     break;
@@ -327,7 +328,7 @@
                     break;
                 // Case 2: Assigned or unassigned.
             }  
-            switch ($this->filters["alternative_condition"]){
+            switch ($this->filters["ALTERNATIVE_CONDITION"]){
                 case 0: // Higher grade, any quality
                     $s = $s .
                     "  rune_alt.stars >= rune.stars ";
@@ -360,15 +361,15 @@
                        "  rune_alt.original_quality > rune.original_quality ";
                     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 ( ";
-                foreach($this->filters["rune_slot"] as $t){
+                foreach($this->filters["RUNE_SLOT"] as $t){
                     $s = $s . "$t, ";
                 }
                 $s = $s . "-1) ";

+ 29 - 28
application/page/Report_Skillup_Page.php

@@ -36,10 +36,10 @@
             parent::__construct($db);
             $this->view = PATH::VIEW . "report_skillup.php";
             $this->parse_filters();
-            $s_mon = $this->build_query();
-            $q_mon = $this->db->query($s_mon);
-            while ($r_mon = $q_mon->fetchArray(SQLITE3_ASSOC)){
-                array_push($this->units, new Unit($db, $r_mon["id"]));
+            $s = $this->build_query();
+            $q = $this->db->query($s);
+            while ($r = $q->fetchArray(SQLITE3_ASSOC)){
+                array_push($this->units, new Unit($db, $r["id"]));
             }
             $this->title = "Urgent skill-ups - SWDB";
             $this->description = "Monster in need of skilling up";
@@ -51,35 +51,36 @@
          * and adds them to the $filters array.
          */
         private function parse_filters(){
+            $this->filters = FILTER::SKILLUP;
             if (isset($_GET["min_stars"]) && intval($_GET["min_stars"]) > 0 && intval($_GET["min_stars"]) < 7){
-                $this->filters["min_stars"] = $_GET["min_stars"];
+                $this->filters["MIN_STARS"] = $_GET["min_stars"];
             }
             if (isset($_GET["max_stars"]) && intval($_GET["max_stars"]) > 0 && intval($_GET["max_stars"]) < 7){
-                $this->filters["max_stars"] = $_GET["max_stars"];
+                $this->filters["MAX_STARS"] = $_GET["max_stars"];
             }
             if (isset($_GET["min_natural_stars"]) && intval($_GET["min_natural_stars"]) > 0 && intval($_GET["min_natural_stars"]) < 6){
-                $this->filters["min_natural_stars"] = $_GET["min_natural_stars"];
+                $this->filters["MIN_NATURAL_STARS"] = $_GET["min_natural_stars"];
             }
             if (isset($_GET["max_natural_stars"]) && intval($_GET["max_natural_stars"]) > 0 && intval($_GET["max_natural_stars"]) < 6){
-                $this->filters["max_natural_stars"] = $_GET["max_natural_stars"];
+                $this->filters["MAX_NATURAL_STARS"] = $_GET["max_natural_stars"];
             }
             if (isset($_GET["in_storage"]) && $_GET["in_storage"] == "on"){
-                $this->filters["in_storage"] = true;
+                $this->filters["IN_STORAGE"] = true;
             }
             if (isset($_GET["without_runes"]) && $_GET["without_runes"] == "on"){
-                $this->filters["without_runes"] = true;
+                $this->filters["WITHOUT_RUNES"] = true;
             }
             if (isset($_GET["family"]) && $_GET["family"] == "on"){
-                $this->filters["family"] = true;
+                $this->filters["FAMILY"] = true;
             }
             if (isset($_GET["maxed"]) && $_GET["maxed"] == "on"){
-                $this->filters["maxed"] = true;
+                $this->filters["MAXED"] = true;
             }
             if (isset($_GET["2a"]) && $_GET["2a"] == "on"){
                 $this->filters["2a"] = true;
             }
             if (isset($_GET["homunculus"]) && $_GET["homunculus"] == "on"){
-                $this->filters["homunculus"] = true;
+                $this->filters["HOMUNCULUS"] = true;
             }
 
             return;
@@ -115,14 +116,14 @@
                 k_unit.id = k_unit_skill.unit AND
                 k_skill.id = k_unit_skill.skill AND
                 k_skill.max_level > 1 AND
-                unit.stars >= " . $this->filters["min_stars"] . " AND
-                unit.stars <= " . $this->filters["max_stars"]
+                unit.stars >= " . $this->filters["MIN_STARS"] . " AND
+                unit.stars <= " . $this->filters["MAX_STARS"]
             ;
             if ($this->filters["2a"]){
                 $s = $s . "
                     AND ((
-                      k_unit.natural_stars >= " . $this->filters["min_natural_stars"] . " AND
-                      k_unit.natural_stars <= " . $this->filters["max_natural_stars"] . "
+                      k_unit.natural_stars >= " . $this->filters["MIN_NATURAL_STARS"] . " AND
+                      k_unit.natural_stars <= " . $this->filters["MAX_NATURAL_STARS"] . "
                     ) OR (
                       k_unit.base_stars - k_unit.natural_stars > 1
                     ))
@@ -130,33 +131,33 @@
             }
             else{
                 $s = $s . "
-                    AND k_unit.natural_stars >= " . $this->filters["min_natural_stars"] . " AND
-                    k_unit.natural_stars <= " . $this->filters["max_natural_stars"]
+                    AND k_unit.natural_stars >= " . $this->filters["MIN_NATURAL_STARS"] . " AND
+                    k_unit.natural_stars <= " . $this->filters["MAX_NATURAL_STARS"]
                 ;
             }
-            if (!$this->filters["in_storage"]){
-                $s = $s . " AND unit.in_storage = 0 ";
+            if (!$this->filters["IN_STORAGE"]){
+                $s = $s . " AND unit.building <> " . BUILDING_ID::MONSTER_STORAGE;
             }
-            if (!$this->filters["without_runes"]){
+            if (!$this->filters["WITHOUT_RUNES"]){
                 $s = $s . " AND unit.id IN (SELECT DISTINCT assigned_to FROM rune) ";
             }
-            if (!$this->filters["family"]){
-                $s = $s . " AND unit.unit NOT IN (SELECT id FROM k_unit m WHERE family IN (SELECT family FROM k_unit k WHERE k.family = m.family AND k.natural_stars < m.natural_stars AND k.natural_stars < " . $this->filters["min_natural_stars"] . ")) ";
+            if (!$this->filters["FAMILY"]){
+                $s = $s . " AND unit.unit NOT IN (SELECT id FROM k_unit m WHERE family IN (SELECT family FROM k_unit k WHERE k.family = m.family AND k.natural_stars < m.natural_stars AND k.natural_stars < " . $this->filters["MIN_NATURAL_STARS"] . ")) ";
                 // Special case: Eirgar (Dark Vampire lord). Nat5 can be powered with 4 star Vampires.
-                if ($this->filters["min_natural_stars"] >= 5){
+                if ($this->filters["MIN_NATURAL_STARS"] >= 5){
                     $s = $s . " AND k_unit.id <> 19114 AND k_unit.id <> 19104 ";
                 }
                 // Special case: Fran (Light Fairy Queen). Nat3 can be powered with 2 star Fairies.
-                if ($this->filters["min_natural_stars"] >= 3){
+                if ($this->filters["MIN_NATURAL_STARS"] >= 3){
                     $s = $s . " AND k_unit.id <> 23015 AND k_unit.id <> 23005 ";
                 }
             }
-            if (!$this->filters["homunculus"]){
+            if (!$this->filters["HOMUNCULUS"]){
                 $s = $s . " AND k_unit.homunculus <> 1 ";
             }
             $s = $s .
               "GROUP BY unit.id ";
-            if (!$this->filters["maxed"]){
+            if (!$this->filters["MAXED"]){
                 $s = $s . " HAVING ponderated_lvl < ponderated_max_lvl ";
             }
             $s = $s . "

+ 40 - 39
application/page/Runes_Page.php

@@ -51,7 +51,7 @@
             $this->parse_filters();
             if (!isset($_GET["custom_filter"])){
                 $s = $this->build_query();
-                $this->filters["group"] = 1;
+                $this->filters["GROUP"] = 1;
             }
             else{
                 $s = $this->build_custom_query($_GET["custom_filter"]);
@@ -85,73 +85,74 @@
          * and adds them to the $filters array.
          */
         private function parse_filters(){
+            $this->filters = FILTER::RUNE;
             if (isset($_GET["type"])){
                 $types = $_GET["type"];
                 foreach ($types as $type){
-                    array_push($this->filters["type"], intval($type));
+                    array_push($this->filters["TYPE"], intval($type));
                 }
             }
             if (isset($_GET["main"])){
                 $mains = $_GET["main"];
                 foreach ($mains as $main){
-                    array_push($this->filters["main"], intval($main));
+                    array_push($this->filters["MAIN"], intval($main));
                 }
             }
             if (isset($_GET["sub"])){
                 $subs = $_GET["sub"];
                 foreach ($subs as $sub){
-                    array_push($this->filters["sub"], intval($sub));
+                    array_push($this->filters["SUB"], intval($sub));
                 }
             }
             if (isset($_GET["slot"])){
                 $slots = $_GET["slot"];
                 foreach ($slots as $slot){
                     if (intval($slot) >= 1 && intval($slot) < 7){
-                        array_push($this->filters["slot"], intval($slot));
+                        array_push($this->filters["SLOT"], intval($slot));
                     }
                 }
             }
             if (isset($_GET["min_stars"]) && intval($_GET["min_stars"]) > 0 && intval($_GET["min_stars"]) < 7){
-                $this->filters["min_stars"] = $_GET["min_stars"];
+                $this->filters["MIN_STARS"] = $_GET["min_stars"];
             }
             if (isset($_GET["max_stars"]) && intval($_GET["max_stars"]) > 0 && intval($_GET["max_stars"]) < 7){
-                $this->filters["max_stars"] = $_GET["max_stars"];
+                $this->filters["MAX_STARS"] = $_GET["max_stars"];
             }
             if (isset($_GET["min_level"]) && intval($_GET["min_level"]) >= 0 && intval($_GET["min_level"]) <= 15){
-                $this->filters["min_level"] = $_GET["min_level"];
+                $this->filters["MIN_LEVEL"] = $_GET["min_level"];
             }
             if (isset($_GET["max_level"]) && intval($_GET["max_level"]) >= 0 && intval($_GET["max_level"]) <= 15){
-                $this->filters["max_level"] = $_GET["max_level"];
+                $this->filters["MAX_LEVEL"] = $_GET["max_level"];
             }
             if (isset($_GET["min_quality"]) && intval($_GET["min_quality"]) >= QUALITY_ID::NORMAL && intval($_GET["min_quality"]) <= QUALITY_ID::LEGEND){
-                $this->filters["min_quality"] = $_GET["min_quality"];
+                $this->filters["MIN_QUALITY"] = $_GET["min_quality"];
             }
             if (isset($_GET["max_quality"]) && intval($_GET["max_quality"]) >= QUALITY_ID::NORMAL && intval($_GET["max_quality"]) <= QUALITY_ID::LEGEND){
-                $this->filters["max_quality"] = $_GET["max_quality"];
+                $this->filters["MAX_QUALITY"] = $_GET["max_quality"];
             }
             if (isset($_GET["min_original_quality"]) && intval($_GET["min_original_quality"]) >= QUALITY_ID::NORMAL && intval($_GET["min_original_quality"]) <= QUALITY_ID::LEGEND){
-                $this->filters["min_original_quality"] = $_GET["min_original_quality"];
+                $this->filters["MIN_ORIGINAL_QUALITY"] = $_GET["min_original_quality"];
             }
             if (isset($_GET["max_original_quality"]) && intval($_GET["max_original_quality"]) >= QUALITY_ID::NORMAL && intval($_GET["max_original_quality"]) <= QUALITY_ID::LEGEND){
-                $this->filters["max_original_quality"] = $_GET["max_original_quality"];
+                $this->filters["MAX_ORIGINAL_QUALITY"] = $_GET["max_original_quality"];
             }
             if (isset($_GET["min_efficiency"]) && intval($_GET["min_efficiency"]) >= 0 && intval($_GET["min_efficiency"]) <= 100){
-                $this->filters["min_efficiency"] = $_GET["min_efficiency"];
+                $this->filters["MIN_EFFICIENCY"] = $_GET["min_efficiency"];
             }
             if (isset($_GET["max_efficiency"]) && intval($_GET["max_efficiency"]) >= 0 && intval($_GET["max_efficiency"]) <= 100){
-                $this->filters["max_efficiency"] = $_GET["max_efficiency"];
+                $this->filters["MAX_EFFICIENCY"] = $_GET["max_efficiency"];
             }
             if (isset($_GET["min_max_efficiency"]) && intval($_GET["min_max_efficiency"]) >= 0 && intval($_GET["min_max_efficiency"]) <= 100){
-                $this->filters["min_max_efficiency"] = $_GET["min_max_efficiency"];
+                $this->filters["MIN_MAX_EFFICIENCY"] = $_GET["min_max_efficiency"];
             }
             if (isset($_GET["max_max_efficiency"]) && intval($_GET["max_max_efficiency"]) >= 0 && intval($_GET["max_max_efficiency"]) <= 100){
-                $this->filters["max_max_efficiency"] = $_GET["max_max_efficiency"];
+                $this->filters["MAX_MAX_EFFICIENCY"] = $_GET["max_max_efficiency"];
             }
             if (isset($_GET["assigned"]) && intval($_GET["assigned"]) >= 0 && intval($_GET["assigned"]) <= 4){
-                $this->filters["assigned"] = $_GET["assigned"];
+                $this->filters["ASSIGNED"] = $_GET["assigned"];
             }
             if (isset($_GET["group"]) && ($_GET["group"] == "1" || $_GET["group"] == "0")){
-                $this->filters["group"] = $_GET["group"];
+                $this->filters["GROUP"] = $_GET["group"];
             }
         }
 
@@ -203,33 +204,33 @@
               "FROM rune " .
               "WHERE " .
               "  uid = '$UID' AND " .
-              "  stars >= " . $this->filters["min_stars"] . " AND " .
-              "  stars <= " . $this->filters["max_stars"] . " AND " .
-              "  level >= " . $this->filters["min_level"] . " AND " .
-              "  level <= " . $this->filters["max_level"] . " AND " .
-              "  quality >= " . $this->filters["min_quality"] . " AND " .
-              "  quality <= " . $this->filters["max_quality"] . " AND " .
-              "  original_quality >= " . $this->filters["min_original_quality"] . " AND " .
-              "  original_quality <= " . $this->filters["max_original_quality"] . " AND " .
-              "  efficiency >= " . $this->filters["min_efficiency"] . " AND " .
-              "  efficiency <= " . $this->filters["max_efficiency"] . " AND " .
-              "  max_efficiency >= " . $this->filters["min_max_efficiency"] . " AND " .
-              "  max_efficiency <= " . $this->filters["max_max_efficiency"] . " ";
-            if (count($this->filters["type"]) > 0){
+              "  stars >= " . $this->filters["MIN_STARS"] . " AND " .
+              "  stars <= " . $this->filters["MAX_STARS"] . " AND " .
+              "  level >= " . $this->filters["MIN_LEVEL"] . " AND " .
+              "  level <= " . $this->filters["MAX_LEVEL"] . " AND " .
+              "  quality >= " . $this->filters["MIN_QUALITY"] . " AND " .
+              "  quality <= " . $this->filters["MAX_QUALITY"] . " AND " .
+              "  original_quality >= " . $this->filters["MIN_ORIGINAL_QUALITY"] . " AND " .
+              "  original_quality <= " . $this->filters["MAX_ORIGINAL_QUALITY"] . " AND " .
+              "  efficiency >= " . $this->filters["MIN_EFFICIENCY"] . " AND " .
+              "  efficiency <= " . $this->filters["MAX_EFFICIENCY"] . " AND " .
+              "  max_efficiency >= " . $this->filters["MIN_MAX_EFFICIENCY"] . " AND " .
+              "  max_efficiency <= " . $this->filters["MAX_MAX_EFFICIENCY"] . " ";
+            if (count($this->filters["TYPE"]) > 0){
                 $s = $s . " AND upper(type) IN ( ";
-                foreach($this->filters["type"] as $t){
+                foreach($this->filters["TYPE"] as $t){
                     $s = $s . "'$t', ";
                 }
                 $s = $s . "'DUMMY0') ";
             }
-            if (count($this->filters["slot"]) > 0){
+            if (count($this->filters["SLOT"]) > 0){
                 $s = $s . " AND slot IN ( ";
-                foreach($this->filters["slot"] as $t){
+                foreach($this->filters["SLOT"] as $t){
                     $s = $s . "$t, ";
                 }
                 $s = $s . "-1) ";
             }
-            switch ($this->filters["assigned"]){
+            switch ($this->filters["ASSIGNED"]){
                 case 1:
                     $s = $s . " AND assigned_to IS NOT NULL ";
                     break;
@@ -237,14 +238,14 @@
                     $s = $s . " AND assigned_to IS NULL ";
                     break;
                 case 3:
-                    $s = $s . " AND (assigned_to IS NULL OR assigned_to IN (SELECT DISTINCT id FROM unit WHERE in_storage = 0)) ";
+                    $s = $s . " AND (assigned_to IS NULL OR assigned_to IN (SELECT DISTINCT id FROM unit WHERE building <> " . BUILDING_ID::MONSTER_STORAGE . ")) ";
                     break;
                 case 4:
-                    $s = $s . " AND assigned_to IN (SELECT DISTINCT id FROM unit WHERE in_storage = 0) ";
+                    $s = $s . " AND assigned_to IN (SELECT DISTINCT id FROM unit WHERE building <> " . BUILDING_ID::MONSTER_STORAGE . ") ";
                     break;
             }
             $s = $s . " ORDER BY ";
-            if ($this->filters["group"] == 1){ // 1: Type, 0: Slot
+            if ($this->filters["GROUP"] == 1){ // 1: Type, 0: Slot
                 $s = $s . " type, slot, stars DESC, original_quality DESC, quality DESC, level;";
             }
             else{

+ 24 - 24
application/page/Runs_Page.php

@@ -53,37 +53,37 @@
         private function parse_filters(){
             $this->filters = FILTER::RUN;
             if (isset($_GET["area_type"]) && intval($_GET["area_type"]) > 0){
-                $this->filters["area_type"] = $_GET["area_type"];
+                $this->filters["AREA_TYPE"] = $_GET["area_type"];
             }
             if (isset($_GET["area"]) && intval($_GET["area"]) > 0){
-                $this->filters["area"] = $_GET["area"];
+                $this->filters["AREA"] = $_GET["area"];
             }
             if (isset($_GET["stage"]) && intval($_GET["stage"]) > 0){
-                $this->filters["stage"] = $_GET["stage"];
+                $this->filters["STAGE"] = $_GET["stage"];
             }
             if (isset($_GET["difficulty"]) && intval($_GET["difficulty"]) >= DIFFICULTY_ID::NORMAL && intval($_GET["difficulty"]) <= DIFFICULTY_ID::HELL){
-                $this->filters["difficulty"] = $_GET["difficulty"];
+                $this->filters["DIFFICULTY"] = $_GET["difficulty"];
             }
             if (isset($_GET["date_min"]) && strlen($_GET["date_min"]) > 0){
-                $this->filters["date_min"] = DateTime::createFromFormat('Y-m-d', $_GET["date_min"])->format('Y-m-d');
+                $this->filters["DATE_MIN"] = DateTime::createFromFormat('Y-m-d', $_GET["date_min"])->format('Y-m-d');
             }
             if (isset($_GET["date_max"]) && strlen($_GET["date_max"]) > 0){
-                $this->filters["date_max"] = DateTime::createFromFormat('Y-m-d', $_GET["date_max"])->format('Y-m-d');
+                $this->filters["DATE_MAX"] = DateTime::createFromFormat('Y-m-d', $_GET["date_max"])->format('Y-m-d');
             }
             if (isset($_GET["defeat"]) && $_GET["defeat"] == "on"){
-                $this->filters["defeat"] = true;
+                $this->filters["DEFEAT"] = true;
             }
             else{
-                $this->filters["helper"] = false;
+                $this->filters["HELPER"] = false;
             }
             if (isset($_GET["helper"]) && $_GET["helper"] == "on"){
-                $this->filters["helper"] = true;
+                $this->filters["HELPER"] = true;
             }
             else{
-                $this->filters["helper"] = false;
+                $this->filters["HELPER"] = false;
             }
             if (isset($_GET["number"]) && intval($_GET["number"]) > 0){
-                $this->filters["number"] = $_GET["number"];
+                $this->filters["NUMBER"] = $_GET["number"];
             }
             return;
         }
@@ -102,29 +102,29 @@
                 FROM run
                 WHERE uid = '$UID'
              ";
-            if ($this->filters["area"] > 0){
-                $s = $s . " AND area =  " . $this->filters["area"] . " ";
+            if ($this->filters["AREA"] > 0){
+                $s = $s . " AND area =  " . $this->filters["AREA"] . " ";
             }
-            if ($this->filters["stage"] > 0){
-                $s = $s . " AND stage =  " . $this->filters["stage"] . " ";
+            if ($this->filters["STAGE"] > 0){
+                $s = $s . " AND stage =  " . $this->filters["STAGE"] . " ";
             }
-            if ($this->filters["difficulty"] > 0){
-                $s = $s . " AND difficulty =  " . $this->filters["difficulty"] . " ";
+            if ($this->filters["DIFFICULTY"] > 0){
+                $s = $s . " AND difficulty =  " . $this->filters["DIFFICULTY"] . " ";
             }
-            if (!$this->filters["defeat"]){
+            if (!$this->filters["DEFEAT"]){
                 $s = $s . " AND win = 1 ";
             }
-            if (!$this->filters["helper"]){
+            if (!$this->filters["HELPER"]){
                 $s = $s . " AND helper = 0 ";
             }
-            if ($this->filters["date_min"] != null){
-                $s = $s . " AND date(dtime) >= date('" . $this->filters["date_min"] . "') ";
+            if ($this->filters["DATE_MIN"] != null){
+                $s = $s . " AND date(dtime) >= date('" . $this->filters["DATE_MIN"] . "') ";
             }
-            if ($this->filters["date_max"] != null){
-                $s = $s . " AND date(dtime) >= date('" . $this->filters["date_max"] . "') ";
+            if ($this->filters["DATE_MAX"] != null){
+                $s = $s . " AND date(dtime) >= date('" . $this->filters["DATE_MAX"] . "') ";
             }
             $s = $s . " ORDER BY dtime DESC ";
-            $s = $s . " LIMIT " . $this->filters["number"] . ";";
+            $s = $s . " LIMIT " . $this->filters["NUMBER"] . ";";
             return $s;
         }
     }

+ 0 - 2
application/view/catalog.php

@@ -8,8 +8,6 @@
      * @property_read Catalog_Page $page The page model
      * @property_read int $UID Player ID
      */
-
-    namespace swdb;
 ?>
 <!DOCTYPE html>
 <html lang='en'>

+ 0 - 2
application/view/fusion.php

@@ -8,8 +8,6 @@
      * @property_read Fusion_Page $page The page model.
      * @property_read int $UID Player ID.
      */
-
-    namespace swdb;
 ?>
 <!DOCTYPE html>
 <html lang='en'>

+ 0 - 2
application/view/guild.php

@@ -7,8 +7,6 @@
      * @category View
      * @property_read Guild_Page $page The page model.
      */
-
-    namespace swdb;
 ?>
 <!DOCTYPE html>
 <html lang='en'>

+ 0 - 2
application/view/help.php

@@ -7,8 +7,6 @@
      * @category View
      * @property_read Page $page The page model.
      */
-
-    namespace swdb;
     // TODO: Implement
 ?>
 <!DOCTYPE html>

+ 0 - 2
application/view/home.php

@@ -7,8 +7,6 @@
      * @category View
      * @property_read Home_Page $page The page model.
      */
-
-    namespace swdb;
 ?>
 <!DOCTYPE html>
 <html lang='en'>

+ 0 - 2
application/view/inc/filter_catalog.php

@@ -8,8 +8,6 @@
      * @property_read mixed[] $filters Selected filters.
      * @property_read int $page Player ID.
      */
-
-    namespace swdb;
 ?>
 <form action='/<?=$UID?>/catalog/' method='get' id='filter_catalog' class='filter'>
     <table>

+ 0 - 2
application/view/inc/filter_fusion.php

@@ -9,8 +9,6 @@
      * @property_read Fusion_Page $page The page model.
      * @property_read int $page Player ID.
      */
-
-    namespace swdb;
 ?>
 <form action='/<?=$UID?>/fusion/' method='get' id='filter_fusion' class='filter'>
     <table>

+ 0 - 2
application/view/inc/filter_monsters.php

@@ -8,8 +8,6 @@
      * @property_read mixed[] $filters Selected filters.
      * @property_read int $page Player ID.
      */
-
-    namespace swdb;
 ?>
 <form action='/<?=$UID?>/monsters/' method='get'  id='filter_monsters' class='filter'>
     <table>

+ 30 - 38
application/view/inc/filter_report_runecraft.php

@@ -8,8 +8,6 @@
      * @property_read mixed[] $filters Selected filters.
      * @property_read int $page Player ID.
      */
-
-    namespace swdb;
 ?>
 <form action='/<?=$UID?>/report/runecraft/' method='get' id='filter_runecraft' class='filter'>
     <table>
@@ -184,18 +182,16 @@
             <td class='filter filter_separator' colspan='2'>
                 <span>Stats:</span>
                 <select multiple name='grind_stat[]' id='filter_grind_stat'>
-<?php
-                    foreach(RUNE_STAT_ID as $k=>$n){
-                        $selected = "";
-                        if (in_array($n, $filters["GRIND_STAT"])){
-                            $selected = "selected='selected'";
-                        }
-                        $name = ucwords($k);
-?>
-                        <option value='<?=$n?>' <?=$selected?>><?=$name?></option>
-<?php
-                    }
-?>
+                    <option value='<?=RUNE_STAT_ID::HP?>' <?=in_array(RUNE_STAT_ID::HP, $filters["GRIND_STAT"]) ? "selected='selected'" : "";?>>HP</option>
+                    <option value='<?=RUNE_STAT_ID::HP_P?>' <?=in_array(RUNE_STAT_ID::HP_P, $filters["GRIND_STAT"]) ? "selected='selected'" : "";?>>HP%</option>
+                    <option value='<?=RUNE_STAT_ID::ATK?>' <?=in_array(RUNE_STAT_ID::ATK, $filters["GRIND_STAT"]) ? "selected='selected'" : "";?>>ATK</option>
+                    <option value='<?=RUNE_STAT_ID::ATK_P?>' <?=in_array(RUNE_STAT_ID::ATK_P, $filters["GRIND_STAT"]) ? "selected='selected'" : "";?>>ATK%</option>
+                    <option value='<?=RUNE_STAT_ID::DEF?>' <?=in_array(RUNE_STAT_ID::DEF, $filters["GRIND_STAT"]) ? "selected='selected'" : "";?>>DEF</option>
+                    <option value='<?=RUNE_STAT_ID::DEF_P?>' <?=in_array(RUNE_STAT_ID::DEF_P, $filters["GRIND_STAT"]) ? "selected='selected'" : "";?>>DEF%</option>
+                    <option value='<?=RUNE_STAT_ID::SPD?>' <?=in_array(RUNE_STAT_ID::SPD, $filters["GRIND_STAT"]) ? "selected='selected'" : "";?>>SPD</option>
+                    <option value='<?=RUNE_STAT_ID::CRR?>' <?=in_array(RUNE_STAT_ID::CRR, $filters["GRIND_STAT"]) ? "selected='selected'" : "";?>>CRR</option>
+                    <option value='<?=RUNE_STAT_ID::CRD?>' <?=in_array(RUNE_STAT_ID::CRD, $filters["GRIND_STAT"]) ? "selected='selected'" : "";?>>CRD</option>
+                    <option value='<?=RUNE_STAT_ID::RES?>' <?=in_array(RUNE_STAT_ID::RES, $filters["GRIND_STAT"]) ? "selected='selected'" : "";?>>RES</option>
                 </select>
             </td>
         </tr>
@@ -232,35 +228,31 @@
             <td class='filter filter_separator'>
                 <span>Replace...</span>
                 <select multiple name='gem_stat_from[]' id='filter_gem_stat_from'>
-<?php
-                    foreach(RUNE_STAT_ID as $k=>$n){
-                        $selected = "";
-                        if (in_array($n, $filters["GEM_STAT_FROM"])){
-                            $selected = "selected='selected'";
-                        }
-                        $name = ucwords($k);
-?>
-                        <option value='<?=$n?>' <?=$selected?>><?=$name?></option>
-<?php
-                    }
-?>
+                    <option value='<?=RUNE_STAT_ID::HP?>' <?=in_array(RUNE_STAT_ID::HP, $filters["GEM_STAT_FROM"]) ? "selected='selected'" : "";?>>HP</option>
+                    <option value='<?=RUNE_STAT_ID::HP_P?>' <?=in_array(RUNE_STAT_ID::HP_P, $filters["GEM_STAT_FROM"]) ? "selected='selected'" : "";?>>HP%</option>
+                    <option value='<?=RUNE_STAT_ID::ATK?>' <?=in_array(RUNE_STAT_ID::ATK, $filters["GEM_STAT_FROM"]) ? "selected='selected'" : "";?>>ATK</option>
+                    <option value='<?=RUNE_STAT_ID::ATK_P?>' <?=in_array(RUNE_STAT_ID::ATK_P, $filters["GEM_STAT_FROM"]) ? "selected='selected'" : "";?>>ATK%</option>
+                    <option value='<?=RUNE_STAT_ID::DEF?>' <?=in_array(RUNE_STAT_ID::DEF, $filters["GEM_STAT_FROM"]) ? "selected='selected'" : "";?>>DEF</option>
+                    <option value='<?=RUNE_STAT_ID::DEF_P?>' <?=in_array(RUNE_STAT_ID::DEF_P, $filters["GEM_STAT_FROM"]) ? "selected='selected'" : "";?>>DEF%</option>
+                    <option value='<?=RUNE_STAT_ID::SPD?>' <?=in_array(RUNE_STAT_ID::SPD, $filters["GEM_STAT_FROM"]) ? "selected='selected'" : "";?>>SPD</option>
+                    <option value='<?=RUNE_STAT_ID::CRR?>' <?=in_array(RUNE_STAT_ID::CRR, $filters["GEM_STAT_FROM"]) ? "selected='selected'" : "";?>>CRR</option>
+                    <option value='<?=RUNE_STAT_ID::CRD?>' <?=in_array(RUNE_STAT_ID::CRD, $filters["GEM_STAT_FROM"]) ? "selected='selected'" : "";?>>CRD</option>
+                    <option value='<?=RUNE_STAT_ID::RES?>' <?=in_array(RUNE_STAT_ID::RES, $filters["GEM_STAT_FROM"]) ? "selected='selected'" : "";?>>RES</option>
                 </select>
             </td>
             <td class='filter filter_separator'>
                 <span>...with...</span>
                 <select multiple name='gem_stat_from[]' id='filter_gem_stat_to'>
-<?php
-                    foreach(RUNE_STAT_ID as $k=>$n){
-                        $selected = "";
-                        if (in_array($n, $filters["GEM_STAT_TO"])){
-                            $selected = "selected='selected'";
-                        }
-                        $name = ucwords($k);
-?>
-                        <option value='<?=$n?>' <?=$selected?>><?=$name?></option>
-<?php
-                    }
-?>
+                    <option value='<?=RUNE_STAT_ID::HP?>' <?=in_array(RUNE_STAT_ID::HP, $filters["GEM_STAT_TO"]) ? "selected='selected'" : "";?>>HP</option>
+                    <option value='<?=RUNE_STAT_ID::HP_P?>' <?=in_array(RUNE_STAT_ID::HP_P, $filters["GEM_STAT_TO"]) ? "selected='selected'" : "";?>>HP%</option>
+                    <option value='<?=RUNE_STAT_ID::ATK?>' <?=in_array(RUNE_STAT_ID::ATK, $filters["GEM_STAT_TO"]) ? "selected='selected'" : "";?>>ATK</option>
+                    <option value='<?=RUNE_STAT_ID::ATK_P?>' <?=in_array(RUNE_STAT_ID::ATK_P, $filters["GEM_STAT_TO"]) ? "selected='selected'" : "";?>>ATK%</option>
+                    <option value='<?=RUNE_STAT_ID::DEF?>' <?=in_array(RUNE_STAT_ID::DEF, $filters["GEM_STAT_TO"]) ? "selected='selected'" : "";?>>DEF</option>
+                    <option value='<?=RUNE_STAT_ID::DEF_P?>' <?=in_array(RUNE_STAT_ID::DEF_P, $filters["GEM_STAT_TO"]) ? "selected='selected'" : "";?>>DEF%</option>
+                    <option value='<?=RUNE_STAT_ID::SPD?>' <?=in_array(RUNE_STAT_ID::SPD, $filters["GEM_STAT_TO"]) ? "selected='selected'" : "";?>>SPD</option>
+                    <option value='<?=RUNE_STAT_ID::CRR?>' <?=in_array(RUNE_STAT_ID::CRR, $filters["GEM_STAT_TO"]) ? "selected='selected'" : "";?>>CRR</option>
+                    <option value='<?=RUNE_STAT_ID::CRD?>' <?=in_array(RUNE_STAT_ID::CRD, $filters["GEM_STAT_TO"]) ? "selected='selected'" : "";?>>CRD</option>
+                    <option value='<?=RUNE_STAT_ID::RES?>' <?=in_array(RUNE_STAT_ID::RES, $filters["GEM_STAT_TO"]) ? "selected='selected'" : "";?>>RES</option>
                 </select>
             </td>
         </tr>

+ 0 - 2
application/view/inc/filter_report_runeupgrade.php

@@ -8,8 +8,6 @@
      * @property_read mixed[] $filters Selected filters.
      * @property_read int $page Player ID.
      */
-
-    namespace swdb;
 ?>
 <?php
     if (count($custom_filters) > 0){

+ 0 - 2
application/view/inc/filter_report_skillup.php

@@ -8,8 +8,6 @@
      * @property_read mixed[] $filters Selected filters.
      * @property_read int $page Player ID.
      */
-
-    namespace swdb;
 ?>
 <form action='/<?=$UID?>/report/skillup/' method='get' id='filter_skillup' class='filter'>
     <table>

+ 0 - 2
application/view/inc/filter_runes.php

@@ -9,8 +9,6 @@
      * @property_read int $page Player ID.
      */
 
-    namespace swdb;
-
     if (count($custom_filters) > 0){
 ?>
         <script>

+ 0 - 2
application/view/inc/filter_runs.php

@@ -8,8 +8,6 @@
      * @property_read mixed[] $filters Selected filters.
      * @property_read int $page Player ID.
      */
-
-    namespace swdb;
 ?>
 <form action='/<?=$UID?>/runs/' method='get' id='filter_runeupgrade' class='filter'>
     <table>

+ 2 - 4
application/view/inc/filter_teams.php

@@ -6,11 +6,9 @@
      *
      * @category View
      * @property_read mixed[] $filters Selected filters.
-     * @property_read Fusion_Page $page The page model.
+     * @property_read Teams_Page $page The page model.
      * @property_read int $page Player ID.
      */
-
-    namespace swdb;
 ?>
 <form action='/<?=$UID?>/teams/' method='get'  id='filter_monsters' class='filter'>
     <table>
@@ -28,7 +26,7 @@
                     <option value='<?=AREA_TYPE_ID::RIFT_DUNGEON?>'>Rift Dungeon</option>
                     <option value='<?=AREA_TYPE_ID::RIFT_RAID?>'>Rift Raid</option>
                     <option value='<?=AREA_TYPE_ID::DIMENSIONAL_HOLE?>'>Dimensional Hole></option>
-                    <option value='<?=AREA_TYPE_ID::AREAN?>'>Arena</option>
+                    <option value='<?=AREA_TYPE_ID::ARENA?>'>Arena</option>
                     <option value='<?=AREA_TYPE_ID::GUILD_WAR?>'>Guild War</option>
                     <option value='<?=AREA_TYPE_ID::GUILD_SIEGE?>'>Guild Siege</option>
                     <option value='<?=AREA_TYPE_ID::TARTARUS_LABYRINTH?>'>Tartarus Labyrinth</option>

+ 0 - 2
application/view/inc/footer.php

@@ -6,8 +6,6 @@
      *
      * @category View
      */
-
-    namespace swdb;
 ?>
 <footer>
     <table id='footer_table'>

+ 0 - 2
application/view/inc/header.php

@@ -6,8 +6,6 @@
      *
      * @category View
      */
-
-    namespace swdb;
 ?>
 <header>
     <div id='logo'>

+ 0 - 2
application/view/landing.php

@@ -7,8 +7,6 @@
      * @category View
      * @property_read Landing_Page $page The page model.
      */
-
-    namespace swdb;
 ?>
 <!DOCTYPE html>
 <html lang='en'>

+ 0 - 2
application/view/monster.php

@@ -8,8 +8,6 @@
      * @property_read Monster_Page $page The page model.
      * @property_read int $UID Player ID.
      */
-
-    namespace swdb;
 ?>
 <!DOCTYPE html>
 <html lang='en'>

+ 0 - 2
application/view/monster_info.php

@@ -7,8 +7,6 @@
      * @category View
      * @property_read Monster_Info_Page The page model.
      */
-
-    namespace swdb;
 ?>
 <!DOCTYPE html>
 <html lang='en'>

+ 0 - 2
application/view/monsters.php

@@ -8,8 +8,6 @@
      * @property_read Monsters_Page $page The page model.
      * @property_read int $UID Player ID.
      */
-
-    namespace swdb;
 ?>
 <!DOCTYPE html>
 <html lang='en'>

+ 0 - 2
application/view/profile.php

@@ -8,8 +8,6 @@
      * @property_read Profile_Page $page The page model.
      * @property_read int $UID Player ID.
      */
-
-    namespace swdb;
 ?>
 <!DOCTYPE html>
 <html lang='en'>

+ 0 - 2
application/view/report.php

@@ -7,8 +7,6 @@
      * @category View
      * @property_read Report_Page $page The page model.
      */
-
-    namespace swdb;
 ?>
 <!DOCTYPE html>
 <html lang='en'>

+ 2 - 5
application/view/report_runecraft.php

@@ -7,8 +7,6 @@
      * @category View
      * @property_read Report_Runecraft_Page $page The page model.
      */
-
-    namespace swdb;
 ?>
 <!DOCTYPE html>
 <html lang='en'>
@@ -47,8 +45,8 @@
             function toggleFilters(){
                 var content = document.getElementById('filters_content');
                 var slid = document.getElementById('filters_slid');
-                if (content.style.maxHeight != '30em'){
-                    content.style.maxHeight = '30em';
+                if (content.style.maxHeight != '60em'){
+                    content.style.maxHeight = '60em';
                     slid.style.transform = 'rotate(90deg)';
                 }
                 else{
@@ -70,7 +68,6 @@
             <article id='filters_content'>
 <?php
                 $filters = $page->filters;
-                $custom_filters = $page->custom_filters;
                 include __DIR__ . "/inc/filter_report_runecraft.php";
 ?>
             </article>

+ 0 - 2
application/view/report_runeupgrade.php

@@ -7,8 +7,6 @@
      * @category View
      * @property_read Report_Runecupgrade_Page $page The page model.
      */
-
-    namespace swdb;
 ?>
 <!DOCTYPE html>
 <html lang='en'>

+ 0 - 2
application/view/report_skillup.php

@@ -7,8 +7,6 @@
      * @category View
      * @property_read Report_Skillup_Page $page The page model.
      */
-
-    namespace swdb;
 ?>
 <!DOCTYPE html>
 <html lang='en'>

+ 0 - 2
application/view/runes.php

@@ -7,8 +7,6 @@
      * @category View
      * @property_read Runes_Page $page The page model.
      */
-
-    namespace swdb;
 ?>
 <!DOCTYPE html>
 <html lang='en'>

+ 0 - 2
application/view/runs.php

@@ -8,8 +8,6 @@
      * @property_read Runs_Page $page The page model.
      * @property_read int $UID Player ID.
      */
-
-    namespace swdb;
 ?>
 <!DOCTYPE html>
 <html lang='en'>

+ 0 - 2
application/view/teams.php

@@ -8,8 +8,6 @@
      * @property_read Teams_Page $page The page model.
      * @property_read int $page Player ID.
      */
-
-    namespace swdb;
 ?>
 <!DOCTYPE html>
 <html lang='en'>

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/APP.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/ARCHETYPE_ID.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/AREA_TYPE_ID.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/ARENA_RANKING_POINTS.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/ARENA_RANKING_RANK.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/BUILDING_ID.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/Building.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/CRAFT_ID.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/Catalog_Page.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/Controller.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/Custom_Filter.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/DB.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/DECORATION_ID.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/DIFFICULTY_ID.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/DUNGEON_ID.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/Decoration.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/EFFECT_AREA_ID.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/ELEMENTAL_RIFT_DUNGEON_ID.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/ELEMENT_ID.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/ENHANCE_MONSTER_ID.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/Entity.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/FILTER.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/Fusion.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/Fusion_Page.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/GUILD_MEMBER_GRADE_ID.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/Guild.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/Guild_Member.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/Guild_Page.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/HTML.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/Helper.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/Home_Page.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/INVENTORY_ID.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/INVENTORY_TYPE_ID.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/Inventory.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/K_Area.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/K_Building.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/K_Decoration.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/K_Effect.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/K_Guild_Skill.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/K_Guild_Skill_Group.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/K_Leader_Skill.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/K_Rune_Set.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/K_Skill.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/K_Skill_Level.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/K_Source.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/K_Unit.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/K_Unit_Transformation.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/LABYRINTH_STAGES_ID.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/Landing_Page.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/Monster_Fusion.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/Monster_Info_Page.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/Monster_Page.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/Monsters_Page.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/NET.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/PATH.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/Page.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/Profile_Page.html


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
doc/classes/QUALITY_ID.html


Некоторые файлы не были показаны из-за большого количества измененных файлов