Эх сурвалжийг харах

Improved filters in reports

Iñigo Valentin 7 жил өмнө
parent
commit
391609fd61

+ 58 - 55
application/page/Report_Runeupgrade_Page.php

@@ -149,19 +149,19 @@
             if (isset($_GET["rune_min_level"]) && intval($_GET["rune_min_level"]) >= 0 && intval($_GET["rune_min_level"]) <= 15){
             if (isset($_GET["rune_min_level"]) && intval($_GET["rune_min_level"]) >= 0 && intval($_GET["rune_min_level"]) <= 15){
                 $this->filters["rune_min_level"] = $_GET["rune_min_level"];
                 $this->filters["rune_min_level"] = $_GET["rune_min_level"];
             }
             }
-            if (isset($_GET["rune_max_level"]) && intval($_GET["max_level"]) >= 0 && intval($_GET["rune_max_level"]) <= 15){
+            if (isset($_GET["rune_max_level"]) && intval($_GET["rune_max_level"]) >= 0 && intval($_GET["rune_max_level"]) <= 15){
                 $this->filters["rune_max_level"] = $_GET["rune_max_level"];
                 $this->filters["rune_max_level"] = $_GET["rune_max_level"];
             }
             }
-            if (isset($_GET["rune_min_quality"]) && intval($_GET["rune_min_quality"]) >= 0 && intval($_GET["rune_min_quality"]) < 5){
+            if (isset($_GET["rune_min_quality"]) && intval($_GET["rune_min_quality"]) >= $QUALITY["NORMAL"] && intval($_GET["rune_min_quality"]) <= $QUALITY["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"]) >= 0 && intval($_GET["rune_max_quality"]) < 5){
+            if (isset($_GET["rune_max_quality"]) && intval($_GET["rune_max_quality"]) >= $QUALITY["NORMAL"] && intval($_GET["rune_max_quality"]) <= $QUALITY["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"]) >= 0 && intval($_GET["rune_min_original_quality"]) < 5){
+            if (isset($_GET["rune_min_original_quality"]) && intval($_GET["rune_min_original_quality"]) >= $QUALITY["NORMAL"] && intval($_GET["rune_min_original_quality"]) <= $QUALITY["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"]) >= 0 && intval($_GET["rune_max_original_quality"]) < 5){
+            if (isset($_GET["rune_max_original_quality"]) && intval($_GET["rune_max_original_quality"]) >= $QUALITY["NORMAL"] && intval($_GET["rune_max_original_quality"]) <= $QUALITY["LEGEND"]){
                 $this->filters["rune_max_original_quality"] = $_GET["rune_max_original_quality"];
                 $this->filters["rune_max_original_quality"] = $_GET["rune_max_original_quality"];
             }
             }
             if (isset($_GET["rune_min_efficiency"]) && intval($_GET["rune_min_efficiency"]) >= 0 && intval($_GET["rune_min_efficiency"]) <= 100){
             if (isset($_GET["rune_min_efficiency"]) && intval($_GET["rune_min_efficiency"]) >= 0 && intval($_GET["rune_min_efficiency"]) <= 100){
@@ -191,10 +191,10 @@
             if (isset($_GET["alternative_min_level"]) && intval($_GET["alternative_min_level"]) >= 0 && intval($_GET["alternative_min_level"]) <= 15){
             if (isset($_GET["alternative_min_level"]) && intval($_GET["alternative_min_level"]) >= 0 && intval($_GET["alternative_min_level"]) <= 15){
                 $this->filters["alternative_min_level"] = $_GET["alternative_min_level"];
                 $this->filters["alternative_min_level"] = $_GET["alternative_min_level"];
             }
             }
-            if (isset($_GET["alternative_min_original_quality"]) && intval($_GET["alternative_min_original_quality"]) >= 0 && intval($_GET["alternative_min_original_quality"]) < 5){
+            if (isset($_GET["alternative_min_original_quality"]) && intval($_GET["alternative_min_original_quality"]) >= $QUALITY["NORMAL"] && intval($_GET["alternative_min_original_quality"]) <= $QUALITY["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"]) <= 5){
+            if (isset($_GET["alternative_condition"]) && intval($_GET["alternative_condition"]) >= 0 && intval($_GET["alternative_condition"]) <= $QUALITY["LEGEND"]){
                 $this->filters["alternative_condition"] = $_GET["alternative_condition"];
                 $this->filters["alternative_condition"] = $_GET["alternative_condition"];
             }
             }
             if (isset($_GET["alternative_source"]) && intval($_GET["alternative_source"]) >= 0 && intval($_GET["alternative_source"]) <= 2){
             if (isset($_GET["alternative_source"]) && intval($_GET["alternative_source"]) >= 0 && intval($_GET["alternative_source"]) <= 2){
@@ -209,49 +209,51 @@
          * @return The query to be executed.
          * @return The query to be executed.
          */
          */
         private function build_query(){
         private function build_query(){
-            $s =
-              "SELECT " .
-              "  unit.id AS unit, " .
-              "  rune.id AS id, " .
-              "  rune_alt.id AS alternative " .
-              "FROM " .
-              "  rune, " .
-              "  rune rune_alt, " .
-              "  unit, " .
-              "  k_unit " .
-              "WHERE " .
-              "  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 " .
-              "  rune.type = rune_alt.type AND " .
-              "  rune.slot = rune_alt.slot AND " .
-              "  rune.main_stat = rune_alt.main_stat 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 ";
+            $s = "
+              SELECT
+                unit.id AS unit,
+                rune.id AS id,
+                rune_alt.id AS alternative
+              FROM
+                rune,
+                rune rune_alt,
+                unit,
+                k_unit
+              WHERE
+                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 
+                rune.type = rune_alt.type AND 
+                rune.slot = rune_alt.slot AND 
+                rune.main_stat = rune_alt.main_stat AND 
+                rune_alt.stars >= " . $this->filters["alternative_min_stars"] . " AND 
+                rune_alt.level >= " . $this->filters["alternative_min_level"] . " AND 
+                rune_alt.original_quality >= " . $this->filters["alternative_min_original_quality"] . " AND
+            ";
             switch ($this->filters["alternative_source"]){
             switch ($this->filters["alternative_source"]){
                 case 0: // Unassigned
                 case 0: // Unassigned
                     $s = $s . " rune_alt.assigned_to IS NULL AND ";
                     $s = $s . " rune_alt.assigned_to IS NULL AND ";
                     break;
                     break;
                 case 1: // Unassigned or assigned to lower star monsters
                 case 1: // Unassigned or assigned to lower star monsters
-                    $s = $s . 
-                      " ( " .
-                      " rune_alt.assigned_to IS NULL OR " .
-                      " rune_alt.assigned_to IN (SELECT id FROM unit m WHERE m.stars < unit.stars) " .
-                      " ) AND ";
+                    $s = $s . "
+                      (
+                        rune_alt.assigned_to IS NULL OR
+                        rune_alt.assigned_to IN (SELECT id FROM unit m WHERE m.stars < unit.stars)
+                      ) AND
+                    ";
                     break;
                     break;
                 // Case 2: Assigned or unassigned.
                 // Case 2: Assigned or unassigned.
             }  
             }  
@@ -301,16 +303,17 @@
                 }
                 }
                 $s = $s . "-1) ";
                 $s = $s . "-1) ";
             }
             }
-            $s = $s .
-              "ORDER BY " .
-              "  unit.stars DESC, " .
-              "  unit.level DESC, " .
-              "  unit.id, " .
-              "  rune.slot, " .
-              "  id, " .
-              "  rune_alt.stars DESC, " .
-              "  rune_alt.original_quality DESC , " .
-              "  rune_alt.main_stat_value DESC;";
+            $s = $s . "
+              ORDER BY
+                unit.stars DESC,
+                unit.level DESC,
+                unit.id,
+                rune.slot,
+                id,
+                rune_alt.stars DESC,
+                rune_alt.original_quality DESC,
+                rune_alt.main_stat_value DESC;
+            ";
             return $s;
             return $s;
         }
         }
     }
     }

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

@@ -1,7 +1,7 @@
 <?php
 <?php
     global $QUALITY;
     global $QUALITY;
 ?>
 ?>
-<form action='/report/runeupgrade/' method='get' id='filter_runeuprade' class='filter'>
+<form action='/report/runeupgrade/' method='get' id='filter_runeupgrade' class='filter'>
     <table>
     <table>
         <tr>
         <tr>
             <td class='filter filter_title' rowspan='2'>
             <td class='filter filter_title' rowspan='2'>
@@ -63,7 +63,7 @@
                             $selected = "";
                             $selected = "";
                         }
                         }
 ?>
 ?>
-                        <option value='$i' <?=$selected?>>%i</option>
+                        <option value='<?=$i?>' <?=$selected?>><?=$i?></option>
 <?php
 <?php
                     }
                     }
 ?>
 ?>

+ 1 - 1
application/view/report.php

@@ -44,7 +44,7 @@
                 Pending skill-ups
                 Pending skill-ups
             </h2>
             </h2>
             <article>
             <article>
-                <img alt=' ' src='<?=$path["img"]["content"]?>monster/0115.png'> <!-- Devilmon image -->
+                <img alt=' ' src='<?=$path["img"]["content"]?>unit/00015105.png'> <!-- Devilmon image -->
                 <p>
                 <p>
                     Shows a list of the monstes in need of skilling-up
                     Shows a list of the monstes in need of skilling-up
                     It sorts monster not by the absolute ammount of remaining power-ups, but by a ponderated list tht takes into account to which skills the previous power ups have gone, placing more value in the more advanced skills. 
                     It sorts monster not by the absolute ammount of remaining power-ups, but by a ponderated list tht takes into account to which skills the previous power ups have gone, placing more value in the more advanced skills. 

+ 2 - 24
public/css/filters.css

@@ -17,6 +17,8 @@ form.filter{
 
 
 form.filter table{
 form.filter table{
     margin: auto;
     margin: auto;
+    display: inline;
+    border-collapse: collapse;
 }
 }
 form.filter table td.filter{
 form.filter table td.filter{
     vertical-align: top;
     vertical-align: top;
@@ -56,38 +58,14 @@ form.filter div#filter_apply{
     margin: 0.5em auto 1em auto;
     margin: 0.5em auto 1em auto;
 }
 }
 
 
-form#filter_runeupgrade table{
-    border-collapse: collapse;
-}
-
-form#filter_runeupgrade td.filter_title{
-    font-weight: bold;
-    border-right: 0.2em solid #ffffff;
-    text-align: center;
-    vertical-align: middle;
-}
-form#filter_runeupgrade td.filter_title span{
-    transform: rotate(-90deg);
-    display: block;
-    width: 2em;
-    margin-top: 2em;
-}
-form#filter_runeupgrade td.filter_separator{
-    border-top: 0.2em solid #ffffff;
-}
 form#filter_runeupgrade select#filter_slot{
 form#filter_runeupgrade select#filter_slot{
     height: 10em;
     height: 10em;
 }
 }
 
 
-form#filter_runecraft table{
-    border-collapse: collapse;
-}
-
 form#filter_runecraft table td select#filter_grind_stat, select#filter_gem_stat_from, select#filter_gem_stat_to{
 form#filter_runecraft table td select#filter_grind_stat, select#filter_gem_stat_from, select#filter_gem_stat_to{
     height: 16em;
     height: 16em;
 }
 }
 
 
-
 form#filter_runecraft select#filter_slot{
 form#filter_runecraft select#filter_slot{
     height: 10em;
     height: 10em;
 }
 }

+ 7 - 0
public/css/report.css

@@ -37,3 +37,10 @@ section.report article img{
 section.report article p{
 section.report article p{
     color: #ffffff;
     color: #ffffff;
 }
 }
+
+section.report article form{
+    border: 0.1em solid #000000;
+    border-radius: 0.5em;
+    padding: 0.5em;
+    text-align: center;
+}

+ 8 - 4
public/css/report_runeupgrade.css

@@ -1,3 +1,7 @@
+section.content article{
+    text-align: left;
+}
+
 section.content article div.monster{
 section.content article div.monster{
     display:inline-block;
     display:inline-block;
     vertical-align: top;
     vertical-align: top;
@@ -25,14 +29,14 @@ section.content article div.monster_runes{
 }
 }
 
 
 section.content article div.monster_runes > table.rune{
 section.content article div.monster_runes > table.rune{
-    font-size: 80%;
+    font-size: 90%;
 }
 }
 
 
 section.content article div.monster_runes div.alternatives{
 section.content article div.monster_runes div.alternatives{
-    padding: 1em;
+    padding: 0.5em;
     margin-top: -0.6em;
     margin-top: -0.6em;
-    margin-left: 2.5em;
-    margin-bottom: 1em;
+    margin-left: 1.5em;
+    margin-bottom: 0.5em;
     border-left: 0.3em solid #ffffff;
     border-left: 0.3em solid #ffffff;
     border-bottom: 0.3em solid #ffffff;
     border-bottom: 0.3em solid #ffffff;
     border-bottom-left-radius: 1em;
     border-bottom-left-radius: 1em;