Browse Source

Major improvements to the rune upgrade report.

Iñigo Valentin 7 years ago
parent
commit
5008eeb8ee

+ 172 - 24
application/page/Report_Runeupgrade_Page.php

@@ -13,9 +13,28 @@
          * Filtrs the eport can handle.
          * Filtrs the eport can handle.
          */
          */
         public $filters = [
         public $filters = [
-            "min_stars" => 5,
-            "max_stars" => 6,
-            "in_storage" => true,
+            "monster_min_stars" => 5,
+            "monster_max_stars" => 6,
+            "monster_name" => "",
+            "monster_in_storage" => false,
+            "rune_min_stars" => 5,
+            "rune_max_stars" => 6,
+            "rune_min_level" => 0,
+            "rune_max_level" => 15,
+            "rune_min_quality" => 0,
+            "rune_max_quality" => 4,
+            "rune_min_original_quality" => 0,
+            "rune_max_original_quality" => 4,
+            "rune_min_efficiency" => 0,
+            "rune_max_efficiency" => 100,
+            "rune_min_max_efficiency" => 0,
+            "rune_max_max_efficiency" => 100,
+            "rune_slot" => [],
+            "alternative_min_stars" => 5,
+            "alternative_min_original_quality" => 0,
+            "alternative_min_level" => 0,
+            "alternative_condition" => 3,
+            "alternative_source" => 0,
         ];
         ];
 
 
         /**
         /**
@@ -48,12 +67,12 @@
             $this->view = $path["view"] . "report_runeupgrade.php";
             $this->view = $path["view"] . "report_runeupgrade.php";
             $this->parse_filters();
             $this->parse_filters();
             $s = $this->build_query();
             $s = $this->build_query();
+            error_log("R: " . $s);
             $q = $this->db->query($s);
             $q = $this->db->query($s);
             $prev_monster = "";
             $prev_monster = "";
             $prev_rune = "";
             $prev_rune = "";
             $upgrade = null;
             $upgrade = null;
             $rupgrade = null;
             $rupgrade = null;
-            $rune_i = 0; // DEBUG
             while ($r = $q->fetchArray(SQLITE3_ASSOC)){
             while ($r = $q->fetchArray(SQLITE3_ASSOC)){
                 if ($r["monster"] != $prev_monster){
                 if ($r["monster"] != $prev_monster){
                     if ($prev_rune != ""){
                     if ($prev_rune != ""){
@@ -84,7 +103,6 @@
                     ];
                     ];
                 }
                 }
                 array_push($rupgrade["alternative"], new Rune($this->db, $r["alternative"]));
                 array_push($rupgrade["alternative"], new Rune($this->db, $r["alternative"]));
-                $rune_i ++;
             }
             }
             // Last entries
             // Last entries
             array_push($upgrade["upgrade"], $rupgrade);
             array_push($upgrade["upgrade"], $rupgrade);
@@ -100,14 +118,82 @@
          * 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(){
-            if (isset($_GET["min_stars"]) && intval($_GET["min_stars"]) > 0 && intval($_GET["min_stars"]) < 7){
-                $this->filters["min_stars"] = $_GET["min_stars"];
+            // Monster
+            if (isset($_GET["monster_min_stars"]) && intval($_GET["monster_min_stars"]) > 0 && intval($_GET["mnster_min_stars"]) < 7){
+                $this->filters["monster_min_stars"] = $_GET["monster_min_stars"];
             }
             }
-            if (isset($_GET["max_stars"]) && intval($_GET["max_stars"]) > 0 && intval($_GET["max_stars"]) < 7){
-                $this->filters["max_stars"] = $_GET["max_stars"];
+            if (isset($_GET["monster_max_stars"]) && intval($_GET["max_stars"]) > 0 && intval($_GET["monster_max_stars"]) < 7){
+                $this->filters["mnster_max_stars"] = $_GET["monster_max_stars"];
             }
             }
-            if (isset($_GET["in_storage"]) && $_GET["in_storage"] != "on"){
-                $this->filters["in_storage"] = false;
+            if (isset($_GET["monster_in_storage"]) && $_GET["monster_in_storage"] == "on"){
+                $this->filters["monster_in_storage"] = true;
+            }
+            else{
+                $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"]);
+            }
+            // Runes
+            if (isset($_GET["rune_min_stars"]) && intval($_GET["rune_min_stars"]) > 0 && intval($_GET["mnster_min_stars"]) < 7){
+                $this->filters["rune_min_stars"] = $_GET["rune_min_stars"];
+            }
+            if (isset($_GET["rune_max_stars"]) && intval($_GET["max_stars"]) > 0 && intval($_GET["rune_max_stars"]) < 7){
+                $this->filters["mnster_max_stars"] = $_GET["rune_max_stars"];
+            }
+            if (isset($_GET["rune_min_level"]) && intval($_GET["rune_min_level"]) >= 0 && intval($_GET["mnster_min_level"]) <= 15){
+                $this->filters["rune_min_level"] = $_GET["rune_min_level"];
+            }
+            if (isset($_GET["rune_max_level"]) && intval($_GET["max_level"]) >= 0 && intval($_GET["rune_max_level"]) <= 15){
+                $this->filters["mnster_max_level"] = $_GET["rune_max_level"];
+            }
+            if (isset($_GET["rune_min_quality"]) && intval($_GET["rune_min_quality"]) >= 0 && intval($_GET["rune_min_quality"]) < 5){
+                $this->filters["rune_min_quality"] = $_GET["rune_min_quality"];
+            }
+            if (isset($_GET["rune_max_quality"]) && intval($_GET["rune_max_quality"]) >= 0 && intval($_GET["rune_max_quality"]) < 5){
+                $this->filters["rune_max_quality"] = $_GET["rune_max_quality"];
+            }
+            if (isset($_GET["rune_min_original_quality"]) && intval($_GET["rune_min_original_quality"]) >= 0 && intval($_GET["rune_min_original_quality"]) < 5){
+                $this->filters["rune_min_original_quality"] = $_GET["rune_min_original_quality"];
+            }
+            if (isset($_GET["rune_max_original_quality"]) && intval($_GET["rune_max_original_quality"]) >= 0 && intval($_GET["rune_max_original_quality"]) < 5){
+                $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"];
+            }
+            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"];
+            }
+            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"];
+            }
+            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"];
+            }
+            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));
+                    }
+                }
+            }
+            // Alternatives
+            if (isset($_GET["alternative_min_stars"]) && intval($_GET["alternative_min_stars"]) > 0 && intval($_GET["mnster_min_stars"]) < 7){
+                $this->filters["alternative_min_stars"] = $_GET["alternative_min_stars"];
+            }
+            if (isset($_GET["alternative_min_level"]) && intval($_GET["alternative_min_level"]) >= 0 && intval($_GET["mnster_min_level"]) <= 15){
+                $this->filters["alternative_min_level"] = $_GET["alternative_min_level"];
+            }
+            if (isset($_GET["alternative_min_original_quality"]) && intval($_GET["alternative_min_original_quality"]) >= 0 && intval($_GET["alternative_min_original_quality"]) < 5){
+                $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"]) <= 5){
+                $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"];
             }
             }
             return;
             return;
         }
         }
@@ -119,7 +205,7 @@
          */
          */
         private function build_query(){
         private function build_query(){
             $s =
             $s =
-              "  SELECT " .
+              "SELECT " .
               "  monster.id AS monster, " .
               "  monster.id AS monster, " .
               "  rune.id AS id, " .
               "  rune.id AS id, " .
               "  rune_alt.id AS alternative " .
               "  rune_alt.id AS alternative " .
@@ -129,23 +215,85 @@
               "  monster " .
               "  monster " .
               "WHERE " .
               "WHERE " .
               "  monster.id = rune.assigned_to AND " .
               "  monster.id = rune.assigned_to AND " .
-              "  monster.stars >= " . $this->filters["min_stars"] . " AND " .
-              "  monster.stars <= " . $this->filters["max_stars"] . " AND " .
-              "  rune.assigned_to IS NOT NULL AND " .
-              "  rune_alt.assigned_to IS NULL AND " .
+              "  monster.stars >= " . $this->filters["monster_min_stars"] . " AND " .
+              "  monster.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_alt.stars > rune.stars OR " .
-              "    ( " .
-              "      rune_alt.stars = rune.stars AND " .
-              "      rune_alt.original_quality > rune.original_quality" .
-              "    ) " .
-              "  ) ";
-            if (!$this->filters["in_storage"]){
+              "  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"]){
+                case 0: // Unassigned
+                    $s = $s . " rune_alt.assigned_to IS NULL AND ";
+                    break;
+                case 1: // Unassigned or assigneed to lower star monsters
+                    $s = $s . 
+                      " ( " .
+                      " rune_alt.assigned_to IS NULL OR " .
+                      " rune_alt assigned_to IN (SELECT id FROM monster m WHERE m.stars < monster.stars) " .
+                      " ) AND ";
+                    break;
+                // Case 2: Assigned or unassigned.
+            }  
+            switch ($this->filters["alternative_condition"]){
+                case 0: // Higher grade, any quality
+                    $s = $s .
+                    "  rune_alt.stars >= rune.stars ";
+                    break;
+                case 1: // Higher grade or higher quality
+                    $s = $s .
+                    "  ( " .
+                    "    rune_alt.stars > rune.stars OR " .
+                    "    rune_alt.original_quality > rune.original_quality " .
+                    "  ) ";
+                    break;
+                case 2: // Equal or higher grade and equal or higher quality
+                    $s = $s . 
+                       "  rune_alt.stars >= rune.stars AND " .
+                       "  rune_alt.original_quality >= rune.original_quality ";
+                    break;
+                case 3: // Equal or higher grade and higher quality
+                    $s = $s . 
+                       "  rune_alt.stars >= rune.stars AND " .
+                       "  rune_alt.original_quality > rune.original_quality ";
+                    break;
+                case 4: // Equal grade and equal or higher quality
+                    $s = $s . 
+                       "  rune_alt.stars > rune.stars AND " .
+                       "  rune_alt.original_quality >= rune.original_quality ";
+                    break;
+                default: // Case 5: Higher grade and higher quality
+                    $s = $s . 
+                       "  rune_alt.stars > rune.stars AND " .
+                       "  rune_alt.original_quality > rune.original_quality ";
+                    break;
+            }
+            if (strlen($this->filters["monster_name"]) > 0){
+                $s = $s . " AND monster.name LIKE = '%" . $this->filters["monster_name"] . "%' ";
+            }
+            if (!$this->filters["monster_in_storage"]){
                 $s = $s . " AND monster.in_storage = 0 ";
                 $s = $s . " AND monster.in_storage = 0 ";
             }
             }
+            if (count($this->filters["rune_slot"]) > 0){
+                $s = $s . " AND rune_slot IN ( ";
+                foreach($this->filters["rune_slot"] as $t){
+                    $s = $s . "$t, ";
+                }
+                $s = $s . "-1) ";
+            }
             $s = $s .
             $s = $s .
               "ORDER BY " .
               "ORDER BY " .
               "  monster.stars DESC, " .
               "  monster.stars DESC, " .

+ 1 - 1
application/page/Runes_Page.php

@@ -93,7 +93,7 @@
             if (isset($_GET["slot"])){
             if (isset($_GET["slot"])){
                 $slots = $_GET["slot"];
                 $slots = $_GET["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["slot"], intval($slot));
                         array_push($this->filters["slot"], intval($slot));
                     }
                     }
                 }
                 }

+ 162 - 14
application/view/report.php

@@ -84,22 +84,170 @@
                         Shows monsters with runes that can be upgraded.
                         Shows monsters with runes that can be upgraded.
                         It list the runes that can be replaced by other runes in your inventory that have either more stars or a higher base quality.
                         It list the runes that can be replaced by other runes in your inventory that have either more stars or a higher base quality.
                     </p>
                     </p>
-                    <div class='report_filters'>
-                        <div class='filter' id='filter_stars'>
-                            <span>Min. stars:</span>
-                            <input type='number' name='min_stars' id='filter_stars_min' min='1' max='6' value='5'/>
-                            <br/>
-                            <span>Max. stars:</span>
-                            <input type='number' name='max_stars' id='filter_stars_max' min='1' max='6' value='6'/>
-                        </div>
-                        <div class='filter'>
-                            <input type='checkbox' name='in_storage'/>
-                            Show monsters in storage
-                        </div>
+                    <div class='filters report_filters'>
+                        <table>
+                            <tr>
+                                <td class='filter filter_title' rowspan='2'>
+                                    <span>
+                                        Monster
+                                    </span>
+                                </td>
+                                <td class='filter' colspan='3'>
+                                    <span>Name:</span>
+                                    <input type='text' name='monster_name' id='filter_name' value=''/>
+                                </td>
+                                <td class='filter'>
+                                    <span>Stars:</span>
+                                    <input type='number' name='monster_min_stars' id='filter_stars_min' min='1' max='6' value='5'/>
+                                    -
+                                    <input type='number' name='monster_max_stars' id='filter_stars_max' min='1' max='6' value='6'/>
+                                </td>
+                            </tr>
+                                <td class='filter' colspan='4'>
+                                    <input type='checkbox' name='monster_in_storage'/>
+                                    Show monsters in storage
+                                </td>
+                            </tr>
+                            <tr>
+                                <td class='filter filter_title filter_separator' rowspan='5'>
+                                    <span>
+                                        Runes
+                                    </span>
+                                </td>
+                                <td class='filter filter_stars filter_separator' colspan='2'>
+                                    <span>Stars:</span>
+                                    <input type='number' name='rune_min_stars' id='filter_stars_min' min='1' max='6' value='5'/>
+                                    -
+                                    <input type='number' name='rune_max_stars' id='filter_stars_max' min='1' max='6' value='6'/>
+                                </td>
+                                <td class='filter filter_separator' colspan='2'>
+                                    <span>Level:</span>
+                                    <input type='number' name='rune_min_level' id='filter_level_min' min='0' max='15' value='0'/>
+                                    -
+                                    <input type='number' name='rune_max_level' id='filter_level_max' min='0' max='15' value='15'/>
+                                </td>
+                            </tr>
+                            <tr>
+                                <td class='filter' rowspan='4'>
+                                    <span>Slot:</span>
+                                    <select multiple name='rune_slot[]' id='filter_slot'>
+                                        <option value='1'>1</option>
+                                        <option value='2'>2</option>
+                                        <option value='3'>3</option>
+                                        <option value='4'>4</option>
+                                        <option value='5'>5</option>
+                                        <option value='6'>6</option>
+                                    </select>
+                                </td>
+                                <td class='filter' colspan='3'>
+                                    <span>Quality:</span>
+                                    <select name='rune_min_quality' id='filter_quality_min'>
+                                        <option value='0' selected>Normal</option>
+                                        <option value='1'>Magic</option>
+                                        <option value='2'>Rare</option>
+                                        <option value='3'>Hero</option>
+                                        <option value='4'>Legend</option>
+                                    </select>
+                                    -
+                                    <select name='rune_max_quality' id='filter_quality_max'>
+                                        <option value='0'>Normal</option>
+                                        <option value='1'>Magic</option>
+                                        <option value='2'>Rare</option>
+                                        <option value='3'>Hero</option>
+                                        <option value='4' selected>Legend</option>
+                                    </select>
+                                </td>
+                            </tr>
+                            <tr>
+                                <td class='filter' colspan='3'>
+                                    <span>Original quality:</span>
+
+                                    <select name='rune_min_original_quality' id='filter_original_quality_min'>
+                                        <option value='0' selected>Normal</option>
+                                        <option value='1'>Magic</option>
+                                        <option value='2'>Rare</option>
+                                        <option value='3'>Hero</option>
+                                        <option value='4'>Legend</option>
+                                    </select>
+                                    -
+                                    <select name='rune_max_original_quality' id='filter_original_quality_max'>
+                                        <option value='0'>Normal</option>
+                                        <option value='1'>Magic</option>
+                                        <option value='2'>Rare</option>
+                                        <option value='3'>Hero</option>
+                                        <option value='4' selected>Legend</option>
+                                    </select>
+                                </td>
+                            </tr>
+                            <tr>
+                                <td class='filter' colspan='3'>
+                                    <span>Efficiency:</span>
+                                    <input type='number' name='rune_min_efficiency' id='filter_efficiency_min' min='0' max='100' value='0'/>%
+                                    -
+                                    <input type='number' name='rune_max_efficiency' id='filter_efficiency_max' min='0' max='100' value='100'/>%
+                                </td>
+                            </tr>
+                            <tr>
+                                <td class='filter' colspan='3'>
+                                    <span>Maximum efficiency:</span>
+                                    <input type='number' name='rune_min_max_efficiency' id='filter_max_efficiency_min' min='0' max='100' value='0'/>%
+                                    -
+                                    <input type='number' name='rune_max_max_efficiency' id='filter_max_efficiency_max' min='0' max='100' value='100'/>%
+                                </td>
+                            </tr>
+                            <tr>
+                                <td class='filter filter_title filter_separator' rowspan='3'>
+                                    <span>
+                                        Alternatives
+                                    </span>
+                                </td>
+                                <td class='filter filter_stars filter_separator'>
+                                    <span>Min. stars:</span>
+                                    <input type='number' name='alternative_min_stars' id='filter_stars_min' min='1' max='6' value='6'/>
+                                </td>
+                                <td class='filter filter_separator' colspan='2'>
+                                    <span>Min. O. quality:</span>
+                                    <select name='alternative_min_original_quality' id='filter_original_quality_min'>
+                                        <option value='0' selected>Normal</option>
+                                        <option value='1'>Magic</option>
+                                        <option value='2'>Rare</option>
+                                        <option value='3'>Hero</option>
+                                        <option value='4'>Legend</option>
+                                    </select>
+                                </td>
+                                <td class='filter filter_separator'>
+                                    <span>Min. Level:</span>
+                                    <input type='number' name='alternative_min_level' id='filter_level_min' min='0' max='15' value='0'/>
+                                </td>
+                            </tr>
+                            <tr>
+                                <td class='filter' colspan='4'>
+                                    <span>Condition:</span>
+                                    <select name='alternative_condition'>
+                                        <option value='0'>Higher grade, any quality
+                                        <option value='1'>Higher grade or higher quality
+                                        <option value='2'>Equal or higher grade and equal or higher quality</option>
+                                        <option value='3' selected>Equal or higher grade and higher quality</option>
+                                        <option value='4' >Equal grade and equal or higher quality</option>
+                                        <option value='5'>Higher grade and higher quality</option>
+                                    </select>
+                                </td>
+                            </tr>
+                            <tr>
+                                <td class='filter' colspan='4'>
+                                    <span>Source:</span>
+                                    <select name='alternative_source'>
+                                        <option value='0' selected>Inventory only</option>
+                                        <option value='1'>Inventory or assigned to a lower grade monster</option>
+                                        <option value='2'>Any</option>
+                                    </select>
+                                </td>
+                            </tr>
+                        </table>
                         <div id='filter_apply'>
                         <div id='filter_apply'>
-                            <input type='submit' value='Generate'/>
+                            <input type='submit' value='Apply'/>
                         </div>
                         </div>
-                    </div>
+                    </div> <!-- .report_filters -->
                 </form>
                 </form>
             </article>
             </article>
         </section>
         </section>

+ 392 - 29
application/view/report_runeupgrade.php

@@ -36,27 +36,390 @@
         <section class='filters'>
         <section class='filters'>
             <h2>
             <h2>
                 <span>
                 <span>
-                    Monster filters
+                    Report filters
                 </span>
                 </span>
             </h2>
             </h2>
             <form action='/report/runeupgrade/' method='get'>
             <form action='/report/runeupgrade/' method='get'>
-                <div class='filter' id='filter_stars'>
-                    <span>Min. stars:</span>
-                    <input type='number' name='min_stars' id='filter_stars_min' min='1' max='6' value='<?=$page->filters["min_stars"]?>'/>
-                    <br/>
-                    <span>Max. stars:</span>
-                    <input type='number' name='max_stars' id='filter_stars_max' min='1' max='6' value='<?=$page->filters["max_stars"]?>'/>
-                </div>
-                <div class='filter'>
+                <table>
+                    <tr>
+                        <td class='filter filter_title' rowspan='2'>
+                            <span>
+                                Monster
+                            </span>
+                        </td>
+                        <td class='filter' colspan='3'>
+                            <span>Name:</span>
+                            <input type='text' name='monster_name' id='filter_name' value='<?=$page->filters["monster_name"]?>'/>
+                        </td>
+                        <td class='filter'>
+                            <span>Stars:</span>
+                            <input type='number' name='monster_min_stars' id='filter_stars_min' min='1' max='6' value='<?=$page->filters["monster_min_stars"]?>'/>
+                            -
+                            <input type='number' name='monster_max_stars' id='filter_stars_max' min='1' max='6' value='<?=$page->filters["monster_max_stars"]?>'/>
+                        </td>
+                    </tr>
+                        <td class='filter' colspan='4'>
 <?php
 <?php
-                        $checked = "";
-                        if ($page->filters["in_storage"]){
-                            $checked = "checked";
-                        }
+                            $checked = "";
+                            if ($page->filters["monster_in_storage"]){
+                                $checked = "checked";
+                            }
 ?>
 ?>
-                    <input type='checkbox' name='in_storage' <?=$checked?>/>
-                    Show monsters in storage
-                </div>
+                            <input type='checkbox' name='monster_in_storage' <?=$checked?>/>
+                            Show monsters in storage
+                        </td>
+                    </tr>
+                    <tr>
+                        <td class='filter filter_title filter_separator' rowspan='5'>
+                            <span>
+                                Runes
+                            </span>
+                        </td>
+                        <td class='filter filter_stars filter_separator' colspan='2'>
+                            <span>Stars:</span>
+                            <input type='number' name='rune_min_stars' id='filter_stars_min' min='1' max='6' value='<?=$page->filters["rune_min_stars"]?>'/>
+                            -
+                            <input type='number' name='rune_max_stars' id='filter_stars_max' min='1' max='6' value='<?=$page->filters["rune_max_stars"]?>'/>
+                        </td>
+                        <td class='filter filter_separator' colspan='2'>
+                            <span>Level:</span>
+                            <input type='number' name='rune_min_level' id='filter_level_min' min='0' max='15' value='<?=$page->filters["rune_min_level"]?>'/>
+                            -
+                            <input type='number' name='rune_max_level' id='filter_level_max' min='0' max='15' value='<?=$page->filters["rune_max_level"]?>'/>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td class='filter' rowspan='4'>
+                            <span>Slot:</span>
+                            <select multiple name='rune_slot[]' id='filter_slot'>
+<?php
+                                if (in_array(1, $page->filters["rune_slot"])){
+                                    $selected = "selected='selected'";
+                                }
+                                else{
+                                    $selected = "";
+                                }
+?>
+                                <option value='1' <?=$selected?>>1</option>
+<?php
+                                if (in_array(2, $page->filters["rune_slot"])){
+                                    $selected = "selected='selected'";
+                                }
+                                else{
+                                    $selected = "";
+                                }
+?>
+                                <option value='2' <?=$selected?>>2</option>
+<?php
+                                if (in_array(3, $page->filters["rune_slot"])){
+                                    $selected = "selected='selected'";
+                                }
+                                else{
+                                    $selected = "";
+                                }
+?>
+                                <option value='3' <?=$selected?>>3</option>
+<?php
+                                if (in_array(4, $page->filters["rune_slot"])){
+                                    $selected = "selected='selected'";
+                                }
+                                else{
+                                    $selected = "";
+                                }
+?>
+                                <option value='4' <?=$selected?>>4</option>
+<?php
+                                if (in_array(5, $page->filters["rune_slot"])){
+                                    $selected = "selected='selected'";
+                                }
+                                else{
+                                    $selected = "";
+                                }
+?>
+                                <option value='5' <?=$selected?>>5</option>
+<?php
+                                if (in_array(6, $page->filters["rune_slot"])){
+                                    $selected = "selected='selected'";
+                                }
+                                else{
+                                    $selected = "";
+                                }
+?>
+                                <option value='6' <?=$selected?>>6</option>
+                            </select>
+                        </td>
+                        <td class='filter' colspan='3'>
+                            <span>Quality:</span>
+<?php
+                            $selected_0 = "";
+                            $selected_1 = "";
+                            $selected_2 = "";
+                            $selected_3 = "";
+                            $selected_4 = "";
+                            switch (strtoupper($page->filters["rune_min_quality"])){
+                                case 0:
+                                    $selected_0 = "selected";
+                                    break;
+                                case 1:
+                                    $selected_1 = "selected";
+                                    break;
+                                case 2:
+                                    $selected_2 = "selected";
+                                    break;
+                                case 3:
+                                    $selected_3 = "selected";
+                                    break;
+                                case 4:
+                                    $selected_4 = "selected";
+                                    break;
+                            }
+?>
+                            <select name='rune_min_quality' id='filter_quality_min'>
+                                <option value='0' <?=$selected_0?>>Normal</option>
+                                <option value='1' <?=$selected_1?>>Magic</option>
+                                <option value='2' <?=$selected_2?>>Rare</option>
+                                <option value='3' <?=$selected_3?>>Hero</option>
+                                <option value='4' <?=$selected_4?>>Legend</option>
+                            </select>
+                            -
+<?php
+                            $selected_0 = "";
+                            $selected_1 = "";
+                            $selected_2 = "";
+                            $selected_3 = "";
+                            $selected_4 = "";
+                            switch (strtoupper($page->filters["rune_max_quality"])){
+                                case 0:
+                                    $selected_0 = "selected";
+                                    break;
+                                case 1:
+                                    $selected_1 = "selected";
+                                    break;
+                                case 2:
+                                    $selected_2 = "selected";
+                                    break;
+                                case 3:
+                                    $selected_3 = "selected";
+                                    break;
+                                case 4:
+                                    $selected_4 = "selected";
+                                    break;
+                            }
+?>
+                            <select name='rune_max_quality' id='filter_quality_max'>
+                                <option value='0' <?=$selected_0?>>Normal</option>
+                                <option value='1' <?=$selected_1?>>Magic</option>
+                                <option value='2' <?=$selected_2?>>Rare</option>
+                                <option value='3' <?=$selected_3?>>Hero</option>
+                                <option value='4' <?=$selected_4?>>Legend</option>
+                            </select>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td class='filter' colspan='3'>
+                            <span>Original quality:</span>
+<?php
+                            $selected_0 = "";
+                            $selected_1 = "";
+                            $selected_2 = "";
+                            $selected_3 = "";
+                            $selected_4 = "";
+                            switch (strtoupper($page->filters["rune_min_original_quality"])){
+                                case 0:
+                                    $selected_0 = "selected";
+                                    break;
+                                case 1:
+                                    $selected_1 = "selected";
+                                    break;
+                                case 2:
+                                    $selected_2 = "selected";
+                                    break;
+                                case 3:
+                                    $selected_3 = "selected";
+                                    break;
+                                case 4:
+                                    $selected_4 = "selected";
+                                    break;
+                            }
+?>
+                            <select name='rune_min_original_quality' id='filter_original_quality_min'>
+                                <option value='0' <?=$selected_0?>>Normal</option>
+                                <option value='1' <?=$selected_1?>>Magic</option>
+                                <option value='2' <?=$selected_2?>>Rare</option>
+                                <option value='3' <?=$selected_3?>>Hero</option>
+                                <option value='4' <?=$selected_4?>>Legend</option>
+                            </select>
+                            -
+<?php
+                            $selected_0 = "";
+                            $selected_1 = "";
+                            $selected_2 = "";
+                            $selected_3 = "";
+                            $selected_4 = "";
+                            switch (strtoupper($page->filters["rune_max_quality"])){
+                                case 0:
+                                    $selected_0 = "selected";
+                                    break;
+                                case 1:
+                                    $selected_1 = "selected";
+                                    break;
+                                case 2:
+                                    $selected_2 = "selected";
+                                    break;
+                                case 3:
+                                    $selected_3 = "selected";
+                                    break;
+                                case 4:
+                                    $selected_4 = "selected";
+                                    break;
+                            }
+?>
+                            <select name='rune_max_original_quality' id='filter_original_quality_max'>
+                                <option value='0' <?=$selected_0?>>Normal</option>
+                                <option value='1' <?=$selected_1?>>Magic</option>
+                                <option value='2' <?=$selected_2?>>Rare</option>
+                                <option value='3' <?=$selected_3?>>Hero</option>
+                                <option value='4' <?=$selected_4?>>Legend</option>
+                            </select>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td class='filter' colspan='3'>
+                            <span>Efficiency:</span>
+                            <input type='number' name='rune_min_efficiency' id='filter_efficiency_min' min='0' max='100' value='<?=$page->filters["rune_min_efficiency"]?>'/>%
+                            -
+                            <input type='number' name='rune_max_efficiency' id='filter_efficiency_max' min='0' max='100' value='<?=$page->filters["rune_max_efficiency"]?>'/>%
+                        </td>
+                    </tr>
+                    <tr>
+                        <td class='filter' colspan='3'>
+                            <span>Maximum efficiency:</span>
+                            <input type='number' name='rune_min_max_efficiency' id='filter_max_efficiency_min' min='0' max='100' value='<?=$page->filters["rune_min_max_efficiency"]?>'/>%
+                            -
+                            <input type='number' name='rune_max_max_efficiency' id='filter_max_efficiency_max' min='0' max='100' value='<?=$page->filters["rune_max_max_efficiency"]?>'/>%
+                        </td>
+                    </tr>
+                    <tr>
+                        <td class='filter filter_title filter_separator' rowspan='3'>
+                            <span>
+                                Alternatives
+                            </span>
+                        </td>
+                        <td class='filter filter_stars filter_separator'>
+                            <span>Min. stars:</span>
+                            <input type='number' name='alternative_min_stars' id='filter_stars_min' min='1' max='6' value='<?=$page->filters["alternative_min_stars"]?>'/>
+                        </td>
+                        <td class='filter filter_separator' colspan='2'>
+                            <span>Min. O. quality:</span>
+<?php
+                            $selected_0 = "";
+                            $selected_1 = "";
+                            $selected_2 = "";
+                            $selected_3 = "";
+                            $selected_4 = "";
+                            switch (strtoupper($page->filters["alternative_min_original_quality"])){
+                                case 0:
+                                    $selected_0 = "selected";
+                                    break;
+                                case 1:
+                                    $selected_1 = "selected";
+                                    break;
+                                case 2:
+                                    $selected_2 = "selected";
+                                    break;
+                                case 3:
+                                    $selected_3 = "selected";
+                                    break;
+                                case 4:
+                                    $selected_4 = "selected";
+                                    break;
+                            }
+?>
+                            <select name='alternative_min_original_quality' id='filter_original_quality_min'>
+                                <option value='0' <?=$selected_0?>>Normal</option>
+                                <option value='1' <?=$selected_1?>>Magic</option>
+                                <option value='2' <?=$selected_2?>>Rare</option>
+                                <option value='3' <?=$selected_3?>>Hero</option>
+                                <option value='4' <?=$selected_4?>>Legend</option>
+                            </select>
+                        </td>
+                        <td class='filter filter_separator'>
+                            <span>Min. Level:</span>
+                            <input type='number' name='alternative_min_level' id='filter_level_min' min='0' max='15' value='<?=$page->filters["alternative_min_level"]?>'/>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td class='filter' colspan='4'>
+                            <span>Condition:</span>
+<?php
+                            $selected_0 = "";
+                            $selected_1 = "";
+                            $selected_2 = "";
+                            $selected_3 = "";
+                            $selected_4 = "";
+                            $selected_5 = "";
+                            switch (strtoupper($page->filters["alternative_condition"])){
+                                case 0:
+                                    $selected_0 = "selected";
+                                    break;
+                                case 1:
+                                    $selected_1 = "selected";
+                                    break;
+                                case 2:
+                                    $selected_2 = "selected";
+                                    break;
+                                case 3:
+                                    $selected_3 = "selected";
+                                    break;
+                                case 4:
+                                    $selected_4 = "selected";
+                                    break;
+                                case 5:
+                                    $selected_5 = "selected";
+                                    break;
+                            }
+?>
+                            <select name='alternative_condition'>
+                                <option value='0' <?=$selected_0?>>Higher grade, any quality
+                                <option value='1' <?=$selected_1?>>Higher grade or higher quality
+                                <option value='2' <?=$selected_2?>>Equal or higher grade and equal or higher quality</option>
+                                <option value='3' <?=$selected_3?>>Equal or higher grade and higher quality</option>
+                                <option value='4' <?=$selected_4?>>Equal grade and equal or higher quality</option>
+                                <option value='5' <?=$selected_5?>>Higher grade and higher quality</option>
+                            </select>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td class='filter' colspan='4'>
+                            <span>Source:</span>
+<?php
+                            $selected_0 = "";
+                            $selected_1 = "";
+                            $selected_2 = "";
+                            $selected_3 = "";
+                            switch (strtoupper($page->filters["alternative_source"])){
+                                case 0:
+                                    $selected_0 = "selected";
+                                    break;
+                                case 1:
+                                    $selected_1 = "selected";
+                                    break;
+                                case 2:
+                                    $selected_2 = "selected";
+                                    break;
+                                case 3:
+                                    $selected_3 = "selected";
+                                    break;
+                            }
+?>
+                            <select name='alternative_source'>
+                                <option value='0' <?=$selected_0?>>Inventory only</option>
+                                <option value='1' <?=$selected_1?>>Inventory or assigned to a lower grade monster</option>
+                                <option value='2' <?=$selected_2?>>Any</option>
+                            </select>
+                        </td>
+                    </tr>
+                </table>
                 <div id='filter_apply'>
                 <div id='filter_apply'>
                     <input type='submit' value='Apply'/>
                     <input type='submit' value='Apply'/>
                 </div>
                 </div>
@@ -155,7 +518,7 @@
                                             </td>
                                             </td>
                                             <td class='value'>
                                             <td class='value'>
                                                 <?=$stat_value?>
                                                 <?=$stat_value?>
-                                            <td>
+                                            </td>
                                         </tr>
                                         </tr>
                                         <tr class='innate_stat'>
                                         <tr class='innate_stat'>
                                             <td class='stat'>
                                             <td class='stat'>
@@ -177,7 +540,7 @@
                                             </td>
                                             </td>
                                             <td class='value'>
                                             <td class='value'>
                                                 <?=$stat_value?>
                                                 <?=$stat_value?>
-                                            <td>
+                                            </td>
                                         </tr>
                                         </tr>
                                         <tr class=substat>
                                         <tr class=substat>
                                             <td class='stat'>
                                             <td class='stat'>
@@ -205,7 +568,7 @@
                                             </td>
                                             </td>
                                             <td class='value <?=$craft?>'>
                                             <td class='value <?=$craft?>'>
                                                 <?=$stat_value?>
                                                 <?=$stat_value?>
-                                            <td>
+                                            </td>
                                         </tr>
                                         </tr>
                                         <tr class=substat>
                                         <tr class=substat>
                                             <td class='stat'>
                                             <td class='stat'>
@@ -233,7 +596,7 @@
                                             </td>
                                             </td>
                                             <td class='value <?=$craft?>'>
                                             <td class='value <?=$craft?>'>
                                                 <?=$stat_value?>
                                                 <?=$stat_value?>
-                                            <td>
+                                            </td>
                                         </tr>
                                         </tr>
                                         <tr class=substat>
                                         <tr class=substat>
                                             <td class='stat'>
                                             <td class='stat'>
@@ -261,7 +624,7 @@
                                             </td>
                                             </td>
                                             <td class='value <?=$craft?>'>
                                             <td class='value <?=$craft?>'>
                                                 <?=$stat_value?>
                                                 <?=$stat_value?>
-                                            <td>
+                                            </td>
                                         </tr>
                                         </tr>
                                         <tr class=substat>
                                         <tr class=substat>
                                             <td class='stat'>
                                             <td class='stat'>
@@ -289,7 +652,7 @@
                                             </td>
                                             </td>
                                             <td class='value <?=$craft?>'>
                                             <td class='value <?=$craft?>'>
                                                 <?=$stat_value?>
                                                 <?=$stat_value?>
-                                            <td>
+                                            </td>
                                         </tr>
                                         </tr>
                                     </table>
                                     </table>
                                 </td>
                                 </td>
@@ -391,7 +754,7 @@
 <?php
 <?php
                                 foreach ($rupgrade["alternative"] as $alternative){
                                 foreach ($rupgrade["alternative"] as $alternative){
 ?>
 ?>
-                                <table class='alternative'>
+                                <table class='rune alternative'>
                                     <tr>
                                     <tr>
                                         <td class='icon'>
                                         <td class='icon'>
                                             <div class='rune_panel rune_slot_<?=$alternative->slot?> rune_level_<?=$alternative->level?> rune_quality_<?=$alternative->quality?> rune_original_quality_<?=$alternative->original_quality?>'>
                                             <div class='rune_panel rune_slot_<?=$alternative->slot?> rune_level_<?=$alternative->level?> rune_quality_<?=$alternative->quality?> rune_original_quality_<?=$alternative->original_quality?>'>
@@ -429,7 +792,7 @@
                                                     </td>
                                                     </td>
                                                     <td class='value'>
                                                     <td class='value'>
                                                         <?=$stat_value?>
                                                         <?=$stat_value?>
-                                                    <td>
+                                                    </td>
                                                 </tr>
                                                 </tr>
                                                 <tr class='innate_stat'>
                                                 <tr class='innate_stat'>
                                                     <td class='stat'>
                                                     <td class='stat'>
@@ -451,7 +814,7 @@
                                                     </td>
                                                     </td>
                                                     <td class='value'>
                                                     <td class='value'>
                                                         <?=$stat_value?>
                                                         <?=$stat_value?>
-                                                    <td>
+                                                    </td>
                                                 </tr>
                                                 </tr>
                                                 <tr class=substat>
                                                 <tr class=substat>
                                                     <td class='stat'>
                                                     <td class='stat'>
@@ -479,7 +842,7 @@
                                                     </td>
                                                     </td>
                                                     <td class='value <?=$craft?>'>
                                                     <td class='value <?=$craft?>'>
                                                         <?=$stat_value?>
                                                         <?=$stat_value?>
-                                                    <td>
+                                                    </td>
                                                 </tr>
                                                 </tr>
                                                 <tr class=substat>
                                                 <tr class=substat>
                                                     <td class='stat'>
                                                     <td class='stat'>
@@ -507,7 +870,7 @@
                                                     </td>
                                                     </td>
                                                     <td class='value <?=$craft?>'>
                                                     <td class='value <?=$craft?>'>
                                                         <?=$stat_value?>
                                                         <?=$stat_value?>
-                                                    <td>
+                                                    </td>
                                                 </tr>
                                                 </tr>
                                                 <tr class=substat>
                                                 <tr class=substat>
                                                     <td class='stat'>
                                                     <td class='stat'>
@@ -535,7 +898,7 @@
                                                     </td>
                                                     </td>
                                                     <td class='value <?=$craft?>'>
                                                     <td class='value <?=$craft?>'>
                                                         <?=$stat_value?>
                                                         <?=$stat_value?>
-                                                    <td>
+                                                    </td>
                                                 </tr>
                                                 </tr>
                                                 <tr class=substat>
                                                 <tr class=substat>
                                                     <td class='stat'>
                                                     <td class='stat'>
@@ -563,7 +926,7 @@
                                                     </td>
                                                     </td>
                                                     <td class='value <?=$craft?>'>
                                                     <td class='value <?=$craft?>'>
                                                         <?=$stat_value?>
                                                         <?=$stat_value?>
-                                                    <td>
+                                                    </td>
                                                 </tr>
                                                 </tr>
                                             </table>
                                             </table>
                                         </td>
                                         </td>

+ 12 - 12
application/view/runes.php

@@ -806,7 +806,7 @@
                                     <tr class='main_stat'>
                                     <tr class='main_stat'>
                                         <td class='stat'>
                                         <td class='stat'>
 <?php
 <?php
-                                            if (strpos($rune->main_stat, "%") !== false){
+                                            if (in_array($rune->main_stat, array("CRR", "CRD", "RES", "ACC", "HP%", "ATK%", "DEF%"))){
                                                 $stat_name = str_replace("%", "", $rune->main_stat);
                                                 $stat_name = str_replace("%", "", $rune->main_stat);
                                                 $stat_value = "+ " . $rune->main_stat_value . "%";
                                                 $stat_value = "+ " . $rune->main_stat_value . "%";
                                             }
                                             }
@@ -819,7 +819,7 @@
                                         </td>
                                         </td>
                                         <td class='value'>
                                         <td class='value'>
                                             <?=$stat_value?>
                                             <?=$stat_value?>
-                                        <td>
+                                        </td>
                                     </tr>
                                     </tr>
                                     <tr class='innate_stat'>
                                     <tr class='innate_stat'>
                                         <td class='stat'>
                                         <td class='stat'>
@@ -828,7 +828,7 @@
                                                 $stat_name = "&nbsp;";
                                                 $stat_name = "&nbsp;";
                                                 $stat_value = "";
                                                 $stat_value = "";
                                             }
                                             }
-                                            elseif (strpos($rune->innate_stat, "%") !== false){
+                                            elseif (in_array($rune->innate_stat, array("CRR", "CRD", "RES", "ACC", "HP%", "ATK%", "DEF%"))){
                                                 $stat_name = str_replace("%", "", $rune->innate_stat);
                                                 $stat_name = str_replace("%", "", $rune->innate_stat);
                                                 $stat_value = "+ " . $rune->innate_stat_value . "%";
                                                 $stat_value = "+ " . $rune->innate_stat_value . "%";
                                             }
                                             }
@@ -841,7 +841,7 @@
                                         </td>
                                         </td>
                                         <td class='value'>
                                         <td class='value'>
                                             <?=$stat_value?>
                                             <?=$stat_value?>
-                                        <td>
+                                        </td>
                                     </tr>
                                     </tr>
                                     <tr class=substat>
                                     <tr class=substat>
                                         <td class='stat'>
                                         <td class='stat'>
@@ -850,7 +850,7 @@
                                                 $stat_name = "&nbsp;";
                                                 $stat_name = "&nbsp;";
                                                 $stat_value = "";
                                                 $stat_value = "";
                                             }
                                             }
-                                            elseif (strpos($rune->substat_1, "%") !== false){
+                                            elseif (in_array($rune->substat_1, array("CRR", "CRD", "RES", "ACC", "HP%", "ATK%", "DEF%"))){
                                                 $stat_name = str_replace("%", "", $rune->substat_1);
                                                 $stat_name = str_replace("%", "", $rune->substat_1);
                                                 $stat_value = "+ " . $rune->substat_1_value . "%";
                                                 $stat_value = "+ " . $rune->substat_1_value . "%";
                                             }
                                             }
@@ -869,7 +869,7 @@
                                         </td>
                                         </td>
                                         <td class='value <?=$craft?>'>
                                         <td class='value <?=$craft?>'>
                                             <?=$stat_value?>
                                             <?=$stat_value?>
-                                        <td>
+                                        </td>
                                     </tr>
                                     </tr>
                                     <tr class=substat>
                                     <tr class=substat>
                                         <td class='stat'>
                                         <td class='stat'>
@@ -878,7 +878,7 @@
                                                 $stat_name = "&nbsp;";
                                                 $stat_name = "&nbsp;";
                                                 $stat_value = "";
                                                 $stat_value = "";
                                             }
                                             }
-                                            elseif (strpos($rune->substat_2, "%") !== false){
+                                            elseif (in_array($rune->substat_2, array("CRR", "CRD", "RES", "ACC", "HP%", "ATK%", "DEF%"))){
                                                 $stat_name = str_replace("%", "", $rune->substat_2);
                                                 $stat_name = str_replace("%", "", $rune->substat_2);
                                                 $stat_value = "+ " . $rune->substat_2_value . "%";
                                                 $stat_value = "+ " . $rune->substat_2_value . "%";
                                             }
                                             }
@@ -897,7 +897,7 @@
                                         </td>
                                         </td>
                                         <td class='value <?=$craft?>'>
                                         <td class='value <?=$craft?>'>
                                             <?=$stat_value?>
                                             <?=$stat_value?>
-                                        <td>
+                                        </td>
                                     </tr>
                                     </tr>
                                     <tr class=substat>
                                     <tr class=substat>
                                         <td class='stat'>
                                         <td class='stat'>
@@ -906,7 +906,7 @@
                                                 $stat_name = "&nbsp;";
                                                 $stat_name = "&nbsp;";
                                                 $stat_value = "";
                                                 $stat_value = "";
                                             }
                                             }
-                                            elseif (strpos($rune->substat_3, "%") !== false){
+                                            elseif (in_array($rune->substat_3, array("CRR", "CRD", "RES", "ACC", "HP%", "ATK%", "DEF%"))){
                                                 $stat_name = str_replace("%", "", $rune->substat_3);
                                                 $stat_name = str_replace("%", "", $rune->substat_3);
                                                 $stat_value = "+ " . $rune->substat_3_value . "%";
                                                 $stat_value = "+ " . $rune->substat_3_value . "%";
                                             }
                                             }
@@ -925,7 +925,7 @@
                                         </td>
                                         </td>
                                         <td class='value <?=$craft?>'>
                                         <td class='value <?=$craft?>'>
                                             <?=$stat_value?>
                                             <?=$stat_value?>
-                                        <td>
+                                        </td>
                                     </tr>
                                     </tr>
                                     <tr class=substat>
                                     <tr class=substat>
                                         <td class='stat'>
                                         <td class='stat'>
@@ -934,7 +934,7 @@
                                                 $stat_name = "&nbsp;";
                                                 $stat_name = "&nbsp;";
                                                 $stat_value = "";
                                                 $stat_value = "";
                                             }
                                             }
-                                            elseif (strpos($rune->substat_4, "%") !== false){
+                                            elseif (in_array($rune->substat_4, array("CRR", "CRD", "RES", "ACC", "HP%", "ATK%", "DEF%"))){
                                                 $stat_name = str_replace("%", "", $rune->substat_4);
                                                 $stat_name = str_replace("%", "", $rune->substat_4);
                                                 $stat_value = "+ " . $rune->substat_4_value . "%";
                                                 $stat_value = "+ " . $rune->substat_4_value . "%";
                                             }
                                             }
@@ -953,7 +953,7 @@
                                         </td>
                                         </td>
                                         <td class='value <?=$craft?>'>
                                         <td class='value <?=$craft?>'>
                                             <?=$stat_value?>
                                             <?=$stat_value?>
-                                        <td>
+                                        </td>
                                     </tr>
                                     </tr>
                                 </table>
                                 </table>
                             </td>
                             </td>

+ 59 - 212
public/css/report.css

@@ -38,7 +38,16 @@ body#body_reports section.report article div.report_filters{
     border: 0.1em solid #000000;
     border: 0.1em solid #000000;
     border-radius: 0.5em;
     border-radius: 0.5em;
     background-color: #aa8866;
     background-color: #aa8866;
+    display: block;
+}
+body#body_reports section.report article div.report_filters table{
+    border-collapse: collapse;
+}
+
+body#body_reports section.report article div.report_filters td.filter_separator{
+    border-top: 0.2em solid #ffffff;
 }
 }
+
 body#body_reports section.report article div.report_filters div.filter{
 body#body_reports section.report article div.report_filters div.filter{
     vertical-align: top;
     vertical-align: top;
     margin: 0.7em;
     margin: 0.7em;
@@ -58,6 +67,30 @@ body#body_reports section.report article div.report_filters div#filter_apply{
     text-align: center;
     text-align: center;
     margin: 2em auto 1em auto;
     margin: 2em auto 1em auto;
 }
 }
+body#body_reports section.report article div.report_filters select#filter_slot{
+    height: 10em;
+}
+body#body_reports section.report article div.report_filters table td.filter{
+    padding: 0.2em;
+    text-align: center;
+    color: #ffffff;
+}
+body#body_reports section.report article div.report_filters table td.filter span{
+    display: block;
+    font-size: 80%;
+}
+body#body_reports section.report article div.report_filters td.filter_title{
+    font-weight: bold;
+    border-right: 0.2em solid #ffffff;
+    text-align: center;
+    vertical-align: middle;
+}
+body#body_reports section.report article div.report_filters td.filter_title span{
+    transform: rotate(-90deg);
+    display: block;
+    width: 2em;
+    margin: 2em 0.5em 0.5em 0.5em;
+}
 
 
 body#body_report_skillup section.content{
 body#body_report_skillup section.content{
     display: inline-block;
     display: inline-block;
@@ -156,7 +189,28 @@ body#body_report_skillup section.content div.monstertable#skill_averages td.valu
     padding-left: 1em;
     padding-left: 1em;
 }
 }
 
 
+body#body_report_runeupgrade section.filters table{
+    border-collapse: collapse;
+}
 
 
+body#body_report_runeupgrade section.filters td.filter_title{
+    font-weight: bold;
+    border-right: 0.2em solid #ffffff;
+    text-align: center;
+    vertical-align: middle;
+}
+body#body_report_runeupgrade section.filters td.filter_title span{
+    transform: rotate(-90deg);
+    display: block;
+    width: 2em;
+    margin-top: 2em;
+}
+body#body_report_runeupgrade section.filters td.filter_separator{
+    border-top: 0.2em solid #ffffff;
+}
+body#body_report_runeupgrade section.filters select#filter_slot{
+    height: 10em;
+}
 
 
 body#body_report_runeupgrade section.content article{
 body#body_report_runeupgrade section.content article{
     text-align: left;
     text-align: left;
@@ -184,230 +238,23 @@ body#body_report_runeupgrade section.content article div.monster_runes{
     max-width: 80%;
     max-width: 80%;
 }
 }
 
 
-body#body_report_runeupgrade section.content article div.monster_runes table.rune{
-    display: inline-block;
-    vertical-align: top;
-    border: 0.2em solid #000000;
-    margin: 0.5em;
-    position: relative;
-    border-radius: 15%;
-    background: #351e0b;
-    border: 0.2em solid #f2c920;
-    border-radius: 0.5em;
-    padding: 0em;
-    font-size: 80%;
-}
-@media screen and (max-width : 990px){
-    body#body_report_runeupgrade section.content article div.monster_runes table.rune{
-        width: 95%;
-        max-width: 95%;
-    }
-}
-body#body_report_runeupgrade section.content article div.monster_runes table.rune{
-    border-collapse: collapse;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes table.rune td.stats{
-    color: #ffffff;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes table.rune td.stats table{
-    color: #ffffff;
-    font-size: 80%;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes table.rune td.stats table tr.main_stat{
-    font-weight: bold;
-    font-size: 110%;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes table.rune td.stats table tr.innate_stat{
-    font-style: italic;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes table.rune td.stats table td.stat{
-    text-align: right;
-}
-body#body_report_runeupgrade section.content article div.monster_runes table.rune td.stats table td.value{
-    text-align: left;
-    padding-left: 1em;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes table.rune td.stats table td.craft{
-    color: #ff7700;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes table.rune td.details{
-    color: #ffffff;
-    padding-left: 0.5em;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes table.rune td.details table.table_details{
+body#body_report_runeupgrade section.content article div.monster_runes > table.rune{
     font-size: 80%;
     font-size: 80%;
 }
 }
 
 
-body#body_report_runeupgrade section.content article div.monster_runes table.rune td.details table.table_details td.title{
-    text-align: right;
-}
-body#body_report_runeupgrade section.content article div.monster_runes table.rune td.details table.table_details td.value{
-    text-align: left;
-    padding-left: 1em;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes table.rune td.details table.table_details span.quality{
-    border: 0.1em solid #000000;
-    border-radius: 0.2em;
-    font-weight: bold;
-    color: #ffffff;
-    text-shadow: 0 0 0.1em #000000;
-    padding: 0 0.3em;
-    display: block;
-    width: 5em;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes table.rune td.details table.table_details span.quality.quality_normal{
-    background-color: #cccccc;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes table.rune td.details table.table_details span.quality.quality_magic{
-    background-color: #55ff55;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes table.rune td.details table.table_details span.quality.quality_rare{
-    background-color: #15c6e1;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes table.rune td.details table.table_details span.quality.quality_hero{
-    background-color: #ad7fa8;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes table.rune td.details table.table_details span.quality.quality_legend{
-    background-color: #f57900;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes table.rune td.details{
-    color: #ffffff;
-    padding-left: 0.5em;
-}
-
 body#body_report_runeupgrade section.content article div.monster_runes div.alternatives{
 body#body_report_runeupgrade section.content article div.monster_runes div.alternatives{
-    padding-bottom: 1em;
-    margin-top: -2em;
+    padding: 1em;
+    margin-top: -0.6em;
     margin-left: 2.5em;
     margin-left: 2.5em;
     margin-bottom: 1em;
     margin-bottom: 1em;
-    padding-left: 1em;
-    padding-bottom: 1em;
     border-left: 0.3em solid #ffffff;
     border-left: 0.3em solid #ffffff;
     border-bottom: 0.3em solid #ffffff;
     border-bottom: 0.3em solid #ffffff;
-    padding-top: 2em;
     border-bottom-left-radius: 1em;
     border-bottom-left-radius: 1em;
     border-bottom-right-radius: 1em;
     border-bottom-right-radius: 1em;
-    font-size: 70%;
-    background: linear-gradient(47deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 50%);
+    font-size: 90%;
+    background: linear-gradient(47deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0) 70%);
 }
 }
 
 
 body#body_report_runeupgrade section.content article div.monster_runes div.alternatives table.alternative{
 body#body_report_runeupgrade section.content article div.monster_runes div.alternatives table.alternative{
-    display: inline-block;
-    vertical-align: top;
-    border: 0.2em solid #000000;
-    margin: 0.5em 2em 0.5em 0.5em;
-    position: relative;
-    border-radius: 15%;
-    background: #351e0b;
-    border: 0.2em solid #f2c920;
-    border-radius: 0.5em;
-    padding: 0em;
-    max-width: 90%;
-}
-@media screen and (max-width : 990px){
-    body#body_report_runeupgrade section.content article div.monster_runes div.alternatives table.alternative{
-        width: 95%;
-        max-width: 95%;
-    }
-}
-body#body_report_runeupgrade section.content article div.monster_runes div.alternatives table.alternative{
-    border-collapse: collapse;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes div.alternatives table.alternative td.stats{
-    color: #ffffff;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes div.alternatives table.alternative td.stats table{
-    color: #ffffff;
-    font-size: 80%;
-}
 
 
-body#body_report_runeupgrade section.content article div.monster_runes div.alternatives table.alternative td.stats table tr.main_stat{
-    font-weight: bold;
-    font-size: 110%;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes div.alternatives table.alternative td.stats table tr.innate_stat{
-    font-style: italic;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes div.alternatives table.alternative td.stats table td.stat{
-    text-align: right;
-}
-body#body_report_runeupgrade section.content article div.monster_runes div.alternatives table.alternative td.stats table td.value{
-    text-align: left;
-    padding-left: 1em;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes div.alternatives table.alternative td.stats table td.craft{
-    color: #ff7700;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes div.alternatives table.alternative td.details{
-    color: #ffffff;
-    padding-left: 0.5em;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes div.alternatives table.alternative td.details table.table_details{
-    font-size: 80%;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes div.alternatives table.alternative td.details table.table_details td.title{
-    text-align: right;
-}
-body#body_report_runeupgrade section.content article div.monster_runes div.alternatives table.alternative td.details table.table_details td.value{
-    text-align: left;
-    padding-left: 1em;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes div.alternatives table.alternative td.details table.table_details span.quality{
-    border: 0.1em solid #000000;
-    border-radius: 0.2em;
-    font-weight: bold;
-    color: #ffffff;
-    text-shadow: 0 0 0.1em #000000;
-    padding: 0 0.3em;
-    display: block;
-    width: 5em;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes div.alternatives table.alternative td.details table.table_details span.quality.quality_normal{
-    background-color: #cccccc;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes div.alternatives table.alternative td.details table.table_details span.quality.quality_magic{
-    background-color: #55ff55;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes div.alternatives table.alternative td.details table.table_details span.quality.quality_rare{
-    background-color: #15c6e1;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes div.alternatives table.alternative td.details table.table_details span.quality.quality_hero{
-    background-color: #ad7fa8;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes div.alternatives table.alternative td.details table.table_details span.quality.quality_legend{
-    background-color: #f57900;
-}
-
-body#body_report_runeupgrade section.content article div.monster_runes div.alternatives table.alternative td.details{
-    color: #ffffff;
-    padding-left: 0.5em;
 }
 }

+ 0 - 121
public/css/runes.css

@@ -40,124 +40,3 @@ section h2 img.group_image_5{
 section h2 img.group_image_6{
 section h2 img.group_image_6{
     transform: rotate(303deg);
     transform: rotate(303deg);
 }
 }
-
-section article table.rune{
-    border-collapse: collapse;
-    display: inline-block;
-    vertical-align: top;
-    font-size: 80%;
-    position: relative;
-    border-radius: 1em;
-    margin: 0.5em;
-}
-section article table.rune{
-    font-size: 70%;
-}
-section article table.rune td.icon div.assigned{
-    max-width: 2.5em;
-    max-height: 2.5em;
-    position: absolute;
-    left: 0.5em;
-    bottom: 1em;
-}
-section article table.rune td.icon div.assigned img.monster_image{
-    width: 2.5em;
-    height: 2.5em;
-    border-style: solid;
-    border-width: 0.2em;
-    border-radius: 15%;
-}
-section article table.rune td.icon{
-    border-bottom: 0.2em solid #777777;
-    border-left: 0.2em solid #777777;
-    border-top: 0.2em solid #777777;
-    background-color: #ffffff44;
-}
-section article table.rune td.icon div.rune_panel{
-    font-size: 70%;
-}
-section article table.rune td.stats{
-    color: #ffffff;
-    border-bottom: 0.2em solid #777777;
-    border-top: 0.2em solid #777777;
-    background-color: #ffffff44;
-    width: 7.5em;
-}
-
-section article table.rune td.stats table{
-    color: #ffffff;
-    font-size: 80%;
-}
-
-section article table.rune td.stats table tr.main_stat{
-    font-weight: bold;
-    font-size: 110%;
-}
-
-section article table.rune td.stats table tr.innate_stat{
-    font-style: italic;
-}
-
-section article table.rune td.stats table td.stat{
-    text-align: right;
-}
-section article table.rune td.stats table td.value{
-    text-align: left;
-    padding-left: 1em;
-}
-
-section article table.rune td.stats table td.craft{
-    color: #ff7700;
-}
-
-section article table.rune td.details{
-    color: #ffffff;
-    padding-left: 0.5em;
-    border-bottom: 0.2em solid #777777;
-    border-right: 0.2em solid #777777;
-    border-top: 0.2em solid #777777;
-    background-color: #ffffff44;
-    width: 15em;
-}
-
-section article table.rune td.details table.table_details{
-    font-size: 80%;
-}
-
-section article table.rune td.details table.table_details td.title{
-    text-align: right;
-}
-section article table.rune td.details table.table_details td.value{
-    text-align: left;
-    padding-left: 1em;
-}
-
-section article table.rune td.details table.table_details span.quality{
-    border: 0.1em solid #000000;
-    border-radius: 0.2em;
-    font-weight: bold;
-    color: #ffffff;
-    text-shadow: 0 0 0.1em #000000;
-    padding: 0 0.3em;
-    width: 5em;
-}
-
-section article table.rune td.details table.table_details span.quality.quality_normal{
-    background-color: #cccccc;
-}
-
-section article table.rune td.details table.table_details span.quality.quality_magic{
-    background-color: #55ff55;
-}
-
-section article table.rune td.details table.table_details span.quality.quality_rare{
-    background-color: #15c6e1;
-}
-
-section article table.rune td.details table.table_details span.quality.quality_hero{
-    background-color: #ad7fa8;
-}
-
-section article table.rune td.details table.table_details span.quality.quality_legend{
-    background-color: #f57900;
-}

+ 129 - 1
public/css/ui.css

@@ -577,4 +577,132 @@ div.monster_panel span.level::before {
 
 
 /**
 /**
  * /Monster panel
  * /Monster panel
- **
+ */
+ 
+ 
+ /**
+  * Rune table
+  */
+table.rune{
+    border-collapse: collapse;
+    display: inline-block;
+    vertical-align: top;
+    font-size: 80%;
+    position: relative;
+    border-radius: 1em;
+    margin: 0.5em;
+}
+table.rune{
+    font-size: 70%;
+}
+table.rune td.icon div.assigned{
+    max-width: 2.5em;
+    max-height: 2.5em;
+    position: absolute;
+    left: 0.5em;
+    bottom: 1em;
+}
+table.rune td.icon div.assigned img.monster_image{
+    width: 2.5em;
+    height: 2.5em;
+    border-style: solid;
+    border-width: 0.2em;
+    border-radius: 15%;
+}
+table.rune td.icon{
+    border-bottom: 0.2em solid #777777;
+    border-left: 0.2em solid #777777;
+    border-top: 0.2em solid #777777;
+    background-color: #655c59;
+}
+table.rune td.icon div.rune_panel{
+    font-size: 70%;
+}
+table.rune td.stats{
+    color: #ffffff;
+    border-bottom: 0.2em solid #777777;
+    border-top: 0.2em solid #777777;
+    background-color: #655c59;
+    width: 8em;
+}
+
+table.rune td.stats table{
+    color: #ffffff;
+    font-size: 90%;
+}
+
+table.rune td.stats table tr.main_stat{
+    font-weight: bold;
+    font-size: 110%;
+}
+
+table.rune td.stats table tr.innate_stat{
+    font-style: italic;
+}
+
+table.rune td.stats table td.stat{
+    text-align: right;
+}
+table.rune td.stats table td.value{
+    text-align: left;
+    padding-left: 1em;
+}
+
+table.rune td.stats table td.craft{
+    color: #ff7700;
+}
+
+table.rune td.details{
+    color: #ffffff;
+    padding-left: 0.5em;
+    border-bottom: 0.2em solid #777777;
+    border-right: 0.2em solid #777777;
+    border-top: 0.2em solid #777777;
+    background-color: #655c59;
+    width: 16em;
+}
+
+table.rune td.details table.table_details{
+    font-size: 80%;
+}
+
+table.rune td.details table.table_details td.title{
+    text-align: right;
+}
+table.rune td.details table.table_details td.value{
+    text-align: left;
+    padding-left: 1em;
+}
+
+table.rune td.details table.table_details span.quality{
+    border: 0.1em solid #000000;
+    border-radius: 0.2em;
+    font-weight: bold;
+    color: #ffffff;
+    text-shadow: 0 0 0.1em #000000;
+    padding: 0 0.3em;
+    width: 5em;
+}
+
+table.rune td.details table.table_details span.quality.quality_normal{
+    background-color: #cccccc;
+}
+
+table.rune td.details table.table_details span.quality.quality_magic{
+    background-color: #55ff55;
+}
+
+table.rune td.details table.table_details span.quality.quality_rare{
+    background-color: #15c6e1;
+}
+
+table.rune td.details table.table_details span.quality.quality_hero{
+    background-color: #ad7fa8;
+}
+
+table.rune td.details table.table_details span.quality.quality_legend{
+    background-color: #f57900;
+}
+/**
+ * /Rune table
+ */